26 if (player.(weaponentity) && player.(weaponentity).m_switchweapon != WEP_Null)
30 return held_weapons > 1;
47 bool is_from_contents = (deathtype == DEATH_SLIME.m_id || deathtype == DEATH_LAVA.m_id);
48 bool is_from_owner = (inflictor == projowner);
49 bool is_from_exception = (exception != -1);
59 if (is_from_exception)
66 if (is_from_exception)
68 else if (!is_from_contents)
73 if (is_from_exception)
75 else if (!(is_from_contents || is_from_owner))
80 if (is_from_exception)
96 this.
owner = attacker;
110 adaptor_think2use(
this);
123 LOG_TRACEF(
"A hit from a projectile happened with no hit contents! DEBUG THIS, this should never happen for projectiles! Projectile will self-destruct. (edict: %i, classname: %s, origin: %v)",
this, this.
classname, this.
origin);
142 LOG_TRACE(
"Detected and prevented the sky-grapple bug.");
168 else if (this.
classname ==
"grapplinghook")
187 Send_Effect(EFFECT_FIREBALL_LASER, start, hit - start, 1);
193 if (damage <= 0 && edgedamage <= 0)
198 float rad2 = rad * rad;
203 vector p = e.origin + e.mins;
204 p.x +=
random() * (e.maxs.x - e.mins.x);
205 p.y +=
random() * (e.maxs.y - e.mins.y);
206 p.z +=
random() * (e.maxs.z - e.mins.z);
211 e.dmg_radius =
sqrt(dist2);
240 float speed_decel,
float speed_accel,
float speed_max,
float turn_rate,
241 bool smart,
float smart_mindist,
float smart_trace_min,
float smart_trace_max)
261 if (smart && dist > smart_mindist)
286 float duration,
float duration_power,
287 float damage,
float edgedamage,
float rad,
float force,
288 entity cantbe,
float think_delay)
291 float dmg_remaining_next =
bound(0, 1 - dt / duration, 1) ** duration_power;
293 float f = this.
dmg_last - dmg_remaining_next;
#define MUTATOR_CALLHOOK(id,...)
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
const float MOVE_NOMONSTERS
float trace_dphitcontents
const float SOLID_TRIGGER
float trace_dphitq3surfaceflags
float Q3SURFACEFLAG_NOIMPACT
vector trace_plane_normal
void UpdateCSQCProjectile(entity e)
float RadiusDamage(entity inflictor, entity attacker, float coredamage, float edgedamage, float rad, entity cantbe, entity mustbe, float forceintensity, int deathtype,.entity weaponentity, entity directhitentity)
float Fire_AddDamage(entity e, entity o, float d, float t, float dt)
const int HITTYPE_BOUNCE
set manually after projectile has bounced
const int HITTYPE_SPAM
set manually after first RadiusDamage, stops effect spam
const int HITTYPE_SPLASH
automatically set by RadiusDamage
void Send_Effect(entity eff, vector eff_loc, vector eff_vel, int eff_cnt)
entity WarpZone_SearchInRadius(vector org, float rad, float nomonsters, WarpZone_FindRadius_cond_callback_t cb)
Modified findradius aware of warpzones, that only includes entities that meet the "cb" criteria.
vector WarpZone_UnTransformOrigin(entity wz, vector org)
Transforms origin org backwards through warpzone wz, as the inverse of WarpZone_TransformOrigin.
vector WarpZone_RefSys_TransformOrigin(entity from, entity to, vector org)
Transform origin org in from's reference into to's reference.
#define WarpZone_TraceLine(org, end, nomonsters, forent)
noref entity WarpZone_SearchInRadius_otherent
Free to use in the callback.
#define WarpZone_TraceLine_ThroughZone(org, end, nomonsters, forent, zone, cb)
entity WarpZone_trace_transform
Transform accumulator during a trace.
bool(entity e) WarpZone_FindRadius_cond_callback_t
const int MOVETYPE_BOUNCEMISSILE
const int MOVETYPE_BOUNCE
ERASEABLE void RandomSelection_Init()
#define RandomSelection_AddEnt(e, weight, priority)
entity RandomSelection_chosen_ent
#define REGISTRY_GET(id, i)
void RemoveHook(entity this)
float W_CheckProjectileDamage(entity inflictor, entity projowner, int deathtype, float exception)
bool WarpZone_Projectile_Touch_ImpactFilter_Callback(entity this, entity toucher)
void W_PlayStrengthSound(entity player)
void W_LaserPlay(entity this, float rad, float damage, float edgedamage, float burntime, WarpZone_FindRadius_cond_callback_t cb)
Randomly chooses a player within the radius to shoot a laser towards.
void W_PrepareExplosionByDamage(entity this, entity attacker, void(entity this) explode)
void W_DamageOverTime_Think(entity this, float duration, float duration_power, float damage, float edgedamage, float rad, float force, entity cantbe, float think_delay)
Applies damage over time, called within a think function.
void W_GiveWeapon(entity e, int wep)
void W_LaserPlay_trace_callback(vector start, vector hit, vector end)
bool SUB_NoImpactCheck(entity this, entity toucher)
vector W_LaserPlay_end_org
float W_SeekOutEnemy(entity this, float speed_decel, float speed_accel, float speed_max, float turn_rate, bool smart, float smart_mindist, float smart_trace_min, float smart_trace_max)
Automatically guides a projectile towards its enemy.
vector W_LaserPlay_last_hit_org
void adaptor_think2use_hittype_splash(entity this)
bool W_DualWielding(entity player)
bool autocvar_g_projectiles_keep_owner
int autocvar_g_projectiles_damage
int autocvar_g_projectiles_interact
bool StatusEffects_active(StatusEffect this, entity actor)
#define vdist(v, cmp, f)
Vector distance comparison, avoids sqrt().
#define WepSet_FromWeapon(it)
const int MAX_WEAPONSLOTS
entity weaponentities[MAX_WEAPONSLOTS]