#include <common/mapobjects/triggers.qh>
#include <common/monsters/all.qh>
#include <common/mutators/mutator/nades/nades.qh>
+#include <common/mutators/mutator/status_effects/_mod.qh>
#include <common/physics/movelib.qh>
#include <common/stats.qh>
#include <common/teams.qh>
|| (time < game_starttime) // monsters do nothing before match has started
|| (targ.takedamage == DAMAGE_NO)
|| (game_stopped)
- || (targ.items & IT_INVISIBILITY)
|| (IS_SPEC(targ) || IS_OBSERVER(targ)) // don't attack spectators
|| (!IS_VEHICLE(targ) && (IS_DEAD(targ) || IS_DEAD(this) || GetResource(targ, RES_HEALTH) <= 0 || GetResource(this, RES_HEALTH) <= 0))
|| (this.monster_follow == targ || targ.monster_follow == this)
//if(time < this.pain_finished && deathtype != DEATH_KILL.m_id)
//return;
- if(time < this.spawnshieldtime && deathtype != DEATH_KILL.m_id)
+ if(StatusEffects_active(STATUSEFFECT_SpawnShield, this) && deathtype != DEATH_KILL.m_id)
return;
if(deathtype == DEATH_FALL.m_id && this.draggedby != NULL)
bool reverse = false;
if(trace_fraction != 1.0)
reverse = true;
- if(trace_ent && IS_PLAYER(trace_ent) && !(trace_ent.items & ITEM_Strength.m_itemid))
+ if(trace_ent && IS_PLAYER(trace_ent))
reverse = false;
if(trace_ent && IS_MONSTER(trace_ent))
reverse = true;
else
setmodel(this, mon.m_model);
+ if(this.statuseffects && this.statuseffects.owner == this)
+ {
+ StatusEffects_clearall(this.statuseffects);
+ StatusEffects_update(this);
+ }
+ else
+ this.statuseffects = NULL;
+
this.flags = FL_MONSTER;
this.classname = "monster";
this.takedamage = DAMAGE_AIM;
this.use = Monster_Use;
this.solid = SOLID_BBOX;
set_movetype(this, MOVETYPE_WALK);
- this.spawnshieldtime = time + autocvar_g_monsters_spawnshieldtime;
+ StatusEffects_apply(STATUSEFFECT_SpawnShield, this, time + autocvar_g_monsters_spawnshieldtime, 0);
this.enemy = NULL;
this.velocity = '0 0 0';
this.moveto = this.origin;