]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Support the count field on powerups
authorbones_was_here <bones_was_here@xa.org.au>
Tue, 20 Jul 2021 01:09:33 +0000 (11:09 +1000)
committerbones_was_here <bones_was_here@xa.org.au>
Tue, 20 Jul 2021 02:39:04 +0000 (12:39 +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
qcsrc/common/mutators/mutator/powerups/sv_powerups.qh

index 294daaabec0cac760dfa3a9e25a6934a5379e7d5..a0d1d76557eeba7ea65555c034a8c241a11ba8d8 100644 (file)
@@ -22,7 +22,7 @@ float autocvar_g_balance_powerup_invisibility_time = 30;
 void powerup_invisibility_init(Pickup this, entity item)
 {
     if(!item.invisibility_finished)
-        item.invisibility_finished = autocvar_g_balance_powerup_invisibility_time;
+        item.invisibility_finished = (item.count) ? item.count : autocvar_g_balance_powerup_invisibility_time;
 }
 #endif
 REGISTER_ITEM(Invisibility, Powerup) {
index 4c273c0f2ef5b56c8ff184867b88c1ac3882fd7c..4267889ac14537ac1204658a4c9415f60bb35f4d 100644 (file)
@@ -21,7 +21,7 @@ float autocvar_g_balance_powerup_invincible_time;
 void powerup_shield_init(Pickup this, entity item)
 {
     if(!item.invincible_finished)
-        item.invincible_finished = autocvar_g_balance_powerup_invincible_time;
+        item.invincible_finished = (item.count) ? item.count : autocvar_g_balance_powerup_invincible_time;
 }
 #endif
 REGISTER_ITEM(Shield, Powerup) {
index 76f87ce5732403ec68dbdc1a64f17454ea9066ad..6b127e39f8355d1265b806e7508eac0f6d9cd830 100644 (file)
@@ -23,7 +23,7 @@ float autocvar_g_balance_powerup_speed_time = 30;
 void powerup_speed_init(Pickup this, entity item)
 {
     if(!item.speed_finished)
-        item.speed_finished = autocvar_g_balance_powerup_speed_time;
+        item.speed_finished = (item.count) ? item.count : autocvar_g_balance_powerup_speed_time;
 }
 #endif
 REGISTER_ITEM(Speed, Powerup) {
index c594568f3aa51bf85d2ef6394f4a77a98e9b02e6..81d939e673e32ff13a4c9b9e63401cbe51209fe2 100644 (file)
@@ -23,7 +23,7 @@ float autocvar_g_balance_powerup_strength_time;
 void powerup_strength_init(Pickup this, entity item)
 {
     if(!item.strength_finished)
-        item.strength_finished = autocvar_g_balance_powerup_strength_time;
+        item.strength_finished = (item.count) ? item.count : autocvar_g_balance_powerup_strength_time;
 }
 #endif
 REGISTER_ITEM(Strength, Powerup) {
index f71025959c67d2c7eaa2a36708b2d6969d6f85b0..c2dcfa0345c60adcf10fcf0ed908d50d842fedb6 100644 (file)
@@ -10,3 +10,6 @@ REGISTER_MUTATOR(powerups, true);
 
 .float prevstrengthsound;
 .float prevstrengthsoundattempt;
+
+// q3compat
+.float count;