예제 #1
0
 public BaseStat(BaseStatType _statType, int _baseValue, string _statName)
 {
     BaseAdditives = new List <StatBonus>();
     StatType      = _statType;
     BaseValue     = _baseValue;
     StatName      = _statName;
 }
예제 #2
0
 public short this[BaseStatType type]
 {
     get
     {
         return(BaseStats[(int)type]);
     }
 }
예제 #3
0
 public BaseStat(BaseStatType statType, int baseValue, string statDescription)
 {
     StatBonuses          = new List <StatBonus>();
     this.statType        = statType;
     this.baseValue       = baseValue;
     this.statDescription = statDescription;
 }
예제 #4
0
 public BaseStat(BaseStatType statType, int baseValue, string statName)
 {
     this.BaseAdditives = new List <StatBonus>();
     this.StatType      = statType;
     this.BaseValue     = baseValue;
     this.StatName      = statName;
 }
예제 #5
0
 public BaseStat(BaseStatType statType, int baseValue, string statName)
 {
     /* Everytime new stat is created, it has an empty list of stat bonuses that it starts from and then gets created. */
     this.BaseAdditives = new List <StatBonus>();
     this.StatType      = statType;
     this.BaseValue     = baseValue;
     this.StatName      = statName;
 }
예제 #6
0
        public void GainInfo(string data, Client client, Server server)
        {
            //basetype-value
            string[]     strs = data.Split('-');
            BaseStatType type = (BaseStatType)int.Parse(strs[0]);

            client.Room.AddOneInfo(client, type, int.Parse(strs[1]));
            SendAllPlayerInfo(client);
        }
 public void ChangeXP(BaseStatType statType, float xp)
 {
     foreach (BaseStat stat in baseStats)
     {
         if (stat.statType == statType)
         {
             stat.ChangeXP(xp);
         }
     }
 }
 private void updateBaseModifier(BaseStatType statType)
 {
     foreach (BaseStat stat in baseStats)
     {
         if (stat.statType == statType)
         {
             baseModifiers[stat.statType] = stat.GetModifier() + additionalBaseModifiers[stat.statType];
             Debug.Log(stat.statType + " Modifier = " + baseModifiers[stat.statType]);
         }
     }
 }
예제 #9
0
        /// <summary>
        /// iterate stats and return the sum
        /// </summary>
        /// <param name="type"></param>
        /// <returns></returns>
        public int SumStat(BaseStatType type)
        {
            var stat = 0;
            var slots = Enum.GetValues(typeof (PaperdollSlot));
            foreach (PaperdollSlot slot in slots)
            {
                if (_equippedItems[slot] == null) continue;

                stat += _equippedItems[slot].GetStat(type);
            }
            return stat;
        }
예제 #10
0
 public void RemoveOneInfo(Client client, BaseStatType type, int value)
 {
     if (PlayerList.TryGetValue(client, out PlayerInfo info))
     {
         lock (PlayerList)
         {
             info.GetStat(type).RemoveExtraValue(new StatBonus(value));
             Console.WriteLine("移除玩家[" + client.GetUserName() + "]的[" + type.ToString() + "]属性" + value.ToString() + "成功");
         }
     }
     else
     {
         return;
     }
 }
예제 #11
0
        /// <summary>
        /// iterate stats and return the sum
        /// </summary>
        /// <param name="type"></param>
        /// <returns></returns>
        public int SumStat(BaseStatType type)
        {
            var stat  = 0;
            var slots = Enum.GetValues(typeof(PaperdollSlot));

            foreach (PaperdollSlot slot in slots)
            {
                if (_equippedItems[slot] == null)
                {
                    continue;
                }

                stat += _equippedItems[slot].GetStat(type);
            }
            return(stat);
        }
예제 #12
0
 public int GetStat(BaseStatType type)
 {
     return _baseItemStats[type];
 }
예제 #13
0
 public int GetStat(BaseStatType type)
 {
     return(_baseItemStats[type]);
 }
예제 #14
0
 public void SendGainRequest(BaseStatType type, int value)
 {
     playerManager.SendGainRequest(type, value);
 }
예제 #15
0
 //发送属性提升请求
 public void SendGainRequest(BaseStatType type, int value)
 {
     gainInfoRequest.SendMessage(type, value);
 }
예제 #16
0
    public void SendMessage(BaseStatType type, int value)
    {
        string s = ((int)type).ToString() + "-" + value.ToString();

        base.SendRequest(s);
    }
예제 #17
0
 public void ChangeAdditionalBaseModifier(BaseStatType statType, int modifier)
 {
     additionalBaseModifiers[statType] = additionalBaseModifiers[statType] + modifier;
     updateBaseModifier(statType);
 }
예제 #18
0
 public void RemoveValue(BaseStatType statType, int value)
 {
     GetStat(statType).RemoveExtraValue(new StatBonus(value));
 }
예제 #19
0
 public void AddValue(BaseStatType statType, int value)
 {
     GetStat(statType).AddExtraValue(new StatBonus(value));
 }
예제 #20
0
 public BaseStat GetStat(BaseStatType statType)
 {
     return(this.playerStats.Find(x => x.StatType == statType));
 }