return;
vector org = self.origin + ((self.mins + self.maxs) * 0.5);
- entity e = spawn();
+ entity e = new(droppedweapon); // use weapon handling to remove it on touch
e.spawnfunc_checked = true;
e.monster_loot = self.monster_loot;
setorigin(e, org);
e.velocity = randomvec() * 175 + '0 0 325';
e.item_spawnshieldtime = time + 0.7;
- e.classname = "droppedweapon"; // use weapon handling to remove it on touch
SUB_SetFade(e, time + autocvar_g_monsters_drop_time, 1);
setself(this);
}
}
else
{
- oldself.think = SUB_Remove;
+ oldself.think = SUB_Remove_self;
oldself.nextthink = time;
}
}
if(delaytoo)
if(time < self.msound_delay)
return; // too early
- GlobalSound(self.(samplefield), chan, VOICETYPE_PLAYERSOUND);
+ GlobalSound_string(self.(samplefield), chan, VOICETYPE_PLAYERSOUND);
self.msound_delay = time + sound_delay;
}
void Monster_Remove(entity mon)
{
- int slot = 0;
+ .entity weaponentity = weaponentities[0];
if(!mon) { return; }
if(!MUTATOR_CALLHOOK(MonsterRemove, mon))
Send_Effect(EFFECT_ITEM_PICKUP, mon.origin, '0 0 0', 1);
- if(mon.weaponentity[slot]) { remove(mon.weaponentity[slot]); }
+ if(mon.(weaponentity)) { remove(mon.(weaponentity)); }
if(mon.iceblock) { remove(mon.iceblock); }
WaypointSprite_Kill(mon.sprite);
remove(mon);
return true;
}
-void Monster_Reset()
-{SELFPARAM();
- setorigin(self, self.pos1);
- self.angles = self.pos2;
+void Monster_Reset(entity this)
+{
+ setorigin(this, this.pos1);
+ this.angles = this.pos2;
- Unfreeze(self); // remove any icy remains
+ Unfreeze(this); // remove any icy remains
- self.health = self.max_health;
- self.velocity = '0 0 0';
- self.enemy = world;
- self.goalentity = world;
- self.attack_finished_single[0] = 0;
- self.moveto = self.origin;
+ this.health = this.max_health;
+ this.velocity = '0 0 0';
+ this.enemy = world;
+ this.goalentity = world;
+ this.attack_finished_single[0] = 0;
+ this.moveto = this.origin;
}
void Monster_Dead_Damage(entity inflictor, entity attacker, float damage, int deathtype, vector hitloc, vector force)
// number of monsters spawned with mobspawn command
totalspawned -= 1;
- self.think = SUB_Remove;
+ self.think = SUB_Remove_self;
self.nextthink = time + 0.1;
self.event_damage = func_null;
}
{
Violence_GibSplash(self, 1, 0.5, attacker);
- self.think = SUB_Remove;
+ self.think = SUB_Remove_self;
self.nextthink = time + 0.1;
}
}
self.movetype = MOVETYPE_FLY;
}
- if(mon.spawnflags & MONSTER_SIZE_BROKEN)
if(!(self.spawnflags & MONSTERFLAG_RESPAWNED))
- self.scale *= 1.3;
+ {
+ if(mon.spawnflags & MONSTER_SIZE_BROKEN)
+ self.scale *= 1.3;
+
+ if(mon.spawnflags & MONSTER_SIZE_QUAKE)
+ if(autocvar_g_monsters_quake_resize)
+ self.scale *= 1.3;
+ }
setsize(self, mon.mins * self.scale, mon.maxs * self.scale);