Ejemplo n.º 1
0
        public static double GetReducedGameCurrencyValue(this IHideOutCost hideOutCost)
        {
            var priceGold = hideOutCost.price_gold;
            //if (price_Gold == null)
            //{
            //    return null;
            //}
            //else
            //{
            //    priceGold = (int)price_Gold;
            //}

            var currentBrokerLevel = 0;

            if (hideOutCost.HideOut != null)
            {
                currentBrokerLevel = hideOutCost.HideOut.current_broker_level;
            }
            if (currentBrokerLevel == 0)
            {
                return(priceGold);
            }
            var    _loc4_      = HzConstants.Default.Constants["hideout_rooms"]["broker"];
            double _loc3_      = priceGold;
            var    brokerlevel = hideOutCost.HideOut?.CurrentBrokerLevel;

            if (brokerlevel != null)
            {
                _loc3_ = (1 - brokerlevel.passiv_bonus_amount_1 / 100.0f) * _loc3_;
            }
            return(Math.Ceiling(_loc3_));
        }
Ejemplo n.º 2
0
 public static bool HaveEnoughRessources(this IHideOutCost roomLevel, HzAccount account)
 {
     //var level = roomLevel.Levels.FirstOrDefault();
     return(roomLevel != null &&
            roomLevel.price_glue <= account.Data.hideout.current_resource_glue &&
            roomLevel.price_stone <= account.Data.hideout.current_resource_stone &&
            roomLevel.GetReducedGameCurrencyValue() <= account.Character.game_currency);
 }
Ejemplo n.º 3
0
 public static int TotalCost(this IHideOutCost roomLevel, HideOut hideOut)
 {
     return(roomLevel.price_stone + roomLevel.price_glue + (int)roomLevel.GetReducedGameCurrencyValue());
 }