Merge branch 'master' into terencehill/quickmenu
authorMario <zacjardine@y7mail.com>
Sun, 30 Aug 2015 04:32:07 +0000 (14:32 +1000)
committerMario <zacjardine@y7mail.com>
Sun, 30 Aug 2015 04:32:07 +0000 (14:32 +1000)
# Conflicts:
# qcsrc/client/command/cl_cmd.qc

211 files changed:
commands.cfg
minigames.cfg
monsters.cfg
notifications.cfg
qcsrc/client/bgmscript.qc
qcsrc/client/command/cl_cmd.qc
qcsrc/client/csqcmodel_hooks.qc
qcsrc/client/damage.qc
qcsrc/client/generator.qc
qcsrc/client/gibs.qc
qcsrc/client/hook.qc
qcsrc/client/hud.qc
qcsrc/client/hud_config.qc
qcsrc/client/main.qc
qcsrc/client/mapvoting.qc
qcsrc/client/miscfunctions.qc
qcsrc/client/mutators/events.qh
qcsrc/client/particles.qc
qcsrc/client/player_skeleton.qc
qcsrc/client/scoreboard.qc
qcsrc/client/tuba.qc
qcsrc/client/view.qc
qcsrc/client/weapons/projectile.qc
qcsrc/common/animdecide.qc
qcsrc/common/animdecide.qh
qcsrc/common/command/generic.qc
qcsrc/common/command/rpn.qc
qcsrc/common/effects.inc [new file with mode: 0644]
qcsrc/common/effects.qc
qcsrc/common/effects.qh
qcsrc/common/items/inventory.qh
qcsrc/common/items/item.qh
qcsrc/common/items/item/pickup.qc
qcsrc/common/items/item/pickup.qh
qcsrc/common/mapinfo.qc
qcsrc/common/minigames/cl_minigames.qc
qcsrc/common/minigames/minigame/nmm.qc
qcsrc/common/minigames/minigame/ttt.qc
qcsrc/common/minigames/sv_minigames.qc
qcsrc/common/monsters/all.inc
qcsrc/common/monsters/all.qh
qcsrc/common/monsters/monster/mage.qc
qcsrc/common/monsters/monster/shambler.qc
qcsrc/common/monsters/monster/spider.qc
qcsrc/common/monsters/monster/wyvern.qc
qcsrc/common/monsters/monster/zombie.qc
qcsrc/common/monsters/spawn.qc
qcsrc/common/monsters/sv_monsters.qc
qcsrc/common/monsters/sv_monsters.qh
qcsrc/common/movetypes/movetypes.qc
qcsrc/common/movetypes/push.qc
qcsrc/common/mutators/base.qh
qcsrc/common/mutators/mutator/waypoints/waypointsprites.qc
qcsrc/common/notifications.inc [new file with mode: 0644]
qcsrc/common/notifications.qc
qcsrc/common/notifications.qh
qcsrc/common/physics.qc
qcsrc/common/physics.qh
qcsrc/common/playerstats.qc
qcsrc/common/triggers/func/breakable.qc
qcsrc/common/triggers/func/door.qc
qcsrc/common/triggers/func/pointparticles.qc
qcsrc/common/triggers/misc/laser.qc
qcsrc/common/triggers/target/music.qc
qcsrc/common/triggers/target/spawn.qc
qcsrc/common/triggers/teleporters.qc
qcsrc/common/triggers/trigger/disablerelay.qc
qcsrc/common/triggers/trigger/jumppads.qc
qcsrc/common/triggers/trigger/viewloc.qc
qcsrc/common/turrets/checkpoint.qc
qcsrc/common/turrets/cl_turrets.qc
qcsrc/common/turrets/config.qc
qcsrc/common/turrets/config.qh
qcsrc/common/turrets/sv_turrets.qc
qcsrc/common/turrets/unit/ewheel.qc
qcsrc/common/turrets/unit/flac.qc
qcsrc/common/turrets/unit/fusionreactor.qc
qcsrc/common/turrets/unit/mlrs.qc
qcsrc/common/turrets/unit/plasma.qc
qcsrc/common/turrets/unit/plasma_dual.qc
qcsrc/common/turrets/unit/walker.qc
qcsrc/common/util-pre.qh
qcsrc/common/util.qc
qcsrc/common/util.qh
qcsrc/common/vehicles/sv_vehicles.qc
qcsrc/common/vehicles/unit/bumblebee.qc
qcsrc/common/vehicles/unit/racer.qc
qcsrc/common/vehicles/unit/raptor.qc
qcsrc/common/vehicles/unit/spiderbot.qc
qcsrc/common/viewloc.qc
qcsrc/common/weapons/calculations.qc
qcsrc/common/weapons/config.qc
qcsrc/common/weapons/config.qh
qcsrc/common/weapons/w_arc.qc
qcsrc/common/weapons/w_blaster.qc
qcsrc/common/weapons/w_crylink.qc
qcsrc/common/weapons/w_devastator.qc
qcsrc/common/weapons/w_electro.qc
qcsrc/common/weapons/w_fireball.qc
qcsrc/common/weapons/w_hagar.qc
qcsrc/common/weapons/w_hlac.qc
qcsrc/common/weapons/w_hmg.qc
qcsrc/common/weapons/w_hook.qc
qcsrc/common/weapons/w_machinegun.qc
qcsrc/common/weapons/w_minelayer.qc
qcsrc/common/weapons/w_mortar.qc
qcsrc/common/weapons/w_porto.qc
qcsrc/common/weapons/w_rifle.qc
qcsrc/common/weapons/w_rpc.qc
qcsrc/common/weapons/w_seeker.qc
qcsrc/common/weapons/w_shockwave.qc
qcsrc/common/weapons/w_shotgun.qc
qcsrc/common/weapons/w_tuba.qc
qcsrc/common/weapons/w_vaporizer.qc
qcsrc/common/weapons/w_vortex.qc
qcsrc/csqcmodellib/cl_player.qc
qcsrc/dpdefs/csprogsdefs.qh
qcsrc/dpdefs/dpextensions.qh
qcsrc/lib/Bool.qh [new file with mode: 0644]
qcsrc/lib/_all.inc
qcsrc/lib/prandom.qc
qcsrc/lib/test.qc
qcsrc/lib/urllib.qc
qcsrc/menu/command/menu_cmd.qc
qcsrc/menu/draw.qc
qcsrc/menu/item/label.qc
qcsrc/menu/menu.qc
qcsrc/menu/skin.qh
qcsrc/menu/xonotic/maplist.qc
qcsrc/menu/xonotic/serverlist.qc
qcsrc/menu/xonotic/skinlist.qc
qcsrc/menu/xonotic/slider_decibels.qc
qcsrc/menu/xonotic/slider_resolution.qc
qcsrc/menu/xonotic/statslist.qc
qcsrc/menu/xonotic/util.qc
qcsrc/server-testcase/framework.qc
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_keyhunt.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/cheats.qc
qcsrc/server/cl_client.qc
qcsrc/server/cl_impulse.qc
qcsrc/server/cl_player.qc
qcsrc/server/command/banning.qc
qcsrc/server/command/cmd.qc
qcsrc/server/command/common.qc
qcsrc/server/command/common.qh
qcsrc/server/command/radarmap.qc
qcsrc/server/command/sv_cmd.qc
qcsrc/server/ent_cs.qc
qcsrc/server/g_damage.qc
qcsrc/server/g_hook.qc
qcsrc/server/g_subs.qc
qcsrc/server/g_tetris.qc
qcsrc/server/g_world.qc
qcsrc/server/ipban.qc
qcsrc/server/mapvoting.qc
qcsrc/server/miscfunctions.qc
qcsrc/server/mutators/events.qh
qcsrc/server/mutators/gamemode_assault.qc
qcsrc/server/mutators/gamemode_ca.qc
qcsrc/server/mutators/gamemode_ctf.qc
qcsrc/server/mutators/gamemode_cts.qc
qcsrc/server/mutators/gamemode_deathmatch.qc [new file with mode: 0644]
qcsrc/server/mutators/gamemode_domination.qc
qcsrc/server/mutators/gamemode_freezetag.qc
qcsrc/server/mutators/gamemode_invasion.qc
qcsrc/server/mutators/gamemode_keepaway.qc
qcsrc/server/mutators/gamemode_keyhunt.qc
qcsrc/server/mutators/gamemode_lms.qc
qcsrc/server/mutators/gamemode_nexball.qc
qcsrc/server/mutators/gamemode_onslaught.qc
qcsrc/server/mutators/gamemode_race.qc
qcsrc/server/mutators/gamemode_tdm.qc
qcsrc/server/mutators/mutator_buffs.qc
qcsrc/server/mutators/mutator_nades.qc
qcsrc/server/mutators/mutator_new_toys.qc
qcsrc/server/mutators/mutator_physical_items.qc
qcsrc/server/mutators/mutator_random_gravity.qc
qcsrc/server/mutators/mutator_superspec.qc
qcsrc/server/mutators/mutator_touchexplode.qc
qcsrc/server/mutators/mutators.qh
qcsrc/server/mutators/mutators_include.qc
qcsrc/server/mutators/sandbox.qc
qcsrc/server/pathlib.qc
qcsrc/server/pathlib/expandnode.qc
qcsrc/server/pathlib/main.qc
qcsrc/server/pathlib/movenode.qc
qcsrc/server/pathlib/path_waypoint.qc
qcsrc/server/playerdemo.qc
qcsrc/server/portals.qc
qcsrc/server/race.qc
qcsrc/server/spawnpoints.qc
qcsrc/server/steerlib.qc
qcsrc/server/sv_main.qc
qcsrc/server/t_items.qc
qcsrc/server/t_plats.qc
qcsrc/server/teamplay.qc
qcsrc/server/weapons/spawning.qc
qcsrc/server/weapons/tracing.qc
qcsrc/server/weapons/weaponstats.qc
qcsrc/server/weapons/weaponsystem.qc
qcsrc/warpzonelib/common.qc
qcsrc/warpzonelib/server.qc

index 812e572..e860a7e 100644 (file)
@@ -157,9 +157,7 @@ alias reportcvar           "qc_cmd_cmd    reportcvar           ${* ?}" // Old sy
 alias selectteam           "qc_cmd_cmd    selectteam           ${* ?}" // Attempt to choose a team to join into
 alias selfstuff            "qc_cmd_cmd    selfstuff            ${* ?}" // Stuffcmd a command to your own client
 alias sentcvar             "qc_cmd_cmd    sentcvar             ${* ?}" // New system for sending a client cvar to the server
-alias mobedit              "qc_cmd_cmd    mobedit              ${* ?}" // Edit a monster's properties
-alias mobkill              "qc_cmd_cmd    mobkill              ${* ?}" // Kill a monster
-alias mobspawn             "qc_cmd_cmd    mobspawn             ${* ?}" // Spawn a monster infront of the player
+alias editmob              "qc_cmd_cmd    editmob              ${* ?}" // Edit a monster's properties
 alias physics              "qc_cmd_cmd    physics              ${* ?}" // Change physics set
 alias spectate             "qc_cmd_cmd    spectate             ${* ?}" // Become an observer
 alias suggestmap           "qc_cmd_cmd    suggestmap           ${* ?}" // Suggest a map to the mapvote at match end
@@ -181,6 +179,15 @@ alias spec "spectate"
 alias sandbox "cmd g_sandbox ${* ?}"
 
 
+// monster aliases
+alias killmob "editmob kill ${* ?}"
+alias spawnmob "editmob spawn ${* ?}"
+alias skinmob "editmob skin ${* ?}"
+alias namemob "editmob name ${* ?}"
+alias movemob "editmob movetarget ${* ?}"
+alias butcher "editmob butcher ${* ?}"
+
+
 // ============================================================
 //  sv_cmd (server console command) - server/command/sv_cmd.qc
 // ============================================================
index 04c370c..9922d7e 100644 (file)
@@ -1,4 +1,4 @@
-set sv_minigames 1 "Allow minigames"
+set sv_minigames 0 "Allow minigames"
 set sv_minigames_observer 1 "Force minigame players to be observers. 0: don't move them to observer, 1: move them to observer, 2: force observer"
 
 // Pong
index 3ff25a4..9d961c0 100644 (file)
@@ -1,35 +1,37 @@
 // {{{ #1: Zombie
-set g_monster_zombie_attack_leap_damage 50
+set g_monster_zombie_attack_leap_damage 60
 set g_monster_zombie_attack_leap_delay 1.5
 set g_monster_zombie_attack_leap_force 55
 set g_monster_zombie_attack_leap_speed 500
-set g_monster_zombie_attack_melee_damage 40
-set g_monster_zombie_attack_melee_delay 1.2
-set g_monster_zombie_health 150
-set g_monster_zombie_speed_run 400
+set g_monster_zombie_attack_melee_damage 55
+set g_monster_zombie_attack_melee_delay 1
+set g_monster_zombie_damageforcescale 0.550000012
+set g_monster_zombie_health 200
+set g_monster_zombie_speed_run 600
 set g_monster_zombie_speed_stop 100
-set g_monster_zombie_speed_walk 150
+set g_monster_zombie_speed_walk 300
 // }}}
 // {{{ #2: Spider
 set g_monster_spider_attack_bite_damage 35
-set g_monster_spider_attack_bite_delay 1.2
-set g_monster_spider_attack_web_damagetime 4
+set g_monster_spider_attack_bite_delay 1.5
+set g_monster_spider_attack_web_damagetime 7
 set g_monster_spider_attack_web_delay 1.5
-set g_monster_spider_attack_web_speed 1000
+set g_monster_spider_attack_web_speed 1300
 set g_monster_spider_attack_web_speed_up 150
-set g_monster_spider_health 160
-set g_monster_spider_speed_run 450
+set g_monster_spider_damageforcescale 0.600000024
+set g_monster_spider_health 180
+set g_monster_spider_speed_run 750
 set g_monster_spider_speed_stop 100
-set g_monster_spider_speed_walk 150
+set g_monster_spider_speed_walk 400
 // }}}
 // {{{ #3: Mage
-set g_monster_mage_attack_push_damage 15
+set g_monster_mage_attack_push_damage 25
 set g_monster_mage_attack_push_delay 1
 set g_monster_mage_attack_push_force 300
 set g_monster_mage_attack_push_radius 150
-set g_monster_mage_attack_spike_accel 400
-set g_monster_mage_attack_spike_damage 30
-set g_monster_mage_attack_spike_decel 400
+set g_monster_mage_attack_spike_accel 480
+set g_monster_mage_attack_spike_damage 45
+set g_monster_mage_attack_spike_decel 480
 set g_monster_mage_attack_spike_delay 2
 set g_monster_mage_attack_spike_radius 60
 set g_monster_mage_attack_spike_smart 1
@@ -38,44 +40,49 @@ set g_monster_mage_attack_spike_smart_trace_max 2500
 set g_monster_mage_attack_spike_smart_trace_min 1000
 set g_monster_mage_attack_spike_speed_max 370
 set g_monster_mage_attack_spike_turnrate 0.65
-set g_monster_mage_heal_allies 15
+set g_monster_mage_damageforcescale 0.5
+set g_monster_mage_heal_allies 20
 set g_monster_mage_heal_delay 1.5
 set g_monster_mage_heal_minhealth 250
-set g_monster_mage_heal_range 200
-set g_monster_mage_heal_self 35
-set g_monster_mage_health 200
+set g_monster_mage_heal_range 250
+set g_monster_mage_heal_self 40
+set g_monster_mage_health 400
 set g_monster_mage_shield_blockpercent 0.8
 set g_monster_mage_shield_delay 7
 set g_monster_mage_shield_time 3
-set g_monster_mage_speed_run 75
+set g_monster_mage_speed_run 400
 set g_monster_mage_speed_stop 50
-set g_monster_mage_speed_walk 50
+set g_monster_mage_speed_walk 250
 // }}}
 // {{{ #4: Wyvern
-set g_monster_wyvern_attack_fireball_damage 30
-set g_monster_wyvern_attack_fireball_damagetime 3
+set g_monster_wyvern_attack_fireball_damage 50
+set g_monster_wyvern_attack_fireball_damagetime 2
 set g_monster_wyvern_attack_fireball_edgedamage 20
 set g_monster_wyvern_attack_fireball_force 50
 set g_monster_wyvern_attack_fireball_radius 120
-set g_monster_wyvern_attack_fireball_speed 900
-set g_monster_wyvern_health 95
-set g_monster_wyvern_speed_run 120
+set g_monster_wyvern_attack_fireball_speed 1200
+set g_monster_wyvern_damageforcescale 0.600000024
+set g_monster_wyvern_health 150
+set g_monster_wyvern_speed_run 250
 set g_monster_wyvern_speed_stop 300
-set g_monster_wyvern_speed_walk 40
+set g_monster_wyvern_speed_walk 120
 // }}}
 // {{{ #5: Shambler
-set g_monster_shambler_attack_claw_damage 50
-set g_monster_shambler_attack_lightning_damage 15
+set g_monster_shambler_attack_claw_damage 60
+set g_monster_shambler_attack_lightning_damage 25
+set g_monster_shambler_attack_lightning_damage_zap 15
 set g_monster_shambler_attack_lightning_force 100
 set g_monster_shambler_attack_lightning_radius 50
 set g_monster_shambler_attack_lightning_radius_zap 250
-set g_monster_shambler_attack_lightning_speed 800
+set g_monster_shambler_attack_lightning_speed 1000
 set g_monster_shambler_attack_lightning_speed_up 150
 set g_monster_shambler_attack_smash_damage 50
-set g_monster_shambler_health 500
-set g_monster_shambler_speed_run 150
+set g_monster_shambler_attack_smash_range 0
+set g_monster_shambler_damageforcescale 0.100000001
+set g_monster_shambler_health 650
+set g_monster_shambler_speed_run 320
 set g_monster_shambler_speed_stop 300
-set g_monster_shambler_speed_walk 100
+set g_monster_shambler_speed_walk 150
 // }}}
 
 // {{{ Misc
index 5240362..fed20f6 100644 (file)
@@ -102,7 +102,8 @@ seta notification_ANNCE_VOTE_ACCEPT "2" "0 = disabled, 1 = enabled if gentle mod
 seta notification_ANNCE_VOTE_CALL "2" "0 = disabled, 1 = enabled if gentle mode is off, 2 = always enabled"
 seta notification_ANNCE_VOTE_FAIL "2" "0 = disabled, 1 = enabled if gentle mode is off, 2 = always enabled"
 
-// MSG_INFO notifications (count = 296):
+// MSG_INFO notifications (count = 311):
+seta notification_INFO_CONNECTING "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
 seta notification_INFO_CHAT_NOSPECTATORS "2" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
 seta notification_INFO_CTF_CAPTURE_RED "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
 seta notification_INFO_CTF_CAPTURE_BLUE "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
@@ -246,7 +247,7 @@ seta notification_INFO_DEATH_SELF_TURRET_PHASER "1" "0 = off, 1 = print to conso
 seta notification_INFO_DEATH_SELF_TURRET_PLASMA "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
 seta notification_INFO_DEATH_SELF_TURRET_TESLA "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
 seta notification_INFO_DEATH_SELF_TURRET_WALK_GUN "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
-seta notification_INFO_DEATH_SELF_TURRET_WALK_MEELE "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
+seta notification_INFO_DEATH_SELF_TURRET_WALK_MELEE "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
 seta notification_INFO_DEATH_SELF_TURRET_WALK_ROCKET "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
 seta notification_INFO_DEATH_SELF_VH_BUMB_DEATH "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
 seta notification_INFO_DEATH_SELF_VH_CRUSH "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
@@ -313,6 +314,19 @@ seta notification_INFO_KEYHUNT_PICKUP_PINK "1" "0 = off, 1 = print to console, 2
 seta notification_INFO_LMS_FORFEIT "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
 seta notification_INFO_LMS_NOLIVES "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
 seta notification_INFO_MONSTERS_DISABLED "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
+seta notification_INFO_ONSLAUGHT_CAPTURE "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
+seta notification_INFO_ONSLAUGHT_CPDESTROYED_RED "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
+seta notification_INFO_ONSLAUGHT_CPDESTROYED_BLUE "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
+seta notification_INFO_ONSLAUGHT_CPDESTROYED_YELLOW "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
+seta notification_INFO_ONSLAUGHT_CPDESTROYED_PINK "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
+seta notification_INFO_ONSLAUGHT_GENDESTROYED_RED "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
+seta notification_INFO_ONSLAUGHT_GENDESTROYED_BLUE "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
+seta notification_INFO_ONSLAUGHT_GENDESTROYED_YELLOW "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
+seta notification_INFO_ONSLAUGHT_GENDESTROYED_PINK "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
+seta notification_INFO_ONSLAUGHT_GENDESTROYED_OVERTIME_RED "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
+seta notification_INFO_ONSLAUGHT_GENDESTROYED_OVERTIME_BLUE "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
+seta notification_INFO_ONSLAUGHT_GENDESTROYED_OVERTIME_YELLOW "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
+seta notification_INFO_ONSLAUGHT_GENDESTROYED_OVERTIME_PINK "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
 seta notification_INFO_POWERUP_INVISIBILITY "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
 seta notification_INFO_POWERUP_SHIELD "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
 seta notification_INFO_POWERUP_SPEED "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
@@ -329,6 +343,7 @@ seta notification_INFO_RACE_NEW_BROKEN "1" "0 = off, 1 = print to console, 2 = p
 seta notification_INFO_RACE_NEW_IMPROVED "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
 seta notification_INFO_RACE_NEW_MISSING_UID "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
 seta notification_INFO_RACE_NEW_SET "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
+seta notification_INFO_MINIGAME_INVITE "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
 seta notification_INFO_SCORES_RED "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
 seta notification_INFO_SCORES_BLUE "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
 seta notification_INFO_SCORES_YELLOW "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
@@ -400,7 +415,7 @@ seta notification_INFO_WEAPON_TUBA_SUICIDE "1" "0 = off, 1 = print to console, 2
 seta notification_INFO_WEAPON_VAPORIZER_MURDER "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
 seta notification_INFO_WEAPON_VORTEX_MURDER "1" "0 = off, 1 = print to console, 2 = print to console and chatbox (if notification_allow_chatboxprint is enabled)"
 
-// MSG_CENTER notifications (count = 201):
+// MSG_CENTER notifications (count = 221):
 seta notification_CENTER_ALONE "1" "0 = off, 1 = centerprint"
 seta notification_CENTER_ASSAULT_ATTACKING "1" "0 = off, 1 = centerprint"
 seta notification_CENTER_ASSAULT_DEFENDING "1" "0 = off, 1 = centerprint"
@@ -525,6 +540,7 @@ seta notification_CENTER_FREEZETAG_REVIVE "1" "0 = off, 1 = centerprint"
 seta notification_CENTER_FREEZETAG_REVIVE_SELF "1" "0 = off, 1 = centerprint"
 seta notification_CENTER_FREEZETAG_REVIVED "1" "0 = off, 1 = centerprint"
 seta notification_CENTER_FREEZETAG_AUTO_REVIVED "1" "0 = off, 1 = centerprint"
+seta notification_CENTER_GENERATOR_UNDERATTACK "1" "0 = off, 1 = centerprint"
 seta notification_CENTER_ROUND_TEAM_WIN_RED "1" "0 = off, 1 = centerprint"
 seta notification_CENTER_ROUND_TEAM_WIN_BLUE "1" "0 = off, 1 = centerprint"
 seta notification_CENTER_ROUND_TEAM_WIN_YELLOW "1" "0 = off, 1 = centerprint"
@@ -569,7 +585,20 @@ seta notification_CENTER_MOTD "1" "0 = off, 1 = centerprint"
 seta notification_CENTER_NIX_COUNTDOWN "1" "0 = off, 1 = centerprint"
 seta notification_CENTER_NIX_NEWWEAPON "1" "0 = off, 1 = centerprint"
 seta notification_CENTER_NADE "1" "0 = off, 1 = centerprint"
-seta notification_CENTER_ONS_NOTSHIELDED "1" "0 = off, 1 = centerprint"
+seta notification_CENTER_ONS_CAPTURE "1" "0 = off, 1 = centerprint"
+seta notification_CENTER_ONS_CAPTURE_RED "1" "0 = off, 1 = centerprint"
+seta notification_CENTER_ONS_CAPTURE_BLUE "1" "0 = off, 1 = centerprint"
+seta notification_CENTER_ONS_CAPTURE_YELLOW "1" "0 = off, 1 = centerprint"
+seta notification_CENTER_ONS_CAPTURE_PINK "1" "0 = off, 1 = centerprint"
+seta notification_CENTER_ONS_CONTROLPOINT_SHIELDED "1" "0 = off, 1 = centerprint"
+seta notification_CENTER_ONS_GENERATOR_SHIELDED "1" "0 = off, 1 = centerprint"
+seta notification_CENTER_ONS_NOTSHIELDED_RED "1" "0 = off, 1 = centerprint"
+seta notification_CENTER_ONS_NOTSHIELDED_BLUE "1" "0 = off, 1 = centerprint"
+seta notification_CENTER_ONS_NOTSHIELDED_YELLOW "1" "0 = off, 1 = centerprint"
+seta notification_CENTER_ONS_NOTSHIELDED_PINK "1" "0 = off, 1 = centerprint"
+seta notification_CENTER_ONS_NOTSHIELDED_TEAM "1" "0 = off, 1 = centerprint"
+seta notification_CENTER_ONS_TELEPORT "1" "0 = off, 1 = centerprint"
+seta notification_CENTER_ONS_TELEPORT_ANTISPAM "1" "0 = off, 1 = centerprint"
 seta notification_CENTER_OVERTIME_FRAG "1" "0 = off, 1 = centerprint"
 seta notification_CENTER_OVERTIME_CONTROLPOINT "1" "0 = off, 1 = centerprint"
 seta notification_CENTER_OVERTIME_TIME "1" "0 = off, 1 = centerprint"
@@ -601,6 +630,12 @@ seta notification_CENTER_TEAMCHANGE_SPECTATE "1" "0 = off, 1 = centerprint"
 seta notification_CENTER_TEAMCHANGE_SUICIDE "1" "0 = off, 1 = centerprint"
 seta notification_CENTER_TIMEOUT_BEGINNING "1" "0 = off, 1 = centerprint"
 seta notification_CENTER_TIMEOUT_ENDING "1" "0 = off, 1 = centerprint"
+seta notification_CENTER_JOIN_PREVENT_MINIGAME "1" "0 = off, 1 = centerprint"
+seta notification_CENTER_VEHICLE_ENTER "1" "0 = off, 1 = centerprint"
+seta notification_CENTER_VEHICLE_ENTER_GUNNER "1" "0 = off, 1 = centerprint"
+seta notification_CENTER_VEHICLE_ENTER_STEAL "1" "0 = off, 1 = centerprint"
+seta notification_CENTER_VEHICLE_STEAL "1" "0 = off, 1 = centerprint"
+seta notification_CENTER_VEHICLE_STEAL_SELF "1" "0 = off, 1 = centerprint"
 seta notification_CENTER_WEAPON_MINELAYER_LIMIT "1" "0 = off, 1 = centerprint"
 
 // MSG_MULTI notifications (count = 152):
@@ -676,7 +711,7 @@ seta notification_DEATH_SELF_TURRET_PHASER "1" "Enable this multiple notificatio
 seta notification_DEATH_SELF_TURRET_PLASMA "1" "Enable this multiple notification"
 seta notification_DEATH_SELF_TURRET_TESLA "1" "Enable this multiple notification"
 seta notification_DEATH_SELF_TURRET_WALK_GUN "1" "Enable this multiple notification"
-seta notification_DEATH_SELF_TURRET_WALK_MEELE "1" "Enable this multiple notification"
+seta notification_DEATH_SELF_TURRET_WALK_MELEE "1" "Enable this multiple notification"
 seta notification_DEATH_SELF_TURRET_WALK_ROCKET "1" "Enable this multiple notification"
 seta notification_DEATH_SELF_VH_BUMB_DEATH "1" "Enable this multiple notification"
 seta notification_DEATH_SELF_VH_CRUSH "1" "Enable this multiple notification"
@@ -824,4 +859,4 @@ seta notification_show_sprees_info "3" "Show spree information in MSG_INFO messa
 seta notification_show_sprees_info_newline "1" "Show attacker spree information for MSG_INFO messages on a separate line than the death notification itself"
 seta notification_show_sprees_info_specialonly "1" "Don't show attacker spree information in MSG_INFO messages if it isn't an achievement"
 
-// Notification counts (total = 762): MSG_ANNCE = 89, MSG_INFO = 296, MSG_CENTER = 201, MSG_MULTI = 152, MSG_CHOICE = 24
+// Notification counts (total = 797): MSG_ANNCE = 89, MSG_INFO = 311, MSG_CENTER = 221, MSG_MULTI = 152, MSG_CHOICE = 24
index 697cae9..894bf69 100644 (file)
@@ -136,7 +136,7 @@ void BGMScript_InitEntity(entity e)
                e.bgmscriptline = e.bgmscriptline0 = i;
                if(i >= bgmscriptbufsize)
                {
-                       printf("ERROR: bgmscript does not define %s\n", e.bgmscript);
+                       LOG_INFOF("ERROR: bgmscript does not define %s\n", e.bgmscript);
                        strunzone(e.bgmscript);
                        e.bgmscript = string_null;
                }
index c3b6019..2d60938 100644 (file)
@@ -53,22 +53,22 @@ void LocalCommand_blurtest(int request)
                        blurtest_time1 = time + stof(argv(1));
                        blurtest_radius = stof(argv(2));
                        blurtest_power = stof(argv(3));
-                       print("Enabled blurtest\n");
+                       LOG_INFO("Enabled blurtest\n");
                        return;
                }
 
                default:
                case CMD_REQUEST_USAGE:
                {
-                       print("\nUsage:^3 cl_cmd blurtest\n");
-                       print("  No arguments required.\n");
+                       LOG_INFO("\nUsage:^3 cl_cmd blurtest\n");
+                       LOG_INFO("  No arguments required.\n");
                        return;
                }
        }
        #else
        if(request)
        {
-               print("Blurtest is not enabled on this client.\n");
+               LOG_INFO("Blurtest is not enabled on this client.\n");
                return;
        }
        #endif
@@ -82,7 +82,7 @@ void LocalCommand_boxparticles(int request, int argc)
                {
                        if (argc == 9)
                        {
-                               int effect = particleeffectnum(argv(1));
+                               int effect = _particleeffectnum(argv(1));
                                if (effect >= 0)
                                {
                                        int index = stoi(argv(2));
@@ -104,22 +104,22 @@ void LocalCommand_boxparticles(int request, int argc)
                }
 
                default:
-                       print("Incorrect parameters for ^2boxparticles^7\n");
+                       LOG_INFO("Incorrect parameters for ^2boxparticles^7\n");
                case CMD_REQUEST_USAGE:
                {
-                       print("\nUsage:^3 lv_cmd boxparticles effectname own org_from org_to, dir_from, dir_to, countmultiplier, flags\n");
-                       print("  'effectname' is the name of a particle effect in effectinfo.txt\n");
-                       print("  'own' is the entity number of the owner (negative for csqc ent, positive for svqc ent)\n");
-                       print("  'org_from' is the starting origin of the box\n");
-                       print("  'org_to' is the ending origin of the box\n");
-                       print("  'dir_from' is the minimum velocity\n");
-                       print("  'dir_to' is the maximum velocity\n");
-                       print("  'countmultiplier' defines a multiplier for the particle count (affects count only, not countabsolute or trailspacing)\n");
-                       print("  'flags' can contain:\n");
-                       print("    1 to respect globals particles_alphamin, particles_alphamax (set right before via prvm_globalset client)\n");
-                       print("    2 to respect globals particles_colormin, particles_colormax (set right before via prvm_globalset client)\n");
-                       print("    4 to respect globals particles_fade (set right before via prvm_globalset client)\n");
-                       print("    128 to draw a trail, not a box\n");
+                       LOG_INFO("\nUsage:^3 lv_cmd boxparticles effectname own org_from org_to, dir_from, dir_to, countmultiplier, flags\n");
+                       LOG_INFO("  'effectname' is the name of a particle effect in effectinfo.txt\n");
+                       LOG_INFO("  'own' is the entity number of the owner (negative for csqc ent, positive for svqc ent)\n");
+                       LOG_INFO("  'org_from' is the starting origin of the box\n");
+                       LOG_INFO("  'org_to' is the ending origin of the box\n");
+                       LOG_INFO("  'dir_from' is the minimum velocity\n");
+                       LOG_INFO("  'dir_to' is the maximum velocity\n");
+                       LOG_INFO("  'countmultiplier' defines a multiplier for the particle count (affects count only, not countabsolute or trailspacing)\n");
+                       LOG_INFO("  'flags' can contain:\n");
+                       LOG_INFO("    1 to respect globals particles_alphamin, particles_alphamax (set right before via prvm_globalset client)\n");
+                       LOG_INFO("    2 to respect globals particles_colormin, particles_colormax (set right before via prvm_globalset client)\n");
+                       LOG_INFO("    4 to respect globals particles_fade (set right before via prvm_globalset client)\n");
+                       LOG_INFO("    128 to draw a trail, not a box\n");
                        return;
                }
        }
@@ -142,13 +142,13 @@ void LocalCommand_create_scrshot_ent(int request)
                                fputs(fh, strcat("\"angles\" \"", strcat(ftos(view_angles.x), " ", ftos(view_angles.y), " ", ftos(view_angles.z)), "\"\n"));
                                fputs(fh, "}\n");
 
-                               print("Completed screenshot entity dump in ^2data/data/", MapInfo_Map_bspname, "_scrshot_ent.txt^7.\n");
+                               LOG_INFO("Completed screenshot entity dump in ^2data/data/", MapInfo_Map_bspname, "_scrshot_ent.txt^7.\n");
 
                                fclose(fh);
                        }
                        else
                        {
-                               print("^1Error: ^7Could not dump to file!\n");
+                               LOG_INFO("^1Error: ^7Could not dump to file!\n");
                        }
                        return;
                }
@@ -156,8 +156,8 @@ void LocalCommand_create_scrshot_ent(int request)
                default:
                case CMD_REQUEST_USAGE:
                {
-                       print("\nUsage:^3 cl_cmd create_scrshot_ent\n");
-                       print("  No arguments required.\n");
+                       LOG_INFO("\nUsage:^3 cl_cmd create_scrshot_ent\n");
+                       LOG_INFO("  No arguments required.\n");
                        return;
                }
        }
@@ -186,8 +186,8 @@ void LocalCommand_debugmodel(int request, int argc)
                default:
                case CMD_REQUEST_USAGE:
                {
-                       print("\nUsage:^3 cl_cmd debugmodel model\n");
-                       print("  Where 'model' is a string of the model name to use for the debug model.\n");
+                       LOG_INFO("\nUsage:^3 cl_cmd debugmodel model\n");
+                       LOG_INFO("  Where 'model' is a string of the model name to use for the debug model.\n");
                        return;
                }
        }
@@ -230,11 +230,11 @@ void LocalCommand_handlevote(int request, int argc)
                }
 
                default:
-                       print("Incorrect parameters for ^2handlevote^7\n");
+                       LOG_INFO("Incorrect parameters for ^2handlevote^7\n");
                case CMD_REQUEST_USAGE:
                {
-                       print("\nUsage:^3 cl_cmd handlevote vote\n");
-                       print("  Where 'vote' is the selection for either the current poll or uid2name.\n");
+                       LOG_INFO("\nUsage:^3 cl_cmd handlevote vote\n");
+                       LOG_INFO("  Where 'vote' is the selection for either the current poll or uid2name.\n");
                        return;
                }
        }
@@ -315,18 +315,18 @@ void LocalCommand_hud(int request, int argc)
                }
 
                default:
-                       print("Incorrect parameters for ^2hud^7\n");
+                       LOG_INFO("Incorrect parameters for ^2hud^7\n");
                case CMD_REQUEST_USAGE:
                {
-                       print("\nUsage:^3 cl_cmd hud action [configname | radartoggle | layout]\n");
-                       print("  Where 'action' is the command to complete,\n");
-                       print("  'configname' is the name to save to for \"save\" action,\n");
-                       print("  'radartoggle' is to control hud_panel_radar_maximized for \"radar\" action,\n");
-                       print("  and 'layout' is how to organize the scoreboard columns for the set action.\n");
-                       print("  quickmenu [[default | file | \"\"] submenu]\n");
-                       print("    Called without options (or with "") loads either the default quickmenu or a quickmenu file if hud_panel_quickmenu_file is set to a valid filename.\n");
-                       print("    Submenu option allows to open quickmenu directly in a submenu, it requires to specify 'default', 'file' or '\"\"' option.\n");
-                       print("  Full list of commands here: \"configure, quickmenu, minigame, save, scoreboard_columns_help, scoreboard_columns_set, radar.\"\n");
+                       LOG_INFO("\nUsage:^3 cl_cmd hud action [configname | radartoggle | layout]\n");
+                       LOG_INFO("  Where 'action' is the command to complete,\n");
+                       LOG_INFO("  'configname' is the name to save to for \"save\" action,\n");
+                       LOG_INFO("  'radartoggle' is to control hud_panel_radar_maximized for \"radar\" action,\n");
+                       LOG_INFO("  and 'layout' is how to organize the scoreboard columns for the set action.\n");
+                       LOG_INFO("  quickmenu [[default | file | \"\"] submenu]\n");
+                       LOG_INFO("    Called without options (or with "") loads either the default quickmenu or a quickmenu file if hud_panel_quickmenu_file is set to a valid filename.\n");
+                       LOG_INFO("    Submenu option allows to open quickmenu directly in a submenu, it requires to specify 'default', 'file' or '\"\"' option.\n");
+                       LOG_INFO("  Full list of commands here: \"configure, minigame, save, scoreboard_columns_help, scoreboard_columns_set, radar.\"\n");
                        return;
                }
        }
@@ -346,11 +346,11 @@ void LocalCommand_localprint(int request, int argc)
                }
 
                default:
-                       print("Incorrect parameters for ^2localprint^7\n");
+                       LOG_INFO("Incorrect parameters for ^2localprint^7\n");
                case CMD_REQUEST_USAGE:
                {
-                       print("\nUsage:^3 cl_cmd localprint \"message\"\n");
-                       print("  'message' is the centerprint message to send to yourself.\n");
+                       LOG_INFO("\nUsage:^3 cl_cmd localprint \"message\"\n");
+                       LOG_INFO("  'message' is the centerprint message to send to yourself.\n");
                        return;
                }
        }
@@ -370,11 +370,11 @@ void LocalCommand_mv_download(int request, int argc)
                }
 
                default:
-                       print("Incorrect parameters for ^2mv_download^7\n");
+                       LOG_INFO("Incorrect parameters for ^2mv_download^7\n");
                case CMD_REQUEST_USAGE:
                {
-                       print("\nUsage:^3 cl_cmd mv_download mapid\n");
-                       print("  Where 'mapid' is the id number of the map to request an image of on the map vote selection menu.\n");
+                       LOG_INFO("\nUsage:^3 cl_cmd mv_download mapid\n");
+                       LOG_INFO("  Where 'mapid' is the id number of the map to request an image of on the map vote selection menu.\n");
                        return;
                }
        }
@@ -389,17 +389,17 @@ void LocalCommand_find(int request, int argc)
                        entity client;
 
                        for(client = world; (client = find(client, classname, argv(1))); )
-                               print(etos(client), "\n");
+                               LOG_INFO(etos(client), "\n");
 
                        return;
                }
 
                default:
-                       print("Incorrect parameters for ^2find^7\n");
+                       LOG_INFO("Incorrect parameters for ^2find^7\n");
                case CMD_REQUEST_USAGE:
                {
-                       print("\nUsage:^3 cl_cmd find classname\n");
-                       print("  Where 'classname' is the classname to search for.\n");
+                       LOG_INFO("\nUsage:^3 cl_cmd find classname\n");
+                       LOG_INFO("  Where 'classname' is the classname to search for.\n");
                        return;
                }
        }
@@ -429,11 +429,11 @@ void LocalCommand_sendcvar(int request, int argc)
                }
 
                default:
-                       print("Incorrect parameters for ^2sendcvar^7\n");
+                       LOG_INFO("Incorrect parameters for ^2sendcvar^7\n");
                case CMD_REQUEST_USAGE:
                {
-                       print("\nUsage:^3 cl_cmd sendcvar <cvar>\n");
-                       print("  Where 'cvar' is the cvar plus arguments to send to the server.\n");
+                       LOG_INFO("\nUsage:^3 cl_cmd sendcvar <cvar>\n");
+                       LOG_INFO("  Where 'cvar' is the cvar plus arguments to send to the server.\n");
                        return;
                }
        }
@@ -484,7 +484,7 @@ void LocalCommand_(int request)
 void LocalCommand_macro_help()
 {
        #define CLIENT_COMMAND(name,function,description) \
-               { if(strtolower(description) != "") { print("  ^2", name, "^7: ", description, "\n"); } }
+               { if(strtolower(description) != "") { LOG_INFO("  ^2", name, "^7: ", description, "\n"); } }
 
        CLIENT_COMMANDS(0, 0);
        #undef CLIENT_COMMAND
@@ -544,14 +544,14 @@ void GameCommand(string command)
        {
                if(argc == 1)
                {
-                       print("\nClient console commands:\n");
+                       LOG_INFO("\nClient console commands:\n");
                        LocalCommand_macro_help();
 
-                       print("\nGeneric commands shared by all programs:\n");
+                       LOG_INFO("\nGeneric commands shared by all programs:\n");
                        GenericCommand_macro_help();
 
-                       print("\nUsage:^3 cl_cmd COMMAND...^7, where possible commands are listed above.\n");
-                       print("For help about a specific command, type cl_cmd help COMMAND\n");
+                       LOG_INFO("\nUsage:^3 cl_cmd COMMAND...^7, where possible commands are listed above.\n");
+                       LOG_INFO("For help about a specific command, type cl_cmd help COMMAND\n");
 
                        return;
                }
@@ -571,7 +571,7 @@ void GameCommand(string command)
        ) return;
 
        // nothing above caught the command, must be invalid
-       print(((command != "") ? strcat("Unknown client command \"", command, "\"") : "No command provided"), ". For a list of supported commands, try cl_cmd help.\n");
+       LOG_INFO(((command != "") ? strcat("Unknown client command \"", command, "\"") : "No command provided"), ". For a list of supported commands, try cl_cmd help.\n");
 
        return;
 }
index 80b68a6..d8c44d6 100644 (file)
@@ -8,6 +8,7 @@
 
 #include "../common/animdecide.qh"
 #include "../common/csqcmodel_settings.qh"
+#include "../common/effects.qh"
 #include "../common/teams.qh"
 #include "../common/triggers/trigger/viewloc.qh"
 
@@ -137,7 +138,7 @@ void CSQCPlayer_ModelAppearance_PostUpdate(void)
                self.forceplayermodels_isgoodmodel = fexists(self.forceplayermodels_savemodel);
                self.forceplayermodels_isgoodmodel_mdl = self.forceplayermodels_savemodel;
                if(!self.forceplayermodels_isgoodmodel)
-                       printf("Warning: missing model %s has been used\n", self.forceplayermodels_savemodel);
+                       LOG_INFOF("Warning: missing model %s has been used\n", self.forceplayermodels_savemodel);
        }
 }
 void CSQCPlayer_ModelAppearance_Apply(bool islocalplayer)
@@ -379,7 +380,7 @@ int CSQCPlayer_FallbackFrame(int f)
                case 29: return 4; // anim_duckwalkbackright -> anim_duckwalk
                case 30: return 4; // anim_duckwalkbackleft -> anim_duckwalk
        }
-       printf("Frame %d missing in model %s, and we have no fallback - FAIL!\n", f, self.model);
+       LOG_INFOF("Frame %d missing in model %s, and we have no fallback - FAIL!\n", f, self.model);
        return f;
 }
 void CSQCPlayer_FallbackFrame_Apply(void)
@@ -450,7 +451,7 @@ void CSQCModel_AutoTagIndex_Apply(void)
                                                        // we need to prevent this from 'appening
                                                        self.tag_entity = world;
                                                        self.drawmask = 0;
-                                                       dprint("h_ model lacks weapon attachment, but v_ model is attached to it\n");
+                                                       LOG_TRACE("h_ model lacks weapon attachment, but v_ model is attached to it\n");
                                                }
                                        }
                                        else if(self.tag_entity.isplayermodel)
@@ -527,7 +528,7 @@ void CSQCModel_Effects_Apply(void)
        self.traileffect = 0;
 
        if(eff & EF_BRIGHTFIELD)
-               self.traileffect = particleeffectnum("TR_NEXUIZPLASMA");
+               self.traileffect = particleeffectnum(EFFECT_TR_NEXUIZPLASMA);
        // ignoring EF_MUZZLEFLASH
        if(eff & EF_BRIGHTLIGHT)
                adddynamiclight(self.origin, 400, '3 3 3');
@@ -545,9 +546,9 @@ void CSQCModel_Effects_Apply(void)
        if(eff & EF_FULLBRIGHT)
                self.renderflags |= RF_FULLBRIGHT;
        if(eff & EF_FLAME)
-               pointparticles(particleeffectnum("EF_FLAME"), self.origin, '0 0 0', bound(0, frametime, 0.1));
+               pointparticles(particleeffectnum(EFFECT_EF_FLAME), self.origin, '0 0 0', bound(0, frametime, 0.1));
        if(eff & EF_STARDUST)
-               pointparticles(particleeffectnum("EF_STARDUST"), self.origin, '0 0 0', bound(0, frametime, 0.1));
+               pointparticles(particleeffectnum(EFFECT_EF_STARDUST), self.origin, '0 0 0', bound(0, frametime, 0.1));
        if(eff & EF_NOSHADOW)
                self.renderflags |= RF_NOSHADOW;
        if(eff & EF_NODEPTHTEST)
@@ -561,24 +562,24 @@ void CSQCModel_Effects_Apply(void)
                self.renderflags |= RF_DYNAMICMODELLIGHT;
        // ignoring EF_UNUSED18, EF_UNUSED19, EF_RESTARTANIM_BIT, EF_TELEPORT_BIT, EF_LOWPRECISION
        if(self.csqcmodel_modelflags & MF_ROCKET)
-               self.traileffect = particleeffectnum("TR_ROCKET");
+               self.traileffect = particleeffectnum(EFFECT_TR_ROCKET);
        if(self.csqcmodel_modelflags & MF_GRENADE)
-               self.traileffect = particleeffectnum("TR_GRENADE");
+               self.traileffect = particleeffectnum(EFFECT_TR_GRENADE);
        if(self.csqcmodel_modelflags & MF_GIB)
-               self.traileffect = particleeffectnum("TR_BLOOD");
+               self.traileffect = particleeffectnum(EFFECT_TR_BLOOD);
        if(self.csqcmodel_modelflags & MF_ROTATE)
        {
                self.renderflags |= RF_USEAXIS;
                makevectors(self.angles + '0 100 0' * fmod(time, 3.6));
        }
        if(self.csqcmodel_modelflags & MF_TRACER)
-               self.traileffect = particleeffectnum("TR_WIZSPIKE");
+               self.traileffect = particleeffectnum(EFFECT_TR_WIZSPIKE);
        if(self.csqcmodel_modelflags & MF_ZOMGIB)
-               self.traileffect = particleeffectnum("TR_SLIGHTBLOOD");
+               self.traileffect = particleeffectnum(EFFECT_TR_SLIGHTBLOOD);
        if(self.csqcmodel_modelflags & MF_TRACER2)
-               self.traileffect = particleeffectnum("TR_KNIGHTSPIKE");
+               self.traileffect = particleeffectnum(EFFECT_TR_KNIGHTSPIKE);
        if(self.csqcmodel_modelflags & MF_TRACER3)
-               self.traileffect = particleeffectnum("TR_VORESPIKE");
+               self.traileffect = particleeffectnum(EFFECT_TR_VORESPIKE);
 
        if(self.drawmask)
                Projectile_DrawTrail(self.origin);
@@ -641,6 +642,7 @@ void CSQCModel_Hook_PreDraw(bool isplayer)
        {
                CSQCPlayer_ModelAppearance_Apply(self.entnum == player_localnum + 1);
                CSQCPlayer_LOD_Apply();
+
                if(!isplayer)
                {
                        skeleton_loadinfo(self);
@@ -738,7 +740,7 @@ void CSQCModel_Hook_PreUpdate(bool isnew, bool isplayer, bool islocalplayer)
 void CSQCModel_Hook_PostUpdate(bool isnew, bool isplayer, bool islocalplayer)
 {
        // is it a player model? (shared state)
-       self.isplayermodel = (substring(self.model, 0, 14) == "models/player/" || substring(self.model, 0, 17) == "models/ok_player/");
+       self.isplayermodel = (substring(self.model, 0, 14) == "models/player/" || substring(self.model, 0, 17) == "models/ok_player/" || (substring(self.model, 0, 16) == "models/monsters/" && (self.entnum >= 1 && self.entnum <= maxclients)));
 
        // save values set by server
        if(self.isplayermodel)
index 5eff455..32d236f 100644 (file)
@@ -7,6 +7,7 @@
 
 #include "../common/constants.qh"
 #include "../common/deathtypes.qh"
+#include "../common/effects.qh"
 #include "../common/movetypes/movetypes.qh"
 #include "../common/util.qh"
 
@@ -117,7 +118,7 @@ void DamageEffect(vector hitorg, float thedamage, int type, int specnum)
        e.classname = "damage";
        e.owner = self;
        e.cnt = time + life;
-       e.team = particleeffectnum(effectname);
+       e.team = _particleeffectnum(effectname);
        e.think = DamageEffect_Think;
        e.nextthink = time;
        self.total_damages += 1;
@@ -233,33 +234,33 @@ void Ent_DamageInfo(float isNew)
                                string _snd;
                                _snd = W_Sound(strcat("ric", ftos(1 + rint(random() * 2))));
                                sound(self, CH_SHOTS, _snd, VOL_BASE, ATTEN_NORM);
-                               pointparticles(particleeffectnum("spiderbot_minigun_impact"), self.origin, w_backoff * 1000, 1);
+                               pointparticles(particleeffectnum(EFFECT_SPIDERBOT_MINIGUN_IMPACT), self.origin, w_backoff * 1000, 1);
                                break;
                        case DEATH_VH_SPID_ROCKET:
                                sound(self, CH_SHOTS, W_Sound("rocket_impact"), VOL_BASE, ATTEN_NORM);
-                               pointparticles(particleeffectnum("spiderbot_rocket_explode"), self.origin, w_backoff * 1000, 1);
+                               pointparticles(particleeffectnum(EFFECT_SPIDERBOT_ROCKET_EXPLODE), self.origin, w_backoff * 1000, 1);
                                break;
                        case DEATH_VH_SPID_DEATH:
                                sound(self, CH_SHOTS, W_Sound("rocket_impact"), VOL_BASE, ATTEN_MIN);
-                               pointparticles(particleeffectnum("explosion_big"), self.origin, w_backoff * 1000, 1);
+                               pointparticles(particleeffectnum(EFFECT_EXPLOSION_BIG), self.origin, w_backoff * 1000, 1);
                                break;
 
                        case DEATH_VH_WAKI_GUN:
                                sound(self, CH_SHOTS, W_Sound("laserimpact"), VOL_BASE, ATTEN_NORM);
-                               pointparticles(particleeffectnum("wakizashi_gun_impact"), self.origin, w_backoff * 1000, 1);
+                               pointparticles(particleeffectnum(EFFECT_RACER_IMPACT), self.origin, w_backoff * 1000, 1);
                                break;
                        case DEATH_VH_WAKI_ROCKET:
                                sound(self, CH_SHOTS, W_Sound("rocket_impact"), VOL_BASE, ATTEN_NORM);
-                               pointparticles(particleeffectnum("wakizashi_rocket_explode"), self.origin, w_backoff * 1000, 1);
+                               pointparticles(particleeffectnum(EFFECT_RACER_ROCKET_EXPLODE), self.origin, w_backoff * 1000, 1);
                                break;
                        case DEATH_VH_WAKI_DEATH:
                                sound(self, CH_SHOTS, W_Sound("rocket_impact"), VOL_BASE, ATTEN_MIN);
-                               pointparticles(particleeffectnum("explosion_big"), self.origin, w_backoff * 1000, 1);
+                               pointparticles(particleeffectnum(EFFECT_EXPLOSION_BIG), self.origin, w_backoff * 1000, 1);
                                break;
 
                        case DEATH_VH_RAPT_CANNON:
                                sound(self, CH_SHOTS, W_Sound("laserimpact"), VOL_BASE, ATTEN_NORM);
-                               pointparticles(particleeffectnum("raptor_cannon_impact"), self.origin, w_backoff * 1000, 1);
+                               pointparticles(particleeffectnum(EFFECT_RAPTOR_CANNON_IMPACT), self.origin, w_backoff * 1000, 1);
                                break;
                        case DEATH_VH_RAPT_FRAGMENT:
                                float i;
@@ -271,19 +272,19 @@ void Ent_DamageInfo(float isNew)
                                        RaptorCBShellfragToss(w_org, vel, ang + '0 0 1' * (120 * i));
                                }
                                sound(self, CH_SHOTS, W_Sound("rocket_impact"), VOL_BASE, ATTEN_NORM);
-                               pointparticles(particleeffectnum("raptor_bomb_spread"), self.origin, w_backoff * 1000, 1);
+                               pointparticles(particleeffectnum(EFFECT_RAPTOR_BOMB_SPREAD), self.origin, w_backoff * 1000, 1);
                                break;
                        case DEATH_VH_RAPT_BOMB:
                                sound(self, CH_SHOTS, W_Sound("rocket_impact"), VOL_BASE, ATTEN_NORM);
-                               pointparticles(particleeffectnum("raptor_bomb_impact"), self.origin, w_backoff * 1000, 1);
+                               pointparticles(particleeffectnum(EFFECT_RAPTOR_BOMB_IMPACT), self.origin, w_backoff * 1000, 1);
                                break;
                        case DEATH_VH_RAPT_DEATH:
                                sound(self, CH_SHOTS, W_Sound("laserimpact"), VOL_BASE, ATTEN_MIN);
-                               pointparticles(particleeffectnum("explosion_big"), self.origin, w_backoff * 1000, 1);
+                               pointparticles(particleeffectnum(EFFECT_EXPLOSION_BIG), self.origin, w_backoff * 1000, 1);
                                break;
                        case DEATH_VH_BUMB_GUN:
                                sound(self, CH_SHOTS, W_Sound("fireball_impact2"), VOL_BASE, ATTEN_NORM);
-                               pointparticles(particleeffectnum("bigplasma_impact"), self.origin, w_backoff * 1000, 1);
+                               pointparticles(particleeffectnum(EFFECT_BIGPLASMA_IMPACT), self.origin, w_backoff * 1000, 1);
                                break;
                }
        }
@@ -304,11 +305,11 @@ void Ent_DamageInfo(float isNew)
                {
                         case DEATH_TURRET_EWHEEL:
                                sound(self, CH_SHOTS, W_Sound("laserimpact"), VOL_BASE, ATTEN_MIN);
-                               pointparticles(particleeffectnum("laser_impact"), self.origin, w_backoff * 1000, 1);
+                               pointparticles(particleeffectnum(EFFECT_BLASTER_IMPACT), self.origin, w_backoff * 1000, 1);
                                break;
 
                         case DEATH_TURRET_FLAC:
-                               pointparticles(particleeffectnum("hagar_explode"), w_org, '0 0 0', 1);
+                               pointparticles(particleeffectnum(EFFECT_HAGAR_EXPLODE), w_org, '0 0 0', 1);
                                _snd = W_Sound(strcat("hagexp", ftos(1 + rint(random() * 2))));
                                sound(self, CH_SHOTS, _snd, VOL_BASE, ATTEN_NORM);
                                break;
@@ -318,24 +319,24 @@ void Ent_DamageInfo(float isNew)
                         case DEATH_TURRET_WALK_ROCKET:
                         case DEATH_TURRET_HELLION:
                                sound(self, CH_SHOTS, W_Sound("rocket_impact"), VOL_BASE, ATTEN_MIN);
-                               pointparticles(particleeffectnum("rocket_explode"), self.origin, w_backoff * 1000, 1);
+                               pointparticles(particleeffectnum(EFFECT_ROCKET_EXPLODE), self.origin, w_backoff * 1000, 1);
                                break;
 
                         case DEATH_TURRET_MACHINEGUN:
                         case DEATH_TURRET_WALK_GUN:
                                _snd = W_Sound(strcat("ric", ftos(1 + rint(random() * 2))));
                                sound(self, CH_SHOTS, _snd, VOL_BASE, ATTEN_NORM);
-                               pointparticles(particleeffectnum("machinegun_impact"), self.origin, w_backoff * 1000, 1);
+                               pointparticles(particleeffectnum(EFFECT_MACHINEGUN_IMPACT), self.origin, w_backoff * 1000, 1);
                                break;
 
                         case DEATH_TURRET_PLASMA:
                                sound(self, CH_SHOTS, W_Sound("electro_impact"), VOL_BASE, ATTEN_MIN);
-                               pointparticles(particleeffectnum("electro_impact"), self.origin, w_backoff * 1000, 1);
+                               pointparticles(particleeffectnum(EFFECT_ELECTRO_IMPACT), self.origin, w_backoff * 1000, 1);
                                break;
 
                         case DEATH_TURRET_WALK_MELEE:
                                sound(self, CH_SHOTS, W_Sound("ric1"), VOL_BASE, ATTEN_MIN);
-                               pointparticles(particleeffectnum("TE_SPARK"), self.origin, w_backoff * 1000, 1);
+                               pointparticles(particleeffectnum(EFFECT_TE_SPARK), self.origin, w_backoff * 1000, 1);
                                break;
 
                         case DEATH_TURRET_PHASER:
index 46872d8..80ccc44 100644 (file)
@@ -81,11 +81,11 @@ void generator_draw()
                if(random() < 0.9 - self.health / self.max_health)
                if(random() < 0.01)
                {
-                       pointparticles(particleeffectnum("electro_ballexplode"), self.origin + randompos('-50 -50 -20', '50 50 50'), '0 0 0', 1);
+                       pointparticles(particleeffectnum(EFFECT_ELECTRO_BALLEXPLODE), self.origin + randompos('-50 -50 -20', '50 50 50'), '0 0 0', 1);
                        sound(self, CH_TRIGGER, "onslaught/electricity_explode.wav", VOL_BASE, ATTEN_NORM);
                }
                else
-                       pointparticles(particleeffectnum("torch_small"), self.origin + randompos('-60 -60 -20', '60 60 60'), '0 0 0', 1);
+                       pointparticles(particleeffectnum(EFFECT_ONS_GENERATOR_DAMAGED), self.origin + randompos('-60 -60 -20', '60 60 60'), '0 0 0', 1);
 
                self.move_time = time + 0.1;
 
@@ -102,7 +102,7 @@ void generator_draw()
        if(self.count==40||self.count==20)
        {
                sound(self, CH_TRIGGER, "onslaught/shockwave.wav", VOL_BASE, ATTEN_NORM);
-               pointparticles(particleeffectnum("electro_combo"), self.origin, '0 0 0', 6);
+               pointparticles(particleeffectnum(EFFECT_ELECTRO_COMBO), self.origin, '0 0 0', 6);
        }
 
        // rays
@@ -115,7 +115,7 @@ void generator_draw()
        for(i=0;i < 10;++i)
        {
                org = self.origin + randompos('-30 -30 -30' * i + '0 0 -20', '30 30 30' * i + '0 0 20');
-               pointparticles(particleeffectnum("onslaught_generator_gib_explode"), org, '0 0 0', 1);
+               pointparticles(particleeffectnum(EFFECT_ONS_GENERATOR_GIB), org, '0 0 0', 1);
        }
 
        // Short explosion sound + small explosion
@@ -127,14 +127,14 @@ void generator_draw()
 
        // Particles
        org = self.origin + randompos(self.mins + '8 8 8', self.maxs + '-8 -8 -8');
-       pointparticles(particleeffectnum("onslaught_generator_smallexplosion"), org, '0 0 0', 1);
+       pointparticles(particleeffectnum(EFFECT_ONS_GENERATOR_EXPLODE), org, '0 0 0', 1);
 
        // Final explosion
        if(self.count==1)
        {
                org = self.origin;
                te_explosion(org);
-               pointparticles(particleeffectnum("onslaught_generator_finalexplosion"), org, '0 0 0', 1);
+               pointparticles(particleeffectnum(EFFECT_ONS_GENERATOR_EXPLODE2), org, '0 0 0', 1);
                sound(self, CH_TRIGGER, W_Sound("rocket_impact"), VOL_BASE, ATTEN_NORM);
        }
 
index bdde3b6..b59cd4f 100644 (file)
@@ -86,7 +86,7 @@ void Gib_Touch()
 
        if(!self.silent)
                sound(self, CH_PAIN, strcat("misc/gib_splat0", ftos(floor(prandom() * 4 + 1)), ".wav"), VOL_BASE, ATTEN_NORM);
-       pointparticles(particleeffectnum(strcat(species_prefix(self.cnt), "blood")), self.origin + '0 0 1', '0 0 30', 10);
+       pointparticles(_particleeffectnum(strcat(species_prefix(self.cnt), "blood")), self.origin + '0 0 1', '0 0 30', 10);
 
        Gib_Delete();
 }
@@ -102,9 +102,9 @@ void Gib_Draw()
 
        if(self.touch == Gib_Touch) // don't do this for the "chunk" thingie...
                // TODO somehow make it spray in a direction dependent on self.angles
-               trailparticles(self, particleeffectnum(strcat(species_prefix(self.cnt), "TR_SLIGHTBLOOD")), oldorg, self.origin);
+               trailparticles(self, _particleeffectnum(strcat(species_prefix(self.cnt), EFFECT_TR_SLIGHTBLOOD.eent_eff_name)), oldorg, self.origin);
        else
-               trailparticles(self, particleeffectnum(strcat(species_prefix(self.cnt), "TR_BLOOD")), oldorg, self.origin);
+               trailparticles(self, _particleeffectnum(strcat(species_prefix(self.cnt), EFFECT_TR_BLOOD.eent_eff_name)), oldorg, self.origin);
 
        self.renderflags = 0;
 
@@ -222,7 +222,7 @@ void Ent_GibSplash(bool isNew)
 
                        if(prandom() < amount)
                                TossGib ("models/gibs/eye.md3", org, org, vel, prandomvec() * 150, specnum, 0, issilent);
-                       new_te_bloodshower(particleeffectnum(strcat(specstr, "bloodshower")), org, 1200, amount);
+                       new_te_bloodshower(_particleeffectnum(strcat(specstr, "bloodshower")), org, 1200, amount);
                        if(prandom() < amount)
                                TossGib ("models/gibs/bloodyskull.md3", org, org + 16 * prandomvec(), vel, prandomvec() * 100, specnum, 0, issilent);
 
@@ -255,17 +255,17 @@ void Ent_GibSplash(bool isNew)
                        }
                        break;
                case 0x02:
-                       pointparticles(particleeffectnum(strcat(specstr, "blood")), org, vel, amount * 16);
+                       pointparticles(_particleeffectnum(strcat(specstr, "blood")), org, vel, amount * 16);
                        break;
                case 0x03:
                        if(prandom() < amount)
                                TossGib ("models/gibs/chunk.mdl", org, org, vel, prandomvec() * (prandom() * 30 + 20), specnum, 1, issilent); // TODO maybe adjust to more randomization?
                        break;
                case 0x81:
-                       pointparticles(particleeffectnum(strcat(gentle_prefix, "damage_dissolve")), org, vel, amount);
+                       pointparticles(_particleeffectnum(strcat(gentle_prefix, "damage_dissolve")), org, vel, amount);
                        break;
                case 0x82:
-                       pointparticles(particleeffectnum(strcat(gentle_prefix, "damage_hit")), org, vel, amount * 16);
+                       pointparticles(_particleeffectnum(strcat(gentle_prefix, "damage_hit")), org, vel, amount * 16);
                        break;
                case 0x83:
                        // no gibs in gentle mode, sorry
index ce6ca92..a30ab73 100644 (file)
@@ -161,7 +161,7 @@ void Draw_GrapplingHook()
                case ENT_CLIENT_HOOK:
                        break;
                case ENT_CLIENT_ARC_BEAM:
-                       pointparticles(particleeffectnum("electro_lightning"), trace_endpos, normalize(atrans - trace_endpos), frametime * intensity); // todo: new effect
+                       pointparticles(particleeffectnum(EFFECT_ARC_LIGHTNING2), trace_endpos, normalize(atrans - trace_endpos), frametime * intensity); // todo: new effect
                        break;
        }
 }
index af423e4..eb50ebc 100644 (file)
@@ -2731,7 +2731,7 @@ void HUD_Vote(void)
                {
                        vote_yescount = 0;
                        vote_nocount = 0;
-                       print(_("^1You must answer before entering hud configure mode\n"));
+                       LOG_INFO(_("^1You must answer before entering hud configure mode\n"));
                        cvar_set("_hud_configure", "0");
                }
                if(vote_called_vote)
@@ -4817,7 +4817,7 @@ void HUD_Main (void)
                        }
                }
                if (warning)
-                       dprint("Automatically fixed wrong/missing panel numbers in _hud_panelorder\n");
+                       LOG_TRACE("Automatically fixed wrong/missing panel numbers in _hud_panelorder\n");
 
                cvar_set("_hud_panelorder", s);
                if(hud_panelorder_prev)
index 72e3fdc..0216a43 100644 (file)
@@ -217,11 +217,11 @@ void HUD_Panel_ExportCfg(string cfgname)
                }
                HUD_Write("menu_sync\n"); // force the menu to reread the cvars, so that the dialogs are updated
 
-               printf(_("^2Successfully exported to %s! (Note: It's saved in data/data/)\n"), filename);
+               LOG_INFOF(_("^2Successfully exported to %s! (Note: It's saved in data/data/)\n"), filename);
                fclose(fh);
        }
        else
-               printf(_("^1Couldn't write to %s\n"), filename);
+               LOG_INFOF(_("^1Couldn't write to %s\n"), filename);
 }
 
 void HUD_Configure_Exit_Force()
index 7dc9466..a5085e8 100644 (file)
@@ -90,7 +90,7 @@ void CSQC_Init(void)
        prvm_language = strzone(cvar_string("prvm_language"));
 
 #ifdef WATERMARK
-       dprintf("^4CSQC Build information: ^1%s\n", WATERMARK);
+       LOG_TRACEF("^4CSQC Build information: ^1%s\n", WATERMARK);
 #endif
 
        int i;
@@ -148,7 +148,6 @@ void CSQC_Init(void)
        CALL_ACCUMULATED_FUNCTION(RegisterNotifications);
        CALL_ACCUMULATED_FUNCTION(RegisterDeathtypes);
        CALL_ACCUMULATED_FUNCTION(RegisterHUD_Panels);
-       CALL_ACCUMULATED_FUNCTION(RegisterEffects);
 
        initialize_minigames();
 
@@ -245,7 +244,7 @@ float SetTeam(entity o, int Team)
                        default:
                                if(GetTeam(Team, false) == world)
                                {
-                                       dprintf("trying to switch to unsupported team %d\n", Team);
+                                       LOG_TRACEF("trying to switch to unsupported team %d\n", Team);
                                        Team = NUM_SPECTATOR;
                                }
                                break;
@@ -261,7 +260,7 @@ float SetTeam(entity o, int Team)
                        default:
                                if(GetTeam(Team, false) == world)
                                {
-                                       dprintf("trying to switch to unsupported team %d\n", Team);
+                                       LOG_TRACEF("trying to switch to unsupported team %d\n", Team);
                                        Team = NUM_SPECTATOR;
                                }
                                break;
@@ -460,7 +459,7 @@ void Ent_ReadPlayerScore()
        if(!isNew && n != self.sv_entnum)
        {
                //print("A CSQC entity changed its owner!\n");
-               printf("A CSQC entity changed its owner! (edict: %d, classname: %s)\n", num_for_edict(self), self.classname);
+               LOG_INFOF("A CSQC entity changed its owner! (edict: %d, classname: %s)\n", num_for_edict(self), self.classname);
                isNew = true;
                Ent_Remove();
                self.enttype = ENT_CLIENT_SCORES;
@@ -730,14 +729,14 @@ void Ent_ReadSpawnPoint(float is_new) // entity for spawnpoint
                        {
                                switch(teamnum)
                                {
-                                       case NUM_TEAM_1: self.cnt = particleeffectnum("spawn_point_red"); break;
-                                       case NUM_TEAM_2: self.cnt = particleeffectnum("spawn_point_blue"); break;
-                                       case NUM_TEAM_3: self.cnt = particleeffectnum("spawn_point_yellow"); break;
-                                       case NUM_TEAM_4: self.cnt = particleeffectnum("spawn_point_pink"); break;
-                                       default: self.cnt = particleeffectnum("spawn_point_neutral"); break;
+                                       case NUM_TEAM_1: self.cnt = particleeffectnum(EFFECT_SPAWNPOINT_RED); break;
+                                       case NUM_TEAM_2: self.cnt = particleeffectnum(EFFECT_SPAWNPOINT_BLUE); break;
+                                       case NUM_TEAM_3: self.cnt = particleeffectnum(EFFECT_SPAWNPOINT_YELLOW); break;
+                                       case NUM_TEAM_4: self.cnt = particleeffectnum(EFFECT_SPAWNPOINT_PINK); break;
+                                       default: self.cnt = particleeffectnum(EFFECT_SPAWNPOINT_NEUTRAL); break;
                                }
                        }
-                       else { self.cnt = particleeffectnum("spawn_point_neutral"); }
+                       else { self.cnt = particleeffectnum(EFFECT_SPAWNPOINT_NEUTRAL); }
 
                        self.draw = Spawn_Draw;
                }
@@ -767,11 +766,11 @@ void Ent_ReadSpawnEvent(float is_new)
                        {
                                switch(teamnum)
                                {
-                                       case NUM_TEAM_1: pointparticles(particleeffectnum("spawn_event_red"), self.origin, '0 0 0', 1); break;
-                                       case NUM_TEAM_2: pointparticles(particleeffectnum("spawn_event_blue"), self.origin, '0 0 0', 1); break;
-                                       case NUM_TEAM_3: pointparticles(particleeffectnum("spawn_event_yellow"), self.origin, '0 0 0', 1); break;
-                                       case NUM_TEAM_4: pointparticles(particleeffectnum("spawn_event_pink"), self.origin, '0 0 0', 1); break;
-                                       default: pointparticles(particleeffectnum("spawn_event_neutral"), self.origin, '0 0 0', 1); break;
+                                       case NUM_TEAM_1: pointparticles(particleeffectnum(EFFECT_SPAWN_RED), self.origin, '0 0 0', 1); break;
+                                       case NUM_TEAM_2: pointparticles(particleeffectnum(EFFECT_SPAWN_BLUE), self.origin, '0 0 0', 1); break;
+                                       case NUM_TEAM_3: pointparticles(particleeffectnum(EFFECT_SPAWN_YELLOW), self.origin, '0 0 0', 1); break;
+                                       case NUM_TEAM_4: pointparticles(particleeffectnum(EFFECT_SPAWN_PINK), self.origin, '0 0 0', 1); break;
+                                       default: pointparticles(particleeffectnum(EFFECT_SPAWN_NEUTRAL), self.origin, '0 0 0', 1); break;
                                }
                        }
                        if(autocvar_cl_spawn_event_sound)
@@ -809,7 +808,7 @@ void CSQC_Ent_Update(float bIsNewEntity)
        t = ReadByte();
 
        if(autocvar_developer_csqcentities)
-               printf("CSQC_Ent_Update(%d) with self=%i self.entnum=%d self.enttype=%d t=%d\n", bIsNewEntity, self, self.entnum, self.enttype, t);
+               LOG_INFOF("CSQC_Ent_Update(%d) with self=%i self.entnum=%d self.enttype=%d t=%d\n", bIsNewEntity, self, self.entnum, self.enttype, t);
 
        // set up the "time" global for received entities to be correct for interpolation purposes
        savetime = time;
@@ -830,7 +829,7 @@ void CSQC_Ent_Update(float bIsNewEntity)
                if(t != self.enttype || bIsNewEntity)
                {
                        //print("A CSQC entity changed its type!\n");
-                       printf("A CSQC entity changed its type! (edict: %d, server: %d, type: %d -> %d)\n", num_for_edict(self), self.entnum, self.enttype, t);
+                       LOG_INFOF("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();
                        clearentity(self);
                        bIsNewEntity = 1;
@@ -840,7 +839,7 @@ void CSQC_Ent_Update(float bIsNewEntity)
        {
                if(!bIsNewEntity)
                {
-                       printf("A CSQC entity appeared out of nowhere! (edict: %d, server: %d, type: %d)\n", num_for_edict(self), self.entnum, t);
+                       LOG_INFOF("A CSQC entity appeared out of nowhere! (edict: %d, server: %d, type: %d)\n", num_for_edict(self), self.entnum, t);
                        bIsNewEntity = 1;
                }
        }
@@ -947,11 +946,11 @@ void Ent_Remove()
 void CSQC_Ent_Remove()
 {
        if(autocvar_developer_csqcentities)
-               printf("CSQC_Ent_Remove() with self=%i self.entnum=%d self.enttype=%d\n", self, self.entnum, self.enttype);
+               LOG_INFOF("CSQC_Ent_Remove() with self=%i self.entnum=%d self.enttype=%d\n", self, self.entnum, self.enttype);
 
        if(wasfreed(self))
        {
-               print("WARNING: CSQC_Ent_Remove called for already removed entity. Packet loss?\n");
+               LOG_INFO("WARNING: CSQC_Ent_Remove called for already removed entity. Packet loss?\n");
                return;
        }
        if(self.enttype)
@@ -972,7 +971,7 @@ void Gamemode_Init()
 void CSQC_Parse_StuffCmd(string strMessage)
 {
        if(autocvar_developer_csqcentities)
-               printf("CSQC_Parse_StuffCmd(\"%s\")\n", strMessage);
+               LOG_INFOF("CSQC_Parse_StuffCmd(\"%s\")\n", strMessage);
 
        localcmd(strMessage);
 }
@@ -980,16 +979,16 @@ void CSQC_Parse_StuffCmd(string strMessage)
 void CSQC_Parse_Print(string strMessage)
 {
        if(autocvar_developer_csqcentities)
-               printf("CSQC_Parse_Print(\"%s\")\n", strMessage);
+               LOG_INFOF("CSQC_Parse_Print(\"%s\")\n", strMessage);
 
-       print(ColorTranslateRGB(strMessage));
+       LOG_INFO(ColorTranslateRGB(strMessage));
 }
 
 // CSQC_Parse_CenterPrint : Provides the centerprint_hud string in the first parameter that the server provided.
 void CSQC_Parse_CenterPrint(string strMessage)
 {
        if(autocvar_developer_csqcentities)
-               printf("CSQC_Parse_CenterPrint(\"%s\")\n", strMessage);
+               LOG_INFOF("CSQC_Parse_CenterPrint(\"%s\")\n", strMessage);
 
        centerprint_hud(strMessage);
 }
@@ -1278,7 +1277,7 @@ float CSQC_Parse_TempEntity()
        int nTEID = ReadByte();
 
        if (autocvar_developer_csqcentities)
-               printf("CSQC_Parse_TempEntity() with nTEID=%d\n", nTEID);
+               LOG_INFOF("CSQC_Parse_TempEntity() with nTEID=%d\n", nTEID);
 
        switch (nTEID)
        {
index 037d906..3511c74 100644 (file)
@@ -495,7 +495,7 @@ void Cmd_MapVote_MapDownload(float argc)
 
        if(argc != 2 || !mv_pk3list)
        {
-               print(_("mv_mapdownload: ^3You're not supposed to use this command on your own!\n"));
+               LOG_INFO(_("mv_mapdownload: ^3You're not supposed to use this command on your own!\n"));
                return;
        }
 
@@ -505,7 +505,7 @@ void Cmd_MapVote_MapDownload(float argc)
                        break;
 
        if(!pak || pak.sv_entnum != id) {
-               print(_("^1Error:^7 Couldn't find pak index.\n"));
+               LOG_INFO(_("^1Error:^7 Couldn't find pak index.\n"));
                return;
        }
 
@@ -514,7 +514,7 @@ void Cmd_MapVote_MapDownload(float argc)
                mv_preview[id] = true;
                return;
        } else {
-               print(_("Requesting preview...\n"));
+               LOG_INFO(_("Requesting preview...\n"));
                localcmd(strcat("\ncmd mv_getpicture ", ftos(id), "\n"));
        }
 }
index fbd98da..9bf0a85 100644 (file)
@@ -107,7 +107,7 @@ void RemoveTeam(entity Team)
 
        if(!tm)
        {
-               print(_("Trying to remove a team which is not in the teamlist!"));
+               LOG_INFO(_("Trying to remove a team which is not in the teamlist!"));
                return;
        }
        parent.sort_next = Team.sort_next;
@@ -566,7 +566,7 @@ void URI_Get_Callback(int id, float status, string data)
        }
        else
        {
-               printf("Received HTTP request data for an invalid id %d.\n", id);
+               LOG_INFOF("Received HTTP request data for an invalid id %d.\n", id);
        }
 }
 
@@ -591,7 +591,7 @@ void Accuracy_LoadLevels()
                if(acc_levels > MAX_ACCURACY_LEVELS)
                        acc_levels = MAX_ACCURACY_LEVELS;
                if(acc_levels < 2)
-                       print("Warning: accuracy_color_levels must contain at least 2 values\n");
+                       LOG_INFO("Warning: accuracy_color_levels must contain at least 2 values\n");
 
                int i;
                for(i = 0; i < acc_levels; ++i)
index 9516fd2..fe2e3fd 100644 (file)
@@ -112,4 +112,21 @@ MUTATOR_HOOKABLE(ClearModelParams, EV_NO_ARGS);
 string checkmodel_input, checkmodel_command;
 MUTATOR_HOOKABLE(GetModelParams, EV_GetModelParams);
 
+/** called when a player presses the jump key */
+#define EV_PlayerJump(i, o) \
+    /**/ i(float, player_multijump) \
+    /**/ i(float, player_jumpheight) \
+    /**/ o(float, player_multijump) \
+    /**/ o(float, player_jumpheight) \
+    /**/
+float player_multijump;
+float player_jumpheight;
+MUTATOR_HOOKABLE(PlayerJump, EV_PlayerJump);
+
+/** Called checking if 3rd person mode should be forced on */
+#define EV_WantEventchase(i, o) \
+    /** entity id */ i(entity, self) \
+    /**/
+MUTATOR_HOOKABLE(WantEventchase, EV_WantEventchase);
+
 #endif
index e997d15..6d73e24 100644 (file)
@@ -14,14 +14,14 @@ void Net_ReadVortexBeamParticle()
        endpos.x = ReadCoord(); endpos.y = ReadCoord(); endpos.z = ReadCoord();
        charge = ReadByte() / 255.0;
 
-       pointparticles(particleeffectnum("nex_muzzleflash"), shotorg, normalize(endpos - shotorg) * 1000, 1);
+       pointparticles(particleeffectnum(EFFECT_VORTEX_MUZZLEFLASH), shotorg, normalize(endpos - shotorg) * 1000, 1);
 
        //draw either the old v2.3 beam or the new beam
        charge = sqrt(charge); // divide evenly among trail spacing and alpha
        particles_alphamin = particles_alphamax = particles_fade = charge;
 
        if (autocvar_cl_particles_oldvortexbeam && (getstati(STAT_ALLOW_OLDVORTEXBEAM) || isdemo()))
-               WarpZone_TrailParticles_WithMultiplier(world, particleeffectnum("TE_TEI_G3"), shotorg, endpos, 1, PARTICLES_USEALPHA | PARTICLES_USEFADE);
+               WarpZone_TrailParticles_WithMultiplier(world, particleeffectnum(EFFECT_VORTEX_BEAM_OLD), shotorg, endpos, 1, PARTICLES_USEALPHA | PARTICLES_USEFADE);
        else
-               WarpZone_TrailParticles_WithMultiplier(world, particleeffectnum("nex_beam"), shotorg, endpos, 1, PARTICLES_USEALPHA | PARTICLES_USEFADE);
+               WarpZone_TrailParticles_WithMultiplier(world, particleeffectnum(EFFECT_VORTEX_BEAM), shotorg, endpos, 1, PARTICLES_USEALPHA | PARTICLES_USEFADE);
 }
index 96b91d1..00f9543 100644 (file)
@@ -48,7 +48,7 @@ void skeleton_loadinfo(entity e)
                }
        }
        else
-               dprint("No model parameters for ", e.model, "\n");
+               LOG_TRACE("No model parameters for ", e.model, "\n");
        //dprint(e.model, " uses ", ftos(e.bone_upperbody), " ", ftos(e.fixbone), "\n");
        get_model_parameters(string_null, 0);
        e.skeleton_info_modelindex = e.modelindex;
index 7b6cff1..da5a7b2 100644 (file)
@@ -245,68 +245,68 @@ void HUD_UpdateTeamPos(entity Team)
 
 void Cmd_HUD_Help()
 {
-       print(_("You can modify the scoreboard using the ^2scoreboard_columns_set command.\n"));
-       print(_("^3|---------------------------------------------------------------|\n"));
-       print(_("Usage:\n"));
-       print(_("^2scoreboard_columns_set default\n"));
-       print(_("^2scoreboard_columns_set ^7field1 field2 ...\n"));
-       print(_("The following field names are recognized (case insensitive):\n"));
-       print(_("You can use a ^3|^7 to start the right-aligned fields.\n\n"));
-
-       print(_("^3name^7 or ^3nick^7             Name of a player\n"));
-       print(_("^3ping^7                     Ping time\n"));
-       print(_("^3pl^7                       Packet loss\n"));
-       print(_("^3kills^7                    Number of kills\n"));
-       print(_("^3deaths^7                   Number of deaths\n"));
-       print(_("^3suicides^7                 Number of suicides\n"));
-       print(_("^3frags^7                    kills - suicides\n"));
-       print(_("^3kd^7                       The kill-death ratio\n"));
-       print(_("^3sum^7                      frags - deaths\n"));
-       print(_("^3caps^7                     How often a flag (CTF) or a key (KeyHunt) was captured\n"));
-       print(_("^3pickups^7                  How often a flag (CTF) or a key (KeyHunt) or a ball (Keepaway) was picked up\n"));
-       print(_("^3captime^7                  Time of fastest cap (CTF)\n"));
-       print(_("^3fckills^7                  Number of flag carrier kills\n"));
-       print(_("^3returns^7                  Number of flag returns\n"));
-       print(_("^3drops^7                    Number of flag drops\n"));
-       print(_("^3lives^7                    Number of lives (LMS)\n"));
-       print(_("^3rank^7                     Player rank\n"));
-       print(_("^3pushes^7                   Number of players pushed into void\n"));
-       print(_("^3destroyed^7                Number of keys destroyed by pushing them into void\n"));
-       print(_("^3kckills^7                  Number of keys carrier kills\n"));
-       print(_("^3losses^7                   Number of times a key was lost\n"));
-       print(_("^3laps^7                     Number of laps finished (race/cts)\n"));
-       print(_("^3time^7                     Total time raced (race/cts)\n"));
-       print(_("^3fastest^7                  Time of fastest lap (race/cts)\n"));
-       print(_("^3ticks^7                    Number of ticks (DOM)\n"));
-       print(_("^3takes^7                    Number of domination points taken (DOM)\n"));
-       print(_("^3bckills^7                  Number of ball carrier kills\n"));
-       print(_("^3bctime^7                   Total amount of time holding the ball in Keepaway\n"));
-       print(_("^3score^7                    Total score\n\n"));
-
-       print(_("Before a field you can put a + or - sign, then a comma separated list\n"
+       LOG_INFO(_("You can modify the scoreboard using the ^2scoreboard_columns_set command.\n"));
+       LOG_INFO(_("^3|---------------------------------------------------------------|\n"));
+       LOG_INFO(_("Usage:\n"));
+       LOG_INFO(_("^2scoreboard_columns_set default\n"));
+       LOG_INFO(_("^2scoreboard_columns_set ^7field1 field2 ...\n"));
+       LOG_INFO(_("The following field names are recognized (case insensitive):\n"));
+       LOG_INFO(_("You can use a ^3|^7 to start the right-aligned fields.\n\n"));
+
+       LOG_INFO(_("^3name^7 or ^3nick^7             Name of a player\n"));
+       LOG_INFO(_("^3ping^7                     Ping time\n"));
+       LOG_INFO(_("^3pl^7                       Packet loss\n"));
+       LOG_INFO(_("^3kills^7                    Number of kills\n"));
+       LOG_INFO(_("^3deaths^7                   Number of deaths\n"));
+       LOG_INFO(_("^3suicides^7                 Number of suicides\n"));
+       LOG_INFO(_("^3frags^7                    kills - suicides\n"));
+       LOG_INFO(_("^3kd^7                       The kill-death ratio\n"));
+       LOG_INFO(_("^3sum^7                      frags - deaths\n"));
+       LOG_INFO(_("^3caps^7                     How often a flag (CTF) or a key (KeyHunt) was captured\n"));
+       LOG_INFO(_("^3pickups^7                  How often a flag (CTF) or a key (KeyHunt) or a ball (Keepaway) was picked up\n"));
+       LOG_INFO(_("^3captime^7                  Time of fastest cap (CTF)\n"));
+       LOG_INFO(_("^3fckills^7                  Number of flag carrier kills\n"));
+       LOG_INFO(_("^3returns^7                  Number of flag returns\n"));
+       LOG_INFO(_("^3drops^7                    Number of flag drops\n"));
+       LOG_INFO(_("^3lives^7                    Number of lives (LMS)\n"));
+       LOG_INFO(_("^3rank^7                     Player rank\n"));
+       LOG_INFO(_("^3pushes^7                   Number of players pushed into void\n"));
+       LOG_INFO(_("^3destroyed^7                Number of keys destroyed by pushing them into void\n"));
+       LOG_INFO(_("^3kckills^7                  Number of keys carrier kills\n"));
+       LOG_INFO(_("^3losses^7                   Number of times a key was lost\n"));
+       LOG_INFO(_("^3laps^7                     Number of laps finished (race/cts)\n"));
+       LOG_INFO(_("^3time^7                     Total time raced (race/cts)\n"));
+       LOG_INFO(_("^3fastest^7                  Time of fastest lap (race/cts)\n"));
+       LOG_INFO(_("^3ticks^7                    Number of ticks (DOM)\n"));
+       LOG_INFO(_("^3takes^7                    Number of domination points taken (DOM)\n"));
+       LOG_INFO(_("^3bckills^7                  Number of ball carrier kills\n"));
+       LOG_INFO(_("^3bctime^7                   Total amount of time holding the ball in Keepaway\n"));
+       LOG_INFO(_("^3score^7                    Total score\n\n"));
+
+       LOG_INFO(_("Before a field you can put a + or - sign, then a comma separated list\n"
                "of game types, then a slash, to make the field show up only in these\n"
                "or in all but these game types. You can also specify 'all' as a\n"
                "field to show all fields available for the current game mode.\n\n"));
 
-       print(_("The special game type names 'teams' and 'noteams' can be used to\n"
+       LOG_INFO(_("The special game type names 'teams' and 'noteams' can be used to\n"
                "include/exclude ALL teams/noteams game modes.\n\n"));
 
-       print(_("Example: scoreboard_columns_set name ping pl | +ctf/field3 -dm/field4\n"));
-       print(_("will display name, ping and pl aligned to the left, and the fields\n"
+       LOG_INFO(_("Example: scoreboard_columns_set name ping pl | +ctf/field3 -dm/field4\n"));
+       LOG_INFO(_("will display name, ping and pl aligned to the left, and the fields\n"
                "right of the vertical bar aligned to the right.\n"));
-       print(_("'field3' will only be shown in CTF, and 'field4' will be shown in all\n"
+       LOG_INFO(_("'field3' will only be shown in CTF, and 'field4' will be shown in all\n"
                "other gamemodes except DM.\n"));
 }
 
 #define HUD_DefaultColumnLayout() \
 "ping pl name | " \
-"-teams,race,lms/kills +ft,tdm/kills -teams,lms/deaths +ft,tdm/deaths -teams,lms,race,ka/suicides +ft,tdm/suicides -race,dm,tdm,ka,ft/frags " /* tdm already has this in "score" */ \
+"-teams,rc,lms/kills +ft,tdm/kills -teams,lms/deaths +ft,tdm/deaths -teams,lms,rc,ka/suicides +ft,tdm/suicides -rc,dm,tdm,ka,ft/frags " /* tdm already has this in "score" */ \
 "+ctf/caps +ctf/pickups +ctf/fckills +ctf/returns +ons/caps +ons/takes " \
 "+lms/lives +lms/rank " \
 "+kh/caps +kh/pushes +kh/destroyed " \
-"?+race/laps ?+race/time ?+race/fastest " \
+"?+rc/laps ?+rc/time ?+rc/fastest " \
 "+as/objectives +nb/faults +nb/goals +ka/pickups +ka/bckills +ka/bctime +ft/revivals " \
-"-lms,race,nb/score"
+"-lms,rc,nb/score"
 
 void Cmd_HUD_SetFields(float argc)
 {
@@ -386,41 +386,38 @@ void Cmd_HUD_SetFields(float argc)
                hud_size[hud_num_fields] = stringwidth(hud_title[hud_num_fields], false, hud_fontsize);
                str = strtolower(str);
 
-               if(str == "ping") {
-                       hud_field[hud_num_fields] = SP_PING;
-               } else if(str == "pl") {
-                       hud_field[hud_num_fields] = SP_PL;
-               } else if(str == "kd" || str == "kdr" || str == "kdratio" || str == "k/d") {
-                       hud_field[hud_num_fields] = SP_KDRATIO;
-               } else if(str == "sum" || str == "diff" || str == "k-d") {
-                       hud_field[hud_num_fields] = SP_SUM;
-               } else if(str == "name" || str == "nick") {
-                       hud_field[hud_num_fields] = SP_NAME;
-                       have_name = 1;
-               } else if(str == "|") {
-                       hud_field[hud_num_fields] = SP_SEPARATOR;
-                       have_separator = 1;
-               } else {
-                       for(j = 0; j < MAX_SCORE; ++j)
-                               if(str == strtolower(scores_label[j]))
-                                       goto found; // sorry, but otherwise fteqcc -O3 miscompiles this and warns about "unreachable code"
-:notfound
-                       if(str == "frags")
-                       {
-                               j = SP_FRAGS;
-                       }
-                       else
+               switch(str)
+               {
+                       case "ping": hud_field[hud_num_fields] = SP_PING; break;
+                       case "pl": hud_field[hud_num_fields] = SP_PL; break;
+                       case "pl": hud_field[hud_num_fields] = SP_PL; break;
+                       case "kd": case "kdr": case "kdratio": case "k/d": hud_field[hud_num_fields] = SP_KDRATIO; break;
+                       case "sum": case "diff": case "k-d": hud_field[hud_num_fields] = SP_SUM; break;
+                       case "name": case "nick": hud_field[hud_num_fields] = SP_NAME; have_name = true; break;
+                       case "|": hud_field[hud_num_fields] = SP_SEPARATOR; have_separator = true; break;
+                       default:
                        {
-                               if (!nocomplain)
-                                       printf("^1Error:^7 Unknown score field: '%s'\n", str);
-                               continue;
-                       }
+                               for(j = 0; j < MAX_SCORE; ++j)
+                                       if(str == strtolower(scores_label[j]))
+                                               goto found; // sorry, but otherwise fteqcc -O3 miscompiles this and warns about "unreachable code"
+
+:notfound
+                               if(str == "frags")
+                                       j = SP_FRAGS;
+                               else
+                               {
+                                       if(!nocomplain)
+                                               LOG_INFOF("^1Error:^7 Unknown score field: '%s'\n", str);
+                                       continue;
+                               }
 :found
-                       hud_field[hud_num_fields] = j;
-                       if(j == ps_primary)
-                               have_primary = 1;
-                       if(j == ps_secondary)
-                               have_secondary = 1;
+                               hud_field[hud_num_fields] = j;
+                               if(j == ps_primary)
+                                       have_primary = 1;
+                               if(j == ps_secondary)
+                                       have_secondary = 1;
+
+                       }
                }
                ++hud_num_fields;
                if(hud_num_fields >= MAX_HUD_FIELDS)
@@ -449,7 +446,7 @@ void Cmd_HUD_SetFields(float argc)
                        hud_title[0] = strzone(TranslateScoresLabel("name"));
                        hud_field[0] = SP_NAME;
                        ++hud_num_fields;
-                       print("fixed missing field 'name'\n");
+                       LOG_INFO("fixed missing field 'name'\n");
 
                        if(!have_separator)
                        {
@@ -464,7 +461,7 @@ void Cmd_HUD_SetFields(float argc)
                                hud_field[1] = SP_SEPARATOR;
                                hud_size[1] = stringwidth("|", false, hud_fontsize);
                                ++hud_num_fields;
-                               print("fixed missing field '|'\n");
+                               LOG_INFO("fixed missing field '|'\n");
                        }
                }
                else if(!have_separator)
@@ -474,7 +471,7 @@ void Cmd_HUD_SetFields(float argc)
                        hud_size[hud_num_fields] = stringwidth("|", false, hud_fontsize);
                        hud_field[hud_num_fields] = SP_SEPARATOR;
                        ++hud_num_fields;
-                       print("fixed missing field '|'\n");
+                       LOG_INFO("fixed missing field '|'\n");
                }
                if(!have_secondary)
                {
@@ -483,7 +480,7 @@ void Cmd_HUD_SetFields(float argc)
                        hud_size[hud_num_fields] = stringwidth(hud_title[hud_num_fields], false, hud_fontsize);
                        hud_field[hud_num_fields] = ps_secondary;
                        ++hud_num_fields;
-                       printf("fixed missing field '%s'\n", scores_label[ps_secondary]);
+                       LOG_INFOF("fixed missing field '%s'\n", scores_label[ps_secondary]);
                }
                if(!have_primary)
                {
@@ -492,7 +489,7 @@ void Cmd_HUD_SetFields(float argc)
                        hud_size[hud_num_fields] = stringwidth(hud_title[hud_num_fields], false, hud_fontsize);
                        hud_field[hud_num_fields] = ps_primary;
                        ++hud_num_fields;
-                       printf("fixed missing field '%s'\n", scores_label[ps_primary]);
+                       LOG_INFOF("fixed missing field '%s'\n", scores_label[ps_primary]);
                }
        }
 
index 2b9dcd0..b95dd99 100644 (file)
@@ -163,7 +163,7 @@ void Tuba_Precache()
        Tuba_PitchStep = autocvar_g_balance_tuba_pitchstep;
        if (Tuba_PitchStep) {
                if (!checkextension("DP_SND_SOUND7_WIP2") && !checkextension("DP_SND_SOUND7")) {
-                       print("^1NOTE:^7 requested pitch shifting, but not supported by this engine build\n");
+                       LOG_INFO("^1NOTE:^7 requested pitch shifting, but not supported by this engine build\n");
                        Tuba_PitchStep = 0;
                }
        }
index 5a6b2fe..701eb9f 100644 (file)
@@ -131,6 +131,7 @@ vector GetCurrentFov(float fov)
 
        zoomdir = button_zoom;
        if(hud == HUD_NORMAL)
+       if(switchweapon == activeweapon)
        if((activeweapon == WEP_VORTEX.m_id && vortex_scope) || (activeweapon == WEP_RIFLE.m_id && rifle_scope)) // do NOT use switchweapon here
                zoomdir += button_attack2;
        if(spectatee_status > 0 || isdemo())
@@ -437,6 +438,8 @@ bool WantEventchase()
        {
                if(hud != HUD_NORMAL && (autocvar_cl_eventchase_vehicle || spectatee_status > 0))
                        return true;
+               if(MUTATOR_CALLHOOK(WantEventchase, self))
+                       return true;
                if(autocvar_cl_eventchase_nexball && gametype == MAPINFO_TYPE_NEXBALL && !(WepSet_GetFromStat() & WepSet_FromWeapon(WEP_PORTO.m_id)))
                        return true;
                if(autocvar_cl_eventchase_death && (getstati(STAT_HEALTH) <= 0))
@@ -455,8 +458,6 @@ bool WantEventchase()
 
 vector damage_blurpostprocess, content_blurpostprocess;
 
-float checkfail[16];
-
 float unaccounted_damage = 0;
 void UpdateDamage()
 {
@@ -471,7 +472,7 @@ void UpdateDamage()
        if (damage_dealt_time != damage_dealt_time_prev)
        {
                unaccounted_damage += unaccounted_damage_new;
-               dprint("dmg total: ", ftos(unaccounted_damage), " (+", ftos(unaccounted_damage_new), ")", "\n");
+               LOG_TRACE("dmg total: ", ftos(unaccounted_damage), " (+", ftos(unaccounted_damage_new), ")", "\n");
        }
        damage_dealt_time_prev = damage_dealt_time;
 
@@ -511,7 +512,7 @@ void UpdateHitsound()
                                pitch_shift = mirror_value + (mirror_value - pitch_shift);
                        }
 
-                       dprint("dmg total (dmg): ", ftos(unaccounted_damage), " , pitch shift: ", ftos(pitch_shift), "\n");
+                       LOG_TRACE("dmg total (dmg): ", ftos(unaccounted_damage), " , pitch shift: ", ftos(pitch_shift), "\n");
 
                        // todo: avoid very long and very short sounds from wave stretching using different sound files? seems unnecessary
                        // todo: normalize sound pressure levels? seems unnecessary
@@ -1005,6 +1006,14 @@ void UpdateCrosshair()
        }
 }
 
+bool ov_enabled;
+float oldr_nearclip;
+float oldr_farclip_base;
+float oldr_farclip_world;
+float oldr_novis;
+float oldr_useportalculling;
+float oldr_useinfinitefarclip;
+
 const int BUTTON_3 = 4;
 const int BUTTON_4 = 8;
 float cl_notice_run();
@@ -1047,22 +1056,6 @@ void CSQC_UpdateView(float w, float h)
        button_attack2 = (input_buttons & BUTTON_3);
        button_zoom = (input_buttons & BUTTON_4);
 
-#define CHECKFAIL_ASSERT(flag,func,parm,val) do {                                                                   \
-       float checkfailv = (func)(parm);                                                                                \
-       if (checkfailv != (val)) {                                                                                      \
-               if (!checkfail[(flag)])                                                                                     \
-               localcmd(sprintf("\ncmd checkfail %s %s %d %d\n", #func, parm, val, checkfailv));                           \
-               checkfail[(flag)] = 1;                                                                                      \
-       }                                                                                                               \
-} while(0)
-       CHECKFAIL_ASSERT(0, cvar_type, "\{100}\{105}\{118}\{48}\{95}\{101}\{118}\{97}\{100}\{101}", 0);
-       CHECKFAIL_ASSERT(1, cvar_type, "\{97}\{97}\{95}\{101}\{110}\{97}\{98}\{108}\{101}", 0);
-       CHECKFAIL_ASSERT(2, cvar, "\{114}\{95}\{115}\{104}\{111}\{119}\{100}\{105}\{115}\{97}\{98}\{108}\{101}\{100}\{101}\{112}\{116}\{104}\{116}\{101}\{115}\{116}", 0);
-       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 = getpropertyvec(VF_SIZE);
        vf_min = getpropertyvec(VF_MIN);
        vid_width = vf_size.x;
@@ -1247,6 +1240,16 @@ void CSQC_UpdateView(float w, float h)
                if((dist = vlen(vec3(ov_worldmax.x, ov_worldmin.y, ov_worldmax.z) - ov_org)) > ov_furthest) { ov_furthest = dist; }
                if((dist = vlen(vec3(ov_worldmax.x, ov_worldmax.y, ov_worldmax.z) - ov_org)) > ov_furthest) { ov_furthest = dist; }
 
+               if(!ov_enabled)
+               {
+                       oldr_nearclip = cvar("r_nearclip");
+                       oldr_farclip_base = cvar("r_farclip_base");
+                       oldr_farclip_world = cvar("r_farclip_world");
+                       oldr_novis = cvar("r_novis");
+                       oldr_useportalculling = cvar("r_useportalculling");
+                       oldr_useinfinitefarclip = cvar("r_useinfinitefarclip");
+               }
+
                cvar_settemp("r_nearclip", ftos(ov_nearest));
                cvar_settemp("r_farclip_base", ftos(ov_furthest));
                cvar_settemp("r_farclip_world", "0");
@@ -1257,8 +1260,10 @@ void CSQC_UpdateView(float w, float h)
                setproperty(VF_ORIGIN, ov_org);
                setproperty(VF_ANGLES, '90 0 0');
 
+               ov_enabled = true;
+
                #if 0
-               printf("OrthoView: org = %s, angles = %s, distance = %f, nearest = %f, furthest = %f\n",
+               LOG_INFOF("OrthoView: org = %s, angles = %s, distance = %f, nearest = %f, furthest = %f\n",
                        vtos(ov_org),
                        vtos(getpropertyvec(VF_ANGLES)),
                        ov_distance,
@@ -1266,6 +1271,19 @@ void CSQC_UpdateView(float w, float h)
                        ov_furthest);
                #endif
        }
+       else
+       {
+               if(ov_enabled)
+               {
+                       cvar_set("r_nearclip", ftos(oldr_nearclip));
+                       cvar_set("r_farclip_base", ftos(oldr_farclip_base));
+                       cvar_set("r_farclip_world", ftos(oldr_farclip_world));
+                       cvar_set("r_novis", ftos(oldr_novis));
+                       cvar_set("r_useportalculling", ftos(oldr_useportalculling));
+                       cvar_set("r_useinfinitefarclip", ftos(oldr_useinfinitefarclip));
+               }
+               ov_enabled = false;
+       }
 
        // Render the Scene
        view_origin = getpropertyvec(VF_ORIGIN);
index 12f1714..7f8a08f 100644 (file)
@@ -279,43 +279,43 @@ void Ent_Projectile()
                self.traileffect = 0;
                switch(self.cnt)
                {
-                       case PROJECTILE_ELECTRO: setmodel(self, "models/ebomb.mdl");self.traileffect = particleeffectnum("TR_NEXUIZPLASMA"); break;
-                       case PROJECTILE_ROCKET: setmodel(self, "models/rocket.md3");self.traileffect = particleeffectnum("TR_ROCKET"); self.scale = 2; break;
-                       case PROJECTILE_CRYLINK: setmodel(self, "models/plasmatrail.mdl");self.traileffect = particleeffectnum("TR_CRYLINKPLASMA"); break;
-                       case PROJECTILE_CRYLINK_BOUNCING: setmodel(self, "models/plasmatrail.mdl");self.traileffect = particleeffectnum("TR_CRYLINKPLASMA"); break;
-                       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("TR_GRENADE"); break;
-                       case PROJECTILE_BLASTER: 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_hagar"); self.scale = 0.75; break;
-                       case PROJECTILE_HAGAR_BOUNCING: setmodel(self, "models/hagarmissile.mdl");self.traileffect = particleeffectnum("tr_hagar"); self.scale = 0.75; break;
-                       case PROJECTILE_NAPALM_FOUNTAIN: //self.model = ""; self.modelindex = 0; self.traileffect = particleeffectnum("torch_small"); 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;
-                       case PROJECTILE_FLAC: setmodel(self, "models/hagarmissile.mdl"); self.scale = 0.4; self.traileffect = particleeffectnum("TR_SEEKER"); break;
-                       case PROJECTILE_SEEKER: setmodel(self, "models/tagrocket.md3"); self.traileffect = particleeffectnum("TR_SEEKER"); break;
-
-                       case PROJECTILE_MAGE_SPIKE: setmodel(self, "models/ebomb.mdl"); self.traileffect = particleeffectnum("TR_VORESPIKE"); break;
-                       case PROJECTILE_SHAMBLER_LIGHTNING: setmodel(self, "models/ebomb.mdl"); self.traileffect = particleeffectnum("TR_NEXUIZPLASMA"); break;
-
-                       case PROJECTILE_RAPTORBOMB:    setmodel(self, "models/vehicles/clusterbomb.md3"); self.gravity = 1; self.avelocity = '0 0 180'; self.traileffect = particleeffectnum(""); break;
-                       case PROJECTILE_RAPTORBOMBLET: setmodel(self, "models/vehicles/bomblet.md3");     self.gravity = 1; self.avelocity = '0 0 180'; self.traileffect = particleeffectnum(""); break;
-                       case PROJECTILE_RAPTORCANNON:  setmodel(self, "models/plasmatrail.mdl"); self.traileffect = particleeffectnum("TR_CRYLINKPLASMA"); break;
-
-                       case PROJECTILE_SPIDERROCKET: setmodel(self, "models/vehicles/rocket02.md3"); self.traileffect = particleeffectnum("spiderbot_rocket_thrust"); break;
-                       case PROJECTILE_WAKIROCKET:   setmodel(self, "models/vehicles/rocket01.md3");  self.traileffect = particleeffectnum("wakizashi_rocket_thrust"); break;
-                       case PROJECTILE_WAKICANNON:   setmodel(self, "models/laser.mdl");  self.traileffect = particleeffectnum(""); break;
-
-                       case PROJECTILE_BUMBLE_GUN: setmodel(self, "models/elaser.mdl");self.traileffect = particleeffectnum("TR_NEXUIZPLASMA"); break;
-                       case PROJECTILE_BUMBLE_BEAM: setmodel(self, "models/elaser.mdl");self.traileffect = particleeffectnum("TR_NEXUIZPLASMA"); break;
-
-                       case PROJECTILE_RPC: setmodel(self, W_Model("ok_rocket"));self.traileffect = particleeffectnum("TR_ROCKET"); break;
+                       case PROJECTILE_ELECTRO: setmodel(self, "models/ebomb.mdl");self.traileffect = particleeffectnum(EFFECT_TR_NEXUIZPLASMA); break;
+                       case PROJECTILE_ROCKET: setmodel(self, "models/rocket.md3");self.traileffect = particleeffectnum(EFFECT_TR_ROCKET); self.scale = 2; break;
+                       case PROJECTILE_CRYLINK: setmodel(self, "models/plasmatrail.mdl");self.traileffect = particleeffectnum(EFFECT_TR_CRYLINKPLASMA); break;
+                       case PROJECTILE_CRYLINK_BOUNCING: setmodel(self, "models/plasmatrail.mdl");self.traileffect = particleeffectnum(EFFECT_TR_CRYLINKPLASMA); break;
+                       case PROJECTILE_ELECTRO_BEAM: setmodel(self, "models/elaser.mdl");self.traileffect = particleeffectnum(EFFECT_TR_NEXUIZPLASMA); break;
+                       case PROJECTILE_GRENADE: setmodel(self, "models/grenademodel.md3");self.traileffect = particleeffectnum(EFFECT_TR_GRENADE); break;
+                       case PROJECTILE_GRENADE_BOUNCING: setmodel(self, "models/grenademodel.md3");self.traileffect = particleeffectnum(EFFECT_TR_GRENADE); break;
+                       case PROJECTILE_MINE: setmodel(self, "models/mine.md3");self.traileffect = particleeffectnum(EFFECT_TR_GRENADE); break;
+                       case PROJECTILE_BLASTER: setmodel(self, "models/laser.mdl");self.traileffect = particleeffectnum(EFFECT_NULL); break;
+                       case PROJECTILE_HLAC: setmodel(self, "models/hlac_bullet.md3");self.traileffect = particleeffectnum(EFFECT_NULL); break;
+                       case PROJECTILE_PORTO_RED: setmodel(self, "models/grenademodel.md3");self.traileffect = particleeffectnum(EFFECT_TR_WIZSPIKE); self.scale = 4; break;
+                       case PROJECTILE_PORTO_BLUE: setmodel(self, "models/grenademodel.md3");self.traileffect = particleeffectnum(EFFECT_TR_WIZSPIKE); self.scale = 4; break;
+                       case PROJECTILE_HOOKBOMB: setmodel(self, "models/grenademodel.md3");self.traileffect = particleeffectnum(EFFECT_TR_KNIGHTSPIKE); break;
+                       case PROJECTILE_HAGAR: setmodel(self, "models/hagarmissile.mdl");self.traileffect = particleeffectnum(EFFECT_HAGAR_ROCKET); self.scale = 0.75; break;
+                       case PROJECTILE_HAGAR_BOUNCING: setmodel(self, "models/hagarmissile.mdl");self.traileffect = particleeffectnum(EFFECT_HAGAR_ROCKET); self.scale = 0.75; break;
+                       case PROJECTILE_NAPALM_FOUNTAIN: //self.model = ""; self.modelindex = 0; self.traileffect = _particleeffectnum("torch_small"); break;
+                       case PROJECTILE_FIREBALL: self.model = ""; self.modelindex = 0; self.traileffect = particleeffectnum(EFFECT_FIREBALL); break; // particle effect is good enough
+                       case PROJECTILE_FIREMINE: self.model = ""; self.modelindex = 0; self.traileffect = particleeffectnum(EFFECT_FIREMINE); break; // particle effect is good enough
+                       case PROJECTILE_TAG: setmodel(self, "models/laser.mdl"); self.traileffect = particleeffectnum(EFFECT_TR_ROCKET); break;
+                       case PROJECTILE_FLAC: setmodel(self, "models/hagarmissile.mdl"); self.scale = 0.4; self.traileffect = particleeffectnum(EFFECT_FLAC_TRAIL); break;
+                       case PROJECTILE_SEEKER: setmodel(self, "models/tagrocket.md3"); self.traileffect = particleeffectnum(EFFECT_SEEKER_TRAIL); break;
+
+                       case PROJECTILE_MAGE_SPIKE: setmodel(self, "models/ebomb.mdl"); self.traileffect = particleeffectnum(EFFECT_TR_VORESPIKE); break;
+                       case PROJECTILE_SHAMBLER_LIGHTNING: setmodel(self, "models/ebomb.mdl"); self.traileffect = particleeffectnum(EFFECT_TR_NEXUIZPLASMA); break;
+
+                       case PROJECTILE_RAPTORBOMB:    setmodel(self, "models/vehicles/clusterbomb.md3"); self.gravity = 1; self.avelocity = '0 0 180'; self.traileffect = particleeffectnum(EFFECT_NULL); break;
+                       case PROJECTILE_RAPTORBOMBLET: setmodel(self, "models/vehicles/bomblet.md3");     self.gravity = 1; self.avelocity = '0 0 180'; self.traileffect = particleeffectnum(EFFECT_NULL); break;
+                       case PROJECTILE_RAPTORCANNON:  setmodel(self, "models/plasmatrail.mdl"); self.traileffect = particleeffectnum(EFFECT_TR_CRYLINKPLASMA); break;
+
+                       case PROJECTILE_SPIDERROCKET: setmodel(self, "models/vehicles/rocket02.md3"); self.traileffect = particleeffectnum(EFFECT_SPIDERBOT_ROCKET_TRAIL); break;
+                       case PROJECTILE_WAKIROCKET:   setmodel(self, "models/vehicles/rocket01.md3");  self.traileffect = particleeffectnum(EFFECT_RACER_ROCKET_TRAIL); break;
+                       case PROJECTILE_WAKICANNON:   setmodel(self, "models/laser.mdl");  self.traileffect = particleeffectnum(EFFECT_NULL); break;
+
+                       case PROJECTILE_BUMBLE_GUN: setmodel(self, "models/elaser.mdl");self.traileffect = particleeffectnum(EFFECT_TR_NEXUIZPLASMA); break;
+                       case PROJECTILE_BUMBLE_BEAM: setmodel(self, "models/elaser.mdl");self.traileffect = particleeffectnum(EFFECT_TR_NEXUIZPLASMA); break;
+
+                       case PROJECTILE_RPC: setmodel(self, W_Model("ok_rocket"));self.traileffect = particleeffectnum(EFFECT_TR_ROCKET); break;
 
                        default:
                                if(MUTATOR_CALLHOOK(Ent_Projectile, self))
@@ -323,8 +323,8 @@ void Ent_Projectile()
 
                                if (Nade_FromProjectile(self.cnt) != NADE_TYPE_NULL)
                                {
-                                       setmodel(self, W_Model("v_ok_grenade"));
-                                       self.traileffect = particleeffectnum(Nade_TrailEffect(self.cnt, self.team));
+                                       setmodel(self, W_Model("v_ok_grenade.md3"));
+                                       self.traileffect = _particleeffectnum(Nade_TrailEffect(self.cnt, self.team));
                                        break;
                                }
                                error("Received invalid CSQC projectile, can't work with this!");
@@ -516,8 +516,8 @@ void Projectile_Precache()
        precache_model("models/tracer.mdl");
        precache_model("models/sphere/sphere.md3");
 
-       precache_model(W_Model("v_ok_grenade"));
-       precache_model(W_Model("ok_rocket"));
+       precache_model(W_Model("v_ok_grenade.md3"));
+       precache_model(W_Model("ok_rocket.md3"));
 
        precache_sound(W_Sound("electro_fly"));
        precache_sound(W_Sound("rocket_fly"));
index 0cba5d7..8a624aa 100644 (file)
     #include "../server/defs.qh"
 #endif
 
-// player animation data for this model
-// each vector is as follows:
-// _x = startframe
-// _y = numframes
-// _z = framerate
-.vector anim_die1; // player dies
-.vector anim_die2; // player dies differently
-.vector anim_draw; // player pulls out a weapon
-.vector anim_duckwalk; // player walking while crouching
-.vector anim_duckjump; // player jumping from a crouch
-.vector anim_duckidle; // player idling while crouching
-.vector anim_idle; // player standing
-.vector anim_jump; // player jump
-.vector anim_pain1; // player flinches from pain
-.vector anim_pain2; // player flinches from pain, differently
-.vector anim_shoot; // player shoots
-.vector anim_taunt; // player taunts others (FIXME: no code references this)
-.vector anim_run; // player running forward
-.vector anim_runbackwards; // player running backward
-.vector anim_strafeleft; // player shuffling left quickly
-.vector anim_straferight; // player shuffling right quickly
-.vector anim_forwardright; // player running forward and right
-.vector anim_forwardleft; // player running forward and left
-.vector anim_backright; // player running backward and right
-.vector anim_backleft; // player running back and left
-.vector anim_melee; // player doing the melee action
-.vector anim_duck; // player doing the melee action
-.vector anim_duckwalkbackwards;
-.vector anim_duckwalkstrafeleft;
-.vector anim_duckwalkstraferight;
-.vector anim_duckwalkforwardright;
-.vector anim_duckwalkforwardleft;
-.vector anim_duckwalkbackright;
-.vector anim_duckwalkbackleft;
-.float animdecide_modelindex;
+bool monsters_animoverride(entity e)
+{
+       int monster_id = 0;
+       for(int i = MON_FIRST; i <= MON_LAST; ++i)
+       {
+               entity mon = get_monsterinfo(i);
+
+               //if(substring(e.model, 0, strlen(mon.model) - 4) == substring(mon.model, 0, strlen(mon.model) - 4))
+               if(e.model == mon.model)
+               {
+                       monster_id = i;
+                       break;
+               }
+       }
+
+       if(!monster_id) { return false; }
+
+       MON_ACTION(monster_id, MR_ANIM);
+
+       vector none = '0 0 0';
+       e.anim_duckwalk = e.anim_walk;
+       e.anim_duckjump = animfixfps(e, '5 1 10', none);
+       e.anim_duckidle = e.anim_idle;
+       e.anim_jump = animfixfps(e, '8 1 10', none);
+       e.anim_taunt = animfixfps(e, '12 1 0.33', none);
+       e.anim_runbackwards = e.anim_run;
+       e.anim_strafeleft = e.anim_run;
+       e.anim_straferight = e.anim_run;
+       e.anim_forwardright = e.anim_run;
+       e.anim_forwardleft = e.anim_run;
+       e.anim_backright = e.anim_run;
+       e.anim_backleft  = e.anim_run;
+       e.anim_duckwalkbackwards = e.anim_walk;
+       e.anim_duckwalkstrafeleft = e.anim_walk;
+       e.anim_duckwalkstraferight = e.anim_walk;
+       e.anim_duckwalkforwardright = e.anim_walk;
+       e.anim_duckwalkforwardleft = e.anim_walk;
+       e.anim_duckwalkbackright = e.anim_walk;
+       e.anim_duckwalkbackleft  = e.anim_walk;
+
+       // these anims ought to stay until stopped explicitly by weaponsystem
+       e.anim_shoot_z = 0.001;
+       e.anim_melee_z = 0.001;
+
+       return true;
+}
 
 void animdecide_load_if_needed(entity e)
 {
@@ -52,6 +63,12 @@ void animdecide_load_if_needed(entity e)
                return;
        e.animdecide_modelindex = e.modelindex;
 
+       if(substring(e.model, 0, 16) == "models/monsters/")
+       {
+               if(monsters_animoverride(e))
+                       return;
+       }
+
        vector none = '0 0 0';
        e.anim_die1 = animfixfps(e, '0 1 0.5', none); // 2 seconds
        e.anim_die2 = animfixfps(e, '1 1 0.5', none); // 2 seconds
index 9dc7cf7..f1bdcb7 100644 (file)
@@ -8,6 +8,42 @@ void animdecide_load_if_needed(entity e);
 void animdecide_setimplicitstate(entity e, float onground);
 void animdecide_setframes(entity e, bool support_blending, .int fld_frame, .int fld_frame1time, .int fld_frame2, .int fld_frame2time);
 
+// player animation data for this model
+// each vector is as follows:
+// _x = startframe
+// _y = numframes
+// _z = framerate
+.vector anim_die1; // player dies
+.vector anim_die2; // player dies differently
+.vector anim_draw; // player pulls out a weapon
+.vector anim_duckwalk; // player walking while crouching
+.vector anim_duckjump; // player jumping from a crouch
+.vector anim_duckidle; // player idling while crouching
+.vector anim_idle; // player standing
+.vector anim_jump; // player jump
+.vector anim_pain1; // player flinches from pain
+.vector anim_pain2; // player flinches from pain, differently
+.vector anim_shoot; // player shoots
+.vector anim_taunt; // player taunts others (FIXME: no code references this)
+.vector anim_run; // player running forward
+.vector anim_runbackwards; // player running backward
+.vector anim_strafeleft; // player shuffling left quickly
+.vector anim_straferight; // player shuffling right quickly
+.vector anim_forwardright; // player running forward and right
+.vector anim_forwardleft; // player running forward and left
+.vector anim_backright; // player running backward and right
+.vector anim_backleft; // player running back and left
+.vector anim_melee; // player doing the melee action
+.vector anim_duck; // player doing the melee action
+.vector anim_duckwalkbackwards;
+.vector anim_duckwalkstrafeleft;
+.vector anim_duckwalkstraferight;
+.vector anim_duckwalkforwardright;
+.vector anim_duckwalkforwardleft;
+.vector anim_duckwalkbackright;
+.vector anim_duckwalkbackleft;
+.float animdecide_modelindex;
+
 // please network this one
 .int anim_state;
 .float anim_time;
index 14bc589..0c8f858 100644 (file)
@@ -50,7 +50,7 @@ void Curl_URI_Get_Callback(int id, float status, string data)
        string do_cvar = curl_uri_get_cvar[i];
        if(status != 0)
        {
-               dprintf("error: status is %d\n", status);
+               LOG_TRACEF("error: status is %d\n", status);
                if(do_cvar)
                        strunzone(do_cvar);
                return;
@@ -64,7 +64,7 @@ void Curl_URI_Get_Callback(int id, float status, string data)
        }
        if(!do_exec)
                if (!do_cvar)
-                       print(data);
+                       LOG_INFO(data);
 }
 
 
@@ -102,12 +102,12 @@ void GenericCommand_addtolist(float request, float argc)
                }
 
                default:
-                       print("Incorrect parameters for ^2addtolist^7\n");
+                       LOG_INFO("Incorrect parameters for ^2addtolist^7\n");
                case CMD_REQUEST_USAGE:
                {
-                       print(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " addtolist variable value\n"));
-                       print("  Where 'variable' is what to add 'value' to.\n");
-                       print("See also: ^2removefromlist^7\n");
+                       LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " addtolist variable value\n"));
+                       LOG_INFO("  Where 'variable' is what to add 'value' to.\n");
+                       LOG_INFO("See also: ^2removefromlist^7\n");
                        return;
                }
        }
@@ -169,7 +169,7 @@ void GenericCommand_qc_curl(float request, float argc)
                                curl_uri_get_pos = (curl_uri_get_pos + 1) % (URI_GET_CURL_END - URI_GET_CURL + 1);
                        }
                        else
-                               print(_("error creating curl handle\n"));
+                               LOG_INFO(_("error creating curl handle\n"));
 
                        buf_del(buf);
 
@@ -179,7 +179,7 @@ void GenericCommand_qc_curl(float request, float argc)
                default:
                case CMD_REQUEST_USAGE:
                {
-                       print(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " qc_curl [--key N] [--cvar] [--exec] URL [postargs...]"));
+                       LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " qc_curl [--key N] [--cvar] [--exec] URL [postargs...]"));
                        return;
                }
        }
@@ -219,13 +219,13 @@ void GenericCommand_dumpcommands(float request)
                                CMD_Write("\ndump of generic commands:\n");
                                GenericCommand_macro_write_aliases(fh);
 
-                               print("Completed dump of aliases in ^2data/data/", GetProgramCommandPrefix(), "_dump.txt^7.\n");
+                               LOG_INFO("Completed dump of aliases in ^2data/data/", GetProgramCommandPrefix(), "_dump.txt^7.\n");
 
                                fclose(fh);
                        }
                        else
                        {
-                               print("^1Error: ^7Could not dump to file!\n");
+                               LOG_INFO("^1Error: ^7Could not dump to file!\n");
                        }
                        return;
                }
@@ -233,8 +233,8 @@ void GenericCommand_dumpcommands(float request)
                default:
                case CMD_REQUEST_USAGE:
                {
-                       print(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " dumpcommands"));
-                       print("  No arguments required.\n");
+                       LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " dumpcommands"));
+                       LOG_INFO("  No arguments required.\n");
                        return;
                }
        }
@@ -253,7 +253,7 @@ void GenericCommand_dumpitems(float request)
                default:
                case CMD_REQUEST_USAGE:
                {
-                       printf("\nUsage:^3 %s dumpitems", GetProgramCommandPrefix());
+                       LOG_INFOF("\nUsage:^3 %s dumpitems", GetProgramCommandPrefix());
                        return;
                }
        }
@@ -284,15 +284,15 @@ void GenericCommand_dumpnotifs(float request)
                        if(fh >= 0)
                        {
                                Dump_Notifications(fh, alsoprint);
-                               printf("Dumping notifications... File located in ^2data/data/%s^7.\n", filename);
+                               LOG_INFOF("Dumping notifications... File located in ^2data/data/%s^7.\n", filename);
                                fclose(fh);
                        }
                        else
                        {
-                               printf("^1Error: ^7Could not open file '%s'!\n", filename);
+                               LOG_INFOF("^1Error: ^7Could not open file '%s'!\n", filename);
                        }
                        #else
-                       print(_("Notification dump command only works with cl_cmd and sv_cmd.\n"));
+                       LOG_INFO(_("Notification dump command only works with cl_cmd and sv_cmd.\n"));
                        #endif
                        return;
                }
@@ -300,10 +300,10 @@ void GenericCommand_dumpnotifs(float request)
                default:
                case CMD_REQUEST_USAGE:
                {
-                       print(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " dumpnotifs [filename]"));
-                       print("  Where 'filename' is the file to write (default is notifications_dump.cfg),\n");
-                       print("  if supplied with '-' output to console as well as default,\n");
-                       print("  if left blank, it will only write to default.\n");
+                       LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " dumpnotifs [filename]"));
+                       LOG_INFO("  Where 'filename' is the file to write (default is notifications_dump.cfg),\n");
+                       LOG_INFO("  if supplied with '-' output to console as well as default,\n");
+                       LOG_INFO("  if left blank, it will only write to default.\n");
                        return;
                }
        }
@@ -335,17 +335,17 @@ void GenericCommand_dumpweapons(float request) // WEAPONTODO: make this work wit
                        if(wep_config_file >= 0)
                        {
                                Dump_Weapon_Settings();
-                               print(sprintf("Dumping weapons... File located in ^2data/data/%s^7.\n", filename));
+                               LOG_INFO(sprintf("Dumping weapons... File located in ^2data/data/%s^7.\n", filename));
                                fclose(wep_config_file);
                                wep_config_file = -1;
                                wep_config_alsoprint = -1;
                        }
                        else
                        {
-                               print(sprintf("^1Error: ^7Could not open file '%s'!\n", filename));
+                               LOG_INFO(sprintf("^1Error: ^7Could not open file '%s'!\n", filename));
                        }
                        #else
-                       print(_("Weapons dump command only works with sv_cmd.\n"));
+                       LOG_INFO(_("Weapons dump command only works with sv_cmd.\n"));
                        #endif
                        return;
                }
@@ -353,10 +353,10 @@ void GenericCommand_dumpweapons(float request) // WEAPONTODO: make this work wit
                default:
                case CMD_REQUEST_USAGE:
                {
-                       print(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " dumpweapons [filename]"));
-                       print("  Where 'filename' is the file to write (default is weapons_dump.cfg),\n");
-                       print("  if supplied with '-' output to console as well as default,\n");
-                       print("  if left blank, it will only write to default.\n");
+                       LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " dumpweapons [filename]"));
+                       LOG_INFO("  Where 'filename' is the file to write (default is weapons_dump.cfg),\n");
+                       LOG_INFO("  if supplied with '-' output to console as well as default,\n");
+                       LOG_INFO("  if left blank, it will only write to default.\n");
                        return;
                }
        }
@@ -388,17 +388,17 @@ void GenericCommand_dumpturrets(float request)
                        if(tur_config_file >= 0)
                        {
                                Dump_Turret_Settings();
-                               print(sprintf("Dumping turrets... File located in ^2data/data/%s^7.\n", filename));
+                               LOG_INFO(sprintf("Dumping turrets... File located in ^2data/data/%s^7.\n", filename));
                                fclose(tur_config_file);
                                tur_config_file = -1;
                                tur_config_alsoprint = -1;
                        }
                        else
                        {
-                               print(sprintf("^1Error: ^7Could not open file '%s'!\n", filename));
+                               LOG_INFO(sprintf("^1Error: ^7Could not open file '%s'!\n", filename));
                        }
                        #else
-                       print(_("Turrets dump command only works with sv_cmd.\n"));
+                       LOG_INFO(_("Turrets dump command only works with sv_cmd.\n"));
                        #endif
                        return;
                }
@@ -406,10 +406,10 @@ void GenericCommand_dumpturrets(float request)
                default:
                case CMD_REQUEST_USAGE:
                {
-                       print(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " dumpturrets [filename]"));
-                       print("  Where 'filename' is the file to write (default is turrets_dump.cfg),\n");
-                       print("  if supplied with '-' output to console as well as default,\n");
-                       print("  if left blank, it will only write to default.\n");
+                       LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " dumpturrets [filename]"));
+                       LOG_INFO("  Where 'filename' is the file to write (default is turrets_dump.cfg),\n");
+                       LOG_INFO("  if supplied with '-' output to console as well as default,\n");
+                       LOG_INFO("  if left blank, it will only write to default.\n");
                        return;
                }
        }
@@ -432,7 +432,7 @@ void GenericCommand_maplist(float request, float argc)
                                        {
                                                if (!fexists(strcat("maps/", argv(2), ".bsp")))
                                                {
-                                                       print("maplist: ERROR: ", argv(2), " does not exist!\n");
+                                                       LOG_INFO("maplist: ERROR: ", argv(2), " does not exist!\n");
                                                        break;
                                                }
 
@@ -493,13 +493,13 @@ void GenericCommand_maplist(float request, float argc)
                }
 
                default:
-                       print("Incorrect parameters for ^2maplist^7\n");
+                       LOG_INFO("Incorrect parameters for ^2maplist^7\n");
                case CMD_REQUEST_USAGE:
                {
-                       print(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " maplist action [map]\n"));
-                       print("  Where 'action' is the command to complete,\n");
-                       print("  and 'map' is what it acts upon (if required).\n");
-                       print("  Full list of commands here: \"add, cleanup, remove, shuffle.\"\n");
+                       LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " maplist action [map]\n"));
+                       LOG_INFO("  Where 'action' is the command to complete,\n");
+                       LOG_INFO("  and 'map' is what it acts upon (if required).\n");
+                       LOG_INFO("  Full list of commands here: \"add, cleanup, remove, shuffle.\"\n");
                        return;
                }
        }
@@ -518,8 +518,8 @@ void GenericCommand_nextframe(float request, float arguments, string command)
                default:
                case CMD_REQUEST_USAGE:
                {
-                       print(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " nextframe command...\n"));
-                       print("  Where command will be executed next frame of this VM\n");
+                       LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " nextframe command...\n"));
+                       LOG_INFO("  Where command will be executed next frame of this VM\n");
                        return;
                }
        }
@@ -553,12 +553,12 @@ void GenericCommand_removefromlist(float request, float argc)
                }
 
                default:
-                       print("Incorrect parameters for ^2removefromlist^7\n");
+                       LOG_INFO("Incorrect parameters for ^2removefromlist^7\n");
                case CMD_REQUEST_USAGE:
                {
-                       print(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " removefromlist variable value\n"));
-                       print("  Where 'variable' is what cvar to remove 'value' from.\n");
-                       print("See also: ^2addtolist^7\n");
+                       LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " removefromlist variable value\n"));
+                       LOG_INFO("  Where 'variable' is what cvar to remove 'value' from.\n");
+                       LOG_INFO("See also: ^2addtolist^7\n");
                        return;
                }
        }
@@ -571,7 +571,7 @@ void GenericCommand_restartnotifs(float request)
                case CMD_REQUEST_COMMAND:
                {
                        #ifndef MENUQC
-                       printf(
+                       LOG_INFOF(
                                strcat(
                                        "Restart_Notifications(): Restarting %d notifications... ",
                                        "Counts: MSG_ANNCE = %d, MSG_INFO = %d, MSG_CENTER = %d, MSG_MULTI = %d, MSG_CHOICE = %d\n"
@@ -592,7 +592,7 @@ void GenericCommand_restartnotifs(float request)
                        Destroy_All_Notifications();
                        CALL_ACCUMULATED_FUNCTION(RegisterNotifications);
                        #else
-                       print(_("Notification restart command only works with cl_cmd and sv_cmd.\n"));
+                       LOG_INFO(_("Notification restart command only works with cl_cmd and sv_cmd.\n"));
                        #endif
                        return;
                }
@@ -600,8 +600,8 @@ void GenericCommand_restartnotifs(float request)
                default:
                case CMD_REQUEST_USAGE:
                {
-                       print(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " restartnotifs"));
-                       print("  No arguments required.\n");
+                       LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " restartnotifs"));
+                       LOG_INFO("  No arguments required.\n");
                        return;
                }
        }
@@ -617,9 +617,9 @@ void GenericCommand_settemp(float request, float argc)
                        {
                                float f = cvar_settemp(argv(1), argv(2));
                                if(f == 1)
-                                       dprint("Creating new settemp tracker for ", argv(1), " and setting it to \"", argv(2), "\" temporarily.\n");
+                                       LOG_TRACE("Creating new settemp tracker for ", argv(1), " and setting it to \"", argv(2), "\" temporarily.\n");
                                else if(f == -1)
-                                       dprint("Already had a tracker for ", argv(1), ", updating it to \"", argv(2), "\".\n");
+                                       LOG_TRACE("Already had a tracker for ", argv(1), ", updating it to \"", argv(2), "\".\n");
                                // else cvar_settemp itself errors out
 
                                return;
@@ -627,12 +627,12 @@ void GenericCommand_settemp(float request, float argc)
                }
 
                default:
-                       print("Incorrect parameters for ^2settemp^7\n");
+                       LOG_INFO("Incorrect parameters for ^2settemp^7\n");
                case CMD_REQUEST_USAGE:
                {
-                       print(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " settemp \"cvar\" \"arguments\"\n"));
-                       print("  Where 'cvar' is the cvar you want to temporarily set with 'arguments'.\n");
-                       print("See also: ^2settemp_restore^7\n");
+                       LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " settemp \"cvar\" \"arguments\"\n"));
+                       LOG_INFO("  Where 'cvar' is the cvar you want to temporarily set with 'arguments'.\n");
+                       LOG_INFO("See also: ^2settemp_restore^7\n");
                        return;
                }
        }
@@ -647,9 +647,9 @@ void GenericCommand_settemp_restore(float request, float argc)
                        float i = cvar_settemp_restore();
 
                        if(i)
-                               dprint("Restored ", ftos(i), " temporary cvar settings to their original values.\n");
+                               LOG_TRACE("Restored ", ftos(i), " temporary cvar settings to their original values.\n");
                        else
-                               dprint("Nothing to restore.\n");
+                               LOG_TRACE("Nothing to restore.\n");
 
                        return;
                }
@@ -657,9 +657,9 @@ void GenericCommand_settemp_restore(float request, float argc)
                default:
                case CMD_REQUEST_USAGE:
                {
-                       print(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " settemp_restore\n"));
-                       print("  No arguments required.\n");
-                       print("See also: ^2settemp^7\n");
+                       LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " settemp_restore\n"));
+                       LOG_INFO("  No arguments required.\n");
+                       LOG_INFO("See also: ^2settemp^7\n");
                        return;
                }
        }
@@ -685,7 +685,7 @@ void GenericCommand_runtest(float request, float argc)
                default:
                case CMD_REQUEST_USAGE:
                {
-                       print(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " [function to run]"));
+                       LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " [function to run]"));
                        return;
                }
        }
@@ -740,7 +740,7 @@ void GenericCommand_(float request)
 void GenericCommand_macro_help()
 {
        #define GENERIC_COMMAND(name,function,description) \
-               { print("  ^2", name, "^7: ", description, "\n"); }
+               { LOG_INFO("  ^2", name, "^7: ", description, "\n"); }
 
        GENERIC_COMMANDS(0, 0, "");
        #undef GENERIC_COMMAND
index c975f98..1ca075b 100644 (file)
@@ -13,7 +13,7 @@ string rpn_pop()
                --rpn_sp;
                return rpn_stack[rpn_sp];
        } else {
-               print("rpn: stack underflow\n");
+               LOG_INFO("rpn: stack underflow\n");
                rpn_error = true;
                return "";
        }
@@ -24,7 +24,7 @@ void rpn_push(string s)
                rpn_stack[rpn_sp] = s;
                ++rpn_sp;
        } else {
-               print("rpn: stack overflow\n");
+               LOG_INFO("rpn: stack overflow\n");
                rpn_error = true;
        }
 }
@@ -33,7 +33,7 @@ string rpn_get()
        if(rpn_sp > 0) {
                return rpn_stack[rpn_sp - 1];
        } else {
-               print("rpn: empty stack\n");
+               LOG_INFO("rpn: empty stack\n");
                rpn_error = true;
                return "";
        }
@@ -43,7 +43,7 @@ void rpn_set(string s)
        if(rpn_sp > 0) {
                rpn_stack[rpn_sp - 1] = s;
        } else {
-               print("rpn: empty stack\n");
+               LOG_INFO("rpn: empty stack\n");
                rpn_error = true;
        }
 }
@@ -107,7 +107,7 @@ void GenericCommand_rpn(float request, float argc, string command)
                                                }
                                                else
                                                {
-                                                       print("rpn: empty cvar name for 'def'\n");
+                                                       LOG_INFO("rpn: empty cvar name for 'def'\n");
                                                        rpn_error = true;
                                                }
                                        } else if(rpncmd == "defs" || rpncmd == "@") {
@@ -132,7 +132,7 @@ void GenericCommand_rpn(float request, float argc, string command)
                                                }
                                                else
                                                {
-                                                       print("rpn: empty cvar name for 'defs'\n");
+                                                       LOG_INFO("rpn: empty cvar name for 'defs'\n");
                                                        rpn_error = true;
                                                }
                                        } else if(rpncmd == "load") {
@@ -288,7 +288,7 @@ void GenericCommand_rpn(float request, float argc, string command)
                                                                db_put(rpn_db, "stack.pos", ftos(i-2));
                                                } else {
                                                        rpn_error = 1;
-                                                       print("rpn: database underflow\n");
+                                                       LOG_INFO("rpn: database underflow\n");
                                                }
                                        } else if(rpncmd == "dbget") {
 
@@ -298,7 +298,7 @@ void GenericCommand_rpn(float request, float argc, string command)
                                                        rpn_push(db_get(rpn_db, strcat("stack.", ftos(i-1))));
                                                } else {
                                                        rpn_error = 1;
-                                                       print("rpn: database empty\n");
+                                                       LOG_INFO("rpn: database empty\n");
                                                }
                                        } else if(rpncmd == "dblen") {
                                                rpn_push(db_get(rpn_db, "stack.pointer"));
@@ -347,7 +347,7 @@ void GenericCommand_rpn(float request, float argc, string command)
                                                if(!j)
                                                {
                                                        rpn_error = true;
-                                                       print("rpn: empty database\n");
+                                                       LOG_INFO("rpn: empty database\n");
                                                } else {
                                                        --j;
                                                        rpn_push(db_get(rpn_db, strcat("stack.", ftos(i))));
@@ -372,7 +372,7 @@ void GenericCommand_rpn(float request, float argc, string command)
                                                        rpn_push(db_get(rpn_db, strcat("stack.", s)));
                                                } else {
                                                        rpn_error = 1;
-                                                       print("rpn: empty database\n");
+                                                       LOG_INFO("rpn: empty database\n");
                                                }
                                        } else if(rpncmd == "dbat") {
                                                rpn_push(db_get(rpn_db, "stack.pos"));
@@ -384,7 +384,7 @@ void GenericCommand_rpn(float request, float argc, string command)
                                                {
                                                        if(i < 0 || i >= j)
                                                        {
-                                                               print("rpn: database cursor out of bounds\n");
+                                                               LOG_INFO("rpn: database cursor out of bounds\n");
                                                                rpn_error = true;
                                                        }
                                                        if(!rpn_error)
@@ -398,7 +398,7 @@ void GenericCommand_rpn(float request, float argc, string command)
                                                if(!j)
                                                {
                                                        rpn_error = true;
-                                                       print("rpn: empty database, cannot move cursor\n");
+                                                       LOG_INFO("rpn: empty database, cannot move cursor\n");
                                                }
                                                if(!rpn_error)
                                                {
@@ -412,7 +412,7 @@ void GenericCommand_rpn(float request, float argc, string command)
                                                        j = stof(db_get(rpn_db, "stack.pointer"));
                                                        if(i < 0 || i >= j)
                                                        {
-                                                               print("rpn: database cursor destination out of bounds\n");
+                                                               LOG_INFO("rpn: database cursor destination out of bounds\n");
                                                                rpn_error = true;
                                                        }
                                                        if(!rpn_error)
@@ -514,7 +514,7 @@ void GenericCommand_rpn(float request, float argc, string command)
                                                {
                                                        if (!fexists(s))
                                                        {
-                                                               print("rpn: ERROR: ", s, " does not exist!\n");
+                                                               LOG_INFO("rpn: ERROR: ", s, " does not exist!\n");
                                                                rpn_error = true;
                                                        }
                                                }
@@ -553,7 +553,7 @@ void GenericCommand_rpn(float request, float argc, string command)
                                while(rpn_sp > 0)
                                {
                                        s = rpn_pop();
-                                       print("rpn: still on stack: ", s, "\n");
+                                       LOG_INFO("rpn: still on stack: ", s, "\n");
                                }
                        }
 
@@ -563,42 +563,42 @@ void GenericCommand_rpn(float request, float argc, string command)
                default:
                case CMD_REQUEST_USAGE:
                {
-                       print(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " rpn EXPRESSION...\n"));
-                       print("    Operator description (x: string, s: set, f: float):\n");
-                       print("    x pop ----------------------------->     : removes the top\n");
-                       print("    x dup -----------------------------> x x : duplicates the top\n");
-                       print("    x x exch --------------------------> x x : swap the top two\n");
-                       print("    /cvarname load --------------------> x   : loads a cvar\n");
-                       print("    /cvarname x def ------------------->     : writes to a cvar\n");
-                       print("    f f add|sub|mul|div|mod|pow -------> f   : adds/... two numbers\n");
-                       print("    f f and|or|xor|bitand|bitor|bitxor > f   : logical and bitwise operations\n");
-                       print("    f f eq|ne|gt|ge|lt|le|max|min -----> f   : compares two numbers\n");
-                       print("    f neg|abs|sgn|rand|floor|ceil------> f   : negates/... a number\n");
-                       print("    f not|bitnot ----------------------> f   : logical and bitwise negation\n");
-                       print("    f exp|log|sin|cos -----------------> f   : exponential function & Co.\n");
-                       print("    f f f bound -----------------------> f   : bounds the middle number\n");
-                       print("    f1 f2 b when ----------------------> f   : f1 if b, f2 otherwise\n");
-                       print("    s s union|intersection|difference -> s   : set operations\n");
-                       print("    s shuffle -------------------------> s   : randomly arrange elements\n");
-                       print("    /key /value put ------------------->     : set a database key\n");
-                       print("    /key get --------------------------> s   : get a database value\n");
-                       print("    x dbpush -------------------------->     : pushes the top onto the database\n");
-                       print("    dbpop|dbget -----------------------> x   : removes/reads DB's top\n");
-                       print("    dblen|dbat ------------------------> f   : gets the DB's size/cursor pos\n");
-                       print("    dbclr ----------------------------->     : clear the DB\n");
-                       print("    s dbsave|dbload-------------------->     : save/load the DB to/from a file\n");
-                       print("    x dbins --------------------------->     : moves the top into the DB\n");
-                       print("    dbext|dbread ----------------------> x   : extract/get from the DB's cursor\n");
-                       print("    f dbmov|dbgoto -------------------->     : move or set the DB's cursor\n");
-                       print("    s localtime -----------------------> s   : formats the current local time\n");
-                       print("    s gmtime --------------------------> s   : formats the current UTC time\n");
-                       print("    time ------------------------------> f   : seconds since VM start\n");
-                       print("    s /MD4 digest ---------------------> s   : MD4 digest\n");
-                       print("    s /SHA256 digest ------------------> s   : SHA256 digest\n");
-                       print("    s /formatstring sprintf1s ---------> s   : sprintf with 1 string (pad, cut)\n");
-                       print("    s eval ---------------------------->     : does something eval\n");
-                       print("    Set operations operate on 'such''strings'.\n");
-                       print("    Unknown tokens insert their cvar value.\n");
+                       LOG_INFO(strcat("\nUsage:^3 ", GetProgramCommandPrefix(), " rpn EXPRESSION...\n"));
+                       LOG_INFO("    Operator description (x: string, s: set, f: float):\n");
+                       LOG_INFO("    x pop ----------------------------->     : removes the top\n");
+                       LOG_INFO("    x dup -----------------------------> x x : duplicates the top\n");
+                       LOG_INFO("    x x exch --------------------------> x x : swap the top two\n");
+                       LOG_INFO("    /cvarname load --------------------> x   : loads a cvar\n");
+                       LOG_INFO("    /cvarname x def ------------------->     : writes to a cvar\n");
+                       LOG_INFO("    f f add|sub|mul|div|mod|pow -------> f   : adds/... two numbers\n");
+                       LOG_INFO("    f f and|or|xor|bitand|bitor|bitxor > f   : logical and bitwise operations\n");
+                       LOG_INFO("    f f eq|ne|gt|ge|lt|le|max|min -----> f   : compares two numbers\n");
+                       LOG_INFO("    f neg|abs|sgn|rand|floor|ceil------> f   : negates/... a number\n");
+                       LOG_INFO("    f not|bitnot ----------------------> f   : logical and bitwise negation\n");
+                       LOG_INFO("    f exp|log|sin|cos -----------------> f   : exponential function & Co.\n");
+                       LOG_INFO("    f f f bound -----------------------> f   : bounds the middle number\n");
+                       LOG_INFO("    f1 f2 b when ----------------------> f   : f1 if b, f2 otherwise\n");
+                       LOG_INFO("    s s union|intersection|difference -> s   : set operations\n");
+                       LOG_INFO("    s shuffle -------------------------> s   : randomly arrange elements\n");
+                       LOG_INFO("    /key /value put ------------------->     : set a database key\n");
+                       LOG_INFO("    /key get --------------------------> s   : get a database value\n");
+                       LOG_INFO("    x dbpush -------------------------->     : pushes the top onto the database\n");
+                       LOG_INFO("    dbpop|dbget -----------------------> x   : removes/reads DB's top\n");
+                       LOG_INFO("    dblen|dbat ------------------------> f   : gets the DB's size/cursor pos\n");
+                       LOG_INFO("    dbclr ----------------------------->     : clear the DB\n");
+                       LOG_INFO("    s dbsave|dbload-------------------->     : save/load the DB to/from a file\n");
+                       LOG_INFO("    x dbins --------------------------->     : moves the top into the DB\n");
+                       LOG_INFO("    dbext|dbread ----------------------> x   : extract/get from the DB's cursor\n");
+                       LOG_INFO("    f dbmov|dbgoto -------------------->     : move or set the DB's cursor\n");
+                       LOG_INFO("    s localtime -----------------------> s   : formats the current local time\n");
+                       LOG_INFO("    s gmtime --------------------------> s   : formats the current UTC time\n");
+                       LOG_INFO("    time ------------------------------> f   : seconds since VM start\n");
+                       LOG_INFO("    s /MD4 digest ---------------------> s   : MD4 digest\n");
+                       LOG_INFO("    s /SHA256 digest ------------------> s   : SHA256 digest\n");
+                       LOG_INFO("    s /formatstring sprintf1s ---------> s   : sprintf with 1 string (pad, cut)\n");
+                       LOG_INFO("    s eval ---------------------------->     : does something eval\n");
+                       LOG_INFO("    Set operations operate on 'such''strings'.\n");
+                       LOG_INFO("    Unknown tokens insert their cvar value.\n");
                        return;
                }
        }
diff --git a/qcsrc/common/effects.inc b/qcsrc/common/effects.inc
new file mode 100644 (file)
index 0000000..8cd4d49
--- /dev/null
@@ -0,0 +1,189 @@
+// Global list of effects, networked to CSQC by ID to save bandwidth and to use client particle numbers (allows mismatching effectinfos to some degree)
+// Not too concerned about the order of this list, just keep the weapon effects together!
+
+// EFFECT(istrail, EFFECT_NAME,     "effectinfo_string")
+EFFECT(0, EXPLOSION_SMALL,          "explosion_small")
+EFFECT(0, EXPLOSION_MEDIUM,         "explosion_medium")
+EFFECT(0, EXPLOSION_BIG,            "explosion_big")
+
+EFFECT(0, SMOKE_SMALL,              "smoke_small")
+EFFECT(0, SMOKE_LARGE,              "smoke_large")
+
+
+
+EFFECT(0, BLASTER_IMPACT,           "laser_impact")
+EFFECT(0, BLASTER_MUZZLEFLASH,      "laser_muzzleflash")
+
+EFFECT(0, SHOTGUN_IMPACT,           "shotgun_impact")
+EFFECT(0, SHOTGUN_MUZZLEFLASH,      "shotgun_muzzleflash")
+
+EFFECT(0, ARC_BEAM,                 "arc_beam")
+EFFECT(0, ARC_BEAM_HEAL,            "arc_beam_heal")
+EFFECT(0, ARC_BEAM_HEAL_IMPACT,     "arc_beam_healimpact")
+EFFECT(0, ARC_BEAM_HEAL_IMPACT2,    "healray_impact")
+EFFECT(0, ARC_LIGHTNING,            "arc_lightning")
+EFFECT(0, ARC_LIGHTNING2,           "electro_lightning")
+
+EFFECT(0, MACHINEGUN_IMPACT,        "machinegun_impact")
+EFFECT(0, MACHINEGUN_MUZZLEFLASH,   "uzi_muzzleflash")
+
+EFFECT(0, GRENADE_EXPLODE,          "grenade_explode")
+EFFECT(0, GRENADE_MUZZLEFLASH,      "grenadelauncher_muzzleflash")
+
+EFFECT(0, ELECTRO_BALLEXPLODE,      "electro_ballexplode")
+EFFECT(0, ELECTRO_COMBO,            "electro_combo")
+EFFECT(0, ELECTRO_IMPACT,           "electro_impact")
+EFFECT(0, ELECTRO_MUZZLEFLASH,      "electro_muzzleflash")
+
+EFFECT(0, CRYLINK_IMPACT,           "crylink_impactbig")
+EFFECT(0, CRYLINK_IMPACT2,          "crylink_impact")
+EFFECT(0, CRYLINK_JOINEXPLODE,      "crylink_joinexplode")
+EFFECT(0, CRYLINK_MUZZLEFLASH,      "crylink_muzzleflash")
+
+EFFECT(0, VORTEX_BEAM,              "nex_beam")
+EFFECT(0, VORTEX_BEAM_OLD,          "TE_TEI_G3")
+EFFECT(0, VORTEX_IMPACT,            "nex_impact")
+EFFECT(0, VORTEX_MUZZLEFLASH,       "nex_muzzleflash")
+
+EFFECT(1, VAPORIZER_RED,            "TE_TEI_G3RED")
+EFFECT(1, VAPORIZER_RED_HIT,        "TE_TEI_G3RED_HIT")
+EFFECT(1, VAPORIZER_BLUE,           "TE_TEI_G3BLUE")
+EFFECT(1, VAPORIZER_BLUE_HIT,       "TE_TEI_G3BLUE_HIT")
+EFFECT(1, VAPORIZER_YELLOW,         "TE_TEI_G3YELLOW")
+EFFECT(1, VAPORIZER_YELLOW_HIT,     "TE_TEI_G3YELLOW_HIT")
+EFFECT(1, VAPORIZER_PINK,           "TE_TEI_G3PINK")
+EFFECT(1, VAPORIZER_PINK_HIT,       "TE_TEI_G3PINK_HIT")
+EFFECT(1, VAPORIZER_NEUTRAL,        "TE_TEI_G3")
+EFFECT(1, VAPORIZER_NEUTRAL_HIT,    "TE_TEI_G3_HIT")
+
+EFFECT(0, RIFLE_IMPACT,             "machinegun_impact")
+EFFECT(0, RIFLE_MUZZLEFLASH,        "rifle_muzzleflash")
+EFFECT(1, RIFLE,                    "tr_rifle")
+EFFECT(1, RIFLE_WEAK,               "tr_rifle_weak")
+
+EFFECT(0, HAGAR_BOUNCE,             "hagar_bounce")
+EFFECT(0, HAGAR_EXPLODE,            "hagar_explode")
+EFFECT(0, HAGAR_MUZZLEFLASH,        "hagar_muzzleflash")
+EFFECT(1, HAGAR_ROCKET,             "tr_hagar")
+
+EFFECT(0, ROCKET_EXPLODE,           "rocket_explode")
+EFFECT(0, ROCKET_GUIDE,             "rocket_guide")
+EFFECT(0, ROCKET_MUZZLEFLASH,       "rocketlauncher_muzzleflash")
+
+EFFECT(0, HOOK_EXPLODE,             "hookbomb_explode")
+EFFECT(0, HOOK_IMPACT,              "grapple_impact")
+EFFECT(0, HOOK_MUZZLEFLASH,         "grapple_muzzleflash")
+
+EFFECT(0, SEEKER_MUZZLEFLASH,       "seeker_muzzleflash")
+
+EFFECT(0, FLAK_BOUNCE,              "flak_bounce")
+
+EFFECT(1, FIREBALL,                 "fireball")
+EFFECT(0, FIREBALL_BFGDAMAGE,       "fireball_bfgdamage")
+EFFECT(0, FIREBALL_EXPLODE,         "fireball_explode")
+EFFECT(0, FIREBALL_LASER,           "fireball_laser")
+EFFECT(0, FIREBALL_MUZZLEFLASH,     "fireball_muzzleflash")
+EFFECT(0, FIREBALL_PRE_MUZZLEFLASH, "fireball_preattack_muzzleflash")
+
+
+
+EFFECT(0, RAPTOR_CANNON_IMPACT,     "raptor_cannon_impact")
+EFFECT(0, RAPTOR_BOMB_IMPACT,       "raptor_bomb_impact")
+EFFECT(0, RAPTOR_BOMB_SPREAD,       "raptor_bomb_spread")
+EFFECT(0, RAPTOR_MUZZLEFLASH,       "raptor_cannon_muzzleflash")
+
+EFFECT(0, RACER_BOOSTER,            "wakizashi_booster_smoke")
+EFFECT(0, RACER_IMPACT,             "wakizashi_gun_impact")
+EFFECT(0, RACER_MUZZLEFLASH,        "wakizashi_gun_muzzleflash")
+EFFECT(0, RACER_ROCKETLAUNCH,       "wakizashi_rocket_launch")
+EFFECT(0, RACER_ROCKET_EXPLODE,     "wakizashi_rocket_launch")
+EFFECT(1, RACER_ROCKET_TRAIL,       "wakizashi_rocket_thrust")
+
+EFFECT(0, SPIDERBOT_ROCKETLAUNCH,   "spiderbot_rocket_launch")
+EFFECT(1, SPIDERBOT_ROCKET_TRAIL,   "spiderbot_rocket_thrust")
+EFFECT(0, SPIDERBOT_ROCKET_EXPLODE, "spiderbot_rocket_explode")
+EFFECT(0, SPIDERBOT_MINIGUN_IMPACT, "spiderbot_minigun_impact")
+EFFECT(0, SPIDERBOT_MINIGUN_MUZZLEFLASH,    "spiderbot_minigun_muzzleflash")
+
+EFFECT(0, BUMBLEBEE_HEAL_MUZZLEFLASH,   "healray_muzzleflash")
+EFFECT(0, BUMBLEBEE_HEAL_IMPACT,   "healray_impact")
+
+EFFECT(0, BIGPLASMA_IMPACT,         "bigplasma_impact")
+EFFECT(0, BIGPLASMA_MUZZLEFLASH,    "bigplasma_muzzleflash")
+
+EFFECT(0, TELEPORT,                 "teleport")
+
+EFFECT(0, SPAWNPOINT_RED,           "spawn_point_red")
+EFFECT(0, SPAWN_RED,                "spawn_event_red")
+EFFECT(0, SPAWNPOINT_BLUE,          "spawn_point_blue")
+EFFECT(0, SPAWN_BLUE,               "spawn_event_blue")
+EFFECT(0, SPAWNPOINT_YELLOW,        "spawn_point_yellow")
+EFFECT(0, SPAWN_YELLOW,             "spawn_event_yellow")
+EFFECT(0, SPAWNPOINT_PINK,          "spawn_point_pink")
+EFFECT(0, SPAWN_PINK,               "spawn_event_pink")
+EFFECT(0, SPAWNPOINT_NEUTRAL,       "spawn_point_neutral")
+EFFECT(0, SPAWN_NEUTRAL,            "spawn_event_neutral")
+
+EFFECT(0, NADE_RED_EXPLODE,         "nade_red_explode")
+EFFECT(0, NADE_BLUE_EXPLODE,        "nade_blue_explode")
+EFFECT(0, NADE_YELLOW_EXPLODE,      "nade_yellow_explode")
+EFFECT(0, NADE_PINK_EXPLODE,        "nade_pink_explode")
+EFFECT(0, NADE_NEUTRAL_EXPLODE,     "nade_neutral_explode")
+
+EFFECT(0, ICEORGLASS,               "iceorglass")
+EFFECT(0, ICEFIELD,                 "icefield")
+EFFECT(0, FIREFIELD,                "firefield")
+EFFECT(0, HEALING,                  "healing_fx")
+EFFECT(1, LASER_BEAM_FAST,          "nex242_misc_laser_beam_fast")
+EFFECT(0, RESPAWN_GHOST,            "respawn_ghost")
+
+EFFECT(0, FLAG_RED_TOUCH,           "redflag_touch")
+EFFECT(0, FLAG_BLUE_TOUCH,          "blueflag_touch")
+EFFECT(0, FLAG_YELLOW_TOUCH,        "yellowflag_touch")
+EFFECT(0, FLAG_PINK_TOUCH,          "pinkflag_touch")
+EFFECT(0, FLAG_NEUTRAL_TOUCH,       "neutralflag_touch")
+EFFECT(1, RED_PASS,                 "red_pass")
+EFFECT(1, BLUE_PASS,                "blue_pass")
+EFFECT(1, YELLOW_PASS,              "yellow_pass")
+EFFECT(1, PINK_PASS,                "pink_pass")
+EFFECT(1, NEUTRAL_PASS,             "neutral_pass")
+EFFECT(0, RED_CAP,                  "red_cap")
+EFFECT(0, BLUE_CAP,                 "blue_cap")
+EFFECT(0, YELLOW_CAP,               "yellow_cap")
+EFFECT(0, PINK_CAP,                 "pink_cap")
+
+EFFECT(0, ITEM_PICKUP,              "item_pickup")
+EFFECT(0, ITEM_RESPAWN,             "item_respawn")
+
+EFFECT(0, ONS_GENERATOR_DAMAGED,    "torch_small")
+EFFECT(0, ONS_GENERATOR_GIB,        "onslaught_generator_gib_explode")
+EFFECT(0, ONS_GENERATOR_EXPLODE,    "onslaught_generator_smallexplosion")
+EFFECT(0, ONS_GENERATOR_EXPLODE2,   "onslaught_generator_finalexplosion")
+
+
+
+EFFECT(0, LASER_DEADLY,             "laser_deadly")
+EFFECT(1, FLAC_TRAIL,               "TR_SEEKER")
+EFFECT(1, SEEKER_TRAIL,             "TR_SEEKER")
+EFFECT(1, FIREMINE,                 "firemine")
+EFFECT(0, BALL_SPARKS,              "kaball_sparks")
+EFFECT(0, ELECTRIC_SPARKS,          "electricity_sparks")
+EFFECT(0, SPARKS,                   "sparks")
+EFFECT(0, RAGE,                     "rage")
+EFFECT(0, SMOKING,                  "smoking")
+EFFECT(0, SMOKE_RING,               "smoke_ring")
+EFFECT(0, JUMPPAD,                  "jumppad_activate")
+EFFECT(1, BULLET,                   "tr_bullet")
+EFFECT(0, EF_FLAME,                 "EF_FLAME")
+EFFECT(0, EF_STARDUST,              "EF_STARDUST")
+EFFECT(0, TE_EXPLOSION,             "TE_EXPLOSION")
+EFFECT(1, TR_NEXUIZPLASMA,          "TR_NEXUIZPLASMA")
+EFFECT(1, TR_CRYLINKPLASMA,         "TR_CRYLINKPLASMA")
+EFFECT(1, TR_ROCKET,                "TR_ROCKET")
+EFFECT(1, TR_GRENADE,               "TR_GRENADE")
+EFFECT(1, TR_BLOOD,                 "TR_BLOOD")
+EFFECT(1, TR_WIZSPIKE,              "TR_WIZSPIKE")
+EFFECT(1, TR_SLIGHTBLOOD,           "TR_SLIGHTBLOOD")
+EFFECT(1, TR_KNIGHTSPIKE,           "TR_KNIGHTSPIKE")
+EFFECT(1, TR_VORESPIKE,             "TR_VORESPIKE")
+EFFECT(0, TE_SPARK,                 "TE_SPARK")
index 349fdff..e170702 100644 (file)
@@ -1,14 +1,3 @@
-void Create_Effect_Entity(int eff_name, string eff_string, bool eff_trail)
-{
-       entity eff;
-       effects_ent[eff_name - 1] = eff = spawn();
-
-       eff.classname = "effect_entity";
-       eff.eent_net_name = eff_name;
-       eff.eent_eff_name = eff_string;
-       eff.eent_eff_trail = eff_trail;
-}
-
 #ifdef CSQC
 void Read_Effect(bool is_new)
 {
@@ -18,7 +7,7 @@ void Read_Effect(bool is_new)
        int net_name = ReadByte();
 #endif
 
-       entity eff = effects_ent[net_name - 1];
+       entity eff = effects_ent[net_name];
 
        vector v, vel = '0 0 0';
        int eff_cnt = 1;
@@ -41,9 +30,9 @@ void Read_Effect(bool is_new)
        if(is_new)
        {
                if(eff_trail)
-                       WarpZone_TrailParticles(world, particleeffectnum(eff.eent_eff_name), v, vel);
+                       WarpZone_TrailParticles(world, particleeffectnum(eff), v, vel);
                else
-                       pointparticles(particleeffectnum(eff.eent_eff_name), v, vel, eff_cnt);
+                       pointparticles(particleeffectnum(eff), v, vel, eff_cnt);
        }
 }
 #endif
@@ -53,9 +42,9 @@ bool Net_Write_Effect(entity client, int sf)
 {
        WriteByte(MSG_ENTITY, ENT_CLIENT_EFFECT);
 #if EFFECTS_COUNT >= 255
-       WriteShort(MSG_ENTITY, self.eent_net_name);
+       WriteShort(MSG_ENTITY, self.m_id);
 #else
-       WriteByte(MSG_ENTITY, self.eent_net_name);
+       WriteByte(MSG_ENTITY, self.m_id);
 #endif
        WriteCoord(MSG_ENTITY, self.eent_net_location_x);
        WriteCoord(MSG_ENTITY, self.eent_net_location_y);
@@ -75,38 +64,15 @@ bool Net_Write_Effect(entity client, int sf)
        return true;
 }
 
-// problem with this is, we might not have all the available effects for it
-int Effect_NameToID(string eff_name)
-{
-       int i;
-       for(i = EFFECT_FIRST; i < MAX_EFFECTS; ++i)
-       {
-               if((effects_ent[i - 1]).eent_eff_name == eff_name)
-                       return (effects_ent[i - 1]).eent_net_name;
-       }
-
-       return 0;
-}
-
-void Send_Effect(string eff_name, vector eff_loc, vector eff_vel, int eff_cnt)
+void Send_Effect(entity eff, vector eff_loc, vector eff_vel, int eff_cnt)
 {
-       int eff_id = Effect_NameToID(eff_name);
-
-       if(!eff_id)
-       {
-               // revert to engine handling?
-               pointparticles(particleeffectnum(eff_name), eff_loc, eff_vel, eff_cnt);
-               return;
-       }
-
-       entity eff = effects_ent[eff_id - 1];
        if(!eff) { return; }
        if(!eff.eent_eff_trail && !eff_cnt) { return; } // effect has no count!
        entity net_eff = spawn();
        net_eff.owner = eff;
        net_eff.classname = "net_effect";
        //net_eff.eent_broadcast = broadcast;
-       net_eff.eent_net_name = eff_id;
+       net_eff.m_id = eff.m_id;
        net_eff.eent_net_velocity = eff_vel;
        net_eff.eent_net_location = eff_loc;
        net_eff.eent_net_count = eff_cnt;
@@ -117,4 +83,15 @@ void Send_Effect(string eff_name, vector eff_loc, vector eff_vel, int eff_cnt)
 
        Net_LinkEntity(net_eff, false, 0, Net_Write_Effect);
 }
+
+void Send_Effect_(string eff_name, vector eff_loc, vector eff_vel, int eff_cnt)
+{
+       // problem with this is, we might not have all the available effects for it
+       FOREACH(effects_ent, it.eent_eff_name == eff_name, LAMBDA(
+               Send_Effect(it, eff_loc, eff_vel, eff_cnt);
+               return;
+       ));
+       // revert to engine handling
+       pointparticles(_particleeffectnum(eff_name), eff_loc, eff_vel, eff_cnt);
+}
 #endif
index 790d8a7..b72eab2 100644 (file)
 #ifndef P_EFFECTS_H
 #define P_EFFECTS_H
-// Global list of effects, networked to CSQC by ID to save bandwidth and to use client particle numbers (allows mismatching effectinfos to some degree)
-// Not too concerned about the order of this list, just keep the weapon effects together!
-
-//  EFFECT(istrail, EFFECT_NAME,                "effectinfo_string")
-#define EFFECTS \
-    EFFECT(0, EFFECT_EXPLOSION_SMALL,           "explosion_small") \
-    EFFECT(0, EFFECT_EXPLOSION_MEDIUM,          "explosion_medium") \
-    EFFECT(0, EFFECT_EXPLOSION_BIG,             "explosion_big") \
-    EFFECT(1, EFFECT_VAPORIZER_RED,             "TE_TEI_G3RED") \
-    EFFECT(1, EFFECT_VAPORIZER_RED_HIT,         "TE_TEI_G3RED_HIT") \
-    EFFECT(1, EFFECT_VAPORIZER_BLUE,            "TE_TEI_G3BLUE") \
-    EFFECT(1, EFFECT_VAPORIZER_BLUE_HIT,        "TE_TEI_G3BLUE_HIT") \
-    EFFECT(1, EFFECT_VAPORIZER_YELLOW,          "TE_TEI_G3YELLOW") \
-    EFFECT(1, EFFECT_VAPORIZER_YELLOW_HIT,      "TE_TEI_G3YELLOW_HIT") \
-    EFFECT(1, EFFECT_VAPORIZER_PINK,            "TE_TEI_G3PINK") \
-    EFFECT(1, EFFECT_VAPORIZER_PINK_HIT,        "TE_TEI_G3PINK_HIT") \
-    EFFECT(1, EFFECT_VAPORIZER_NEUTRAL,         "TE_TEI_G3NEUTRAL") \
-    EFFECT(1, EFFECT_VAPORIZER_NEUTRAL_HIT,     "TE_TEI_G3NEUTRAL_HIT") \
-    EFFECT(0, EFFECT_ELECTRO_COMBO,             "electro_combo") \
-    EFFECT(0, EFFECT_ELECTRO_IMPACT,            "electro_impact") \
-    EFFECT(0, EFFECT_ELECTRO_MUZZLEFLASH,       "electro_muzzleflash") \
-    EFFECT(0, EFFECT_HAGAR_BOUNCE,              "hagar_bounce") \
-    EFFECT(0, EFFECT_HAGAR_MUZZLEFLASH,         "hagar_muzzleflash") \
-    EFFECT(0, EFFECT_LASER_MUZZLEFLASH,         "laser_muzzleflash") \
-    EFFECT(0, EFFECT_MACHINEGUN_MUZZLEFLASH,    "uzi_muzzleflash") \
-    EFFECT(0, EFFECT_RIFLE_MUZZLEFLASH,         "rifle_muzzleflash") \
-    EFFECT(0, EFFECT_RAPTOR_MUZZLEFLASH,        "raptor_cannon_muzzleflash") \
-    EFFECT(0, EFFECT_RACER_MUZZLEFLASH,         "wakizashi_gun_muzzleflash") \
-    EFFECT(0, EFFECT_RACER_ROCKETLAUNCH,        "wakizashi_rocket_launch") \
-    EFFECT(0, EFFECT_SPIDERBOT_ROCKETLAUNCH,    "spiderbot_rocket_launch") \
-    EFFECT(0, EFFECT_BIGPLASMA_MUZZLEFLASH,     "bigplasma_muzzleflash") \
-    EFFECT(1, EFFECT_RIFLE,                     "tr_rifle") \
-    EFFECT(1, EFFECT_RIFLE_WEAK,                "tr_rifle_weak") \
-    EFFECT(0, EFFECT_SEEKER_MUZZLEFLASH,        "seeker_muzzleflash") \
-    EFFECT(0, EFFECT_SHOTGUN_MUZZLEFLASH,       "shotgun_muzzleflash") \
-    EFFECT(0, EFFECT_GRENADE_MUZZLEFLASH,       "grenadelauncher_muzzleflash") \
-    EFFECT(0, EFFECT_GRENADE_EXPLODE,           "grenade_explode") \
-    EFFECT(0, EFFECT_FLAK_BOUNCE,               "flak_bounce") \
-    EFFECT(0, EFFECT_CRYLINK_JOINEXPLODE,       "crylink_joinexplode") \
-    EFFECT(0, EFFECT_CRYLINK_MUZZLEFLASH,       "crylink_muzzleflash") \
-    EFFECT(0, EFFECT_VORTEX_MUZZLEFLASH,        "nex_muzzleflash") \
-    EFFECT(0, EFFECT_HOOK_MUZZLEFLASH,          "grapple_muzzleflash") \
-    EFFECT(0, EFFECT_HOOK_IMPACT,               "grapple_impact") \
-    EFFECT(0, EFFECT_ROCKET_EXPLODE,            "rocket_explode") \
-    EFFECT(0, EFFECT_ROCKET_GUIDE,              "rocket_guide") \
-    EFFECT(0, EFFECT_ROCKET_MUZZLEFLASH,        "rocketlauncher_muzzleflash") \
-    EFFECT(0, EFFECT_FIREBALL_LASER,            "fireball_laser") \
-    EFFECT(0, EFFECT_FIREBALL_EXPLODE,          "fireball_explode") \
-    EFFECT(0, EFFECT_FIREBALL_BFGDAMAGE,        "fireball_bfgdamage") \
-    EFFECT(0, EFFECT_FIREBALL_MUZZLEFLASH,      "fireball_muzzleflash") \
-    EFFECT(0, EFFECT_FIREBALL_PRE_MUZZLEFLASH,  "fireball_preattack_muzzleflash") \
-    EFFECT(0, EFFECT_TELEPORT,                  "teleport") \
-    EFFECT(0, EFFECT_SPAWN_RED,                 "spawn_event_red") \
-    EFFECT(0, EFFECT_SPAWN_BLUE,                "spawn_event_blue") \
-    EFFECT(0, EFFECT_SPAWN_YELLOW,              "spawn_event_yellow") \
-    EFFECT(0, EFFECT_SPAWN_PINK,                "spawn_event_pink") \
-    EFFECT(0, EFFECT_SPAWN_NEUTRAL,             "spawn_event_neutral") \
-    EFFECT(0, EFFECT_NADE_RED_EXPLODE,          "nade_red_explode") \
-    EFFECT(0, EFFECT_NADE_BLUE_EXPLODE,         "nade_blue_explode") \
-    EFFECT(0, EFFECT_NADE_YELLOW_EXPLODE,       "nade_yellow_explode") \
-    EFFECT(0, EFFECT_NADE_PINK_EXPLODE,         "nade_pink_explode") \
-    EFFECT(0, EFFECT_NADE_NEUTRAL_EXPLODE,      "nade_neutral_explode") \
-    EFFECT(0, EFFECT_ICEORGLASS,                "iceorglass") \
-    EFFECT(0, EFFECT_ICEFIELD,                  "icefield") \
-    EFFECT(0, EFFECT_FIREFIELD,                 "firefield") \
-    EFFECT(0, EFFECT_HEALING,                   "healing_fx") \
-    EFFECT(1, EFFECT_LASER_BEAM_FAST,           "nex242_misc_laser_beam_fast") \
-    EFFECT(0, EFFECT_RESPAWN_GHOST,             "respawn_ghost") \
-    EFFECT(0, EFFECT_FLAG_RED_TOUCH,            "redflag_touch") \
-    EFFECT(0, EFFECT_FLAG_BLUE_TOUCH,           "blueflag_touch") \
-    EFFECT(0, EFFECT_FLAG_YELLOW_TOUCH,         "yellowflag_touch") \
-    EFFECT(0, EFFECT_FLAG_PINK_TOUCH,           "pinkflag_touch") \
-    EFFECT(0, EFFECT_FLAG_NEUTRAL_TOUCH,        "neutralflag_touch") \
-    EFFECT(1, EFFECT_RED_PASS,                  "red_pass") \
-    EFFECT(1, EFFECT_BLUE_PASS,                 "blue_pass") \
-    EFFECT(1, EFFECT_YELLOW_PASS,               "yellow_pass") \
-    EFFECT(1, EFFECT_PINK_PASS,                 "pink_pass") \
-    EFFECT(1, EFFECT_NEUTRAL_PASS,              "neutral_pass") \
-    EFFECT(0, EFFECT_RED_CAP,                   "red_cap") \
-    EFFECT(0, EFFECT_BLUE_CAP,                  "blue_cap") \
-    EFFECT(0, EFFECT_YELLOW_CAP,                "yellow_cap") \
-    EFFECT(0, EFFECT_PINK_CAP,                  "pink_cap") \
-    EFFECT(0, EFFECT_BALL_SPARKS,               "kaball_sparks") \
-    EFFECT(0, EFFECT_ELECTRIC_SPARKS,           "electricity_sparks") \
-    EFFECT(0, EFFECT_SPARKS,                    "sparks") \
-    EFFECT(0, EFFECT_RAGE,                      "rage") \
-    EFFECT(0, EFFECT_SMOKING,                   "smoking") \
-    EFFECT(0, EFFECT_SMOKE_RING,                "smoke_ring") \
-    EFFECT(0, EFFECT_ITEM_PICKUP,               "item_pickup") \
-    EFFECT(0, EFFECT_ITEM_RESPAWN,              "item_respawn") \
-    EFFECT(0, EFFECT_JUMPPAD,                   "jumppad_activate") \
-    EFFECT(1, EFFECT_BULLET,                    "tr_bullet")
-
-
-
-
-// --------------------
-// --------------------------
-// -----------------------------------
-// ------------------------------------------|
-// some stuff you don't need to care about...|
-// ------------------------------------------|
-// -----------------------------------
-// --------------------------
-// --------------------
-
-.int eent_net_name; // id
-.vector eent_net_location;
-.vector eent_net_velocity;
-.int eent_eff_trail;
-.string eent_eff_name;
-.int eent_net_count;
 
 #ifdef CSQC
 void Read_Effect(bool is_new);
 #elif defined(SVQC)
-void Send_Effect(string eff_name, vector eff_loc, vector eff_vel, int eff_cnt);
+void Send_Effect(entity eff, vector eff_loc, vector eff_vel, int eff_cnt);
+void Send_Effect_(string eff_name, vector eff_loc, vector eff_vel, int eff_cnt);
 #endif
 
-const int EFFECT_FIRST = 1;
-int EFFECT_COUNT;
+#define particleeffectnum(e) _particleeffectnum(e.eent_eff_name)
 
+void RegisterEffects();
 const int MAX_EFFECTS = 512;
-entity effects_ent[MAX_EFFECTS];
+entity effects_ent[MAX_EFFECTS], effects_ent_first, effects_ent_last;
+int EFFECT_COUNT;
+
+#define EFFECT(istrail, name, realname) \
+    REGISTER(RegisterEffects, EFFECT, effects_ent, EFFECT_COUNT, name, m_id, Create_Effect_Entity(realname, istrail));
+REGISTER_REGISTRY(RegisterEffects)
 
-void Create_Effect_Entity(int eff_name, string eff_string, int eff_trail);
+.int m_id;
+.string eent_eff_name;
+.int eent_eff_trail;
 
-#define EFFECT(istrail,name,realname) \
-    int name; \
-    void RegisterEffect_##name() \
-    { \
-        SET_FIELD_COUNT(name, EFFECT_FIRST, EFFECT_COUNT) \
-        CHECK_MAX_COUNT(name, MAX_EFFECTS, EFFECT_COUNT, "EFFECT") \
-        Create_Effect_Entity(name, realname, istrail); \
-    } \
-    ACCUMULATE_FUNCTION(RegisterEffects, RegisterEffect_##name);
+.vector eent_net_location;
+.vector eent_net_velocity;
+.int eent_net_count;
+
+entity Create_Effect_Entity(string eff_name, bool eff_trail)
+{
+       entity this = new(effect_entity);
+       this.eent_eff_name = eff_name;
+       this.eent_eff_trail = eff_trail;
+       return this;
+}
 
 void RegisterEffects_First()
 {
@@ -145,19 +43,19 @@ void RegisterEffects_First()
     #define dedi ""
     #endif
 
-    dprintf("Beginning effect initialization on %s%s program...\n", dedi, PROGNAME);
+    LOG_TRACEF("Beginning effect initialization on %s%s program...\n", dedi, PROGNAME);
     #undef dedi
 }
 
 void RegisterEffects_Done()
 {
-    dprint("Effects initialization successful!\n");
+    LOG_TRACE("Effects initialization successful!\n");
 }
 
 // NOW we actually activate the declarations
 ACCUMULATE_FUNCTION(RegisterEffects, RegisterEffects_First);
-EFFECTS
+EFFECT(0, NULL, string_null)
+#include "effects.inc"
 ACCUMULATE_FUNCTION(RegisterEffects, RegisterEffects_Done);
-#undef EFFECT
 
 #endif
index 8b0d433..9b40134 100644 (file)
@@ -19,7 +19,7 @@ void Inventory_Read(Inventory data)
         .int fld = inv_items[i];
         int prev = data.(fld);
         int next = data.(fld) = ReadByte();
-        dprintf("%s: %.0f -> %.0f\n", ITEMS[i].m_name, prev, next);
+        LOG_TRACEF("%s: %.0f -> %.0f\n", ITEMS[i].m_name, prev, next);
     ));
 }
 #endif
index bddf75b..ceb9a0a 100644 (file)
@@ -12,7 +12,7 @@ CLASS(GameItem, Object)
     METHOD(GameItem, display, void(entity this, void(string name, string icon) returns)) {
         returns(this.m_name, this.m_icon ? sprintf("/gfx/hud/%s/%s", cvar_string("menu_skin"), this.m_icon) : string_null);
     }
-    METHOD(GameItem, show, void(entity this)) { print("A game item\n"); }
+    METHOD(GameItem, show, void(entity this)) { LOG_INFO("A game item\n"); }
     void ITEM_HANDLE(Show, entity this) { this.show(this); }
 ENDCLASS(GameItem)
 
index 35aac2b..ade99c5 100644 (file)
@@ -4,7 +4,7 @@
 bool ITEM_HANDLE(Pickup, entity this, entity item, entity player) {
     bool b = this.giveTo(this, item, player);
     if (b) {
-        dprintf("entity %i picked up %s\n", player, this.m_name);
+        LOG_TRACEF("entity %i picked up %s\n", player, this.m_name);
         player.inventory.inv_items[this.m_id]++;
         Inventory_update(player);
     }
index 6436170..793230e 100644 (file)
@@ -6,7 +6,7 @@ CLASS(Pickup, GameItem)
     ATTRIB(Pickup, m_sound, string, "misc/itempickup.wav")
     ATTRIB(Pickup, m_name, string, string_null)
     METHOD(Pickup, show, void(entity this));
-    void Pickup_show(entity this) { printf("%s: %s\n", etos(this), this.m_name); }
+    void Pickup_show(entity this) { LOG_INFOF("%s: %s\n", etos(this), this.m_name); }
 #ifdef SVQC
     ATTRIB(Pickup, m_botvalue, int, 0)
     ATTRIB(Pickup, m_itemflags, int, 0)
index 0b851d5..eff61db 100644 (file)
@@ -169,7 +169,7 @@ float MapInfo_FilterGametype(int pGametype, int pFeatures, int pFlagsRequired, i
                if(MapInfo_Get_ByName(_MapInfo_GlobItem(i), 1, 0) == 2) // if we generated one... BAIL OUT and let the caller continue in the next frame.
                        if(pAbortOnGenerate)
                        {
-                               dprint("Autogenerated a .mapinfo, doing the rest later.\n");
+                               LOG_TRACE("Autogenerated a .mapinfo, doing the rest later.\n");
                                MapInfo_progress = i / _MapInfo_globcount;
                                return 0;
                        }
@@ -287,7 +287,7 @@ float _MapInfo_Generate(string pFilename) // 0: failure, 1: ok ent, 2: ok bsp
        }
        if(fh < 0)
                return 0;
-       print("Analyzing ", fn, " to generate initial mapinfo\n");
+       LOG_INFO("Analyzing ", fn, " to generate initial mapinfo\n");
 
        inWorldspawn = 2;
        MapInfo_Map_flags = 0;
@@ -395,7 +395,7 @@ float _MapInfo_Generate(string pFilename) // 0: failure, 1: ok ent, 2: ok bsp
        }
        if(inWorldspawn)
        {
-               print(fn, " ended still in worldspawn, BUG\n");
+               LOG_INFO(fn, " ended still in worldspawn, BUG\n");
                return 0;
        }
        diameter = vlen(mapMaxs - mapMins);
@@ -428,9 +428,9 @@ float _MapInfo_Generate(string pFilename) // 0: failure, 1: ok ent, 2: ok bsp
                MapInfo_Map_supportedGametypes |= MAPINFO_TYPE_CTS;
        }
 
-       dprint("-> diameter ",    ftos(diameter));
-       dprint(";  spawnpoints ", ftos(spawnpoints));
-       dprint(";  modes ",       ftos(MapInfo_Map_supportedGametypes), "\n");
+       LOG_TRACE("-> diameter ",    ftos(diameter));
+       LOG_TRACE(";  spawnpoints ", ftos(spawnpoints));
+       LOG_TRACE(";  modes ",       ftos(MapInfo_Map_supportedGametypes), "\n");
 
        fclose(fh);
 
@@ -650,7 +650,7 @@ void _MapInfo_Map_ApplyGametypeEx(string s, int pWantedType, int pThisType)
                p = strstrofs(sa, "=", 0);
                if(p < 0)
                {
-                       print("Invalid gametype setting in mapinfo for gametype ", MapInfo_Type_ToString(pWantedType), ": ", sa, "\n");
+                       LOG_INFO("Invalid gametype setting in mapinfo for gametype ", MapInfo_Type_ToString(pWantedType), ": ", sa, "\n");
                        continue;
                }
                k = substring(sa, 0, p);
@@ -691,7 +691,7 @@ void _MapInfo_Map_ApplyGametypeEx(string s, int pWantedType, int pThisType)
                }
                else
                {
-                       print("Invalid gametype setting in mapinfo for gametype ", MapInfo_Type_ToString(pWantedType), ": ", sa, "\n");
+                       LOG_INFO("Invalid gametype setting in mapinfo for gametype ", MapInfo_Type_ToString(pWantedType), ": ", sa, "\n");
                }
        }
 
@@ -711,39 +711,39 @@ float MapInfo_Type_FromString(string t)
 {
        if(t == "nexball")
        {
-               print("MapInfo_Type_FromString (probably ", MapInfo_Map_bspname, "): using deprecated name '", t);
+               LOG_INFO("MapInfo_Type_FromString (probably ", MapInfo_Map_bspname, "): using deprecated name '", t);
                t = "nb";
-               print("'. Should use '", t, "'.\n");
+               LOG_INFO("'. Should use '", t, "'.\n");
        }
        if(t == "freezetag")
        {
-               print("MapInfo_Type_FromString (probably ", MapInfo_Map_bspname, "): using deprecated name '", t);
+               LOG_INFO("MapInfo_Type_FromString (probably ", MapInfo_Map_bspname, "): using deprecated name '", t);
                t = "ft";
-               print("'. Should use '", t, "'.\n");
+               LOG_INFO("'. Should use '", t, "'.\n");
        }
        if(t == "keepaway")
        {
-               print("MapInfo_Type_FromString (probably ", MapInfo_Map_bspname, "): using deprecated name '", t);
+               LOG_INFO("MapInfo_Type_FromString (probably ", MapInfo_Map_bspname, "): using deprecated name '", t);
                t = "ka";
-               print("'. Should use '", t, "'.\n");
+               LOG_INFO("'. Should use '", t, "'.\n");
        }
        if(t == "invasion")
        {
-               print("MapInfo_Type_FromString (probably ", MapInfo_Map_bspname, "): using deprecated name '", t);
+               LOG_INFO("MapInfo_Type_FromString (probably ", MapInfo_Map_bspname, "): using deprecated name '", t);
                t = "inv";
-               print("'. Should use '", t, "'.\n");
+               LOG_INFO("'. Should use '", t, "'.\n");
        }
        if(t == "assault")
        {
-               print("MapInfo_Type_FromString (probably ", MapInfo_Map_bspname, "): using deprecated name '", t);
+               LOG_INFO("MapInfo_Type_FromString (probably ", MapInfo_Map_bspname, "): using deprecated name '", t);
                t = "as";
-               print("'. Should use '", t, "'.\n");
+               LOG_INFO("'. Should use '", t, "'.\n");
        }
        if(t == "race")
        {
-               print("MapInfo_Type_FromString (probably ", MapInfo_Map_bspname, "): using deprecated name '", t);
+               LOG_INFO("MapInfo_Type_FromString (probably ", MapInfo_Map_bspname, "): using deprecated name '", t);
                t = "rc";
-               print("'. Should use '", t, "'.\n");
+               LOG_INFO("'. Should use '", t, "'.\n");
        }
        if(t == "all")
                return MAPINFO_TYPE_ALL;
@@ -811,7 +811,7 @@ void _MapInfo_Parse_Settemp(string pFilename, string acl, float type, string s,
                {
                        fh = fopen(s, FILE_READ);
                        if(fh < 0)
-                               print("Map ", pFilename, " references not existing config file ", s, "\n");
+                               LOG_INFO("Map ", pFilename, " references not existing config file ", s, "\n");
                        else
                        {
                                for (;;)
@@ -840,23 +840,23 @@ void _MapInfo_Parse_Settemp(string pFilename, string acl, float type, string s,
                        }
                }
                else
-                       print("Map ", pFilename, " uses too many levels of inclusion\n");
+                       LOG_INFO("Map ", pFilename, " uses too many levels of inclusion\n");
        }
        else if(t == "")
-               print("Map ", pFilename, " contains a potentially harmful setting, ignored\n");
+               LOG_INFO("Map ", pFilename, " contains a potentially harmful setting, ignored\n");
        else if (!cvar_value_issafe(t))
-               print("Map ", pFilename, " contains a potentially harmful setting, ignored\n");
+               LOG_INFO("Map ", pFilename, " contains a potentially harmful setting, ignored\n");
        else if (!cvar_value_issafe(s))
-               print("Map ", pFilename, " contains a potentially harmful setting, ignored\n");
+               LOG_INFO("Map ", pFilename, " contains a potentially harmful setting, ignored\n");
        else if(matchacl(MAPINFO_SETTEMP_ACL_SYSTEM, t) <= 0)
-               print("Map ", pFilename, " contains a potentially harmful setting, ignored\n");
+               LOG_INFO("Map ", pFilename, " contains a potentially harmful setting, ignored\n");
        else if(matchacl(acl, t) <= 0)
-               print("Map ", pFilename, " contains a denied setting, ignored\n");
+               LOG_INFO("Map ", pFilename, " contains a denied setting, ignored\n");
        else
        {
                if(type == 0) // server set
                {
-                       dprint("Applying temporary setting ", t, " := ", s, "\n");
+                       LOG_TRACE("Applying temporary setting ", t, " := ", s, "\n");
                        if(cvar("g_campaign"))
                                cvar_set(t, s); // this is a wrapper and is always temporary anyway; no need to backup old values then
                        else
@@ -864,7 +864,7 @@ void _MapInfo_Parse_Settemp(string pFilename, string acl, float type, string s,
                }
                else
                {
-                       dprint("Applying temporary client setting ", t, " := ", s, "\n");
+                       LOG_TRACE("Applying temporary client setting ", t, " := ", s, "\n");
                        MapInfo_Map_clientstuff = strcat(
                                        MapInfo_Map_clientstuff, "cl_cmd settemp \"", t, "\" \"", s, "\"\n"
                                        );
@@ -911,7 +911,7 @@ float MapInfo_Get_ByName_NoFallbacks(string pFilename, int pAllowGenerate, int p
 
        if(strstrofs(pFilename, "/", 0) >= 0)
        {
-               print("Invalid character in map name, ignored\n");
+               LOG_INFO("Invalid character in map name, ignored\n");
                return 0;
        }
 
@@ -1001,7 +1001,7 @@ float MapInfo_Get_ByName_NoFallbacks(string pFilename, int pAllowGenerate, int p
                                error("... but I just wrote it!");
                }
 
-               print("WARNING: autogenerated mapinfo file ", fn, " has been loaded; please edit that file and move it to maps/", pFilename, ".mapinfo\n");
+               LOG_INFO("WARNING: autogenerated mapinfo file ", fn, " has been loaded; please edit that file and move it to maps/", pFilename, ".mapinfo\n");
        }
 
        _MapInfo_Map_Reset();
@@ -1040,7 +1040,7 @@ float MapInfo_Get_ByName_NoFallbacks(string pFilename, int pAllowGenerate, int p
                        else if(t == "monsters") MapInfo_Map_supportedFeatures |= MAPINFO_FEATURE_MONSTERS;
                        else if(t == "new_toys") MapInfo_Map_supportedFeatures |= MAPINFO_FEATURE_WEAPONS;
                        else
-                               dprint("Map ", pFilename, " supports unknown feature ", t, ", ignored\n");
+                               LOG_TRACE("Map ", pFilename, " supports unknown feature ", t, ", ignored\n");
                }
                else if(t == "hidden")
                {
@@ -1062,11 +1062,11 @@ float MapInfo_Get_ByName_NoFallbacks(string pFilename, int pAllowGenerate, int p
                {
                        t = car(s); s = cdr(s);
                        f = MapInfo_Type_FromString(t);
-                       dprint("Map ", pFilename, " contains the legacy 'type' keyword which is deprecated and will be removed in the future. Please migrate the mapinfo file to 'gametype'.\n");
+                       LOG_TRACE("Map ", pFilename, " contains the legacy 'type' keyword which is deprecated and will be removed in the future. Please migrate the mapinfo file to 'gametype'.\n");
                        if(f)
                                _MapInfo_Map_ApplyGametype (s, pGametypeToSet, f, true);
                        else
-                               dprint("Map ", pFilename, " supports unknown game type ", t, ", ignored\n");
+                               LOG_TRACE("Map ", pFilename, " supports unknown game type ", t, ", ignored\n");
                }
                else if(t == "gametype")
                {
@@ -1075,7 +1075,7 @@ float MapInfo_Get_ByName_NoFallbacks(string pFilename, int pAllowGenerate, int p
                        if(f)
                                _MapInfo_Map_ApplyGametypeEx (s, pGametypeToSet, f);
                        else
-                               dprint("Map ", pFilename, " supports unknown game type ", t, ", ignored\n");
+                               LOG_TRACE("Map ", pFilename, " supports unknown game type ", t, ", ignored\n");
                }
                else if(t == "size")
                {
@@ -1086,16 +1086,16 @@ float MapInfo_Get_ByName_NoFallbacks(string pFilename, int pAllowGenerate, int p
                        t = car(s); s = cdr(s); d = stof(t);
                        t = car(s); s = cdr(s); e = stof(t);
                        if(s == "")
-                               print("Map ", pFilename, " contains an incorrect size line (not enough params), syntax: size mins_x mins_y mins_z maxs_x maxs_y maxs_z\n");
+                               LOG_INFO("Map ", pFilename, " contains an incorrect size line (not enough params), syntax: size mins_x mins_y mins_z maxs_x maxs_y maxs_z\n");
                        else
                        {
                                t = car(s); s = cdr(s); f = stof(t);
                                if(s != "")
-                                       print("Map ", pFilename, " contains an incorrect size line (too many params), syntax: size mins_x mins_y mins_z maxs_x maxs_y maxs_z\n");
+                                       LOG_INFO("Map ", pFilename, " contains an incorrect size line (too many params), syntax: size mins_x mins_y mins_z maxs_x maxs_y maxs_z\n");
                                else
                                {
                                        if(a >= d || b >= e || c >= f)
-                                               print("Map ", pFilename, " contains an incorrect size line, mins have to be < maxs\n");
+                                               LOG_INFO("Map ", pFilename, " contains an incorrect size line, mins have to be < maxs\n");
                                        else
                                        {
                                                MapInfo_Map_mins.x = a;
@@ -1120,7 +1120,7 @@ float MapInfo_Get_ByName_NoFallbacks(string pFilename, int pAllowGenerate, int p
                        }
                        else
                        {
-                               dprint("Map ", pFilename, " has a setting for unknown game type ", t, ", ignored\n");
+                               LOG_TRACE("Map ", pFilename, " has a setting for unknown game type ", t, ", ignored\n");
                        }
                }
                else if(t == "clientsettemp_for_type")
@@ -1135,13 +1135,13 @@ float MapInfo_Get_ByName_NoFallbacks(string pFilename, int pAllowGenerate, int p
                        }
                        else
                        {
-                               dprint("Map ", pFilename, " has a client setting for unknown game type ", t, ", ignored\n");
+                               LOG_TRACE("Map ", pFilename, " has a client setting for unknown game type ", t, ", ignored\n");
                        }
                }
                else if(t == "fog")
                {
                        if (!cvar_value_issafe(s))
-                               print("Map ", pFilename, " contains a potentially harmful fog setting, ignored\n");
+                               LOG_INFO("Map ", pFilename, " contains a potentially harmful fog setting, ignored\n");
                        else
                                MapInfo_Map_fog = s;
                }
@@ -1157,7 +1157,7 @@ float MapInfo_Get_ByName_NoFallbacks(string pFilename, int pAllowGenerate, int p
                        if(pGametypeToSet)
                        {
                                if (!cvar_value_issafe(t))
-                                       print("Map ", pFilename, " contains a potentially harmful cdtrack, ignored\n");
+                                       LOG_INFO("Map ", pFilename, " contains a potentially harmful cdtrack, ignored\n");
                                else
                                        MapInfo_Map_clientstuff = strcat(
                                                MapInfo_Map_clientstuff, "cd loop \"", t, "\"\n"
@@ -1165,7 +1165,7 @@ float MapInfo_Get_ByName_NoFallbacks(string pFilename, int pAllowGenerate, int p
                        }
                }
                else
-                       dprint("Map ", pFilename, " provides unknown info item ", t, ", ignored\n");
+                       LOG_TRACE("Map ", pFilename, " provides unknown info item ", t, ", ignored\n");
        }
        fclose(fh);
 
@@ -1179,7 +1179,7 @@ float MapInfo_Get_ByName_NoFallbacks(string pFilename, int pAllowGenerate, int p
        MapInfo_Cache_Store();
        if(MapInfo_Map_supportedGametypes != 0)
                return r;
-       dprint("Map ", pFilename, " supports no game types, ignored\n");
+       LOG_TRACE("Map ", pFilename, " supports no game types, ignored\n");
        return 0;
 }
 float MapInfo_Get_ByName(string pFilename, float pAllowGenerate, int pGametypeToSet)
@@ -1371,14 +1371,14 @@ void MapInfo_LoadMapSettings(string s) // to be called from worldspawn
        {
                if(cvar("g_mapinfo_allow_unsupported_modes_and_let_stuff_break"))
                {
-                       print("EMERGENCY: can't play the selected map in the given game mode. Working with only the override settings.\n");
+                       LOG_INFO("EMERGENCY: can't play the selected map in the given game mode. Working with only the override settings.\n");
                        _MapInfo_Map_ApplyGametypeEx("", t, t);
                        return; // do not call Get_ByName!
                }
 
                if(MapInfo_Map_supportedGametypes == 0)
                {
-                       print("Mapinfo system is not functional at all. Assuming deathmatch.\n");
+                       LOG_INFO("Mapinfo system is not functional at all. Assuming deathmatch.\n");
                        MapInfo_Map_supportedGametypes = MAPINFO_TYPE_DEATHMATCH;
                        MapInfo_LoadMapSettings_SaveGameType(MAPINFO_TYPE_DEATHMATCH);
                        _MapInfo_Map_ApplyGametypeEx("", MAPINFO_TYPE_DEATHMATCH, MAPINFO_TYPE_DEATHMATCH);
@@ -1393,7 +1393,7 @@ void MapInfo_LoadMapSettings(string s) // to be called from worldspawn
                }
 
                // t is now a supported mode!
-               print("EMERGENCY: can't play the selected map in the given game mode. Falling back to a supported mode.\n");
+               LOG_INFO("EMERGENCY: can't play the selected map in the given game mode. Falling back to a supported mode.\n");
                MapInfo_LoadMapSettings_SaveGameType(t);
        }
        MapInfo_Get_ByName(s, 1, t);
index 2fefd53..3a1cc86 100644 (file)
@@ -95,7 +95,7 @@ MINIGAME_SIMPLELINKED_ENTITIES
 
 void minigame_autoclean_entity(entity e)
 {
-       dprint("CL Auto-cleaned: ",ftos(num_for_edict(e)), " (",e.classname,")\n");
+       LOG_TRACE("CL Auto-cleaned: ",ftos(num_for_edict(e)), " (",e.classname,")\n");
        remove(e);
 }
 
@@ -142,7 +142,7 @@ void activate_minigame(entity minigame)
        
        if ( !minigame.descriptor || minigame.classname != "minigame" )
        {
-               dprint("Trying to activate unregistered minigame ",minigame.netname," in client\n");
+               LOG_TRACE("Trying to activate unregistered minigame ",minigame.netname," in client\n");
                return;
        }
        
@@ -197,7 +197,7 @@ void minigame_read_owner()
                self.owner = find(self.owner,netname,owner_name);
        while ( self.owner && self.owner.classname != "minigame" );
        if ( !self.owner )
-               dprint("Got a minigame entity without a minigame!\n");
+               LOG_TRACE("Got a minigame entity without a minigame!\n");
 }
 void ent_read_minigame()
 {
@@ -219,7 +219,7 @@ void ent_read_minigame()
                        self.entremove = minigame_entremove;
                        self.descriptor = minigame_get_descriptor(ReadString_Raw());
                        if ( !self.descriptor )
-                               dprint("Got a minigame without a client-side descriptor!\n");
+                               LOG_TRACE("Got a minigame without a client-side descriptor!\n");
                        else
                                self.minigame_event = self.descriptor.minigame_event;
                }
@@ -235,7 +235,7 @@ void ent_read_minigame()
                        minigame_read_owner();
                        float ent = ReadLong();
                        self.minigame_playerslot = ent;
-                       dprint("Player: ",GetPlayerName(ent-1),"\n");
+                       LOG_TRACE("Player: ",GetPlayerName(ent-1),"\n");
                        
                        activate = (ent == player_localnum+1 && self.owner && self.owner != active_minigame);
                        
@@ -258,9 +258,9 @@ void ent_read_minigame()
 
        if ( sf & MINIG_SF_CREATE )
        {
-               dprint("CL Reading entity: ",ftos(num_for_edict(self)),
+               LOG_TRACE("CL Reading entity: ",ftos(num_for_edict(self)),
                        " classname:",self.classname," enttype:",ftos(self.enttype) );
-               dprint(" sf:",ftos(sf)," netname:",self.netname,"\n\n");
+               LOG_TRACE(" sf:",ftos(sf)," netname:",self.netname,"\n\n");
        }
 }
 #undef ReadString
index fc5df6b..b7ad467 100644 (file)
@@ -368,7 +368,7 @@ int nmm_server_event(entity minigame, string event, ...)
                                minigame.SendFlags |= MINIG_SF_UPDATE;
                        }
                        else
-                               dprint("Invalid move: ",...(2,string),"\n");
+                               LOG_TRACE("Invalid move: ",...(2,string),"\n");
                        return 1;
                }
        }
index 644bd8e..18a64e4 100644 (file)
@@ -419,7 +419,7 @@ int ttt_ai_random(int piecemask)
                f <<= 1;
        }
        
-       dprint(sprintf("TTT AI: selected %x from %x\n",
+       LOG_TRACE(sprintf("TTT AI: selected %x from %x\n",
                        RandomSelection_chosen_float, piecemask) );
        return RandomSelection_chosen_float;
 }
@@ -437,7 +437,7 @@ int ttt_ai_block3 ( int piecemask, int piecemask_free )
        r |= ttt_ai_1of3(piecemask,TTT_AI_POSFLAG_A3,TTT_AI_POSFLAG_B3,TTT_AI_POSFLAG_C3);
        r |= ttt_ai_1of3(piecemask,TTT_AI_POSFLAG_A1,TTT_AI_POSFLAG_B2,TTT_AI_POSFLAG_C3);
        r |= ttt_ai_1of3(piecemask,TTT_AI_POSFLAG_A3,TTT_AI_POSFLAG_B2,TTT_AI_POSFLAG_C1);
-       dprint(sprintf("TTT AI: possible 3 in a rows in %x: %x (%x)\n",piecemask,r, r&piecemask_free));
+       LOG_TRACE(sprintf("TTT AI: possible 3 in a rows in %x: %x (%x)\n",piecemask,r, r&piecemask_free));
        r &= piecemask_free;
        return ttt_ai_random(r);
 }
@@ -450,15 +450,15 @@ string ttt_ai_choose_simple(int piecemask_self, int piecemask_opponent, int piec
 {
        int move = 0;
        
-       dprint("TTT AI: checking winning move\n");
+       LOG_TRACE("TTT AI: checking winning move\n");
        if (( move = ttt_ai_block3(piecemask_self,piecemask_free) ))
                return ttt_ai_piece_flag2pos(move); // place winning move
                
-       dprint("TTT AI: checking opponent's winning move\n");
+       LOG_TRACE("TTT AI: checking opponent's winning move\n");
        if (( move = ttt_ai_block3(piecemask_opponent,piecemask_free) ))
                return ttt_ai_piece_flag2pos(move); // block opponent
                
-       dprint("TTT AI: random move\n");
+       LOG_TRACE("TTT AI: random move\n");
        return ttt_ai_piece_flag2pos(ttt_ai_random(piecemask_free));
 }
 
@@ -508,12 +508,12 @@ void ttt_aimove(entity minigame)
                }
                        
                // TODO multiple AI difficulties
-               dprint(sprintf("TTT AI: self: %x opponent: %x free: %x\n",
+               LOG_TRACE(sprintf("TTT AI: self: %x opponent: %x free: %x\n",
                                piecemask_self, piecemask_opponent, piecemask_free));
                pos = ttt_ai_choose_simple(piecemask_self, piecemask_opponent, piecemask_free);
-               dprint("TTT AI: chosen move: ",pos,"\n\n");
+               LOG_TRACE("TTT AI: chosen move: ",pos,"\n\n");
                if ( !pos )
-                       dprint("Tic Tac Toe AI has derped!\n");
+                       LOG_TRACE("Tic Tac Toe AI has derped!\n");
                else
                        ttt_move(minigame,aiplayer,pos);
        }
@@ -688,4 +688,4 @@ int ttt_client_event(entity minigame, string event, ...)
        return false;
 }
 
-#endif
\ No newline at end of file
+#endif
index 157471c..feb4b02 100644 (file)
@@ -183,7 +183,7 @@ entity start_minigame(entity player, string minigame )
                GameLogEcho(strcat(":minigame:start:",minig.netname));
                if ( ! minigame_addplayer(minig,player) )
                {
-                       dprint("Minigame ",minig.netname," rejected the first player join!\n");
+                       LOG_TRACE("Minigame ",minig.netname," rejected the first player join!\n");
                        end_minigame(minig);
                        return world;
                }
@@ -242,7 +242,7 @@ void end_minigame(entity minigame_session)
        while( (e = findentity(e, owner, minigame_session)) )
                if ( e.minigame_autoclean )
                {
-                       dprint("SV Auto-cleaned: ",ftos(num_for_edict(e)), " (",e.classname,")\n");
+                       LOG_TRACE("SV Auto-cleaned: ",ftos(num_for_edict(e)), " (",e.classname,")\n");
                        remove(e);
                }
        
@@ -427,4 +427,4 @@ void ClientCommand_minigame(int request, int argc, string command)
        sprint(self, "  Leave the current minigame\n");
        sprint(self, "Usage:^3 cmd minigame invite <player>\n");
        sprint(self, "  Invite the given player to join you in a minigame\n");
-}
\ No newline at end of file
+}
index 201b9a5..f44cabc 100644 (file)
@@ -1,3 +1,8 @@
+#ifndef MENUQC
+#include "../animdecide.qh"
+vector animfixfps(entity e, vector a, vector b);
+#endif
+
 #include "monster/mage.qc"
 #include "monster/shambler.qc"
 #include "monster/spider.qc"
index 4158b15..20a2103 100644 (file)
@@ -31,6 +31,8 @@ const int MR_SETUP = 1; // (SERVER) setup monster data
 const int MR_THINK = 2; // (SERVER) logic to run every frame
 const int MR_DEATH = 3; // (SERVER) called when monster dies
 const int MR_PRECACHE = 4; // (BOTH) precaches models/sounds used by this monster
+const int MR_PAIN = 5; // (SERVER) called when monster is damaged
+const int MR_ANIM = 6; // (BOTH?) sets animations for monster
 
 // special spawn flags
 const int MONSTER_RESPAWN_DEATHPOINT = 16; // re-spawn where we died
@@ -40,6 +42,8 @@ const int MONSTER_SIZE_BROKEN = 128; // TODO: remove when bad models are replace
 const int MON_FLAG_SUPERMONSTER = 256; // incredibly powerful monster
 const int MON_FLAG_RANGED = 512; // monster shoots projectiles
 const int MON_FLAG_MELEE = 1024;
+const int MON_FLAG_CRUSH = 2048; // monster can be stomped in special modes
+const int MON_FLAG_RIDE = 4096; // monster can be ridden in special modes
 
 // entity properties of monsterinfo:
 .string netname; // short name
@@ -47,9 +51,21 @@ const int MON_FLAG_MELEE = 1024;
 .string model; // full name of model
 .int spawnflags;
 .vector mins, maxs; // monster hitbox size
+.bool(int) monster_attackfunc;
+
+// animations
+.vector anim_blockend;
+.vector anim_blockstart;
+.vector anim_melee1;
+.vector anim_melee2;
+.vector anim_melee3;
+.vector anim_pain3;
+.vector anim_pain4;
+.vector anim_pain5;
+.vector anim_walk;
+.vector anim_spawn;
 
 // other useful macros
 #define MON_ACTION(monstertype,mrequest) (get_monsterinfo(monstertype)).monster_func(mrequest)
-#define M_NAME(monstertype) (get_monsterinfo(monstertype)).monster_name
 
 #endif
index e2258db..8f92d69 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef MENUQC
-bool m_mage(int);
+bool M_Mage(int);
 #endif
 REGISTER_MONSTER_SIMPLE(
 /* MON_##id   */ MAGE,
@@ -10,12 +10,14 @@ REGISTER_MONSTER_SIMPLE(
 /* fullname   */ _("Mage")
 ) {
 #ifndef MENUQC
-    this.monster_func = m_mage;
+    this.monster_func = M_Mage;
+    this.monster_func(MR_PRECACHE);
 #endif
 }
 
 #ifdef SVQC
 float autocvar_g_monster_mage_health;
+float autocvar_g_monster_mage_damageforcescale = 0.5;
 float autocvar_g_monster_mage_attack_spike_damage;
 float autocvar_g_monster_mage_attack_spike_radius;
 float autocvar_g_monster_mage_attack_spike_delay;
@@ -43,26 +45,29 @@ float autocvar_g_monster_mage_speed_stop;
 float autocvar_g_monster_mage_speed_run;
 float autocvar_g_monster_mage_speed_walk;
 
+/*
 const float mage_anim_idle             = 0;
 const float mage_anim_walk             = 1;
 const float mage_anim_attack   = 2;
 const float mage_anim_pain             = 3;
 const float mage_anim_death            = 4;
 const float mage_anim_run              = 5;
+*/
 
-void() mage_heal;
-void() mage_shield;
+void() M_Mage_Defend_Heal;
+void() M_Mage_Defend_Shield;
 
 .entity mage_spike;
-.float shield_ltime;
+.float mage_shield_delay;
+.float mage_shield_time;
 
-float friend_needshelp(entity e)
+float M_Mage_Defend_Heal_Check(entity e)
 {
        if(e == world)
                return false;
        if(e.health <= 0)
                return false;
-       if(DIFF_TEAM(e, self) && e != self.monster_owner)
+       if(DIFF_TEAM(e, self) && e != self.monster_follow)
                return false;
        if(e.frozen)
                return false;
@@ -82,7 +87,7 @@ float friend_needshelp(entity e)
        return false;
 }
 
-void mage_spike_explode()
+void M_Mage_Attack_Spike_Explode()
 {
        self.event_damage = func_null;
 
@@ -90,21 +95,21 @@ void mage_spike_explode()
 
        self.realowner.mage_spike = world;
 
-       Send_Effect("explosion_small", self.origin, '0 0 0', 1);
+       Send_Effect(EFFECT_EXPLOSION_SMALL, self.origin, '0 0 0', 1);
        RadiusDamage (self, self.realowner, (autocvar_g_monster_mage_attack_spike_damage), (autocvar_g_monster_mage_attack_spike_damage) * 0.5, (autocvar_g_monster_mage_attack_spike_radius), world, world, 0, DEATH_MONSTER_MAGE, other);
 
        remove (self);
 }
 
-void mage_spike_touch()
+void M_Mage_Attack_Spike_Touch()
 {
        PROJECTILE_TOUCH;
 
-       mage_spike_explode();
+       M_Mage_Attack_Spike_Explode();
 }
 
 // copied from W_Seeker_Think
-void mage_spike_think()
+void M_Mage_Attack_Spike_Think()
 {
        entity e;
        vector desireddir, olddir, newdir, eorg;
@@ -115,7 +120,7 @@ void mage_spike_think()
        if (time > self.ltime || self.enemy.health <= 0 || self.owner.health <= 0)
        {
                self.projectiledeathtype |= HITTYPE_SPLASH;
-               mage_spike_explode();
+               M_Mage_Attack_Spike_Explode();
        }
 
        spd = vlen(self.velocity);
@@ -167,7 +172,7 @@ void mage_spike_think()
        UpdateCSQCProjectile(self);
 }
 
-void mage_attack_spike()
+void M_Mage_Attack_Spike()
 {
        entity missile;
        vector dir = normalize((self.enemy.origin + '0 0 10') - self.origin);
@@ -176,7 +181,7 @@ void mage_attack_spike()
 
        missile = spawn ();
        missile.owner = missile.realowner = self;
-       missile.think = mage_spike_think;
+       missile.think = M_Mage_Attack_Spike_Think;
        missile.ltime = time + 7;
        missile.nextthink = time;
        missile.solid = SOLID_BBOX;
@@ -187,19 +192,19 @@ void mage_attack_spike()
        missile.velocity = dir * 400;
        missile.avelocity = '300 300 300';
        missile.enemy = self.enemy;
-       missile.touch = mage_spike_touch;
+       missile.touch = M_Mage_Attack_Spike_Touch;
 
        self.mage_spike = missile;
 
        CSQCProjectile(missile, true, PROJECTILE_MAGE_SPIKE, true);
 }
 
-void mage_heal()
+void M_Mage_Defend_Heal()
 {
        entity head;
        float washealed = false;
 
-       for(head = findradius(self.origin, (autocvar_g_monster_mage_heal_range)); head; head = head.chain) if(friend_needshelp(head))
+       for(head = findradius(self.origin, (autocvar_g_monster_mage_heal_range)); head; head = head.chain) if(M_Mage_Defend_Heal_Check(head))
        {
                washealed = true;
                string fx = "";
@@ -209,7 +214,7 @@ void mage_heal()
                        {
                                case 0:
                                        if(head.health < autocvar_g_balance_health_regenstable) head.health = bound(0, head.health + (autocvar_g_monster_mage_heal_allies), autocvar_g_balance_health_regenstable);
-                                       fx = "healing_fx";
+                                       fx = EFFECT_HEALING.eent_eff_name;
                                        break;
                                case 1:
                                        if(head.ammo_cells) head.ammo_cells = bound(head.ammo_cells, head.ammo_cells + 1, g_pickup_cells_max);
@@ -228,39 +233,40 @@ void mage_heal()
                                        break;
                                case 3:
                                        head.health = bound(0, head.health - ((head == self)  ? (autocvar_g_monster_mage_heal_self) : (autocvar_g_monster_mage_heal_allies)), autocvar_g_balance_health_regenstable);
-                                       fx = "rage";
+                                       fx = EFFECT_RAGE.eent_eff_name;
                                        break;
                        }
 
-                       Send_Effect(fx, head.origin, '0 0 0', 1);
+                       Send_Effect_(fx, head.origin, '0 0 0', 1);
                }
                else
                {
-                       Send_Effect("healing_fx", head.origin, '0 0 0', 1);
+                       Send_Effect(EFFECT_HEALING, head.origin, '0 0 0', 1);
                        head.health = bound(0, head.health + (autocvar_g_monster_mage_heal_allies), head.max_health);
-                       if(!(head.spawnflags & MONSTERFLAG_INVINCIBLE))
+                       if(!(head.spawnflags & MONSTERFLAG_INVINCIBLE) && head.sprite)
                                WaypointSprite_UpdateHealth(head.sprite, head.health);
                }
        }
 
        if(washealed)
        {
-               self.frame = mage_anim_attack;
+               setanim(self, self.anim_shoot, true, true, true);
                self.attack_finished_single = time + (autocvar_g_monster_mage_heal_delay);
+               self.anim_finished = time + 1.5;
        }
 }
 
-void mage_push()
+void M_Mage_Attack_Push()
 {
        sound(self, CH_SHOTS, W_Sound("tagexp1"), 1, ATTEN_NORM);
        RadiusDamage (self, self, (autocvar_g_monster_mage_attack_push_damage), (autocvar_g_monster_mage_attack_push_damage), (autocvar_g_monster_mage_attack_push_radius), world, world, (autocvar_g_monster_mage_attack_push_force), DEATH_MONSTER_MAGE, self.enemy);
-       Send_Effect("TE_EXPLOSION", self.origin, '0 0 0', 1);
+       Send_Effect(EFFECT_TE_EXPLOSION, self.origin, '0 0 0', 1);
 
-       self.frame = mage_anim_attack;
+       setanim(self, self.anim_shoot, true, true, true);
        self.attack_finished_single = time + (autocvar_g_monster_mage_attack_push_delay);
 }
 
-void mage_teleport()
+void M_Mage_Attack_Teleport()
 {
        if(vlen(self.enemy.origin - self.origin) >= 500)
                return;
@@ -271,31 +277,30 @@ void mage_teleport()
        if(trace_fraction < 1)
                return;
 
-       Send_Effect("spawn_event_neutral", self.origin, '0 0 0', 1);
+       Send_Effect(EFFECT_SPAWN_NEUTRAL, self.origin, '0 0 0', 1);
        setorigin(self, self.enemy.origin + ((v_forward * -1) * 200));
 
        self.attack_finished_single = time + 0.2;
 }
 
-void mage_shield_remove()
+void M_Mage_Defend_Shield_Remove()
 {
        self.effects &= ~(EF_ADDITIVE | EF_BLUE);
-       self.armorvalue = 0;
-       self.m_armor_blockpercent = autocvar_g_monsters_armor_blockpercent;
+       self.armorvalue = autocvar_g_monsters_armor_blockpercent;
 }
 
-void mage_shield()
+void M_Mage_Defend_Shield()
 {
        self.effects |= (EF_ADDITIVE | EF_BLUE);
-       self.lastshielded = time + (autocvar_g_monster_mage_shield_delay);
-       self.m_armor_blockpercent = (autocvar_g_monster_mage_shield_blockpercent);
-       self.armorvalue = self.health;
-       self.shield_ltime = time + (autocvar_g_monster_mage_shield_time);
-       self.frame = mage_anim_attack;
+       self.mage_shield_delay = time + (autocvar_g_monster_mage_shield_delay);
+       self.armorvalue = (autocvar_g_monster_mage_shield_blockpercent);
+       self.mage_shield_time = time + (autocvar_g_monster_mage_shield_time);
+       setanim(self, self.anim_shoot, true, true, true);
        self.attack_finished_single = time + 1;
+       self.anim_finished = time + 1;
 }
 
-float mage_attack(float attack_type)
+float M_Mage_Attack(float attack_type)
 {
        switch(attack_type)
        {
@@ -303,7 +308,7 @@ float mage_attack(float attack_type)
                {
                        if(random() <= 0.7)
                        {
-                               mage_push();
+                               M_Mage_Attack_Push();
                                return true;
                        }
 
@@ -315,14 +320,15 @@ float mage_attack(float attack_type)
                        {
                                if(random() <= 0.4)
                                {
-                                       mage_teleport();
+                                       M_Mage_Attack_Teleport();
                                        return true;
                                }
                                else
                                {
-                                       self.frame = mage_anim_attack;
+                                       setanim(self, self.anim_shoot, true, true, true);
                                        self.attack_finished_single = time + (autocvar_g_monster_mage_attack_spike_delay);
-                                       defer(0.2, mage_attack_spike);
+                                       self.anim_finished = time + 1;
+                                       Monster_Delay(1, 0, 0.2, M_Mage_Attack_Spike);
                                        return true;
                                }
                        }
@@ -337,28 +343,24 @@ float mage_attack(float attack_type)
        return false;
 }
 
-void spawnfunc_monster_mage()
-{
-       self.classname = "monster_mage";
-
-       if(!monster_initialize(MON_MAGE.monsterid)) { remove(self); return; }
-}
+void spawnfunc_monster_mage() { Monster_Spawn(MON_MAGE.monsterid); }
 
-// compatibility with old spawns
-void spawnfunc_monster_shalrath() { spawnfunc_monster_mage(); }
+#endif // SVQC
 
-float m_mage(float req)
+bool M_Mage(int req)
 {
        switch(req)
        {
+               #ifdef SVQC
                case MR_THINK:
                {
                        entity head;
-                       float need_help = false;
+                       bool need_help = false;
 
-                       for(head = findradius(self.origin, (autocvar_g_monster_mage_heal_range)); head; head = head.chain)
+                       for(head = world; (head = findfloat(head, iscreature, true)); )
                        if(head != self)
-                       if(friend_needshelp(head))
+                       if(vlen(head.origin - self.origin) <= (autocvar_g_monster_mage_heal_range))
+                       if(M_Mage_Defend_Heal_Check(head))
                        {
                                need_help = true;
                                break;
@@ -367,32 +369,54 @@ float m_mage(float req)
                        if(self.health < (autocvar_g_monster_mage_heal_minhealth) || need_help)
                        if(time >= self.attack_finished_single)
                        if(random() < 0.5)
-                               mage_heal();
+                               M_Mage_Defend_Heal();
 
-                       if(time >= self.shield_ltime && self.armorvalue)
-                               mage_shield_remove();
+                       if(time >= self.mage_shield_time && self.armorvalue)
+                               M_Mage_Defend_Shield_Remove();
 
                        if(self.enemy)
                        if(self.health < self.max_health)
-                       if(time >= self.lastshielded)
+                       if(time >= self.mage_shield_delay)
                        if(random() < 0.5)
-                               mage_shield();
+                               M_Mage_Defend_Shield();
 
-                       monster_move((autocvar_g_monster_mage_speed_run), (autocvar_g_monster_mage_speed_walk), (autocvar_g_monster_mage_speed_stop), mage_anim_walk, mage_anim_run, mage_anim_idle);
+                       return true;
+               }
+               case MR_PAIN:
+               {
                        return true;
                }
                case MR_DEATH:
                {
-                       self.frame = mage_anim_death;
+                       setanim(self, self.anim_die1, false, true, true);
                        return true;
                }
+               #endif
+               #ifndef MENUQC
+               case MR_ANIM:
+               {
+                       vector none = '0 0 0';
+                       self.anim_die1 = animfixfps(self, '4 1 0.5', none); // 2 seconds
+                       self.anim_walk = animfixfps(self, '1 1 1', none);
+                       self.anim_idle = animfixfps(self, '0 1 1', none);
+                       self.anim_pain1 = animfixfps(self, '3 1 2', none); // 0.5 seconds
+                       self.anim_shoot = animfixfps(self, '2 1 5', none); // analyze models and set framerate
+                       self.anim_run = animfixfps(self, '5 1 1', none);
+
+                       return true;
+               }
+               #endif
+               #ifdef SVQC
                case MR_SETUP:
                {
                        if(!self.health) self.health = (autocvar_g_monster_mage_health);
+                       if(!self.speed) { self.speed = (autocvar_g_monster_mage_speed_walk); }
+                       if(!self.speed2) { self.speed2 = (autocvar_g_monster_mage_speed_run); }
+                       if(!self.stopspeed) { self.stopspeed = (autocvar_g_monster_mage_speed_stop); }
+                       if(!self.damageforcescale) { self.damageforcescale = (autocvar_g_monster_mage_damageforcescale); }
 
                        self.monster_loot = spawnfunc_item_health_large;
-                       self.monster_attackfunc = mage_attack;
-                       self.frame = mage_anim_walk;
+                       self.monster_attackfunc = M_Mage_Attack;
 
                        return true;
                }
@@ -403,24 +427,8 @@ float m_mage(float req)
                        precache_sound (W_Sound("tagexp1"));
                        return true;
                }
+               #endif
        }
 
        return true;
 }
-
-#endif // SVQC
-#ifdef CSQC
-float m_mage(float req)
-{
-       switch(req)
-       {
-               case MR_PRECACHE:
-               {
-                       return true;
-               }
-       }
-
-       return true;
-}
-
-#endif // CSQC
index 47e371a..4640fe9 100644 (file)
@@ -1,5 +1,5 @@
 #ifndef MENUQC
-bool m_shambler(int);
+bool M_Shambler(int);
 #endif
 REGISTER_MONSTER_SIMPLE(
 /* MON_##id   */ SHAMBLER,
@@ -10,15 +10,19 @@ REGISTER_MONSTER_SIMPLE(
 /* fullname   */ _("Shambler")
 ) {
 #ifndef MENUQC
-       this.monster_func = m_shambler;
+       this.monster_func = M_Shambler;
+       this.monster_func(MR_PRECACHE);
 #endif
 }
 
 #ifdef SVQC
 float autocvar_g_monster_shambler_health;
+float autocvar_g_monster_shambler_damageforcescale = 0.1;
 float autocvar_g_monster_shambler_attack_smash_damage;
+float autocvar_g_monster_shambler_attack_smash_range;
 float autocvar_g_monster_shambler_attack_claw_damage;
 float autocvar_g_monster_shambler_attack_lightning_damage;
+float autocvar_g_monster_shambler_attack_lightning_damage_zap = 15;
 float autocvar_g_monster_shambler_attack_lightning_force;
 float autocvar_g_monster_shambler_attack_lightning_radius;
 float autocvar_g_monster_shambler_attack_lightning_radius_zap;
@@ -28,6 +32,7 @@ float autocvar_g_monster_shambler_speed_stop;
 float autocvar_g_monster_shambler_speed_run;
 float autocvar_g_monster_shambler_speed_walk;
 
+/*
 const float shambler_anim_stand                = 0;
 const float shambler_anim_walk         = 1;
 const float shambler_anim_run          = 2;
@@ -37,38 +42,41 @@ const float shambler_anim_swingl    = 5;
 const float shambler_anim_magic                = 6;
 const float shambler_anim_pain         = 7;
 const float shambler_anim_death                = 8;
+*/
 
 .float shambler_lastattack; // delay attacks separately
 
-void shambler_smash()
+void M_Shambler_Attack_Smash()
 {
        makevectors(self.angles);
-       Send_Effect("explosion_medium", (self.origin + (v_forward * 150)) - ('0 0 1' * self.maxs.z), '0 0 0', 1);
+       Send_Effect(EFFECT_EXPLOSION_MEDIUM, (self.origin + (v_forward * 150)) - ('0 0 1' * self.maxs.z), '0 0 0', 1);
        sound(self, CH_SHOTS, W_Sound("rocket_impact"), VOL_BASE, ATTEN_NORM);
 
-       tracebox(self.origin + v_forward * 50, self.mins * 0.5, self.maxs * 0.5, self.origin + v_forward * 500, MOVE_NORMAL, self);
+       // RadiusDamage does NOT support custom starting location, which means we must use this hack...
+
+       tracebox(self.origin + v_forward * 50, self.mins * 0.5, self.maxs * 0.5, self.origin + v_forward * autocvar_g_monster_shambler_attack_smash_range, MOVE_NORMAL, self);
 
        if(trace_ent.takedamage)
-               Damage(trace_ent, self, self, (autocvar_g_monster_shambler_attack_smash_damage) * Monster_SkillModifier(), DEATH_MONSTER_SHAMBLER_SMASH, trace_ent.origin, normalize(trace_ent.origin - self.origin));
+               Damage(trace_ent, self, self, (autocvar_g_monster_shambler_attack_smash_damage) * MONSTER_SKILLMOD(self), DEATH_MONSTER_SHAMBLER_SMASH, trace_ent.origin, normalize(trace_ent.origin - self.origin));
 }
 
-void shambler_swing()
+void M_Shambler_Attack_Swing()
 {
        float r = (random() < 0.5);
-       monster_melee(self.enemy, (autocvar_g_monster_shambler_attack_claw_damage), ((r) ? shambler_anim_swingr : shambler_anim_swingl), self.attack_range, 0.8, DEATH_MONSTER_SHAMBLER_CLAW, true);
-       if(r)
+       if(r && Monster_Attack_Melee(self.enemy, (autocvar_g_monster_shambler_attack_claw_damage), ((r) ? self.anim_melee2 : self.anim_melee3), self.attack_range, 0.8, DEATH_MONSTER_SHAMBLER_CLAW, true))
        {
-               defer(0.5, shambler_swing);
+               Monster_Delay(1, 0, 0.5, M_Shambler_Attack_Swing);
                self.attack_finished_single += 0.5;
+               self.anim_finished = self.attack_finished_single;
        }
 }
 
-void shambler_lightning_explode()
+void M_Shambler_Attack_Lightning_Explode()
 {
        entity head;
 
        sound(self, CH_SHOTS, W_Sound("electro_impact"), VOL_BASE, ATTEN_NORM);
-       Send_Effect("electro_impact", '0 0 0', '0 0 0', 1);
+       Send_Effect(EFFECT_ELECTRO_IMPACT, '0 0 0', '0 0 0', 1);
 
        self.event_damage = func_null;
        self.takedamage = DAMAGE_NO;
@@ -83,14 +91,14 @@ void shambler_lightning_explode()
        for(head = findradius(self.origin, (autocvar_g_monster_shambler_attack_lightning_radius_zap)); head; head = head.chain) if(head != self.realowner) if(head.takedamage)
        {
                te_csqc_lightningarc(self.origin, head.origin);
-               Damage(head, self, self.realowner, (autocvar_g_monster_shambler_attack_lightning_damage) * Monster_SkillModifier(), DEATH_MONSTER_SHAMBLER_ZAP, head.origin, '0 0 0');
+               Damage(head, self, self.realowner, (autocvar_g_monster_shambler_attack_lightning_damage_zap) * MONSTER_SKILLMOD(self), DEATH_MONSTER_SHAMBLER_ZAP, head.origin, '0 0 0');
        }
 
        self.think = SUB_Remove;
        self.nextthink = time + 0.2;
 }
 
-void shambler_lightning_damage(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
+void M_Shambler_Attack_Lightning_Damage(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
 {
        if (self.health <= 0)
                return;
@@ -104,25 +112,25 @@ void shambler_lightning_damage(entity inflictor, entity attacker, float damage,
                W_PrepareExplosionByDamage(attacker, self.use);
 }
 
-void shambler_lightning_touch()
+void M_Shambler_Attack_Lightning_Touch()
 {
        PROJECTILE_TOUCH;
 
        self.use ();
 }
 
-void shambler_lightning_think()
+void M_Shambler_Attack_Lightning_Think()
 {
        self.nextthink = time;
        if (time > self.cnt)
        {
                other = world;
-               shambler_lightning_explode();
+               M_Shambler_Attack_Lightning_Explode();
                return;
        }
 }
 
-void shambler_lightning()
+void M_Shambler_Attack_Lightning()
 {
        entity gren;
 
@@ -142,14 +150,14 @@ void shambler_lightning()
 
        gren.cnt = time + 5;
        gren.nextthink = time;
-       gren.think = shambler_lightning_think;
-       gren.use = shambler_lightning_explode;
-       gren.touch = shambler_lightning_touch;
+       gren.think = M_Shambler_Attack_Lightning_Think;
+       gren.use = M_Shambler_Attack_Lightning_Explode;
+       gren.touch = M_Shambler_Attack_Lightning_Touch;
 
        gren.takedamage = DAMAGE_YES;
        gren.health = 50;
        gren.damageforcescale = 0;
-       gren.event_damage = shambler_lightning_damage;
+       gren.event_damage = M_Shambler_Attack_Lightning_Damage;
        gren.damagedbycontents = true;
        gren.missile_flags = MIF_SPLASH | MIF_ARC;
        W_SetupProjVelocity_Explicit(gren, v_forward, v_up, (autocvar_g_monster_shambler_attack_lightning_speed), (autocvar_g_monster_shambler_attack_lightning_speed_up), 0, 0, false);
@@ -160,33 +168,39 @@ void shambler_lightning()
        CSQCProjectile(gren, true, PROJECTILE_SHAMBLER_LIGHTNING, true);
 }
 
-float shambler_attack(float attack_type)
+float M_Shambler_Attack(float attack_type)
 {
        switch(attack_type)
        {
                case MONSTER_ATTACK_MELEE:
                {
-                       shambler_swing();
+                       M_Shambler_Attack_Swing();
                        return true;
                }
                case MONSTER_ATTACK_RANGED:
                {
+                       float randomness = random(), enemy_len = vlen(self.enemy.origin - self.origin);
+
                        if(time >= self.shambler_lastattack) // shambler doesn't attack much
                        if(self.flags & FL_ONGROUND)
-                       if(random() <= 0.5 && vlen(self.enemy.origin - self.origin) <= 500)
+                       if(randomness <= 0.5 && enemy_len <= autocvar_g_monster_shambler_attack_smash_range)
      &