]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Add cvars to enable individual powerups
authorbones_was_here <bones_was_here@xa.org.au>
Tue, 20 Jul 2021 00:06:18 +0000 (10:06 +1000)
committerbones_was_here <bones_was_here@xa.org.au>
Tue, 20 Jul 2021 02:38:53 +0000 (12:38 +1000)
qcsrc/common/mutators/mutator/powerups/powerup/invisibility.qh
qcsrc/common/mutators/mutator/powerups/powerup/shield.qh
qcsrc/common/mutators/mutator/powerups/powerup/speed.qh
qcsrc/common/mutators/mutator/powerups/powerup/strength.qh
xonotic-server.cfg

index d043e121fb421029203e23f1dba5ce0f6d3a8cdb..294daaabec0cac760dfa3a9e25a6934a5379e7d5 100644 (file)
@@ -16,6 +16,7 @@ SOUND(Invisibility, Item_Sound("powerup"));
 #ifdef SVQC
 .float invisibility_finished;
 
+bool autocvar_g_powerups_invisibility;
 float autocvar_g_balance_powerup_invisibility_alpha = 0.15;
 float autocvar_g_balance_powerup_invisibility_time = 30;
 void powerup_invisibility_init(Pickup this, entity item)
@@ -26,8 +27,13 @@ void powerup_invisibility_init(Pickup this, entity item)
 #endif
 REGISTER_ITEM(Invisibility, Powerup) {
     this.m_canonical_spawnfunc = "item_invisibility";
+#ifdef SVQC
+    if(autocvar_g_powerups_invisibility)
+        this.spawnflags = ITEM_FLAG_NORMAL;
+    else
+        this.spawnflags = ITEM_FLAG_MUTATORBLOCKED;
+#endif
 #ifdef GAMEQC
-    this.spawnflags = ITEM_FLAG_NORMAL;
 //    this.m_model            =   MDL_Invisibility_ITEM; // TODO: new model required
     this.m_model            =   MDL_BUFF;
     this.m_skin             =   12;
index 854c802769fb83f38c062759d024a738956a1b85..4c273c0f2ef5b56c8ff184867b88c1ac3882fd7c 100644 (file)
@@ -14,6 +14,7 @@ SOUND(Shield, Item_Sound("powerup_shield"));
 #endif
 
 #ifdef SVQC
+bool autocvar_g_powerups_shield;
 float autocvar_g_balance_powerup_invincible_takedamage;
 float autocvar_g_balance_powerup_invincible_takeforce = 0.33;
 float autocvar_g_balance_powerup_invincible_time;
@@ -25,8 +26,13 @@ void powerup_shield_init(Pickup this, entity item)
 #endif
 REGISTER_ITEM(Shield, Powerup) {
     this.m_canonical_spawnfunc = "item_shield";
+#ifdef SVQC
+    if(autocvar_g_powerups_shield)
+        this.spawnflags = ITEM_FLAG_NORMAL;
+    else
+        this.spawnflags = ITEM_FLAG_MUTATORBLOCKED;
+#endif
 #ifdef GAMEQC
-    this.spawnflags = ITEM_FLAG_NORMAL;
     this.m_model            =   MDL_Shield_ITEM;
     this.m_sound            =   SND_Shield;
     this.m_glow             =   true;
index f5970dac50fc414b1ad271d5862dabee66c030ae..76f87ce5732403ec68dbdc1a64f17454ea9066ad 100644 (file)
@@ -16,6 +16,7 @@ SOUND(Speed, Item_Sound("powerup_shield"));
 #ifdef SVQC
 .float speed_finished;
 
+bool autocvar_g_powerups_speed;
 float autocvar_g_balance_powerup_speed_attackrate = 0.8;
 float autocvar_g_balance_powerup_speed_highspeed = 1.5;
 float autocvar_g_balance_powerup_speed_time = 30;
@@ -27,8 +28,13 @@ void powerup_speed_init(Pickup this, entity item)
 #endif
 REGISTER_ITEM(Speed, Powerup) {
     this.m_canonical_spawnfunc = "item_speed";
+#ifdef SVQC
+    if(autocvar_g_powerups_speed)
+        this.spawnflags = ITEM_FLAG_NORMAL;
+    else
+        this.spawnflags = ITEM_FLAG_MUTATORBLOCKED;
+#endif
 #ifdef GAMEQC
-    this.spawnflags = ITEM_FLAG_NORMAL;
 //    this.m_model            =   MDL_Speed_ITEM; // TODO: new model required
     this.m_model            =   MDL_BUFF;
     this.m_skin             =   9;
index ce1914966bd7f15ae0a2878301199a1abe22e314..c594568f3aa51bf85d2ef6394f4a77a98e9b02e6 100644 (file)
@@ -14,6 +14,7 @@ SOUND(Strength, Item_Sound("powerup"));
 #endif
 
 #ifdef SVQC
+bool autocvar_g_powerups_strength;
 float autocvar_g_balance_powerup_strength_damage;
 float autocvar_g_balance_powerup_strength_force;
 float autocvar_g_balance_powerup_strength_selfdamage;
@@ -27,8 +28,13 @@ void powerup_strength_init(Pickup this, entity item)
 #endif
 REGISTER_ITEM(Strength, Powerup) {
     this.m_canonical_spawnfunc = "item_strength";
+#ifdef SVQC
+    if(autocvar_g_powerups_strength)
+        this.spawnflags = ITEM_FLAG_NORMAL;
+    else
+        this.spawnflags = ITEM_FLAG_MUTATORBLOCKED;
+#endif
 #ifdef GAMEQC
-       this.spawnflags = ITEM_FLAG_NORMAL;
     this.m_model            =   MDL_Strength_ITEM;
     this.m_sound            =   SND_Strength;
     this.m_glow             =   true;
index 09cb0e85672d579c1731b64f888628359ce471ee..28d5101ed8e394505d90320a97e43ff4b177a294 100644 (file)
@@ -197,7 +197,11 @@ set g_shootfromcenter 0 "weapon gets moved to the center, shots still come from
 set g_shootfromfixedorigin "" "if set to a string like 0 y z, the gun is moved to the given y and z coordinates. If set to a string like x y z, the whole shot origin is used"
 set g_weapon_stay 0 "1: ghost weapons can be picked up but give no ammo, thrown guns have ammo 2: ghost weapons can be picked up and refill ammo to one pickup size, thrown guns have no ammo (to prevent infinite ammo abuse)"
 set g_weapon_throwable 1 "if set to 1, weapons can be dropped"
-set g_powerups -1 "if set to 0 the strength and shield (invincibility) will not spawn on the map, if 1 they will spawn in all game modes, -1 is game mode default"
+set g_powerups -1 "if set to 0 no powerups will spawn, if 1 they will spawn in all game modes, -1 is game mode default"
+set g_powerups_strength 1 "allow strength powerups to spawn"
+set g_powerups_shield 1 "allow shield powerups to spawn"
+set g_powerups_speed 1 "allow speed powerups to spawn"
+set g_powerups_invisibility 1 "allow invisibility powerups to spawn"
 set g_use_ammunition 1 "if set to 0 all weapons have unlimited ammo"
 set g_pickup_items -1 "if set to 0 all items (health, armor, ammo, weapons...) are removed from the map, if 1 they are forced to spawn"
 set g_pickup_respawntime_scaling_reciprocal 0 "Multiply respawn time by `reciprocal / (p + offset) + linear` where `p` is the current number of players, takes effect with 2 or more players present, `reciprocal` (with `offset` and `linear` set to 0) can be used to achieve a constant number of items spawned *per player*"