public static int GetSpeedUpCost(int Time, int VillageType, int Multiplier) { if (Time > 0) { int SpeedUpDiamondCost1Min; int SpeedUpDiamondCost1Hour; int SpeedUpDiamondCost24Hours; int SpeedUpDiamondCost1Week; if (VillageType == 0) { SpeedUpDiamondCost1Min = Globals.SpeedUpDiamondCost1Min; SpeedUpDiamondCost1Hour = Globals.SpeedUpDiamondCost1Hour; SpeedUpDiamondCost24Hours = Globals.SpeedUpDiamondCost24Hours; SpeedUpDiamondCost1Week = Globals.SpeedUpDiamondCost1Week; } else { SpeedUpDiamondCost1Min = Globals.Village2SpeedUpDiamondCost1Min; SpeedUpDiamondCost1Hour = Globals.Village2SpeedUpDiamondCost1Hour; SpeedUpDiamondCost24Hours = Globals.Village2SpeedUpDiamondCost24Hours; SpeedUpDiamondCost1Week = Globals.Village2SpeedUpDiamondCost1Week; } if (Time > 59) { if (Time > 3599) { if (Time > 86399) { return(SpeedUpDiamondCost24Hours * Multiplier / 100 + (SpeedUpDiamondCost1Week - SpeedUpDiamondCost24Hours) * (Time - 86400) / 100 * Multiplier / 518400); } return(SpeedUpDiamondCost1Hour * Multiplier / 100 + (SpeedUpDiamondCost24Hours - SpeedUpDiamondCost1Hour) * (Time - 3600) / 100 * Multiplier / 82800); } return(SpeedUpDiamondCost1Min * Multiplier / 100 + Multiplier * (SpeedUpDiamondCost1Hour - SpeedUpDiamondCost1Min) * (Time - 60) / 354000); } return(Math.Max(SpeedUpDiamondCost1Min * Multiplier / 100, 1)); } return(0); }
public static int TimeToXp(int BuildTime) { return(Math.Sqrt(BuildTime)); }