Exemplo n.º 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);
        }
Exemplo n.º 2
0
 public static bool DeductCost(CurrentPlayer player, CostVO cost)
 {
     if (!CostUtils.HasRequiredCurrency(player, cost))
     {
         return(false);
     }
     if (cost.Credits != 0 || cost.Materials != 0 || cost.Contraband != 0 || cost.Reputation != 0 || cost.Crystals != 0)
     {
         GameUtils.SpendCurrency(cost.Credits, cost.Materials, cost.Contraband, cost.Reputation, cost.Crystals, true);
     }
     return(true);
 }
Exemplo n.º 3
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);
        }
Exemplo n.º 4
0
 public static bool HasRequiredCurrency(CurrentPlayer player, CostVO cost)
 {
     return(CostUtils.CheckForMissingCurrency(player, cost) == MissingCurrencyTypes.None);
 }