5 void W_Rifle_FireBullet(
Weapon thiswep, .
entity weaponentity,
float pSpread,
float pDamage,
float pHeadshotDamage,
float pForce,
float pSolidPenetration,
float pAmmo,
int deathtype,
float pTracer,
float pShots,
Sound pSound,
entity actor)
21 for(i = 0; i < pShots; ++i)
22 fireBullet(actor, weaponentity,
w_shotorg,
w_shotdir, pSpread, pSolidPenetration, pDamage, pHeadshotDamage, pForce, deathtype, (pTracer ? EFFECT_RIFLE : EFFECT_RIFLE_WEAK));
24 if(autocvar_g_casings >= 2)
33 W_Rifle_FireBullet(thiswep, weaponentity,
WEP_CVAR_PRI(rifle, spread),
WEP_CVAR_PRI(rifle, damage),
WEP_CVAR_PRI(rifle, headshot_multiplier),
WEP_CVAR_PRI(rifle, force),
WEP_CVAR_PRI(rifle, solidpenetration),
WEP_CVAR_PRI(rifle,
ammo), thiswep.
m_id,
WEP_CVAR_PRI(rifle, tracer),
WEP_CVAR_PRI(rifle, shots), SND_CAMPINGRIFLE_FIRE, actor);
38 W_Rifle_FireBullet(thiswep, weaponentity,
WEP_CVAR_SEC(rifle, spread),
WEP_CVAR_SEC(rifle, damage),
WEP_CVAR_SEC(rifle, headshot_multiplier),
WEP_CVAR_SEC(rifle, force),
WEP_CVAR_SEC(rifle, solidpenetration),
WEP_CVAR_SEC(rifle,
ammo), thiswep.
m_id |
HITTYPE_SECONDARY,
WEP_CVAR_SEC(rifle, tracer),
WEP_CVAR_SEC(rifle, shots), SND_CAMPINGRIFLE_FIRE2, actor);
42 .WFRAME rifle_bullethail_frame;
43 .float rifle_bullethail_animtime;
44 .float rifle_bullethail_refire;
45 void W_Rifle_BulletHail_Continue(
Weapon thiswep,
entity actor, .
entity weaponentity,
int fire)
49 Weapon sw = actor.(weaponentity).m_switchweapon;
51 actor.(weaponentity).m_switchweapon = actor.(weaponentity).m_weapon;
53 r =
weapon_prepareattack(thiswep, actor, weaponentity, actor.rifle_bullethail_frame == WFRAME_FIRE2, actor.rifle_bullethail_refire);
54 if(actor.(weaponentity).m_switchweapon == actor.(weaponentity).m_weapon)
55 actor.(weaponentity).m_switchweapon = sw;
58 actor.rifle_bullethail_attackfunc(thiswep, actor, weaponentity);
59 weapon_thinkf(actor, weaponentity, actor.rifle_bullethail_frame, actor.rifle_bullethail_animtime, W_Rifle_BulletHail_Continue);
67 void W_Rifle_BulletHail(
Weapon thiswep,
entity actor, .
entity weaponentity,
float mode,
void(
Weapon thiswep,
entity actor, .
entity weaponentity) AttackFunc, WFRAME fr,
float animtime,
float refire)
70 AttackFunc(thiswep, actor, weaponentity);
74 actor.rifle_bullethail_attackfunc = AttackFunc;
75 actor.rifle_bullethail_frame = fr;
76 actor.rifle_bullethail_animtime = animtime;
77 actor.rifle_bullethail_refire = refire;
78 weapon_thinkf(actor, weaponentity, fr, animtime, W_Rifle_BulletHail_Continue);
87 .float bot_secondary_riflemooth;
93 if(
vdist(actor.origin - actor.enemy.origin, >, 1000))
94 actor.bot_secondary_riflemooth = 0;
95 if(actor.bot_secondary_riflemooth == 0)
97 if(
bot_aim(actor, weaponentity, 1000000, 0, 0.001,
false))
100 if(
random() < 0.01) actor.bot_secondary_riflemooth = 1;
105 if(
bot_aim(actor, weaponentity, 1000000, 0, 0.001,
false))
108 if(
random() < 0.03) actor.bot_secondary_riflemooth = 0;
115 thiswep.wr_reload(thiswep, actor, weaponentity);
118 actor.(weaponentity).rifle_accumulator =
bound(
time -
WEP_CVAR(rifle, bursttime), actor.(weaponentity).rifle_accumulator,
time);
121 if(
time >= actor.(weaponentity).rifle_accumulator +
WEP_CVAR_PRI(rifle, burstcost))
124 W_Rifle_BulletHail(thiswep, actor, weaponentity,
WEP_CVAR_PRI(rifle, bullethail), W_Rifle_Attack, WFRAME_FIRE1,
WEP_CVAR_PRI(rifle, animtime),
WEP_CVAR_PRI(rifle, refire));
125 actor.(weaponentity).rifle_accumulator +=
WEP_CVAR_PRI(rifle, burstcost);
132 thiswep.wr_reload(thiswep, actor, weaponentity);
136 if(
time >= actor.(weaponentity).rifle_accumulator +
WEP_CVAR_SEC(rifle, burstcost))
139 W_Rifle_BulletHail(thiswep, actor, weaponentity,
WEP_CVAR_SEC(rifle, bullethail), W_Rifle_Attack2, WFRAME_FIRE2,
WEP_CVAR_SEC(rifle, animtime),
WEP_CVAR_PRI(rifle, refire));
140 actor.(weaponentity).rifle_accumulator +=
WEP_CVAR_SEC(rifle, burstcost);
164 actor.(weaponentity).rifle_accumulator =
time -
WEP_CVAR(rifle, bursttime);
173 return WEAPON_THINKING_WITH_PORTALS;
180 return WEAPON_RIFLE_MURDER_HAIL_PIERCING;
182 return WEAPON_RIFLE_MURDER_HAIL;
187 return WEAPON_RIFLE_MURDER_PIERCING;
189 return WEAPON_RIFLE_MURDER;
203 org2 = w_org + w_backoff * 2;
#define WEP_CVAR_PRI(wepname, name)
#define PHYS_INPUT_BUTTON_ATCK2(s)
bool bot_aim(entity this,.entity weaponentity, float shotspeed, float shotspeedupward, float maxshottime, float applygravity)
#define WEP_CVAR_SEC(wepname, name)
float weapon_load[REGISTRY_MAX(Weapons)]
void w_ready(Weapon thiswep, entity actor,.entity weaponentity, int fire)
#define PHYS_INPUT_BUTTON_ZOOM(s)
#define WEP_CVAR(wepname, name)
bool weapon_prepareattack_check(Weapon thiswep, entity actor,.entity weaponentity, bool secondary, float attacktime)
#define METHOD(cname, name, prototype)
void fireBullet(entity this,.entity weaponentity, vector start, vector dir, float spread, float max_solid_penetration, float damage, float headshot_multiplier, float force, float dtype, entity tracer_effect)
const int MAX_WEAPONSLOTS
bool weapon_prepareattack(Weapon thiswep, entity actor,.entity weaponentity, bool secondary, float attacktime)
#define PHYS_INPUT_BUTTON_ZOOMSCRIPT(s)
#define PHYS_INPUT_BUTTON_ATCK(s)
const int HITTYPE_SECONDARY
#define W_SetupShot(ent, wepent, antilag, recoil, snd, chan, maxdamage, deathtype)
bool autocvar_cl_reticle_weapon
vector(float skel, float bonenum) _skel_get_boneabs_hidden
float GetResource(entity e, Resource res_type)
Returns the current amount of resource the given entity has.
#define vdist(v, cmp, f)
Vector distance comparison, avoids sqrt()
entity Notification
always last
void weapon_thinkf(entity actor,.entity weaponentity, WFRAME fr, float t, void(Weapon thiswep, entity actor,.entity weaponentity, int fire) func)
entity weaponentities[MAX_WEAPONSLOTS]
#define ATTACK_FINISHED(ent, w)
void W_DecreaseAmmo(Weapon wep, entity actor, float ammo_use,.entity weaponentity)
#define sound(e, c, s, v, a)
void weapon_prepareattack_do(entity actor,.entity weaponentity, bool secondary, float attacktime)
fields which are explicitly/manually set are marked with "M", fields set automatically are marked wit...
void W_Reload(entity actor,.entity weaponentity, float sent_ammo_min, Sound sent_sound)