public void OnAttrChangedMain(eSkillAttrIndex attrIdx) { if (mUpdateAttrList.Find(x => x == attrIdx) != eSkillAttrIndex.None) { return; } mUpdateAttrList.Add(attrIdx); }
/// <summary> /// 获取最终属性值 /// </summary> public int GetAttrValue(eSkillAttrIndex idx) { int currValue = 0; currValue += GetAttrValueMain(idx); currValue += GetAttrValueEx(idx); return(currValue); }
public void OnAttrChanged(eSkillAttrIndex attrIdx) { if (mUpdateAttrList.Find(x => x.Equals(attrIdx)) != eSkillAttrIndex.None) { return; } OnAttrChangedMain(attrIdx); OnAttrChangedEx(attrIdx); }
public int GetAttrBase(eValueType type, eSkillAttrIndex idx) { if (idx >= eSkillAttrIndex.Power && idx <= eSkillAttrIndex.Dex) { return(mAttrs[type][(int)idx].Base); } if (idx >= eSkillAttrIndex.HP && idx < eSkillAttrIndex.MAX) { return(mSecondAttrs[type][(int)idx].Base); } return(0); }
public void AddAttrBasePer(eValueType type, eSkillAttrIndex idx, float value) { OnAttrChanged(idx); if (idx >= eSkillAttrIndex.Power && idx <= eSkillAttrIndex.Dex) { FinalRoleValue.AddAttrBasePer(type, idx, value); return; } if (idx >= eSkillAttrIndex.HP && idx < eSkillAttrIndex.MAX) { FinalRoleValue.AddSecondAttrBasePer(type, idx, value); } }
/// <summary> /// 是否广播该属性 /// </summary> /// <param name="idx"></param> public bool IsBroadCastAttr(eSkillAttrIndex idx) { switch (idx) { case eSkillAttrIndex.Level: case eSkillAttrIndex.HP: case eSkillAttrIndex.MP: case eSkillAttrIndex.MaxHP: case eSkillAttrIndex.MaxHPRate: case eSkillAttrIndex.MaxMP: case eSkillAttrIndex.MoveSpeed: return(true); } return(false); }
public int GetAttrValueEx(eSkillAttrIndex idx) { if (idx >= eSkillAttrIndex.Power && idx <= eSkillAttrIndex.Dex) { } if (idx >= eSkillAttrIndex.HP && idx < eSkillAttrIndex.MAX) { //float tempValue = 0; //tempValue = BuffMgr.GetEffectValue(BuffMgr.BufferTypeTranslate(idx)); //if (tempValue < 0 && tempValue + GetAttrValueMain(idx) < 0) // tempValue = -1 * GetAttrValueMain(idx); //return tempValue; } return(0); }
/// <summary> /// 获取属性值 /// </summary> public bool GetAttrStruct(ref AttrStruct attr, eSkillAttrIndex idx) { if (idx <= eSkillAttrIndex.None || idx >= eSkillAttrIndex.MAX) { return(false); } attr.attrIdx = (byte)idx; switch (idx) { case eSkillAttrIndex.Level: attr.attrValue = mRoleLevel.ToString(); break; case eSkillAttrIndex.HP: attr.attrValue = CurHP.ToString(); break; case eSkillAttrIndex.MaxHP: case eSkillAttrIndex.MaxHPRate: attr.attrValue = FinalRoleValue.MaxHP.ToString(); break; case eSkillAttrIndex.MP: attr.attrValue = CurMP.ToString(); break; case eSkillAttrIndex.MaxMP: attr.attrValue = FinalRoleValue.MaxMP.ToString(); break; case eSkillAttrIndex.MoveSpeed: attr.attrValue = FinalRoleValue.Speed.ToString(); break; default: return(false); } return(true); }
public int GetAttrValueMain(eSkillAttrIndex idx) { if (idx >= eSkillAttrIndex.Power && idx <= eSkillAttrIndex.Dex) { int tempValue = 0; for (var i = eValueType.Base; i < eValueType.MAX; i++) { tempValue += mAttrs[i][(int)idx].Value; } return(tempValue); } if (idx >= eSkillAttrIndex.HP && idx < eSkillAttrIndex.MAX) { int tempValue = 0; for (var i = eValueType.Base; i < eValueType.MAX; i++) { tempValue += mSecondAttrs[i][(int)idx].Value; } return(tempValue); } return(0); }
public void OnAttrChangedEx(eSkillAttrIndex attrIdx) { }
public void AddSecondAttrBasePer(eValueType type, eSkillAttrIndex idx, float value) { mSecondAttrs[type][(int)idx].AddBasePer(value); }
public void SetAttrBasePer(eValueType type, eSkillAttrIndex idx, float value) { mAttrs[type][(int)idx].SetBasePer(value); }
public void AddAttrBase(eValueType type, eSkillAttrIndex idx, int value) { mAttrs[type][(int)idx].AddBase(value); }
public void SetSecondAttrBase(eValueType type, eSkillAttrIndex idx, int value) { mSecondAttrs[type][(int)idx].Base = value; }