44 setattachment(
timer, _nade,
"");
45 timer.colormap = _nade.colormap;
46 timer.glowmod = _nade.glowmod;
49 timer.wait = _nade.wait;
50 timer.nade_lifetime = _nade.nade_lifetime;
84 orb.owner = this.
owner;
86 setorigin(orb, this.
origin);
88 orb.lifetime = orb_lifetime;
89 orb.ltime =
time + orb.lifetime;
90 orb.bot_dodge =
false;
100 STAT(NADE_BONUS_TYPE, orb) =
STAT(NADE_BONUS_TYPE,
this);
108 orb.nextthink =
time;
117 vector expcol_min =
'0 0 0', expcol_max =
'0 0 0';
121 if (!this.
takedamage || ntype == NADE_TYPE_Null)
125 ntype = NADE_TYPE_NORMAL;
128#define SET_NADE_EFFECT(nade_type, exp_effect, exp_color_min, exp_color_max) \
130 expef = exp_effect; \
131 expcol_min = exp_color_min; \
132 expcol_max = exp_color_max; \
137 SET_NADE_EFFECT(NADE_TYPE_NAPALM, EFFECT_EXPLOSION_MEDIUM,
'0 0 0',
'0 0 0');
138 SET_NADE_EFFECT(NADE_TYPE_ICE, EFFECT_ELECTRO_COMBO,
'0 0 0',
'0 0 0');
145 SET_NADE_EFFECT(NADE_TYPE_AMMO, EFFECT_SPAWN,
'0.33 0.33 1',
'0.33 0.33 1');
146 SET_NADE_EFFECT(NADE_TYPE_DARKNESS, EFFECT_EXPLOSION_MEDIUM,
'0 0 0',
'0 0 0');
149#undef SET_NADE_EFFECT
185 STAT(NADE_TIMER,
this) = 0;
188 this.
nade.nade_time_primed = thenade.nade_time_primed;
255 if (
STAT(NADE_BONUS_TYPE,
this) == NADE_TYPE_TRANSLOCATE.m_id ||
STAT(NADE_BONUS_TYPE,
this) == NADE_TYPE_SPAWN.m_id)
305 &&
STAT(NADE_BONUS_TYPE,
this) != NADE_TYPE_TRANSLOCATE.m_id
306 &&
STAT(NADE_BONUS_TYPE,
this) != NADE_TYPE_SPAWN.m_id)
349 if (
STAT(NADES_SMALL, e))
353 setsize(_nade,
'0.5 0.5 0.5' * -
size,
'0.5 0.5 0.5' *
size);
356 tracebox(_nade.origin, _nade.mins, _nade.maxs, _nade.origin,
MOVE_NOMONSTERS, _nade);
358 setorigin(_nade, e.origin);
361 _nade.velocity =
'0 0 100';
363 _nade.velocity = e.velocity + _velocity;
365 _nade.velocity = _velocity;
373 _nade.spawnshieldtime =
time + 0.1;
379 _nade.exteriormodeltoclient =
NULL;
380 _nade.traileffectnum = 0;
381 _nade.teleportable =
true;
382 _nade.pushable =
true;
385 _nade.damagedbycontents =
true;
391 _nade.projectiledeathtype = DEATH_NADE.m_id;
392 _nade.toss_time =
time;
395 switch (
STAT(NADE_BONUS_TYPE, _nade))
397 case NADE_TYPE_TRANSLOCATE.m_id:
398 case NADE_TYPE_SPAWN.m_id:
399 case NADE_TYPE_MONSTER.m_id:
412 _nade.nextthink = _time;
416 STAT(NADE_TIMER, e) = 0;
421#define NADE_TYPE_CHECK(nade_ent, nade_cvar) \
422 case nade_ent.m_id: \
429 case 0:
return NADE_TYPE_Null;
441 return NADE_TYPE_NORMAL;
442#undef NADE_TYPE_CHECK
451 if (
STAT(NADE_BONUS_SCORE, player) < 1)
454 if (
STAT(NADE_BONUS_SCORE, player) >= 1)
458 ++
STAT(NADE_BONUS, player);
459 --
STAT(NADE_BONUS_SCORE, player);
467 STAT(NADE_BONUS, player) =
STAT(NADE_BONUS_SCORE, player) = 0;
505 FOREACH(Nades, it != NADE_TYPE_Null,
515 FOREACH(Nades, it != NADE_TYPE_Null && (it.netname == ntype ||
ftos(it.impulse) == ntype),
return it);
516 return NADE_TYPE_Null;
522 if (ntype ==
"random" || ntype ==
"0")
527 return (def == NADE_TYPE_Null) ? NADE_TYPE_NORMAL : def;
536 n.pokenade_type = pntype;
538 STAT(NADE_BONUS_TYPE, n) = def.
m_id;
544 n.exteriormodeltoclient = player;
548 n.realowner = nowner;
549 n.colormap = player.colormap;
550 n.glowmod = player.glowmod;
552 n.nade_time_primed =
time;
554 n.nextthink =
max(n.wait - 3,
time);
555 n.projectiledeathtype = DEATH_NADE.m_id;
556 n.weaponentity_fld = weaponentity;
557 n.nade_lifetime = ntime;
562 fn.viewmodelforclient = player;
563 fn.realowner = fn.owner = player;
565 fn.colormap = player.colormap;
566 fn.glowmod = player.glowmod;
568 fn.nextthink = n.wait;
569 fn.weaponentity_fld = weaponentity;
573 player.fake_nade = fn;
595 else if (
STAT(NADE_BONUS,
this) >= 1)
599 --
STAT(NADE_BONUS,
this);
606 pntype =
CS_CVAR(
this).cvar_cl_pokenade_type;
643 if (
time >= held_nade.nade_time_primed + 1)
646 float _force =
time - held_nade.nade_time_primed;
660 if (player.fake_nade)
661 delete(player.fake_nade);
663 player.nade = player.fake_nade =
NULL;
664 STAT(NADE_TIMER, player) = 0;
678 entity held_nade = player.nade;
687 held_nade = player.nade;
690 else if (
time >= held_nade.nade_time_primed + 1)
694 makevectors(player.v_angle);
695 float _force = time - held_nade.nade_time_primed;
696 _force /= autocvar_g_nades_nade_lifetime;
697 _force = autocvar_g_nades_nade_minforce + (_force * (autocvar_g_nades_nade_maxforce - autocvar_g_nades_nade_minforce));
698 vector dir = v_forward * 0.7 + v_up * 0.2 + v_right * 0.1;
699 dir = W_CalculateSpread(dir, autocvar_g_nades_spread, autocvar_g_projectiles_spread_style, false);
700 toss_nade(player, false, dir * _force, 0);
736 entity held_nade = player.nade;
739 STAT(NADE_TIMER, player) =
bound(0, (
time - held_nade.nade_time_primed) / held_nade.nade_lifetime, 1);
742 held_nade.velocity = player.velocity;
743 setorigin(held_nade, player.origin + player.view_ofs +
v_forward * 8 +
v_right * -8 +
v_up * 0);
744 held_nade.angles.y = player.angles.y;
746 if (
time + 0.1 >= held_nade.wait)
749 int ntype =
STAT(NADE_BONUS_TYPE, held_nade);
750 if (ntype == NADE_TYPE_NORMAL.m_id
751 || ntype == NADE_TYPE_NAPALM.m_id
753 || ntype == NADE_TYPE_TRANSLOCATE.m_id
770 if (key.owner == player)
783 player.pokenade_type =
CS_CVAR(player).cvar_cl_pokenade_type;
795 STAT(NADE_BONUS, player) =
STAT(NADE_BONUS_SCORE, player) = 0;
808 player.nade_refire =
time;
816 STAT(NADE_TIMER, player) = 0;
821 if (player.nade_spawnloc)
823 setorigin(player, player.nade_spawnloc.origin);
824 --player.nade_spawnloc.cnt;
826 if (player.nade_spawnloc.cnt <= 0)
828 delete(player.nade_spawnloc);
829 player.nade_spawnloc =
NULL;
847 float killcount_bonus = (
CS(frag_attacker).killcount >= 1)
856 #define SPREE_ITEM(counta, countb, center, normal, gentle) \
858 nades_GiveBonus(frag_attacker, autocvar_g_nades_bonus_score_spree); \
881 float frag_deathtype =
M_ARGV(3,
float);
884 &&
time - frag_inflictor.toss_time <= 0.1)
942 STAT(NADE_TIMER, client) =
STAT(NADE_TIMER, spectatee);
943 STAT(NADE_BONUS_TYPE, client) =
STAT(NADE_BONUS_TYPE, spectatee);
944 client.pokenade_type = spectatee.pokenade_type;
945 STAT(NADE_BONUS, client) =
STAT(NADE_BONUS, spectatee);
946 STAT(NADE_BONUS_SCORE, client) =
STAT(NADE_BONUS_SCORE, spectatee);
IntrusiveList g_bot_dodge
#define MUTATOR_CALLHOOK(id,...)
#define REGISTER_MUTATOR(...)
#define MUTATOR_HOOKFUNCTION(...)
vector W_CalculateSpread(vector dir, float spread, int spread_style, bool must_normalize)
var entity(vector mins, vector maxs,.entity tofield) findbox_tofield_OrFallback
void SetResource(entity e, Resource res_type, float amount)
Sets the current amount of resource the given entity will have.
float GetResource(entity e, Resource res_type)
Returns the current amount of resource the given entity has.
virtual void offhand_think()
#define colormapPaletteColor(c, isPants)
#define setmodel(this, m)
void nade_ammo_boom(entity this)
float autocvar_g_nades_ammo_friend
bool autocvar_g_nades_ammo
#define PHYS_INPUT_BUTTON_CROUCH(s)
vector findbetterlocation(vector org, float mindist)
const float MOVE_NOMONSTERS
const float SOLID_TRIGGER
float DPCONTENTS_PLAYERCLIP
void UpdateCSQCProjectile(entity e)
void CSQCProjectile(entity e, float clientanimate, int type, float docull)
IntrusiveList g_damagedbycontents
void nade_darkness_boom(entity this)
bool autocvar_g_nades_darkness
bool autocvar_g_nades_darkness_teamcheck
#define DEATH_ISWEAPON(t, w)
#define DEATH_WEAPONOF(t)
const int HITTYPE_SECONDARY
void SUB_Remove(entity this)
Remove entity.
entity exteriormodeltoclient
#define nade(name, colormin1, colormax1, colormin2, colormax2)
void Send_Effect(entity eff, vector eff_loc, vector eff_vel, int eff_cnt)
void Send_Effect_Except(entity eff, vector eff_loc, vector eff_vel, int eff_cnt, vector eff_col_min, vector eff_col_max, entity ignore)
void nade_entrap_boom(entity this)
bool autocvar_g_nades_entrap
float autocvar_g_nades_entrap_strength
float autocvar_g_nades_entrap_speed
void nade_ice_boom(entity this)
bool autocvar_g_nades_ice
bool autocvar_g_nades_ice_teamcheck
ERASEABLE entity IL_PUSH(IntrusiveList this, entity it)
Push to tail.
#define IL_EACH(this, cond, body)
#define FOREACH(list, cond, body)
#define PutClientInServer
void Net_LinkEntity(entity e, bool docull, float dt, bool(entity this, entity to, int sendflags) sendfunc)
void nade_monster_boom(entity this)
void set_movetype(entity this, int mt)
const int MOVETYPE_BOUNCE
void nade_heal_boom(entity this)
float autocvar_g_nades_heal_friend
bool autocvar_g_nades_heal
float autocvar_g_nades_heal_armor_rate
bool autocvar_g_nades_pokenade
string autocvar_g_nades_pokenade_monster_type
void nade_spawn_boom(entity this)
void nade_spawn_SetSpawnHealth(entity player)
bool nade_spawn_DestroyDamage(entity this, entity attacker)
bool autocvar_g_nades_spawn
entity Nade_TrailEffect(int proj, int nade_team)
float autocvar_g_nades_spread
void nade_napalm_boom(entity this)
bool autocvar_g_nades_napalm
bool orb_send(entity this, entity to, int sf)
void nade_normal_boom(entity this)
strcat(_("^F4Countdown stopped!"), "\n^BG", _("Teams are too unbalanced."))
void Send_Notification(NOTIF broadcast, entity client, MSG net_type, Notification net_name,...count)
void Kill_Notification(NOTIF broadcast, entity client, MSG net_type, CPID net_cpid)
#define METHOD(cname, name, prototype)
ERASEABLE void RandomSelection_Init()
#define RandomSelection_AddEnt(e, weight, priority)
entity RandomSelection_chosen_ent
#define REGISTRY_GET(id, i)
void SpectateCopy(entity this, entity spectatee)
void RemoveHook(entity this)
#define ITEM_TOUCH_NEEDKILL()
#define ITEM_DAMAGE_NEEDKILL(dt)
void W_PrepareExplosionByDamage(entity this, entity attacker, void(entity this) explode)
#define PROJECTILE_TOUCH(e, t)
IntrusiveList g_projectiles
#define PROJECTILE_MAKETRIGGER(e)
const int CH_SHOTS_SINGLE
#define sound(e, c, s, v, a)
Sound SND_GRENADE_BOUNCE_RANDOM()
void play2(entity e, string filename)
float spamsound(entity e, int chan, Sound samp, float vol, float _atten)
use this one if you might be causing spam (e.g.
ClientState CS(Client this)
float StatusEffects_gettime(StatusEffect this, entity actor)
bool StatusEffects_active(StatusEffect this, entity actor)
if(frag_attacker.flagcarried)
void freezetag_Unfreeze(entity targ, bool reset_health)
float autocvar_g_freezetag_revive_nade_health
bool autocvar_g_freezetag_revive_nade
#define FOR_EACH_KH_KEY(v)
const int MONSTERFLAG_SPAWNED
flag for spawned monsters
float autocvar_g_monsters
#define SET_NADE_EFFECT(nade_type, exp_effect, exp_color_min, exp_color_max)
void nades_RemoveBonus(entity player)
Remove all bonus nades from a player.
void nades_orb_think(entity this)
void nade_boom(entity this)
void spawn_held_nade(entity player, entity nowner, float ntime, string ntype, string pntype)
entity nades_spawn_orb(entity this, float orb_lifetime, float orb_rad)
Spawns an orb for some nade types.
vector nades_PlayerColor(entity this, bool isPants)
bool CanThrowNade(entity this)
void nade_damage(entity this, entity inflictor, entity attacker, float damage, int deathtype,.entity weaponentity, vector hitloc, vector force)
void nades_Clear(entity player)
Remove nades that are being thrown.
void nade_pickup(entity this, entity thenade)
void nades_CheckThrow(entity this)
bool nade_customize(entity this, entity client)
Nade Nades_FromString(string ntype)
void nades_GiveBonus(entity player, float score)
Give a bonus grenade to a player.
void nades_RemovePlayer(entity this)
Remove nades and bonus nades from a player.
void nade_touch(entity this, entity toucher)
Nade nades_CheckTypes(Nade ntype)
void nade_burn_spawn(entity _nade)
#define NADE_TYPE_CHECK(nade_ent, nade_cvar)
void nade_beep(entity this)
void nade_timer_think(entity this)
Nade Nades_GetType(string ntype)
void nade_prime(entity this)
void toss_nade(entity e, bool set_owner, vector _velocity, float _time)
void nade_spawn(entity _nade)
float autocvar_g_nades_nade_minforce
int autocvar_g_nades_bonus_score_spree
int autocvar_g_nades_nade_newton_style
bool autocvar_g_nades_bonus_client_select
float autocvar_g_nades_nade_refire
bool autocvar_g_nades_override_dropweapon
float autocvar_g_nades_nade_lifetime
float autocvar_g_nades_pickup_time
bool autocvar_g_nades_bonus_onstrength
int autocvar_g_nades_bonus_score_time_flagcarrier
bool autocvar_g_nades_bonus_only
bool autocvar_g_nades_bonus
int autocvar_g_nades_bonus_score_time
float autocvar_g_nades_nade_health
bool autocvar_g_nades_onspawn
vector autocvar_g_nades_throw_offset
int autocvar_g_nades_bonus_max
float autocvar_g_nades_nade_maxforce
string autocvar_g_nades_bonus_type
int autocvar_g_nades_bonus_score_minor
bool autocvar_g_nades_pickup
int autocvar_g_nades_bonus_score_medium
bool autocvar_g_nades_client_select
string autocvar_g_nades_nade_type
int autocvar_g_nades_bonus_score_max
#define GameRules_scoring_is_vip(player)
vector Team_ColorRGB(int teamid)
vector W_CalculateProjectileVelocity(entity actor, vector pvelocity, vector mvelocity, float forceAbsolute)
int autocvar_g_projectiles_spread_style
#define W_SetupShot(ent, wepent, antilag, recoil, snd, chan, maxdamage, deathtype)
void nade_translocate_boom(entity this)
bool nade_translocate_DestroyDamage(entity this, entity attacker)
bool autocvar_g_nades_translocate
#define IS_REAL_CLIENT(v)
#define FOREACH_CLIENT(cond, body)
void nade_veil_Apply(entity player)
void nade_veil_boom(entity this)
bool autocvar_g_nades_veil
const int WEP_TYPE_MELEE_PRI
entity weaponentities[MAX_WEAPONSLOTS]
const int WEP_TYPE_MELEE_SEC
bool weaponLocked(entity player)