public BaseStat(BaseStatType _statType, int _baseValue, string _statName) { BaseAdditives = new List <StatBonus>(); StatType = _statType; BaseValue = _baseValue; StatName = _statName; }
public short this[BaseStatType type] { get { return(BaseStats[(int)type]); } }
public BaseStat(BaseStatType statType, int baseValue, string statDescription) { StatBonuses = new List <StatBonus>(); this.statType = statType; this.baseValue = baseValue; this.statDescription = statDescription; }
public BaseStat(BaseStatType statType, int baseValue, string statName) { this.BaseAdditives = new List <StatBonus>(); this.StatType = statType; this.BaseValue = baseValue; this.StatName = statName; }
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; }
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]); } } }
/// <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; }
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; } }
/// <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); }
public int GetStat(BaseStatType type) { return _baseItemStats[type]; }
public int GetStat(BaseStatType type) { return(_baseItemStats[type]); }
public void SendGainRequest(BaseStatType type, int value) { playerManager.SendGainRequest(type, value); }
//发送属性提升请求 public void SendGainRequest(BaseStatType type, int value) { gainInfoRequest.SendMessage(type, value); }
public void SendMessage(BaseStatType type, int value) { string s = ((int)type).ToString() + "-" + value.ToString(); base.SendRequest(s); }
public void ChangeAdditionalBaseModifier(BaseStatType statType, int modifier) { additionalBaseModifiers[statType] = additionalBaseModifiers[statType] + modifier; updateBaseModifier(statType); }
public void RemoveValue(BaseStatType statType, int value) { GetStat(statType).RemoveExtraValue(new StatBonus(value)); }
public void AddValue(BaseStatType statType, int value) { GetStat(statType).AddExtraValue(new StatBonus(value)); }
public BaseStat GetStat(BaseStatType statType) { return(this.playerStats.Find(x => x.StatType == statType)); }