コード例 #1
0
        public sbyte UpCheats(CSTable.ISkillLevelTable tpl, byte costType)
        {
            var           ctpl     = tpl as CSTable.CheatsData;
            int           cost     = 0;
            float         rate     = 0;
            eCurrenceType costtype = eCurrenceType.Gold;

            if (costType == (byte)CSCommon.eUpCheatsType.Normal)
            {
                cost     = ctpl.goldcost;
                rate     = ctpl.goldcostrate;
                costtype = eCurrenceType.Gold;
            }
            else if (costType == (byte)CSCommon.eUpCheatsType.Normal)
            {
                cost     = ctpl.rmbcost;
                rate     = ctpl.rmbcostrate;
                costtype = eCurrenceType.Rmb;
            }
            if (!_IsMoneyEnough(costtype, cost))
            {
                return((sbyte)eRet_UpSkillLv.LessMoney);
            }
            _ChangeMoney(costtype, eMoneyChangeType.UpSkill, -cost);
            float rand = (float)mRandom.NextDouble();

            if (rand > rate)
            {
                return((sbyte)eRet_UpSkillLv.Failure);
            }
            return((sbyte)eRet_UpSkillLv.Succeed);
        }
コード例 #2
0
ファイル: ItemUtil.cs プロジェクト: 372285834/GServer
 public static CurrencePath GetCurrencePath(eCurrenceType type)
 {
     foreach (var i in ItemCommon.Instance.CurrencePathList)
     {
         if (type == i.Type)
         {
             return(i);
         }
     }
     return(null);
 }