#ifndef TRACING_H #define TRACING_H #if defined(CSQC) #elif defined(MENUQC) #elif defined(SVQC) #include "../../common/util-pre.qh" #include "../sys-pre.qh" #include "../../dpdefs/progsdefs.qh" #include "../../dpdefs/dpextensions.qh" #include "../sys-post.qh" #include "../../warpzonelib/anglestransform.qh" #include "../../warpzonelib/mathlib.qh" #include "../../warpzonelib/common.qh" #include "../../warpzonelib/util_server.qh" #include "../../warpzonelib/server.qh" #include "../../common/constants.qh" #include "../../common/stats.qh" #include "../../common/teams.qh" #include "../../common/util.qh" #include "../../common/nades.qh" #include "../../common/buffs.qh" #include "../../common/test.qh" #include "../../common/counting.qh" #include "../../common/urllib.qh" #include "../../common/command/markup.qh" #include "../../common/command/rpn.qh" #include "../../common/command/generic.qh" #include "../../common/command/shared_defs.qh" #include "../../common/net_notice.qh" #include "../../common/animdecide.qh" #include "../../common/monsters/monsters.qh" #include "../../common/monsters/sv_monsters.qh" #include "../../common/monsters/spawn.qh" #include "../../common/weapons/config.qh" #include "../../common/weapons/weapons.qh" #include "accuracy.qh" #include "common.qh" #include "csqcprojectile.qh" #include "hitplot.qh" #include "selection.qh" #include "spawning.qh" #include "throwing.qh" #endif vector w_shotorg; vector w_shotdir; vector w_shotend; // this function calculates w_shotorg and w_shotdir based on the weapon model // offset, trueaim and antilag, and won't put w_shotorg inside a wall. // make sure you call makevectors first (FIXME?) void W_SetupShot_Dir_ProjectileSize_Range(entity ent, vector s_forward, vector mi, vector ma, float antilag, float recoil, string snd, float chan, float maxdamage, float range); #define W_SetupShot_Dir_ProjectileSize(ent,s_forward,mi,ma,antilag,recoil,snd,chan,maxdamage) W_SetupShot_Dir_ProjectileSize_Range(ent, s_forward, mi, ma, antilag, recoil, snd, chan, maxdamage, MAX_SHOT_DISTANCE) #define W_SetupShot_ProjectileSize(ent,mi,ma,antilag,recoil,snd,chan,maxdamage) W_SetupShot_Dir_ProjectileSize(ent, v_forward, mi, ma, antilag, recoil, snd, chan, maxdamage) #define W_SetupShot_Dir(ent,s_forward,antilag,recoil,snd,chan,maxdamage) W_SetupShot_Dir_ProjectileSize(ent, s_forward, '0 0 0', '0 0 0', antilag, recoil, snd, chan, maxdamage) #define W_SetupShot(ent,antilag,recoil,snd,chan,maxdamage) W_SetupShot_ProjectileSize(ent, '0 0 0', '0 0 0', antilag, recoil, snd, chan, maxdamage) #define W_SetupShot_Range(ent,antilag,recoil,snd,chan,maxdamage,range) W_SetupShot_Dir_ProjectileSize_Range(ent, v_forward, '0 0 0', '0 0 0', antilag, recoil, snd, chan, maxdamage, range) vector W_CalculateProjectileVelocity(vector pvelocity, vector mvelocity, float forceAbsolute); #if 0 float mspercallsum; float mspercallsstyle; float mspercallcount; #endif void W_SetupProjVelocity_Explicit(entity proj, vector dir, vector upDir, float pSpeed, float pUpSpeed, float pZSpeed, float spread, float forceAbsolute); #define W_SetupProjVelocity_Basic(ent,pspeed,pspread) W_SetupProjVelocity_Explicit(ent, w_shotdir, v_up, pspeed, 0, 0, pspread, false) #define W_SetupProjVelocity_UP_PRE(ent,wepname,prefix) W_SetupProjVelocity_Explicit(ent, w_shotdir, v_up, WEP_CVAR(wepname, prefix##speed), WEP_CVAR(wepname, prefix##speed_up), WEP_CVAR(wepname, prefix##speed_z), WEP_CVAR(wepname, prefix##spread), false) #define W_SetupProjVelocity_UP_PRI(ent,wepname) W_SetupProjVelocity_Explicit(ent, w_shotdir, v_up, WEP_CVAR_PRI(wepname, speed), WEP_CVAR_PRI(wepname, speed_up), WEP_CVAR_PRI(wepname, speed_z), WEP_CVAR_PRI(wepname, spread), false) #define W_SetupProjVelocity_UP_SEC(ent,wepname) W_SetupProjVelocity_Explicit(ent, w_shotdir, v_up, WEP_CVAR_SEC(wepname, speed), WEP_CVAR_SEC(wepname, speed_up), WEP_CVAR_SEC(wepname, speed_z), WEP_CVAR_SEC(wepname, spread), false) #define W_SetupProjVelocity_UP_BOTH(ent,wepname,isprimary) \ if(isprimary) { W_SetupProjVelocity_UP_PRI(ent, wepname); } \ else { W_SetupProjVelocity_UP_SEC(ent, wepname); } #define W_SetupProjVelocity_PRE(ent,wepname,prefix) W_SetupProjVelocity_Explicit(ent, w_shotdir, v_up, WEP_CVAR(wepname, prefix##speed), 0, 0, WEP_CVAR(wepname, prefix##spread), false) #define W_SetupProjVelocity_PRI(ent,wepname) W_SetupProjVelocity_Explicit(ent, w_shotdir, v_up, WEP_CVAR_PRI(wepname, speed), 0, 0, WEP_CVAR_PRI(wepname, spread), false) #define W_SetupProjVelocity_SEC(ent,wepname) W_SetupProjVelocity_Explicit(ent, w_shotdir, v_up, WEP_CVAR_SEC(wepname, speed), 0, 0, WEP_CVAR_SEC(wepname, spread), false) #define W_SetupProjVelocity_BOTH(ent,wepname,isprimary) \ if(isprimary) { W_SetupProjVelocity_PRI(ent, wepname); } \ else { W_SetupProjVelocity_SEC(ent, wepname); } // ==================== // Ballistics Tracing // ==================== .float railgundistance; .vector railgunforce; void FireRailgunBullet (vector start, vector end, float bdamage, float bforce, float mindist, float maxdist, float halflifedist, float forcehalflifedist, float deathtype); float fireBullet_trace_callback_eff; entity fireBullet_last_hit; void fireBullet_trace_callback(vector start, vector hit, vector end); void fireBullet(vector start, vector dir, float spread, float max_solid_penetration, float damage, float force, float dtype, float tracereffects); #endif