Advertisement
Guest User

Untitled

a guest
Oct 19th, 2019
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.68 KB | None | 0 0
  1. public int CalculateProfit(double timeInSeconds, bool withIdle, int town = -1)
  2.         {
  3.             if (town == -1)
  4.             {
  5.                 town = CurrentWorld;
  6.             }
  7.             int prestige = GameProgress.GetPrestigeLevel(town);
  8.  
  9.             float waitressAmount = ((WaitressUpgrade)GetUpgrade(GameProgress.GetWaitressLvl(town), UpgradeType.waitress, prestige)).WaitressAmount;
  10.             float waitressTime = _CurrentCoffeeShop.WaitressDuration * 2.0f;
  11.             float seetsAmount = GameProgress.GetSeatsLvl(town);
  12.             float coffeesAmount = ((CoffeeGeneratorUpgrade)GetUpgrade(GameProgress.GetGeneratorLvl(town), UpgradeType.generator, prestige)).CoffeeMadePerOverflow;
  13.  
  14.             float seetsTime = waitressTime * 2.0f;
  15.  
  16.             float kurwa1 = 0;
  17.             if (seetsAmount > 0)
  18.             {
  19.                 kurwa1 = coffeesAmount / seetsAmount;
  20.                 kurwa1 = kurwa1 > 1 ? 1 : kurwa1;
  21.             }
  22.             float kurwa2 = 0;
  23.             if (waitressTime > 0)
  24.             {
  25.                 kurwa2 = seetsTime / waitressTime;
  26.             }
  27.             float kurwa3 = 0;
  28.             if (seetsAmount > 0)
  29.             {
  30.                 kurwa3 = ((waitressAmount * kurwa2) / seetsAmount);
  31.                 kurwa3 = kurwa3 > 1 ? 1 : kurwa3;
  32.             }
  33.             float kurwa4 = seetsAmount * Mathf.Min(kurwa1, kurwa3);
  34.  
  35.             float timeToEarn = seetsTime / kurwa4;
  36.             int coffeePrice = UpgradeManager.GetWorld(GameProgress.GetPrestigeLevel(town), town).CoffePrice;
  37.             int moneyEarned = CalculateEarnings(timeInSeconds, timeToEarn, coffeePrice, 1, town, withIdle);
  38.  
  39.             return moneyEarned;
  40.         }
  41.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement