]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add a cvar to control monster loot lifetime
authorMario <mario.mario@y7mail.com>
Tue, 23 Apr 2013 12:21:10 +0000 (22:21 +1000)
committerMario <mario.mario@y7mail.com>
Tue, 23 Apr 2013 12:21:10 +0000 (22:21 +1000)
monsters.cfg
qcsrc/server/autocvars.qh
qcsrc/server/monsters/lib/monsters.qc
qcsrc/server/mutators/gamemode_towerdefense.qc

index 41585805c6466c3b82cd51c37f93a21c2e057788..d506ee15174c32f285f7fcffd20efb6a34dcac44 100644 (file)
@@ -5,6 +5,7 @@ set g_monsters_skill 1 "Monster skill (affecting some of their attributes). 1 -
 set g_monsters_miniboss_chance 5
 set g_monsters_miniboss_healthboost 100
 set g_monsters_forcedrop 0 "Force all monsters to drop this item on death. Use g_monsters_drop_* cvars to change forced drop item"
+set g_monsters_drop_time 10 "Amount of time before monster's dropped loot disappears"
 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 "Monsters will not attack their owners in team matches if set to 1"
index 5237ebe9b02ee874cb8cffdcc3ac51b4acb628a7..d7c8d1144e030d2d2acb62e88c61bcb393ec0978 100644 (file)
@@ -1257,6 +1257,7 @@ 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_teams;
index 905fc8aac2568ba17b3dc8905a85bf2ac496269b..b0e1f002375cee8e97732d7bff8466e54c340eba 100644 (file)
@@ -14,13 +14,11 @@ void monster_item_spawn()
 {
        self.monster_delayedattack();
        
-       self.think = SUB_Remove;
-       self.nextthink = time + 5;
        self.gravity = 1;
        self.velocity = randomvec() * 175 + '0 0 325';
        self.touch = M_Item_Touch;
        
-       SUB_SetFade(self, time + 5, 1);
+       SUB_SetFade(self, time + autocvar_g_monsters_drop_time, 1);
 }
 
 void Monster_DropItem (string itype, string itemsize)
index 4d4506f77ca55f4f27ba081b4354f9ed24ee26b0..6c4b811517ddf46af481a2c5eb5f74a402b69292 100644 (file)
@@ -887,7 +887,7 @@ MUTATOR_HOOKFUNCTION(td_MonsterDies)
                self = oldself;
                return FALSE;
        }
-       SUB_SetFade(self, time + 5, 1);
+       SUB_SetFade(self, time + autocvar_g_monsters_drop_time, 1);
        
        self = oldself;