]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blob - qcsrc/server/weapons/tracing.qh
Remove one of the projectile velocity setup macros
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / weapons / tracing.qh
1 .float antilag_debug;
2
3 vector w_shotorg;
4 vector w_shotdir;
5 vector w_shotend;
6
7 // this function calculates w_shotorg and w_shotdir based on the weapon model
8 // offset, trueaim and antilag, and won't put w_shotorg inside a wall.
9 // make sure you call makevectors first (FIXME?)
10 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);
11
12 #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)
13 #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)
14 #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)
15 #define W_SetupShot(ent,antilag,recoil,snd,chan,maxdamage) W_SetupShot_ProjectileSize(ent, '0 0 0', '0 0 0', antilag, recoil, snd, chan, maxdamage)
16 #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)
17
18 vector W_CalculateProjectileVelocity(vector pvelocity, vector mvelocity, float forceAbsolute);
19
20 #if 0
21 float mspercallsum;
22 float mspercallsstyle;
23 float mspercallcount;
24 #endif
25 void W_SetupProjectileVelocityEx(entity missile, vector dir, vector upDir, float pSpeed, float pUpSpeed, float pZSpeed, float spread, float forceAbsolute);
26
27 #define WEP_SETUPPROJVELOCITY_UP_NONE(ent,wepname,prefix) W_SetupProjectileVelocityEx(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)
28 #define WEP_SETUPPROJVELOCITY_UP_PRI(ent,wepname) W_SetupProjectileVelocityEx(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)
29 #define WEP_SETUPPROJVELOCITY_UP_SEC(ent,wepname) W_SetupProjectileVelocityEx(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)
30 #define WEP_SETUPPROJVELOCITY_UP_BOTH(ent,wepname,isprimary) W_SetupProjectileVelocityEx(ent, w_shotdir, v_up, WEP_CVAR_BOTH(wepname, isprimary, speed), WEP_CVAR_BOTH(wepname, isprimary, speed_up), WEP_CVAR_BOTH(wepname, isprimary, speed_z), WEP_CVAR_BOTH(wepname, isprimary, spread), FALSE)
31
32 #define WEP_SETUPPROJVELOCITY_NONE(ent,wepname,prefix) W_SetupProjectileVelocityEx(ent, w_shotdir, v_up, WEP_CVAR(wepname, prefix##speed), 0, 0, WEP_CVAR(wepname, prefix##spread), FALSE)
33 #define WEP_SETUPPROJVELOCITY_PRI(ent,wepname) W_SetupProjectileVelocityEx(ent, w_shotdir, v_up, WEP_CVAR_PRI(wepname, speed), 0, 0, WEP_CVAR_PRI(wepname, spread), FALSE)
34 #define WEP_SETUPPROJVELOCITY_SEC(ent,wepname) W_SetupProjectileVelocityEx(ent, w_shotdir, v_up, WEP_CVAR_SEC(wepname, speed), 0, 0, WEP_CVAR_SEC(wepname, spread), FALSE)
35 #define WEP_SETUPPROJVELOCITY_BOTH(ent,wepname,isprimary) W_SetupProjectileVelocityEx(ent, w_shotdir, v_up, WEP_CVAR_BOTH(wepname, isprimary, speed), 0, 0, WEP_CVAR_BOTH(wepname, isprimary, spread), FALSE)
36
37 // ====================
38 //  Ballistics Tracing
39 // ====================
40
41 .float railgundistance;
42 .vector railgunforce;
43 void FireRailgunBullet (vector start, vector end, float bdamage, float bforce, float mindist, float maxdist, float halflifedist, float forcehalflifedist, float deathtype);
44
45 .float dmg_force;
46 .float dmg_radius;
47 .float dmg_total;
48 //.float last_yoda;
49 void W_BallisticBullet_Hit (void);
50
51 .void(void) W_BallisticBullet_LeaveSolid_think_save;
52 .float W_BallisticBullet_LeaveSolid_nextthink_save;
53 .vector W_BallisticBullet_LeaveSolid_origin;
54 .vector W_BallisticBullet_LeaveSolid_velocity;
55
56 void W_BallisticBullet_LeaveSolid_think();
57
58 float W_BallisticBullet_LeaveSolid(float eff);
59
60 void W_BallisticBullet_Touch (void);
61
62 void endFireBallisticBullet(); /* WEAPONTODO
63 {
64         endzcurveparticles();
65 }*/
66
67 entity fireBallisticBullet_trace_callback_ent;
68 float fireBallisticBullet_trace_callback_eff;
69 void fireBallisticBullet_trace_callback(vector start, vector hit, vector end);
70
71 void fireBallisticBullet(vector start, vector dir, float spread, float pSpeed, float lifetime, float damage, float force, float dtype, float tracereffects, float bulletconstant);
72
73 void fireBullet (vector start, vector dir, float spread, float damage, float force, float dtype, float tracer);