From d42b04ca5bf32888d426838400a4ff688719f001 Mon Sep 17 00:00:00 2001 From: bones_was_here Date: Sat, 1 Mar 2025 20:57:58 +1000 Subject: [PATCH] monsters: remove redundant g_monsters_drop cvar, improve documentation --- monsters.cfg | 13 ++++++------- qcsrc/common/monsters/sv_monsters.qc | 4 ++-- qcsrc/common/monsters/sv_monsters.qh | 3 +-- 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/monsters.cfg b/monsters.cfg index 5669e2696..7bdd9f377 100644 --- a/monsters.cfg +++ b/monsters.cfg @@ -7,7 +7,7 @@ set g_monster_zombie_attack_melee_damage 55 set g_monster_zombie_attack_melee_delay 1 set g_monster_zombie_damageforcescale 0.55 set g_monster_zombie_health 200 -set g_monster_zombie_loot "health_medium" +set g_monster_zombie_loot "health_medium" "on monster death a random loot item from this space-separated list is dropped, \"random\" drops any allowed normal item, \"\" disables loot items" set g_monster_zombie_speed_run 600 set g_monster_zombie_speed_stop 100 set g_monster_zombie_speed_walk 300 @@ -22,7 +22,7 @@ set g_monster_spider_attack_web_speed 1300 set g_monster_spider_attack_web_speed_up 150 set g_monster_spider_damageforcescale 0.6 set g_monster_spider_health 180 -set g_monster_spider_loot "health_medium" +set g_monster_spider_loot "health_medium" "on monster death a random loot item from this space-separated list is dropped, \"random\" drops any allowed normal item, \"\" disables loot items" set g_monster_spider_speed_run 500 set g_monster_spider_speed_stop 100 set g_monster_spider_speed_walk 400 @@ -55,7 +55,7 @@ set g_monster_mage_heal_delay 1.5 set g_monster_mage_heal_minhealth 250 set g_monster_mage_heal_range 250 set g_monster_mage_health 400 -set g_monster_mage_loot "health_big" +set g_monster_mage_loot "health_big" "on monster death a random loot item from this space-separated list is dropped, \"random\" drops any allowed normal item, \"\" disables loot items" set g_monster_mage_shield_blockpercent 0.8 set g_monster_mage_shield_delay 7 set g_monster_mage_shield_time 3 @@ -72,7 +72,7 @@ set g_monster_wyvern_attack_fireball_radius 120 set g_monster_wyvern_attack_fireball_speed 1200 set g_monster_wyvern_damageforcescale 0.6 set g_monster_wyvern_health 150 -set g_monster_wyvern_loot "cells" +set g_monster_wyvern_loot "cells" "on monster death a random loot item from this space-separated list is dropped, \"random\" drops any allowed normal item, \"\" disables loot items" set g_monster_wyvern_speed_run 250 set g_monster_wyvern_speed_stop 300 set g_monster_wyvern_speed_walk 120 @@ -91,7 +91,7 @@ set g_monster_golem_attack_smash_force 100 set g_monster_golem_attack_smash_range 200 set g_monster_golem_damageforcescale 0.1 set g_monster_golem_health 650 -set g_monster_golem_loot "health_mega electro" +set g_monster_golem_loot "health_mega electro" "on monster death a random loot item from this space-separated list is dropped, \"random\" drops any allowed normal item, \"\" disables loot items" set g_monster_golem_speed_run 320 set g_monster_golem_speed_stop 300 set g_monster_golem_speed_walk 150 @@ -104,8 +104,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_miniboss_loot "vortex" "space-separated list of items added as a potential drop when a miniboss dies" -set g_monsters_drop 1 -set g_monsters_drop_time 10 +set g_monsters_drop_time 10 "lifetime of loot items, <= 0 disables loot items" set g_monsters_ignoretraces 1 set g_monsters_lineofsight 1 set g_monsters_owners 1 diff --git a/qcsrc/common/monsters/sv_monsters.qc b/qcsrc/common/monsters/sv_monsters.qc index b44c922de..a0db8a809 100644 --- a/qcsrc/common/monsters/sv_monsters.qc +++ b/qcsrc/common/monsters/sv_monsters.qc @@ -39,7 +39,7 @@ void monsters_setstatus(entity this) void monster_dropitem(entity this, entity attacker) { - if(!this.candrop || !autocvar_g_monsters_drop) + if(!this.candrop || autocvar_g_monsters_drop_time <= 0) return; // TODO: mapper customization (different field?) @@ -62,7 +62,7 @@ void monster_dropitem(entity this, entity attacker) e.itemdef = loot_itemdef; setorigin(e, CENTER_OR_VIEWOFS(this)); e.velocity = randomvec() * 175 + '0 0 325'; - e.lifetime = max(0, autocvar_g_monsters_drop_time); + e.lifetime = autocvar_g_monsters_drop_time; Item_Initialise(e); } diff --git a/qcsrc/common/monsters/sv_monsters.qh b/qcsrc/common/monsters/sv_monsters.qh index e367fb419..ab28d843d 100644 --- a/qcsrc/common/monsters/sv_monsters.qh +++ b/qcsrc/common/monsters/sv_monsters.qh @@ -21,8 +21,7 @@ bool autocvar_g_monsters_playerclip_collisions; float autocvar_g_monsters_miniboss_chance; float autocvar_g_monsters_miniboss_healthboost; string autocvar_g_monsters_miniboss_loot = "vortex"; -bool autocvar_g_monsters_drop = true; -float autocvar_g_monsters_drop_time; +float autocvar_g_monsters_drop_time = 10; float autocvar_g_monsters_spawnshieldtime; bool autocvar_g_monsters_quake_resize = true; bool autocvar_g_monsters_teams; -- 2.39.5