public static MonsterAttr GetMonsterAttr(CreatureCommonAttr attrType) { if ((int)attrType <= (int)CreatureCommonAttr.C_NONE || (int)attrType >= (int)CreatureCommonAttr.C_MAX) { return(MonsterAttr.M_NONE); } return((MonsterAttr)m_CommonAttrToMonsterAttr[(int)attrType]); }
//******************属性外部调用接口****************** //玩家 public static PlayerAttr GetPlayerAttr(CreatureCommonAttr attrType) { if ((int)attrType <= (int)CreatureCommonAttr.C_NONE || (int)attrType >= (int)CreatureCommonAttr.C_MAX) { return(PlayerAttr.P_NONE); } return((PlayerAttr)m_CommonAttrToPlayerAttr[(int)attrType]); }
public bool AddAttr(CreatureCommonAttr CAttrType, int attrValue) { MonsterAttr mAttrType = AttrMgr.GetMonsterAttr(CAttrType); if (attrValue < 0) { uint absValue = (uint)Math.Abs(attrValue); m_Attrs[(int)mAttrType] = ((m_Attrs[(int)mAttrType] > absValue) ? (m_Attrs[(int)mAttrType] - absValue) : 0); } else { m_Attrs[(int)mAttrType] = m_Attrs[(int)mAttrType] + (uint)attrValue; } return(true); }
public override bool AddAttr(CreatureCommonAttr attrType, int attrCount, bool syn, uint relationCid) { if (attrType == CreatureCommonAttr.C_HP && attrCount < 0) { } if (attrCount == 0) { return(false); } MonsterAttr.AddAttr(attrType, attrCount); if (attrType == CreatureCommonAttr.C_HP && MonsterAttr.GetAttrCount(attrType) <= 0) { syn = true; OnDead(relationCid); } return(true); }
public uint GetAttrCount(CreatureCommonAttr CAttrType) { return(m_Attrs[GetAttrType(CAttrType)]); }
public int GetAttrType(CreatureCommonAttr CAttrType) { return((int)AttrMgr.GetMonsterAttr(CAttrType)); }
public void SetAttr(CreatureCommonAttr CAttrType, int attrValue) { m_Attrs[GetAttrType(CAttrType)] = (uint)(attrValue > 0 ? attrValue : 0); }
public override void SetAttrCache(CreatureCommonAttr attrType, int attrCount) { }
public override void SetAttr(CreatureCommonAttr attrType, int attrCount, bool syn) { MonsterAttr.SetAttr(attrType, attrCount); }
public abstract void SetAttrCache(CreatureCommonAttr attrType, int attrCount);
public abstract void SetAttr(CreatureCommonAttr attrType, int attrCount, bool syn);
public abstract bool AddAttr(CreatureCommonAttr attrType, int attrCount, bool syn, uint relationCid);