set g_monster_brute_speed_run 200
set g_monster_brute_speed_stop 300
set g_monster_brute_speed_walk 100
-
-set g_monster_brute_drop ammo
-set g_monster_brute_drop_size bullets
// }}}
// {{{ #2: Animus
set g_monster_animus_attack_jump_damage 80
set g_monster_animus_speed_run 350
set g_monster_animus_speed_stop 100
set g_monster_animus_speed_walk 150
-
-set g_monster_animus_drop health
-set g_monster_animus_drop_size medium
// }}}
// {{{ #3: Shambler
set g_monster_shambler_attack_claw_damage 50
set g_monster_shambler_speed_run 150
set g_monster_shambler_speed_stop 300
set g_monster_shambler_speed_walk 100
-
-set g_monster_shambler_drop health
-set g_monster_shambler_drop_size large
// }}}
// {{{ #4: Bruiser
set g_monster_bruiser_attack_melee_damage 50
set g_monster_bruiser_speed_run 360
set g_monster_bruiser_speed_stop 50
set g_monster_bruiser_speed_walk 40
-
-set g_monster_bruiser_drop armor
-set g_monster_bruiser_drop_size medium
// }}}
// {{{ #5: Wyvern
set g_monster_wyvern_attack_fireball_damage 30
set g_monster_wyvern_speed_run 120
set g_monster_wyvern_speed_stop 300
set g_monster_wyvern_speed_walk 40
-
-set g_monster_wyvern_drop ammo
-set g_monster_wyvern_drop_size cells
// }}}
// {{{ #6: Cerberus
set g_monster_cerberus_attack_bite_damage 30
set g_monster_cerberus_speed_run 250
set g_monster_cerberus_speed_stop 50
set g_monster_cerberus_speed_walk 60
-
-set g_monster_cerberus_drop health
-set g_monster_cerberus_drop_size small
// }}}
// {{{ #7: Slime
set g_monster_slime_attack_explode_damage 250
set g_monster_slime_speed_run 400
set g_monster_slime_speed_stop 20
set g_monster_slime_speed_walk 20
-
-set g_monster_slime_drop ammo
-set g_monster_slime_drop_size rockets
// }}}
// {{{ #8: Knight
set g_monster_knight_attack_fireball_chance 0.3
set g_monster_knight_speed_run 150
set g_monster_knight_speed_stop 100
set g_monster_knight_speed_walk 75
-
-set g_monster_knight_drop armor
-set g_monster_knight_drop_size medium
// }}}
// {{{ #9: Stingray
set g_monster_stingray_attack_bite_damage 25
set g_monster_stingray_speed_run 200
set g_monster_stingray_speed_stop 10
set g_monster_stingray_speed_walk 40
-
-set g_monster_stingray_drop health
-set g_monster_stingray_drop_size small
// }}}
// {{{ #10: Mage
set g_monster_mage_attack_grenade_chance 30
set g_monster_mage_speed_run 75
set g_monster_mage_speed_stop 50
set g_monster_mage_speed_walk 50
-
-set g_monster_mage_drop health
-set g_monster_mage_drop_size medium
// }}}
// {{{ #11: Zombie
set g_monster_zombie_attack_leap_damage 50
set g_monster_zombie_speed_run 400
set g_monster_zombie_speed_stop 100
set g_monster_zombie_speed_walk 150
-
-set g_monster_zombie_drop health
-set g_monster_zombie_drop_size large
// }}}
// {{{ #12: Spider
set g_monster_spider_attack_bite_damage 35
set g_monster_spider_speed_run 400
set g_monster_spider_speed_stop 100
set g_monster_spider_speed_walk 150
-
-set g_monster_spider_drop health
-set g_monster_spider_drop_size large
// }}}
// {{{ Misc
set g_monsters_skill 1 "Monster skill (affecting some of their attributes). 1 - easy, 2 - medium, 3 - hard, 4 - insane, 5 - nightmare"
set g_monsters_miniboss_chance 5
set g_monsters_miniboss_healthboost 100
-set g_monsters_forcedrop 0
set g_monsters_drop_time 10
-set g_monsters_drop_type armor "Type of item to drop when forced. Possible values are: health, armor, ammo"
-set g_monsters_drop_size medium "Size of the item monsters drop. Possible health/amor values are: small, medium, large. Possible ammo values are: shells, bullets, cells, rockets"
set g_monsters_owners 1
set g_monsters_teams 1
set g_monsters_spawnshieldtime 2
SUB_SetFade(self, time + autocvar_g_monsters_drop_time, 1);
}
-void Monster_DropItem (string itype, string itemsize)
+void monster_dropitem()
{
+ if(!self.candrop || !self.monster_loot)
+ return;
+
vector org = self.origin + ((self.mins + self.maxs) * 0.5);
entity e = spawn();
setorigin(e, org);
- switch(itype)
- {
- case "armor":
- {
- switch(itemsize)
- {
- case "mega": e.monster_loot = spawnfunc_item_armor_large; break;
- case "large": e.monster_loot = spawnfunc_item_armor_big; break;
- case "medium": e.monster_loot = spawnfunc_item_armor_medium; break;
- case "small": e.monster_loot = spawnfunc_item_armor_small; break;
- }
- break;
- }
- case "health":
- {
- switch(itemsize)
- {
- case "mega": e.monster_loot = spawnfunc_item_health_mega; break;
- case "large": e.monster_loot = spawnfunc_item_health_large; break;
- case "medium": e.monster_loot = spawnfunc_item_health_medium; break;
- case "small": e.monster_loot = spawnfunc_item_health_small; break;
- }
- break;
- }
- case "ammo":
- {
- switch(itemsize)
- {
- case "shells": e.monster_loot = spawnfunc_item_shells; break;
- case "cells": e.monster_loot = spawnfunc_item_cells; break;
- case "rockets": e.monster_loot = spawnfunc_item_rockets; break;
- case "bullets":
- case "nails": e.monster_loot = spawnfunc_item_bullets; break;
- }
- break;
- }
- }
+ e.monster_loot = self.monster_loot;
other = e;
MUTATOR_CALLHOOK(MonsterDropItem);
e = other;
-
+
e.think = monster_item_spawn;
- e.nextthink = time + 0.1;
+ e.nextthink = time + 0.3;
}
void monsters_setframe(float _frame)
return TRUE;
}
-void Monster_CheckDropCvars (string mon)
-{
- if not(self.candrop)
- return; // forced off
-
- string dropitem;
- string dropsize;
-
- dropitem = cvar_string(strcat("g_monster_", mon, "_drop"));
- dropsize = cvar_string(strcat("g_monster_", mon, "_drop_size"));
-
- if(autocvar_g_monsters_forcedrop)
- Monster_DropItem(autocvar_g_monsters_drop_type, autocvar_g_monsters_drop_size);
- else if(dropitem != "")
- Monster_DropItem(dropitem, dropsize);
- else
- Monster_DropItem("armor", "medium");
-}
-
void Monster_CheckMinibossFlag ()
{
if(MUTATOR_CALLHOOK(MonsterCheckBossFlag))
self.nextthink = self.ticrate;
self.ltime = time + 5;
- Monster_CheckDropCvars(self.netname);
+ monster_dropitem();
WaypointSprite_Kill(self.sprite);
case MR_SETUP:
{
if not(self.health) self.health = MON_CVAR(animus, health);
-
+
+ self.monster_loot = spawnfunc_item_health_medium;
self.monster_attackfunc = animus_attack;
monsters_setframe(animus_anim_stand);
case MR_SETUP:
{
if not(self.health) self.health = MON_CVAR(bruiser, health);
-
+
+ self.monster_loot = spawnfunc_item_armor_medium;
self.monster_attackfunc = bruiser_attack;
monsters_setframe(bruiser_anim_stand);
case MR_SETUP:
{
if not(self.health) self.health = MON_CVAR(brute, health);
-
+
+ self.monster_loot = spawnfunc_item_bullets;
self.monster_attackfunc = brute_attack;
monsters_setframe(brute_anim_idle);
self.weapon = WEP_GRENADE_LAUNCHER;
case MR_SETUP:
{
if not(self.health) self.health = MON_CVAR(cerberus, health);
-
+
+ self.monster_loot = spawnfunc_item_health_small;
self.monster_attackfunc = cerberus_attack;
monsters_setframe(cerberus_anim_idle);
case MR_SETUP:
{
if not(self.health) self.health = MON_CVAR(knight, health);
-
+
+ self.monster_loot = spawnfunc_item_armor_big;
self.monster_attackfunc = knight_attack;
monsters_setframe(knight_anim_stand);
case MR_SETUP:
{
if not(self.health) self.health = MON_CVAR(mage, health);
-
+
+ self.monster_loot = spawnfunc_item_health_large;
self.monster_attackfunc = mage_attack;
monsters_setframe(mage_anim_walk);
case MR_SETUP:
{
if not(self.health) self.health = MON_CVAR(shambler, health);
-
+
+ self.monster_loot = spawnfunc_item_health_mega;
self.monster_attackfunc = shambler_attack;
monsters_setframe(shambler_anim_stand);
self.weapon = WEP_NEX;
self.health = -100; // gibbed
slime_explode();
- Monster_CheckDropCvars (self.netname); // TODO: add a special function to drop items after death
-
self.deadflag = DEAD_DEAD;
self.think = Monster_Fade;
self.nextthink = time + 0.1;
case MR_SETUP:
{
if not(self.health) self.health = MON_CVAR(slime, health);
-
+
+ self.monster_loot = spawnfunc_item_rockets;
self.monster_attackfunc = slime_attack;
monsters_setframe(slime_anim_idle);
{
if not(self.health) self.health = MON_CVAR(spider, health);
if not(self.spider_type) self.spider_type = MON_CVAR(spider, attack_type);
-
+
+ self.monster_loot = spawnfunc_item_health_medium;
self.monster_attackfunc = spider_attack;
monsters_setframe(spider_anim_idle);
case MR_SETUP:
{
if not(self.health) self.health = MON_CVAR(stingray, health);
-
+
+ self.monster_loot = spawnfunc_item_health_small;
self.monster_attackfunc = stingray_attack;
monsters_setframe(stingray_anim_swim);
case MR_SETUP:
{
if not(self.health) self.health = MON_CVAR(wyvern, health);
-
+
+ self.monster_loot = spawnfunc_item_cells;
self.monster_attackfunc = wyvern_attack;
monsters_setframe(wyvern_anim_hover);
case MR_SETUP:
{
if not(self.health) self.health = MON_CVAR(zombie, health);
-
+
+ self.monster_loot = spawnfunc_item_health_medium;
self.monster_attackfunc = zombie_attack;
monsters_setframe(zombie_anim_spawn);
self.spawn_time = time + 2.1;
float autocvar_g_monsters_owners;
float autocvar_g_monsters_miniboss_chance;
float autocvar_g_monsters_miniboss_healthboost;
-float autocvar_g_monsters_forcedrop;
float autocvar_g_monsters_drop_time;
-string autocvar_g_monsters_drop_type;
-string autocvar_g_monsters_drop_size;
float autocvar_g_monsters_spawnshieldtime;
float autocvar_g_monsters_teams;
float autocvar_g_monsters_healthbars;