else
{
dprint("Invalid monster drop item selected.\n");
- self = oldself;
- return;
}
self.gravity = 1;
+ self.noalign = TRUE;
setorigin(self, backuporigin);
self.velocity = randomvec() * 175 + '0 0 325';
entity FindTarget (entity ent)
{
if(MUTATOR_CALLHOOK(MonsterFindTarget)) { return ent.enemy; } // Handled by a mutator
- local entity e;
+ entity e;
+
for(e = world; (e = findflags(e, monster_attack, TRUE)); )
- {
- if(monster_isvalidtarget(e, ent))
- {
- return e;
- }
- }
+ if(monster_isvalidtarget(e, ent))
+ return e;
+
return world;
}
if(msound == "")
return; // sound doesn't exist
- sound(self, CH_PAIN_SINGLE, msound, VOL_BASE, ATTN_NORM);
+ sound(self, CHAN_AUTO, msound, VOL_BASE, ATTN_NORM);
self.msound_delay = time + sound_delay;
}
-void monster_precachesounds()
+void monster_precachesounds(entity e)
{
- precache_sound(self.msound_idle);
- precache_sound(self.msound_death);
- precache_sound(self.msound_attack_melee);
- precache_sound(self.msound_attack_ranged);
- precache_sound(self.msound_sight);
- precache_sound(self.msound_pain);
+ precache_sound(e.msound_idle);
+ precache_sound(e.msound_death);
+ precache_sound(e.msound_attack_melee);
+ precache_sound(e.msound_attack_ranged);
+ precache_sound(e.msound_sight);
+ precache_sound(e.msound_pain);
}
void monster_melee (entity targ, float damg, float er, float deathtype)
self.health += autocvar_g_monsters_miniboss_healthboost;
ScaleMonster(1.5);
self.flags |= MONSTERFLAG_MINIBOSS;
+ self.weapon = WEP_NEX;
if (r < 2 || self.team == NUM_TEAM_2)
{
if((ignore_turrets && !(attacker.turrcaps_flags & TFL_TURRCAPS_ISTURRET)) || !ignore_turrets)
if(monster_isvalidtarget(attacker, self))
self.enemy = attacker;
-
+
+ damage *= self.armorvalue;
+
self.health -= damage;
if(self.sprite)
if(self.sprite)
WaypointSprite_Kill(self.sprite);
+ if(self.weaponentity)
+ {
+ remove(self.weaponentity);
+ self.weaponentity = world;
+ }
+
monster_sound(self.msound_death, 0, FALSE);
if(!(self.spawnflags & MONSTERFLAG_SPAWNED) && !self.monster_respawned)
if(self.candrop && self.weapon)
W_ThrowNewWeapon(self, self.weapon, 0, self.origin, randomvec() * 150 + '0 0 325');
- if(self.flags & MONSTERFLAG_MINIBOSS && self.candrop && !self.weapon)
- W_ThrowNewWeapon(self, WEP_NEX, 0, self.origin, randomvec() * 150 + '0 0 325');
-
if(self.realowner.classname == "monster_spawner")
self.realowner.spawner_monstercount -= 1;
self.max_health = self.health;
self.pain_finished = self.nextthink;
- monster_precachesounds();
+ monster_precachesounds(self);
if(teamplay && self.team)
{
self.pos2 = self.angles;
self.candrop = TRUE;
+ if not(self.armorvalue)
+ self.armorvalue = 1;
+
if not(self.target_range)
self.target_range = autocvar_g_monsters_target_range;
{
Monster_CheckDropCvars ("soldier");
- remove(self.weaponentity);
-
self.solid = SOLID_NOT;
self.takedamage = DAMAGE_NO;
self.event_damage = func_null;
self.movetype = MOVETYPE_TOSS;
self.think = Monster_Fade;
self.nextthink = time + 2.1;
- self.weaponentity = world;
if (random() < 0.5)
self.frame = soldier_anim_die1;
{
self.weapon = WEP_ROCKET_LAUNCHER;
self.currentammo = self.ammo_rockets;
- self.armorvalue = 10;
+ self.armorvalue = 0.9;
self.attack_ranged = soldier_missile_rl;
}
else if (RandomSelection_chosen_float == WEP_UZI)
{
self.weapon = WEP_UZI;
self.currentammo = self.ammo_nails;
- self.armorvalue = 100;
+ self.armorvalue = 0.5;
self.attack_ranged = soldier_missile_uzi;
}
else if (RandomSelection_chosen_float == WEP_SHOTGUN)
{
self.weapon = WEP_SHOTGUN;
self.currentammo = self.ammo_shells;
- self.armorvalue = 25;
+ self.armorvalue = 0.7;
self.attack_ranged = soldier_missile_shotgun;
}
else
{
self.weapon = WEP_LASER;
- self.armorvalue = 60;
+ self.armorvalue = 0.6;
self.currentammo = self.ammo_none;
self.attack_ranged = soldier_missile_laser;
}