#include "mutator_nades.qh"
-#include "../_all.qh"
#include "mutator.qh"
#include "gamemode_keyhunt.qh"
#include "gamemode_freezetag.qh"
-#include "../../common/nades.qh"
+#include "../../common/nades/all.qh"
+#include "../../common/gamemodes/all.qh"
#include "../../common/monsters/spawn.qh"
#include "../../common/monsters/sv_monsters.qh"
+#include "../g_subs.qh"
.float nade_time_primed;
void nade_burn_spawn(entity _nade)
{
- CSQCProjectile(_nade, true, NADES[_nade.nade_type].m_projectile[true], true);
+ CSQCProjectile(_nade, true, Nades[_nade.nade_type].m_projectile[true], true);
}
void nade_spawn(entity _nade)
_nade.effects |= EF_LOWPRECISION;
- CSQCProjectile(_nade, true, NADES[_nade.nade_type].m_projectile[false], true);
+ CSQCProjectile(_nade, true, Nades[_nade.nade_type].m_projectile[false], true);
}
void napalm_damage(float dist, float damage, float edgedamage, float burntime)
proj.bot_dodge = true;
proj.bot_dodgerating = autocvar_g_nades_napalm_ball_damage;
proj.movetype = MOVETYPE_BOUNCE;
- proj.projectiledeathtype = DEATH_NADE_NAPALM;
+ proj.projectiledeathtype = DEATH_NADE_NAPALM.m_id;
PROJECTILE_MAKETRIGGER(proj);
setmodel(proj, MDL_Null);
proj.scale = 1;//0.5;
fountain.pushltime = fountain.ltime;
fountain.team = self.team;
fountain.movetype = MOVETYPE_TOSS;
- fountain.projectiledeathtype = DEATH_NADE_NAPALM;
+ fountain.projectiledeathtype = DEATH_NADE_NAPALM.m_id;
fountain.bot_dodge = true;
fountain.bot_dodgerating = autocvar_g_nades_napalm_fountain_damage;
fountain.nade_special_time = time;
fountain.pushltime = fountain.wait = fountain.ltime;
fountain.team = self.team;
fountain.movetype = MOVETYPE_TOSS;
- fountain.projectiledeathtype = DEATH_NADE_ICE;
+ fountain.projectiledeathtype = DEATH_NADE_ICE.m_id;
fountain.bot_dodge = false;
setsize(fountain, '-16 -16 -16', '16 16 16');
fountain.nade_special_time = time+0.3;
}
else if ( health_factor < 0 )
{
- Damage(other,self,self.realowner,-health_factor,DEATH_NADE_HEAL,other.origin,'0 0 0');
+ Damage(other,self,self.realowner,-health_factor,DEATH_NADE_HEAL.m_id,other.origin,'0 0 0');
}
}
entity expef = NULL;
bool nade_blast = true;
- switch ( NADES[self.nade_type] )
+ switch ( Nades[self.nade_type] )
{
case NADE_TYPE_NAPALM:
nade_blast = autocvar_g_nades_napalm_blast;
}
if(self.takedamage)
- switch ( NADES[self.nade_type] )
+ switch ( Nades[self.nade_type] )
{
case NADE_TYPE_NAPALM: nade_napalm_boom(); break;
case NADE_TYPE_ICE: nade_ice_boom(); break;
if(self.nade_type == NADE_TYPE_TRANSLOCATE.m_id || self.nade_type == NADE_TYPE_SPAWN.m_id)
return;
- if(DEATH_ISWEAPON(deathtype, WEP_BLASTER.m_id))
+ if(DEATH_ISWEAPON(deathtype, WEP_BLASTER))
{
force *= 1.5;
damage = 0;
}
- if(DEATH_ISWEAPON(deathtype, WEP_VAPORIZER.m_id) && (deathtype & HITTYPE_SECONDARY))
+ if(DEATH_ISWEAPON(deathtype, WEP_VAPORIZER) && (deathtype & HITTYPE_SECONDARY))
{
force *= 0.5; // too much
frag_damage = 0;
}
- if(DEATH_ISWEAPON(deathtype, WEP_VORTEX.m_id) || DEATH_ISWEAPON(deathtype, WEP_VAPORIZER.m_id))
+ if(DEATH_ISWEAPON(deathtype, WEP_VORTEX) || DEATH_ISWEAPON(deathtype, WEP_VAPORIZER))
{
force *= 6;
damage = self.max_health * 0.55;
}
- if(DEATH_ISWEAPON(deathtype, WEP_MACHINEGUN.m_id) || DEATH_ISWEAPON(deathtype, WEP_HMG.m_id))
+ if(DEATH_ISWEAPON(deathtype, WEP_MACHINEGUN) || DEATH_ISWEAPON(deathtype, WEP_HMG))
damage = self.max_health * 0.1;
- if(DEATH_ISWEAPON(deathtype, WEP_SHOCKWAVE.m_id) || DEATH_ISWEAPON(deathtype, WEP_SHOTGUN.m_id)) // WEAPONTODO
+ if(DEATH_ISWEAPON(deathtype, WEP_SHOCKWAVE) || DEATH_ISWEAPON(deathtype, WEP_SHOTGUN)) // WEAPONTODO
if(deathtype & HITTYPE_SECONDARY)
{
damage = self.max_health * 0.1;
_nade.damagedbycontents = true;
_nade.angles = vectoangles(_nade.velocity);
_nade.flags = FL_PROJECTILE;
- _nade.projectiledeathtype = DEATH_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);
{
//self.effects = EF_ADDITIVE | EF_FULLBRIGHT | EF_LOWPRECISION;
if(!self.traileffectnum)
- self.traileffectnum = _particleeffectnum(Nade_TrailEffect(NADES[self.nade_type].m_projectile[false], self.team).eent_eff_name);
+ self.traileffectnum = _particleeffectnum(Nade_TrailEffect(Nades[self.nade_type].m_projectile[false], self.team).eent_eff_name);
self.alpha = 1;
}
n.pokenade_type = ((autocvar_g_nades_client_select) ? self.cvar_cl_pokenade_type : autocvar_g_nades_pokenade_monster_type);
}
- n.nade_type = bound(1, n.nade_type, NADES_COUNT);
+ n.nade_type = bound(1, n.nade_type, Nades_COUNT);
setmodel(n, MDL_PROJECTILE_NADE);
//setattachment(n, self, "bip01 l hand");
n.exteriormodeltoclient = self;
n.customizeentityforclient = nade_customize;
- n.traileffectnum = _particleeffectnum(Nade_TrailEffect(NADES[n.nade_type].m_projectile[false], self.team).eent_eff_name);
- n.colormod = NADES[n.nade_type].m_color;
+ n.traileffectnum = _particleeffectnum(Nade_TrailEffect(Nades[n.nade_type].m_projectile[false], self.team).eent_eff_name);
+ n.colormod = Nades[n.nade_type].m_color;
n.realowner = self;
n.colormap = self.colormap;
n.glowmod = self.glowmod;
n.nade_time_primed = time;
n.think = nade_beep;
n.nextthink = max(n.wait - 3, time);
- n.projectiledeathtype = DEATH_NADE;
+ n.projectiledeathtype = DEATH_NADE.m_id;
setmodel(fn, MDL_NADE_VIEW);
setattachment(fn, self.weaponentity, "");
fn.realowner = fn.owner = self;
- fn.colormod = NADES[n.nade_type].m_color;
+ fn.colormod = Nades[n.nade_type].m_color;
fn.colormap = self.colormap;
fn.glowmod = self.glowmod;
fn.think = SUB_Remove;
MUTATOR_HOOKFUNCTION(nades_CheckThrow)
{
- if (self.offhand != OFFHAND_NADE || (self.weapons & WEPSET(HOOK))) {
+ if (self.offhand != OFFHAND_NADE || (self.weapons & WEPSET(HOOK)) || autocvar_g_nades_override_dropweapon) {
nades_CheckThrow();
return true;
}
{SELFPARAM();
if (!IS_PLAYER(self)) { return false; }
- if (self.nade && self.offhand != OFFHAND_NADE) OFFHAND_NADE.offhand_think(OFFHAND_NADE, self, self.nade_altbutton);
+ if (self.nade && (self.offhand != OFFHAND_NADE || (self.weapons & WEPSET(HOOK)))) OFFHAND_NADE.offhand_think(OFFHAND_NADE, self, self.nade_altbutton);
if(IS_PLAYER(self))
{
self.pokenade_type = autocvar_g_nades_pokenade_monster_type;
}
- self.nade_type = bound(1, self.nade_type, NADES_COUNT);
+ self.nade_type = bound(1, self.nade_type, Nades_COUNT);
if(self.bonus_nade_score >= 0 && autocvar_g_nades_bonus_score_max)
nades_GiveBonus(self, time_score / autocvar_g_nades_bonus_score_max);
if(frag_target.frozen)
if(autocvar_g_freezetag_revive_nade)
if(frag_attacker == frag_target)
- if(frag_deathtype == DEATH_NADE)
+ if(frag_deathtype == DEATH_NADE.m_id)
if(time - frag_inflictor.toss_time <= 0.1)
{
Unfreeze(frag_target);