.float() attack_ranged;
.float() checkattack;
+.float candrop;
+
.float spawner_monstercount;
.float monster_respawned; // used to make sure we're not recounting respawned monster stats
void Monster_CheckDropCvars (string mon)
{
+ if not(self.candrop)
+ return; // forced off
+
string dropitem;
string dropsize;
void monsters_damage (entity inflictor, entity attacker, float damage, float deathtype, vector hitloc, vector force)
{
- if(self.frozen)
+ if(self.frozen && deathtype != DEATH_KILL)
return;
- if(time < self.pain_finished)
+ if(time < self.pain_finished && deathtype != DEATH_KILL)
return;
if((ignore_turrets && !(attacker.turrcaps_flags & TFL_TURRCAPS_ISTURRET)) || !ignore_turrets)
WaypointSprite_UpdateHealth(self.sprite, 0);
}
- if(self.flags & MONSTERFLAG_MINIBOSS) // TODO: cvarise the weapon drop?
+ if(deathtype == DEATH_KILL)
+ self.candrop = FALSE; // killed by mobkill command
+
+ if(self.flags & MONSTERFLAG_MINIBOSS && self.candrop)
W_ThrowNewWeapon(self, WEP_NEX, 0, self.origin, self.velocity);
activator = attacker;
self.moveto = self.origin;
self.pos1 = self.origin;
self.pos2 = self.angles;
+ self.candrop = TRUE;
if not(self.target_range)
self.target_range = autocvar_g_monsters_target_range;
remove(self.weaponentity);
self.weaponentity = world;
- if (self.attack_ranged == enf_missile_rocket)
- W_ThrowNewWeapon(self, WEP_ROCKET_LAUNCHER, 0, self.origin, self.velocity);
- else if (self.attack_ranged == enf_missile_plasma)
- W_ThrowNewWeapon(self, WEP_ELECTRO, 0, self.origin, self.velocity);
- else if (self.attack_ranged == enf_missile_shotgun)
- W_ThrowNewWeapon(self, WEP_SHOTGUN, 0, self.origin, self.velocity);
- else if (self.attack_ranged == enf_missile_uzi)
- W_ThrowNewWeapon(self, WEP_UZI, 0, self.origin, self.velocity);
- else
- W_ThrowNewWeapon(self, WEP_LASER, 0, self.origin, self.velocity);
+ if(self.candrop)
+ {
+ if (self.attack_ranged == enf_missile_rocket)
+ W_ThrowNewWeapon(self, WEP_ROCKET_LAUNCHER, 0, self.origin, self.velocity);
+ else if (self.attack_ranged == enf_missile_plasma)
+ W_ThrowNewWeapon(self, WEP_ELECTRO, 0, self.origin, self.velocity);
+ else if (self.attack_ranged == enf_missile_shotgun)
+ W_ThrowNewWeapon(self, WEP_SHOTGUN, 0, self.origin, self.velocity);
+ else if (self.attack_ranged == enf_missile_uzi)
+ W_ThrowNewWeapon(self, WEP_UZI, 0, self.origin, self.velocity);
+ else
+ W_ThrowNewWeapon(self, WEP_LASER, 0, self.origin, self.velocity);
+ }
self.frame = enforcer_anim_stop;
self.nextthink = time + 2.1;
if(chance < 0.10 || self.flags & MONSTERFLAG_MINIBOSS)
+ if(self.candrop)
{
self.superweapons_finished = time + autocvar_g_balance_superweapons_time + 5; // give the player a few seconds to find the weapon
W_ThrowNewWeapon(self, WEP_FIREBALL, 0, self.origin, self.velocity);
self.movetype = MOVETYPE_TOSS;
self.think = Monster_Fade;
- W_ThrowNewWeapon(self, WEP_GRENADE_LAUNCHER, 0, self.origin, self.velocity);
+ if(self.candrop)
+ W_ThrowNewWeapon(self, WEP_GRENADE_LAUNCHER, 0, self.origin, self.velocity);
if (random() < 0.5)
self.frame = ogre_anim_death1;
else
{
Monster_CheckDropCvars ("shambler");
- W_ThrowNewWeapon(self, WEP_NEX, 0, self.origin, self.velocity);
+ if(self.candrop)
+ W_ThrowNewWeapon(self, WEP_NEX, 0, self.origin, self.velocity);
self.think = Monster_Fade;
self.solid = SOLID_NOT;
self.nextthink = time + 2.1;
self.weaponentity = world;
- if (self.attack_ranged == soldier_missile_uzi)
- W_ThrowNewWeapon(self, WEP_UZI, 0, self.origin, self.velocity);
- else if (self.attack_ranged == soldier_missile_shotgun)
- W_ThrowNewWeapon(self, WEP_SHOTGUN, 0, self.origin, self.velocity);
- else if (self.attack_ranged == soldier_missile_rl)
- W_ThrowNewWeapon(self, WEP_ROCKET_LAUNCHER, 0, self.origin, self.velocity);
- else
- W_ThrowNewWeapon(self, WEP_LASER, 0, self.origin, self.velocity);
+ if(self.candrop)
+ {
+ if (self.attack_ranged == soldier_missile_uzi)
+ W_ThrowNewWeapon(self, WEP_UZI, 0, self.origin, self.velocity);
+ else if (self.attack_ranged == soldier_missile_shotgun)
+ W_ThrowNewWeapon(self, WEP_SHOTGUN, 0, self.origin, self.velocity);
+ else if (self.attack_ranged == soldier_missile_rl)
+ W_ThrowNewWeapon(self, WEP_ROCKET_LAUNCHER, 0, self.origin, self.velocity);
+ else
+ W_ThrowNewWeapon(self, WEP_LASER, 0, self.origin, self.velocity);
+ }
if (random() < 0.5)
self.frame = soldier_anim_die1;
local entity missile;
local vector dir = '0 0 0';
local float dist = 0, flytime = 0;
+
+ self.attack_finished_single = time + 0.2;
dir = normalize((self.enemy.origin + '0 0 10') - self.origin);
dist = vlen (self.enemy.origin - self.origin);