Explorar o código

Make extra life power up more rare

SimplyMinimal %!s(int64=3) %!d(string=hai) anos
pai
achega
9bd77bd8b0
Modificáronse 1 ficheiros con 8 adicións e 0 borrados
  1. 8 0
      app.c

+ 8 - 0
app.c

@@ -728,6 +728,14 @@ PowerUp* add_powerUp(AsteroidsApp* app) {
         return NULL;
     }
 
+    // Make extra life power up more rare
+    if(selected_powerUpType == PowerUpTypeLife) {
+        if(rand() % 10 != 0) {
+            FURI_LOG_D(TAG, "[add_powerUp] Power Up %i not selected", selected_powerUpType);
+            return NULL;
+        }
+    }
+
     float size = 10;
     float min_distance = 20;
     float x, y;