#include "sv_monsters.qh"
+#include <common/constants.qh>
+#include <common/deathtypes/all.qh>
+#include <common/items/_mod.qh>
+#include <common/mapobjects/teleporters.qh>
+#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>
+#include <common/turrets/sv_turrets.qh>
+#include <common/turrets/util.qh>
+#include <common/util.qh>
+#include <common/vehicles/all.qh>
+#include <common/weapons/_all.qh>
+#include <common/weapons/_mod.qh>
+#include <lib/csqcmodel/sv_model.qh>
#include <lib/warpzone/common.qh>
-#include "../constants.qh"
-#include "../teams.qh"
-#include "../util.qh"
-#include "all.qh"
-#include "../physics/movelib.qh"
-#include "../weapons/_mod.qh"
-#include <server/autocvars.qh>
-#include <server/defs.qh>
-#include <server/g_damage.qh>
-#include "../deathtypes/all.qh"
-#include <server/items/items.qh>
-#include <server/mutators/_mod.qh>
-#include <server/steerlib.qh>
-#include <server/sv_main.qh>
-#include "../turrets/sv_turrets.qh"
-#include "../turrets/util.qh"
-#include "../vehicles/all.qh"
#include <server/campaign.qh>
#include <server/cheats.qh>
+#include <server/client.qh>
#include <server/command/_mod.qh>
-#include <common/mapobjects/teleporters.qh>
-#include "../mapobjects/triggers.qh"
-#include <lib/csqcmodel/sv_model.qh>
+#include <server/damage.qh>
+#include <server/items/items.qh>
+#include <server/mutators/_mod.qh>
#include <server/round_handler.qh>
+#include <server/steerlib.qh>
#include <server/weapons/_mod.qh>
void monsters_setstatus(entity this)
|| (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(Monster_ValidTarget(this, it))
{
- // if it's a player, use the view origin as reference (stolen from RadiusDamage functions in g_damage.qc)
+ // if it's a player, use the view origin as reference (stolen from RadiusDamage functions in damage.qc)
vector targ_center = CENTER_OR_VIEWOFS(it);
if(closest_target)
void Monster_Delay(entity this, int repeat_count, float defer_amnt, void(entity) func)
{
// deferred attacking, checks if monster is still alive and target is still valid before attacking
- entity e = spawn();
+ entity e = new_pure(Monster_Delay);
setthink(e, Monster_Delay_Action);
e.nextthink = time + defer_amnt;
//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;