8 void W_Shotgun_Attack(
Weapon thiswep,
entity actor, .
entity weaponentity,
float isprimary,
float ammocount,
float damage,
float bullets,
float spread,
float solidpenetration,
float force,
entity bullet_trail_effect)
16 if(lag && bullets > 0)
19 for(
int sc = 0;sc < bullets;sc = sc + 1)
20 fireBullet_antilag(actor, weaponentity,
w_shotorg,
w_shotdir, spread, solidpenetration, damage, 0, force, thiswep.
m_id, bullet_trail_effect,
false);
22 if(lag && bullets > 0)
28 if(autocvar_g_casings >= 1)
37 .entity swing_alreadyhit;
38 void W_Shotgun_Melee_Think(
entity this)
41 float i, f, swing, swing_factor, swing_damage, meleetime, is_player;
55 swing =
bound(0, (this.
cnt + meleetime -
time) / meleetime, 10);
66 for(i=this.swing_prev; i < f; ++i)
68 swing_factor = ((1 - (i /
WEP_CVAR_SEC(shotgun, melee_traces))) * 2 - 1);
78 #ifdef SHOTGUN_MELEEDEBUG 80 te_customflash(targpos, 40, 2,
'1 1 1');
88 && (is_player ||
WEP_CVAR_SEC(shotgun, melee_nonplayerdamage)))
93 swing_damage = (
WEP_CVAR_SEC(shotgun, damage) *
min(1, swing_factor + 1));
95 swing_damage = (
WEP_CVAR_SEC(shotgun, melee_nonplayerdamage) *
min(1, swing_factor + 1));
101 this.realowner.origin +
this.realowner.view_ofs,
107 #ifdef SHOTGUN_MELEEDEBUG 108 te_customflash(targpos, 200, 2,
'15 0 0');
113 this.swing_alreadyhit = target_victim;
124 if(
time >= this.
cnt + meleetime)
144 meleetemp.realowner = actor;
145 setthink(meleetemp, W_Shotgun_Melee_Think);
147 meleetemp.weaponentity_fld = weaponentity;
148 W_SetupShot_Range(actor, weaponentity,
true, 0, SND_Null, 0,
WEP_CVAR_SEC(shotgun, damage),
WEP_CVAR_SEC(shotgun, melee_range), WEP_SHOTGUN.m_id |
HITTYPE_SECONDARY);
152 void W_Shotgun_Attack3_Frame2(
Weapon thiswep,
entity actor, .
entity weaponentity,
int fire)
154 if (!thiswep.wr_checkammo2(thiswep, actor, weaponentity))
155 if (!(actor.items & IT_UNLIMITED_AMMO))
158 w_ready(thiswep, actor, weaponentity, fire);
163 W_Shotgun_Attack(thiswep, actor, weaponentity,
true,
173 void W_Shotgun_Attack3_Frame1(
Weapon thiswep,
entity actor, .
entity weaponentity,
int fire)
175 if (!thiswep.wr_checkammo2(thiswep, actor, weaponentity))
176 if (!(actor.items & IT_UNLIMITED_AMMO))
179 w_ready(thiswep, actor, weaponentity, fire);
183 W_Shotgun_Attack(thiswep, actor, weaponentity,
false,
194 .float shotgun_primarytime;
198 if(
vdist(actor.origin - actor.enemy.origin, <=,
WEP_CVAR_SEC(shotgun, melee_range)))
209 if(
WEP_CVAR(shotgun, secondary) < 2) {
210 thiswep.wr_reload(thiswep, actor, weaponentity);
217 if(
time >= actor.(weaponentity).shotgun_primarytime)
221 W_Shotgun_Attack(thiswep, actor, weaponentity,
true,
234 else if((fire & 2) &&
WEP_CVAR(shotgun, secondary) == 2)
236 if(
time >= actor.(weaponentity).shotgun_primarytime)
240 W_Shotgun_Attack(thiswep, actor, weaponentity,
false,
254 if(actor.(weaponentity).clip_load >= 0)
255 if(
WEP_CVAR(shotgun, secondary) == 1)
256 if(((fire & 1) &&
GetResource(actor, thiswep.ammo_type) <= 0 && !(actor.items & IT_UNLIMITED_AMMO)) || (fire & 2))
260 weapon_thinkf(actor, weaponentity, WFRAME_FIRE1, 0, W_Shotgun_Attack2);
272 if(
vdist(actor.origin - actor.enemy.origin, >,
WEP_CVAR_SEC(shotgun, melee_range)))
274 switch(
WEP_CVAR(shotgun, secondary))
283 default:
return false;
292 return WEAPON_THINKING_WITH_PORTALS;
297 return WEAPON_SHOTGUN_MURDER_SLAP;
299 return WEAPON_SHOTGUN_MURDER;
308 vector org2 = w_org + w_backoff * 2;
310 if(!w_issilent &&
time - actor.prevric > 0.25)
314 actor.prevric =
time;
#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_SwitchWeapon_Force(Player this, Weapon w,.entity weaponentity)
#define w_getbestweapon(ent, wepent)
#define W_SetupShot_Range(ent, wepent, antilag, recoil, snd, chan, maxdamage, range, deathtype)
float antilag_getlag(entity e)
void w_ready(Weapon thiswep, entity actor,.entity weaponentity, int fire)
#define WEP_CVAR(wepname, name)
#define METHOD(cname, name, prototype)
void WarpZone_traceline_antilag(entity source, vector v1, vector v2, float nomonst, entity forent, float lag)
void antilag_restore_all(entity ignore)
void W_PlayStrengthSound(entity player)
bool weapon_prepareattack(Weapon thiswep, entity actor,.entity weaponentity, bool secondary, float attacktime)
const int CH_WEAPON_SINGLE
#define PHYS_INPUT_BUTTON_ATCK(s)
void Damage(entity targ, entity inflictor, entity attacker, float damage, int deathtype,.entity weaponentity, vector hitloc, vector force)
const int HITTYPE_SECONDARY
#define W_SetupShot(ent, wepent, antilag, recoil, snd, chan, maxdamage, deathtype)
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()
void accuracy_add(entity this, Weapon w, float fired, float hit)
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)
bool accuracy_isgooddamage(entity attacker, entity targ)
#define IS_BOT_CLIENT(v)
want: (IS_CLIENT(v) && !IS_REAL_CLIENT(v))
#define new_pure(class)
purely logical entities (.origin doesn't work)
#define ANTILAG_LATENCY(e)
void W_DecreaseAmmo(Weapon wep, entity actor, float ammo_use,.entity weaponentity)
#define sound(e, c, s, v, a)
fields which are explicitly/manually set are marked with "M", fields set automatically are marked wit...
void antilag_takeback_all(entity ignore, float lag)
float W_WeaponRateFactor(entity this)
void fireBullet_antilag(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, bool do_antilag)
void W_Reload(entity actor,.entity weaponentity, float sent_ammo_min, Sound sent_sound)