40 setattachment(
timer, _nade,
"");
41 timer.colormap = _nade.colormap;
42 timer.glowmod = _nade.glowmod;
45 timer.wait = _nade.wait;
46 timer.nade_lifetime = _nade.nade_lifetime;
82 orb.realowner = realown;
85 orb.orb_lifetime = orb_ltime;
86 orb.ltime =
time + orb.orb_lifetime;
87 orb.bot_dodge =
false;
88 orb.team = realown.team;
93 orb.orb_radius = orb_rad;
101 orb.nextthink =
time;
110 vector expcol_min =
'0 0 0', expcol_max =
'0 0 0';
114 if (!this.
takedamage || ntype == NADE_TYPE_Null)
118 ntype = NADE_TYPE_NORMAL;
121#define SET_NADE_EFFECT(nade_type, exp_effect, exp_color_min, exp_color_max) \
123 expef = exp_effect; \
124 expcol_min = exp_color_min; \
125 expcol_max = exp_color_max; \
130 SET_NADE_EFFECT(NADE_TYPE_NAPALM, EFFECT_EXPLOSION_MEDIUM,
'0 0 0',
'0 0 0');
131 SET_NADE_EFFECT(NADE_TYPE_ICE, EFFECT_ELECTRO_COMBO,
'0 0 0',
'0 0 0');
138 SET_NADE_EFFECT(NADE_TYPE_AMMO, EFFECT_SPAWN,
'0.33 0.33 1',
'0.33 0.33 1');
139 SET_NADE_EFFECT(NADE_TYPE_DARKNESS, EFFECT_EXPLOSION_MEDIUM,
'0 0 0',
'0 0 0');
142#undef SET_NADE_EFFECT
182 STAT(NADE_TIMER,
this) = 0;
185 this.
nade.nade_time_primed = thenade.nade_time_primed;
253 if(
STAT(NADE_BONUS_TYPE,
this) == NADE_TYPE_TRANSLOCATE.m_id ||
STAT(NADE_BONUS_TYPE,
this) == NADE_TYPE_SPAWN.m_id)
300 if(
STAT(NADE_BONUS_TYPE,
this) != NADE_TYPE_TRANSLOCATE.m_id &&
STAT(NADE_BONUS_TYPE,
this) != NADE_TYPE_SPAWN.m_id)
301 if(
STAT(NADE_BONUS_TYPE,
this) != NADE_TYPE_HEAL.m_id ||
IS_PLAYER(attacker))
344 if(
STAT(NADES_SMALL, e))
345 setsize(_nade,
'-8 -8 -8',
'8 8 8');
347 setsize(_nade,
'-16 -16 -16',
'16 16 16');
350 tracebox(_nade.origin, _nade.mins, _nade.maxs, _nade.origin,
MOVE_NOMONSTERS, _nade);
352 setorigin(_nade, e.origin);
355 _nade.velocity =
'0 0 100';
357 _nade.velocity = e.velocity + _velocity;
359 _nade.velocity = _velocity;
367 _nade.spawnshieldtime =
time + 0.1;
373 _nade.exteriormodeltoclient =
NULL;
374 _nade.traileffectnum = 0;
375 _nade.teleportable =
true;
376 _nade.pushable =
true;
379 _nade.damagedbycontents =
true;
385 _nade.projectiledeathtype = DEATH_NADE.m_id;
386 _nade.toss_time =
time;
389 if(
STAT(NADE_BONUS_TYPE, _nade) == NADE_TYPE_TRANSLOCATE.m_id
390 ||
STAT(NADE_BONUS_TYPE, _nade) == NADE_TYPE_SPAWN.m_id
391 ||
STAT(NADE_BONUS_TYPE, _nade) == NADE_TYPE_MONSTER.m_id)
401 _nade.nextthink = _time;
405 STAT(NADE_TIMER, e) = 0;
410#define NADE_TYPE_CHECK(nade_ent, nade_cvar) \
411 case nade_ent.m_id: \
418 case 0:
return NADE_TYPE_Null;
430 return NADE_TYPE_NORMAL;
431#undef NADE_TYPE_CHECK
440 if (!
STAT(FROZEN, player))
443 if (
STAT(NADE_BONUS_SCORE, player) < 1 )
446 if (
STAT(NADE_BONUS_SCORE, player) >= 1 )
450 STAT(NADE_BONUS, player)++;
451 STAT(NADE_BONUS_SCORE, player) -= 1;
459 STAT(NADE_BONUS, player) =
STAT(NADE_BONUS_SCORE, player) = 0;
497 FOREACH(Nades, it != NADE_TYPE_Null, {
506 FOREACH(Nades, it != NADE_TYPE_Null && (it.netname == ntype ||
ftos(it.impulse) == ntype),
510 return NADE_TYPE_Null;
516 if(ntype ==
"random" || ntype ==
"0")
519 return (def == NADE_TYPE_Null) ? NADE_TYPE_NORMAL : def;
528 n.pokenade_type = pntype;
530 STAT(NADE_BONUS_TYPE, n) = def.
m_id;
536 n.exteriormodeltoclient = player;
540 n.realowner = nowner;
541 n.colormap = player.colormap;
542 n.glowmod = player.glowmod;
544 n.nade_time_primed =
time;
546 n.nextthink =
max(n.wait - 3,
time);
547 n.projectiledeathtype = DEATH_NADE.m_id;
548 n.weaponentity_fld = weaponentity;
549 n.nade_lifetime = ntime;
554 fn.viewmodelforclient = player;
555 fn.realowner = fn.owner = player;
557 fn.colormap = player.colormap;
558 fn.glowmod = player.glowmod;
560 fn.nextthink = n.wait;
561 fn.weaponentity_fld = weaponentity;
565 player.fake_nade = fn;
587 else if (
STAT(NADE_BONUS,
this) >= 1)
591 STAT(NADE_BONUS,
this) -= 1;
598 pntype =
CS_CVAR(
this).cvar_cl_pokenade_type;
635 if (
time >= held_nade.nade_time_primed + 1) {
637 float _force =
time - held_nade.nade_time_primed;
652 delete(player.fake_nade);
654 player.nade = player.fake_nade =
NULL;
655 STAT(NADE_TIMER, player) = 0;
669 entity held_nade = player.nade;
672 if (!(
time > player.nade_refire))
return;
676 held_nade = player.nade;
678 }
else if (
time >= held_nade.nade_time_primed + 1) {
680 makevectors(player.v_angle);
681 float _force = time - held_nade.nade_time_primed;
682 _force /= autocvar_g_nades_nade_lifetime;
683 _force = autocvar_g_nades_nade_minforce + (_force * (autocvar_g_nades_nade_maxforce - autocvar_g_nades_nade_minforce));
684 vector dir = (v_forward * 0.7 + v_up * 0.2 + v_right * 0.1);
685 dir = W_CalculateSpread(dir, autocvar_g_nades_spread, autocvar_g_projectiles_spread_style, false);
686 toss_nade(player, false, dir * _force, 0);
720 entity held_nade = player.nade;
723 STAT(NADE_TIMER, player) =
bound(0, (
time - held_nade.nade_time_primed) / held_nade.nade_lifetime, 1);
726 held_nade.velocity = player.velocity;
727 setorigin(held_nade, player.origin + player.view_ofs +
v_forward * 8 +
v_right * -8 +
v_up * 0);
728 held_nade.angles_y = player.angles.y;
730 if (
time + 0.1 >= held_nade.wait)
757 player.pokenade_type =
CS_CVAR(player).cvar_cl_pokenade_type;
770 STAT(NADE_BONUS, player) =
STAT(NADE_BONUS_SCORE, player) = 0;
784 player.nade_refire =
time;
792 STAT(NADE_TIMER, player) = 0;
796 if(player.nade_spawnloc)
798 setorigin(player, player.nade_spawnloc.origin);
799 player.nade_spawnloc.cnt -= 1;
801 if(player.nade_spawnloc.cnt <= 0)
803 delete(player.nade_spawnloc);
804 player.nade_spawnloc =
NULL;
830 #define SPREE_ITEM(counta,countb,center,normal,gentle) \
831 case counta: { nades_GiveBonus(frag_attacker, autocvar_g_nades_bonus_score_spree); break; }
851 float frag_deathtype =
M_ARGV(3,
float);
854 if(
time - frag_inflictor.toss_time <= 0.1)
906 STAT(NADE_TIMER, client) =
STAT(NADE_TIMER, spectatee);
907 STAT(NADE_BONUS_TYPE, client) =
STAT(NADE_BONUS_TYPE, spectatee);
908 client.pokenade_type = spectatee.pokenade_type;
909 STAT(NADE_BONUS, client) =
STAT(NADE_BONUS, spectatee);
910 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)
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
#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
void nade_ice_boom(entity this)
bool autocvar_g_nades_ice
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)
bool autocvar_g_nades_heal
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)
#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
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)
entity nades_spawn_orb(entity own, entity realown, vector org, float orb_ltime, float orb_rad)
void nade_boom(entity this)
void spawn_held_nade(entity player, entity nowner, float ntime, string ntype, string pntype)
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)
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)
void nades_RemovePlayer(entity this)
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
float nade_show_particles
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)
entity vehicle
Entity to disply the shild effect on damage.
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)