9 float isprimary,
float ammocount,
float damage,
10 float falloff_halflife,
float falloff_mindist,
float falloff_maxdist,
11 float bullets,
float spread,
12 float spread_pattern,
float spread_pattern_scale,
float spread_pattern_bias,
13 float solidpenetration,
14 float force,
float falloff_forcehalflife,
15 entity bullet_trail_effect)
19 W_SetupShot(actor, weaponentity,
true, 5, SND_SHOTGUN_FIRE,
25 if(lag && bullets > 0)
28 if (spread_pattern && spread_pattern_scale > 0)
35 spread_pattern_bias =
bound(0, spread_pattern_bias, 1);
36 for(
int sc = 0; sc < bullets; ++sc)
39 s = s * fixed_spread_factor;
42 0, solidpenetration, damage,
43 falloff_halflife, falloff_mindist, falloff_maxdist,
44 0, force, falloff_forcehalflife,
45 thiswep.
m_id, bullet_trail_effect,
false);
49 for(
int sc = 0; sc < bullets; ++sc)
52 spread, solidpenetration, damage,
53 falloff_halflife, falloff_mindist, falloff_maxdist,
54 0, force, falloff_forcehalflife,
55 thiswep.
m_id, bullet_trail_effect,
false);
57 if(lag && bullets > 0)
76 float i, f, swing, swing_factor, swing_damage, meleetime, is_player;
78 vector targpos, melee_path;
90 swing =
bound(0, (this.
cnt + meleetime -
time) / meleetime, 10);
91 f = ((1 - swing) *
WEP_CVAR_SEC(WEP_SHOTGUN, melee_traces));
105 swing_factor = ((1 - (i /
WEP_CVAR_SEC(WEP_SHOTGUN, melee_traces))) * 2 - 1);
108 + (melee_path * swing_factor)
116 #ifdef SHOTGUN_MELEEDEBUG
118 te_customflash(targpos, 40, 2,
'1 1 1');
126 && (is_player ||
WEP_CVAR_SEC(WEP_SHOTGUN, melee_nonplayerdamage)))
131 swing_damage = (
WEP_CVAR_SEC(WEP_SHOTGUN, damage) *
min(1, swing_factor + 1));
133 swing_damage = (
WEP_CVAR_SEC(WEP_SHOTGUN, melee_nonplayerdamage) *
min(1, swing_factor + 1));
139 this.realowner.origin +
this.realowner.view_ofs,
146 #ifdef SHOTGUN_MELEEDEBUG
147 te_customflash(targpos, 200, 2,
'15 0 0');
163 if(
time >= this.
cnt + meleetime)
183 meleetemp.realowner = actor;
186 meleetemp.weaponentity_fld = weaponentity;
187 W_SetupShot_Range(actor, weaponentity,
true, 0, SND_Null, 0,
WEP_CVAR_SEC(WEP_SHOTGUN, damage),
WEP_CVAR_SEC(WEP_SHOTGUN, melee_range), WEP_SHOTGUN.m_id |
HITTYPE_SECONDARY);
197 w_ready(thiswep, actor, weaponentity, fire);
225 w_ready(thiswep, actor, weaponentity, fire);
251 if(
vdist(actor.origin - actor.enemy.origin, <=,
WEP_CVAR_SEC(WEP_SHOTGUN, melee_range)))
264 thiswep.wr_reload(thiswep, actor, weaponentity);
269 if(actor.(weaponentity).clip_load >= 0)
273 if(
time >= actor.(weaponentity).shotgun_primarytime)
298 else if((fire & 2) &&
WEP_CVAR(WEP_SHOTGUN, secondary) == 2)
300 if(
time >= actor.(weaponentity).shotgun_primarytime)
327 if(actor.(weaponentity).clip_load >= 0)
328 if(
WEP_CVAR(WEP_SHOTGUN, secondary) == 1)
330 if(!
WEP_CVAR_SEC(WEP_SHOTGUN, melee_blockedbyfiring) ||
time >= actor.(weaponentity).shotgun_primarytime)
348 switch(
WEP_CVAR(WEP_SHOTGUN, secondary))
357 default:
return false;
368 return WEAPON_THINKING_WITH_PORTALS;
374 return WEAPON_SHOTGUN_MURDER_SLAP;
376 return WEAPON_SHOTGUN_MURDER;
391 actor.prevric =
time;
403 PAR(_(
"The %s is one of the two main default weapons, firing a single shotgun round which spreads into multiple pellets upon exiting the barrel."),
COLORED_NAME(
this));
404 PAR(_(
"The secondary fire swings the %s, slapping players close enough with the head of the weapon. "
405 "Since the slap takes a moment to land, timing this well is difficult."),
COLORED_NAME(
this));
406 PAR(_(
"The primary fire consumes %s ammo, although if you spawn in with the %s you will already have some."),
COLORED_NAME(ITEM_Shells),
COLORED_NAME(
this));
407 PAR(_(
"The %s damage drops off quickly as the range increases, so it is only useful for close combat or sometimes medium range combat."),
COLORED_NAME(
this));
void accuracy_add(entity this, Weapon w, float fired, float hit, float real)
update accuracy stats
bool accuracy_isgooddamage(entity attacker, entity targ)
does this damage count towards accuracy stats?
void antilag_takeback_all(entity ignore, float lag)
void WarpZone_traceline_antilag(entity source, vector v1, vector v2, float nomonst, entity forent, float lag)
float antilag_getlag(entity e)
void antilag_restore_all(entity ignore)
#define ANTILAG_LATENCY(e)
bool bot_aim(entity this,.entity weaponentity, float shotspeed, float shotspeedupward, float maxshottime, float applygravity, bool shot_accurate)
vector W_CalculateSpreadPattern(int pattern, float bias, int counter, int total)
float autocvar_g_weaponspreadfactor
void SpawnCasing(vector vel, vector ang, int casingtype, entity casingowner,.entity weaponentity)
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
float GetResource(entity e, Resource res_type)
Returns the current amount of resource the given entity has.
fields which are explicitly/manually set are marked with "M", fields set automatically are marked wit...
virtual void wr_checkammo2()
(SERVER) checks ammo for weapon second
#define COLORED_NAME(this)
const int IT_UNLIMITED_AMMO
#define PHYS_INPUT_BUTTON_ATCK(s)
#define PHYS_INPUT_BUTTON_ATCK2(s)
float W_WeaponRateFactor(entity this)
void Damage(entity targ, entity inflictor, entity attacker, float damage, int deathtype,.entity weaponentity, vector hitloc, vector force)
void W_SwitchWeapon_Force(Player this, Weapon w,.entity weaponentity)
const int HITTYPE_SECONDARY
#define pointparticles(effect, org, vel, howmany)
void Send_Effect(entity eff, vector eff_loc, vector eff_vel, int eff_cnt)
entity Notification
always last
#define new_pure(class)
purely logical entities (not linked to the area grid)
#define METHOD(cname, name, prototype)
#define w_getbestweapon(ent, wepent)
void W_PlayStrengthSound(entity player)
float shotgun_primarytime
void W_Shotgun_Attack2(Weapon thiswep, entity actor,.entity weaponentity, int fire)
void W_Shotgun_Attack(Weapon thiswep, entity actor,.entity weaponentity, float isprimary, float ammocount, float damage, float falloff_halflife, float falloff_mindist, float falloff_maxdist, float bullets, float spread, float spread_pattern, float spread_pattern_scale, float spread_pattern_bias, float solidpenetration, float force, float falloff_forcehalflife, entity bullet_trail_effect)
void W_Shotgun_Attack3_Frame1(Weapon thiswep, entity actor,.entity weaponentity, int fire)
void W_Shotgun_Melee_Think(entity this)
void W_Shotgun_Attack3_Frame2(Weapon thiswep, entity actor,.entity weaponentity, int fire)
const int CH_WEAPON_SINGLE
#define sound(e, c, s, v, a)
#define PAR(...)
Adds an individually translatable paragraph to PAGE_TEXT without having to deal with strcat and sprin...
void fireBullet_falloff(entity this,.entity weaponentity, vector start, vector dir, float spread, float max_solid_penetration, float damage, float falloff_halflife, float falloff_mindist, float falloff_maxdist, float headshot_multiplier, float force, float falloff_forcehalflife, float dtype, entity tracer_effect, bool do_antilag)
#define W_SetupShot_Range(ent, wepent, antilag, recoil, snd, chan, maxdamage, range, deathtype)
#define W_SetupShot(ent, wepent, antilag, recoil, snd, chan, maxdamage, deathtype)
#define IS_BOT_CLIENT(v)
want: (IS_CLIENT(v) && !IS_REAL_CLIENT(v))
#define vdist(v, cmp, f)
Vector distance comparison, avoids sqrt()
string W_Guide_Keybinds(Weapon wep)
string W_Guide_DPS_primaryMultishot(string name, string pri, string sec, string shots, string refire2)
void W_MuzzleFlash(Weapon thiswep, entity actor,.entity weaponentity, vector shotorg, vector shotdir)
#define WEP_CVAR_PRI(wep, name)
#define WEP_CVAR(wep, name)
#define WEP_CVAR_SEC(wep, name)
void W_DecreaseAmmo(Weapon wep, entity actor, float ammo_use,.entity weaponentity)
void W_Reload(entity actor,.entity weaponentity, float sent_ammo_min, Sound sent_sound)
void weapon_thinkf(entity actor,.entity weaponentity, WFRAME fr, float t, void(Weapon thiswep, entity actor,.entity weaponentity, int fire) func)
bool weapon_prepareattack(Weapon thiswep, entity actor,.entity weaponentity, bool secondary, float attacktime)
void w_ready(Weapon thiswep, entity actor,.entity weaponentity, int fire)
float weapon_load[REGISTRY_MAX(Weapons)]