#include "nades.qh"
-#ifdef IMPLEMENTATION
-
#ifdef SVQC
bool autocvar_g_nades_nade_small;
float autocvar_g_nades_spread = 0.04;
REGISTER_STAT(NADES_SMALL, int, autocvar_g_nades_nade_small)
-#ifndef MENUQC
+#ifdef GAMEQC
entity Nade_TrailEffect(int proj, int nade_team)
{
switch (proj)
#ifdef SVQC
-#include <common/gamemodes/all.qh>
-#include <common/monsters/spawn.qh>
+#include <common/gamemodes/_mod.qh>
+#include <common/monsters/sv_spawn.qh>
#include <common/monsters/sv_monsters.qh>
#include <server/g_subs.qh>
if(d < dist)
{
e.fireball_impactvec = p;
- RandomSelection_Add(e, 0, string_null, 1 / (1 + d), !Fire_IsBurning(e));
+ RandomSelection_AddEnt(e, 1 / (1 + d), !Fire_IsBurning(e));
}
}
if(RandomSelection_chosen_ent)
proj.angles = vectoangles(proj.velocity);
proj.flags = FL_PROJECTILE;
+ IL_PUSH(g_projectiles, proj);
+ IL_PUSH(g_bot_dodge, proj);
proj.missile_flags = MIF_SPLASH | MIF_PROXY | MIF_ARC;
//CSQCProjectile(proj, true, PROJECTILE_NAPALM_FIRE, true);
fountain.owner = this.owner;
fountain.realowner = this.realowner;
fountain.origin = this.origin;
+ fountain.flags = FL_PROJECTILE;
+ IL_PUSH(g_projectiles, fountain);
+ IL_PUSH(g_bot_dodge, fountain);
setorigin(fountain, fountain.origin);
setthink(fountain, napalm_fountain_think);
fountain.nextthink = time;
case NADE_TYPE_ENTRAP: nade_entrap_boom(this); break;
}
- FOREACH_ENTITY_ENT(aiment, this,
+ IL_EACH(g_projectiles, it.classname == "grapplinghook" && it.aiment == this,
{
- if(it.classname == "grapplinghook")
- RemoveGrapplingHook(it.realowner);
+ RemoveGrapplingHook(it.realowner);
});
delete(this);
is_weapclip = 1;*/
if(ITEM_TOUCH_NEEDKILL()) // || is_weapclip)
{
- FOREACH_ENTITY_ENT(aiment, this,
+ IL_EACH(g_projectiles, it.classname == "grapplinghook" && it.aiment == this,
{
- if(it.classname == "grapplinghook")
- RemoveGrapplingHook(it.realowner);
+ RemoveGrapplingHook(it.realowner);
});
delete(this);
return;
makevectors(e.v_angle);
- W_SetupShot(e, false, false, SND_Null, CH_WEAPON_A, 0);
+ // NOTE: always throw from first weapon entity?
+ W_SetupShot(e, weaponentities[0], false, false, SND_Null, CH_WEAPON_A, 0);
Kill_Notification(NOTIF_ONE_ONLY, e, MSG_CENTER, CPID_NADES);
setsize(_nade, '-16 -16 -16', '16 16 16');
set_movetype(_nade, MOVETYPE_BOUNCE);
- tracebox(_nade.origin, _nade.mins, _nade.maxs, _nade.origin, false, _nade);
+ tracebox(_nade.origin, _nade.mins, _nade.maxs, _nade.origin, MOVE_NOMONSTERS, _nade);
if (trace_startsolid)
setorigin(_nade, e.origin);
_nade.damagedbycontents = true;
_nade.angles = vectoangles(_nade.velocity);
_nade.flags = FL_PROJECTILE;
+ IL_PUSH(g_projectiles, _nade);
+ IL_PUSH(g_bot_dodge, _nade);
_nade.projectiledeathtype = DEATH_NADE.m_id;
_nade.toss_time = time;
_nade.solid = SOLID_CORPSE; //((_nade.nade_type == NADE_TYPE_TRANSLOCATE) ? SOLID_CORPSE : SOLID_BBOX);
if (held_nade)
{
player.nade_timer = bound(0, (time - held_nade.nade_time_primed) / autocvar_g_nades_nade_lifetime, 1);
- // LOG_TRACEF("%d %d\n", player.nade_timer, time - held_nade.nade_time_primed);
+ // LOG_TRACEF("%d %d", player.nade_timer, time - held_nade.nade_time_primed);
makevectors(player.angles);
held_nade.velocity = player.velocity;
setorigin(held_nade, player.origin + player.view_ofs + v_forward * 8 + v_right * -8 + v_up * 0);
MUTATOR_HOOKFUNCTION(nades, DropSpecialItems)
{
entity frag_target = M_ARGV(0, entity);
-
+
if(frag_target.nade)
toss_nade(frag_target, true, '0 0 0', time + 0.05);
}
}
#endif
-#endif