Beispiel #1
0
 private void ModifySouls(string element, int amount)
 {
     AudioManager.PlaySound(AudioManager.Sound.GetSoul);
     TotalSouls += amount;
     ModifiedSouls?.Invoke(TotalSouls);
     if (element == "Fire")
     {
         FireSouls += amount;
         ModifiedFireSouls?.Invoke(FireSouls);
     }
     else if (element == "Water")
     {
         WaterSouls += amount;
         ModifiedWaterSouls?.Invoke(WaterSouls);
     }
     else if (element == "Earth")
     {
         EarthSouls += amount;
         ModifiedEarthSouls?.Invoke(EarthSouls);
     }
     else if (element == "Air")
     {
         AirSouls += amount;
         ModifiedAirSouls?.Invoke(AirSouls);
     }
 }
Beispiel #2
0
 private void ResetSouls()
 {
     TotalSouls = 0;
     FireSouls  = 0;
     WaterSouls = 0;
     EarthSouls = 0;
     AirSouls   = 0;
     ModifiedSouls?.Invoke(TotalSouls);
     ModifiedFireSouls?.Invoke(TotalSouls);
     ModifiedWaterSouls?.Invoke(TotalSouls);
     ModifiedEarthSouls?.Invoke(TotalSouls);
     ModifiedAirSouls?.Invoke(TotalSouls);
 }
Beispiel #3
0
 public bool TrySpendSouls(int soulsAmount, string elementType)
 {
     if (elementType == "General" && TotalSouls >= soulsAmount)
     {
         TotalSouls -= soulsAmount;
         ModifiedSouls?.Invoke(TotalSouls);
         return(true);
     }
     else if (elementType == "Fire" && FireSouls >= soulsAmount)
     {
         FireSouls -= soulsAmount;
         ModifiedFireSouls?.Invoke(FireSouls);
         return(true);
     }
     else if (elementType == "Water" && WaterSouls >= soulsAmount)
     {
         WaterSouls -= soulsAmount;
         ModifiedWaterSouls?.Invoke(WaterSouls);
         return(true);
     }
     else if (elementType == "Earth" && EarthSouls >= soulsAmount)
     {
         EarthSouls -= soulsAmount;
         ModifiedEarthSouls?.Invoke(EarthSouls);
         return(true);
     }
     else if (elementType == "Air" && AirSouls >= soulsAmount)
     {
         AirSouls -= soulsAmount;
         ModifiedAirSouls?.Invoke(AirSouls);
         return(true);
     }
     else
     {
         return(false);
     }
 }