]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/common/monsters/sv_monsters.qc
Merge branch 'master' into TimePath/deathtypes
[xonotic/xonotic-data.pk3dir.git] / qcsrc / common / monsters / sv_monsters.qc
index e42908fbd5118f2b4cd27005d98a87c4e26ff91f..1155c6427108eb51320c3c382e3789d3e2b52683 100644 (file)
@@ -10,7 +10,7 @@
     #include "../weapons/all.qh"
     #include "../../server/autocvars.qh"
     #include "../../server/defs.qh"
-    #include "../deathtypes.qh"
+    #include "../deathtypes/all.qh"
     #include "../../server/mutators/mutators_include.qh"
        #include "../../server/steerlib.qh"
        #include "../turrets/sv_turrets.qh"
@@ -742,7 +742,7 @@ void Monster_Move(float runspeed, float walkspeed, float stpspeed)
                        Unfreeze(self);
                        self.health = 0;
                        if(self.event_damage)
-                               self.event_damage(self, self.frozen_by, 1, DEATH_NADE_ICE_FREEZE, self.origin, '0 0 0');
+                               self.event_damage(self, self.frozen_by, 1, DEATH_NADE_ICE_FREEZE.m_id, self.origin, '0 0 0');
                }
 
                else if ( self.revive_progress <= 0 )
@@ -759,7 +759,7 @@ void Monster_Move(float runspeed, float walkspeed, float stpspeed)
                        {
                                self.last_trace = time + 0.4;
 
-                               Damage (self, world, world, 2, DEATH_DROWN, self.origin, '0 0 0');
+                               Damage (self, world, world, 2, DEATH_DROWN.m_id, self.origin, '0 0 0');
                                self.angles = '90 90 0';
                                if(random() < 0.5)
                                {
@@ -1046,19 +1046,19 @@ void Monster_Dead(entity attacker, float gibbed)
 
 void Monster_Damage(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
 {SELFPARAM();
-       if((self.spawnflags & MONSTERFLAG_INVINCIBLE) && deathtype != DEATH_KILL && !ITEM_DAMAGE_NEEDKILL(deathtype))
+       if((self.spawnflags & MONSTERFLAG_INVINCIBLE) && deathtype != DEATH_KILL.m_id && !ITEM_DAMAGE_NEEDKILL(deathtype))
                return;
 
-       if(self.frozen && deathtype != DEATH_KILL && deathtype != DEATH_NADE_ICE_FREEZE)
+       if(self.frozen && deathtype != DEATH_KILL.m_id && deathtype != DEATH_NADE_ICE_FREEZE.m_id)
                return;
 
-       //if(time < self.pain_finished && deathtype != DEATH_KILL)
+       //if(time < self.pain_finished && deathtype != DEATH_KILL.m_id)
                //return;
 
-       if(time < self.spawnshieldtime && deathtype != DEATH_KILL)
+       if(time < self.spawnshieldtime && deathtype != DEATH_KILL.m_id)
                return;
 
-       if(deathtype == DEATH_FALL && self.draggedby != world)
+       if(deathtype == DEATH_FALL.m_id && self.draggedby != world)
                return;
 
        vector v;
@@ -1086,12 +1086,12 @@ void Monster_Damage(entity inflictor, entity attacker, float damage, int deathty
 
        self.dmg_time = time;
 
-       if(sound_allowed(MSG_BROADCAST, attacker) && deathtype != DEATH_DROWN)
+       if(sound_allowed(MSG_BROADCAST, attacker) && deathtype != DEATH_DROWN.m_id)
                spamsound (self, CH_PAIN, SND(BODYIMPACT1), VOL_BASE, ATTEN_NORM);  // FIXME: PLACEHOLDER
 
        self.velocity += force * self.damageforcescale;
 
-       if(deathtype != DEATH_DROWN && take)
+       if(deathtype != DEATH_DROWN.m_id && take)
        {
                Violence_GibSplash_At(hitloc, force, 2, bound(0, take, 200) / 16, self, attacker);
                if (take > 50)
@@ -1102,7 +1102,7 @@ void Monster_Damage(entity inflictor, entity attacker, float damage, int deathty
 
        if(self.health <= 0)
        {
-               if(deathtype == DEATH_KILL)
+               if(deathtype == DEATH_KILL.m_id)
                        self.candrop = false; // killed by mobkill command
 
                // TODO: fix this?
@@ -1111,14 +1111,14 @@ void Monster_Damage(entity inflictor, entity attacker, float damage, int deathty
                SUB_UseTargets();
                self.target2 = self.oldtarget2; // reset to original target on death, incase we respawn
 
-               Monster_Dead(attacker, (self.health <= -100 || deathtype == DEATH_KILL));
+               Monster_Dead(attacker, (self.health <= -100 || deathtype == DEATH_KILL.m_id));
 
                WaypointSprite_Kill(self.sprite);
 
                frag_target = self;
                MUTATOR_CALLHOOK(MonsterDies, attacker);
 
-               if(self.health <= -100 || deathtype == DEATH_KILL) // check if we're already gibbed
+               if(self.health <= -100 || deathtype == DEATH_KILL.m_id) // check if we're already gibbed
                {
                        Violence_GibSplash(self, 1, 0.5, attacker);
 
@@ -1229,7 +1229,7 @@ void Monster_Think()
        if(self.monster_lifetime)
        if(time >= self.monster_lifetime)
        {
-               Damage(self, self, self, self.health + self.max_health, DEATH_KILL, self.origin, self.origin);
+               Damage(self, self, self, self.health + self.max_health, DEATH_KILL.m_id, self.origin, self.origin);
                return;
        }