Example #1
0
        public static CostVO CombineCurrenciesForShards(CostVO cost)
        {
            int    numCurrencyTypes = CostUtils.GetNumCurrencyTypes(cost);
            CostVO result           = cost;

            if (numCurrencyTypes > 1)
            {
                result = CostUtils.ConvertToCrystalsForShardShop(cost);
            }
            return(result);
        }
Example #2
0
        public static CostVO ConvertToCrystalsForShardShop(CostVO original)
        {
            if (original.Reputation > 0)
            {
                Service.Logger.ErrorFormat("Cannot convert REPUTATION cost to CRYSTAL cost: CostVO uid: {0}", new object[]
                {
                    original.Uid
                });
                return(original);
            }
            CostVO costVO = new CostVO();

            costVO.Uid       = string.Format("CONVERT_{0}", original.Uid);
            costVO.Crystals  = original.Crystals;
            costVO.Crystals += CostUtils.ConvertToCrystalsForShardShop(CurrencyType.Credits, original.Credits);
            costVO.Crystals += CostUtils.ConvertToCrystalsForShardShop(CurrencyType.Materials, original.Materials);
            costVO.Crystals += CostUtils.ConvertToCrystalsForShardShop(CurrencyType.Contraband, original.Contraband);
            return(costVO);
        }