public static bool IsContainType(MIXBATATTR nMixType, COMBATATTE nJudgeAttrType) { switch (nMixType) { case MIXBATATTR.MIXATTR_ALLDEF: { if (nJudgeAttrType == COMBATATTE.PYSDEF || nJudgeAttrType == COMBATATTE.MAGDEF) { return(true); } } break; case MIXBATATTR.MIXATTR_ALLATTACK: { if (nJudgeAttrType == COMBATATTE.PYSATTACK || nJudgeAttrType == COMBATATTE.MAGATTACK) { return(true); } } break; default: break; } return(false); }
/// <summary> /// 侠客附加的战斗属性值 /// </summary> /// <param name="attrtype"></param> /// <returns></returns> public int GetComBatAttrById(COMBATATTE attrtype) { int nBaseAttrValue = 0; if (IsValidAttrType((int)attrtype) == false) { return(nBaseAttrValue); } Tab_SwordsManAttr SwordsMmanTable = TableManager.GetSwordsManAttrByID(m_nDataId, 0); if (null == SwordsMmanTable) { return(nBaseAttrValue); } //附加属性 for (int attrIndex = 0; attrIndex < SwordsMmanTable.getAddAttrTypeCount(); ++attrIndex) { int addAttrType = SwordsMmanTable.GetAddAttrTypebyIndex(attrIndex); float addAttrValue = SwordsMmanTable.GetAddAttrValuebyIndex(attrIndex); if ((int)attrtype == addAttrType || MaxBatAttrUtil.IsContainType((MIXBATATTR)addAttrType, attrtype)) { nBaseAttrValue += (int)addAttrValue; } } float fAddValue = (float)nBaseAttrValue + (float)(m_nLevel - 1) * (float)0.4 * (float)nBaseAttrValue; int nAttrValue = (int)fAddValue; return(nAttrValue); }
void ShowSwordsManEffect() { SwordsManContainer Container = GameManager.gameManager.PlayerDataPool.GetSwordsManContainer(m_PackType); if (Container == null) { return; } SwordsMan oSwordsMan = Container.GetSwordsManByGuid(m_SwordsManGuid); if (oSwordsMan == null) { LogModule.ErrorLog("ShowSwordsManEffect::oSwordsMan is null"); return; } Tab_SwordsManAttr pAttrTable = TableManager.GetSwordsManAttrByID(oSwordsMan.DataId, 0); if (null == pAttrTable) { LogModule.ErrorLog("ShowSwordsManEffect::pAttrTable is null"); return; } for (int i = 0; i < m_LabelCurEffect.Length; i++) { m_LabelCurEffect[i].gameObject.SetActive(false); } for (int i = 0; i < m_LabelNextEffect.Length; i++) { m_LabelNextEffect[i].gameObject.SetActive(false); } int nCurEffectIndex = 0; int nNextEffectIndex = 0; for (int i = 0; i < pAttrTable.getAddAttrTypeCount(); i++) { COMBATATTE nAttrType = (COMBATATTE)pAttrTable.GetAddAttrTypebyIndex(i); int nAttrValue = oSwordsMan.GetComBatAttrById(nAttrType); int nNextLevelAttrValue = oSwordsMan.GetNextLevelComBatAttrById(nAttrType); if (nAttrValue > 0 && nCurEffectIndex < m_LabelCurEffect.Length && nCurEffectIndex >= 0) { //m_LabelCurEffect[nCurEffectIndex].text = string.Format("{0}+{1}", ItemTool.ConvertAttrToString(nAttrType), nAttrValue.ToString()); m_LabelCurEffect[nCurEffectIndex].text = StrDictionary.GetClientDictionaryString("#{3339}", ItemTool.ConvertAttrToString(nAttrType), nAttrValue.ToString()); m_LabelCurEffect[nCurEffectIndex].gameObject.SetActive(true); ++nCurEffectIndex; } if (nNextLevelAttrValue > 0 && nNextEffectIndex < m_LabelNextEffect.Length && nNextEffectIndex >= 0) { //m_LabelNextEffect[nNextEffectIndex].text = string.Format("{0}+{1}", ItemTool.ConvertAttrToString(nAttrType), nNextLevelAttrValue.ToString()); m_LabelNextEffect[nNextEffectIndex].text = StrDictionary.GetClientDictionaryString("#{3339}", ItemTool.ConvertAttrToString(nAttrType), nNextLevelAttrValue.ToString()); m_LabelNextEffect[nNextEffectIndex].gameObject.SetActive(true); ++nNextEffectIndex; } } if (m_CurEffectGrid != null) { m_CurEffectGrid.SetActive(true); } if (m_CurEffectTitle != null) { m_CurEffectTitle.SetActive(true); } if (oSwordsMan.IsFullLevel()) { if (m_NextEffectGrid != null) { m_NextEffectGrid.SetActive(false); } if (m_NextEffectTitle != null) { m_NextEffectTitle.SetActive(false); } } else { if (m_NextEffectGrid != null) { m_NextEffectGrid.SetActive(true); } if (m_NextEffectTitle != null) { m_NextEffectTitle.SetActive(true); } } }
static public string ConvertAttrToString(COMBATATTE attr) { switch (attr) { case COMBATATTE.MAXHP: return(Utils.GetDicByID(1573)); //生命 case COMBATATTE.MAXMP: return(Utils.GetDicByID(1574)); //"法力"; case COMBATATTE.MAXXP: return(Utils.GetDicByID(1575)); //"战意"; case COMBATATTE.PYSATTACK: return(Utils.GetDicByID(1576)); //"外功攻击"; case COMBATATTE.MAGATTACK: return(Utils.GetDicByID(1577)); //"内功攻击"; case COMBATATTE.PYSDEF: return(Utils.GetDicByID(1578)); //"外功防御"; case COMBATATTE.MAGDEF: return(Utils.GetDicByID(1579)); //"内功防御"; case COMBATATTE.HIT: return(Utils.GetDicByID(1580)); //"命中"; case COMBATATTE.DODGE: return(Utils.GetDicByID(1581)); //"闪避"; case COMBATATTE.CRITICAL: return(Utils.GetDicByID(1582)); //"暴击"; case COMBATATTE.DECRITICAL: return(Utils.GetDicByID(1583)); //"暴击抗性"; case COMBATATTE.STRIKE: return(Utils.GetDicByID(1584)); //"穿透"; case COMBATATTE.DUCTICAL: return(Utils.GetDicByID(1585)); //"韧性"; case COMBATATTE.CRITIADD: return(Utils.GetDicByID(1586)); //"暴击加成"; case COMBATATTE.CRITIMIS: return(Utils.GetDicByID(1587)); //"暴击减免"; case COMBATATTE.MOVESPEED: return(Utils.GetDicByID(1588)); //"移动速度"; case COMBATATTE.ATTACKSPEED: return(Utils.GetDicByID(1589)); //"攻击速度"; default: break; } switch ((int)attr) { case 1000: return(Utils.GetDicByID(1590)); //"全攻击"; case 1001: return(Utils.GetDicByID(1591)); //"全防御"; default: break; } return(""); }
/// <summary> /// 侠客属性加成效果 /// </summary> void ShowSwordsManEffect() { if (m_SwordsMan == null) { LogModule.ErrorLog("ShowSwordsManEffect::m_SwordsMan is null"); return; } Tab_SwordsManAttr pAttrTable = TableManager.GetSwordsManAttrByID(m_SwordsMan.DataId, 0); if (null == pAttrTable) { LogModule.ErrorLog("ShowSwordsManEffect::pAttrTable is null"); return; } for (int i = 0; i < m_LabelCurEffect.Length; i++) { m_LabelCurEffect[i].gameObject.SetActive(false); } for (int i = 0; i < m_LabelNextEffect.Length; i++) { m_LabelNextEffect[i].gameObject.SetActive(false); } int nNextEffectIndex = 0; int nCurEffectIndex = 0; for (int i = 0; i < pAttrTable.getAddAttrTypeCount(); i++) { COMBATATTE nAttrType = (COMBATATTE)pAttrTable.GetAddAttrTypebyIndex(i); int nAttrValue = m_SwordsMan.GetComBatAttrById(nAttrType); int nNextLevelAttrValue = m_SwordsMan.GetNextLevelComBatAttrById(nAttrType); if (nAttrValue > 0 && nCurEffectIndex < m_LabelCurEffect.Length && nCurEffectIndex >= 0) { m_LabelCurEffect[nCurEffectIndex].text = string.Format("{0}+{1}", ItemTool.ConvertAttrToString(nAttrType), nAttrValue.ToString()); m_LabelCurEffect[nCurEffectIndex].gameObject.SetActive(true); ++nCurEffectIndex; } if (nNextLevelAttrValue > 0 && nNextEffectIndex < m_LabelNextEffect.Length && nNextEffectIndex >= 0) { m_LabelNextEffect[nNextEffectIndex].text = string.Format("{0}+{1}", ItemTool.ConvertAttrToString(nAttrType), nNextLevelAttrValue.ToString()); m_LabelNextEffect[nNextEffectIndex].gameObject.SetActive(true); ++nNextEffectIndex; } } if (m_ShowType == SwordsMan_ShowType.Equiped || m_ShowType == SwordsMan_ShowType.UnEquiped) { if (m_SwordsMan.IsFullLevel()) { if (m_NextEffectGrid != null) { m_NextEffectGrid.SetActive(false); } if (m_NextEffectTitle != null) { m_NextEffectTitle.SetActive(false); } } else { if (m_NextEffectGrid != null) { m_NextEffectGrid.SetActive(true); } if (m_NextEffectTitle != null) { m_NextEffectTitle.SetActive(true); } } } else if (m_ShowType == SwordsMan_ShowType.ScoreShop || m_ShowType == SwordsMan_ShowType.ChatLink) { if (m_NextEffectTitle != null) { m_NextEffectTitle.SetActive(false); } if (m_NextEffectGrid != null) { m_NextEffectGrid.SetActive(false); } } }
public static int GetGemAttrValue(COMBATATTE attr, int gemid) { Tab_GemAttr line = TableManager.GetGemAttrByID(gemid, 0); if (line != null) { switch (attr) { case COMBATATTE.MAXHP: if (line.MaxHP > 0) { return(line.MaxHP); } break; case COMBATATTE.MAXMP: if (line.MaxMP > 0) { return(line.MaxMP); } break; case COMBATATTE.MAXXP: break; case COMBATATTE.PYSATTACK: if (line.PysAttack > 0) { return(line.PysAttack); } break; case COMBATATTE.MAGATTACK: if (line.MagAttack > 0) { return(line.MagAttack); } break; case COMBATATTE.PYSDEF: if (line.PysDef > 0) { return(line.PysDef); } break; case COMBATATTE.MAGDEF: if (line.MagDef > 0) { return(line.MagDef); } break; case COMBATATTE.HIT: if (line.Hit > 0) { return(line.Hit); } break; case COMBATATTE.DODGE: if (line.Dodge > 0) { return(line.Dodge); } break; case COMBATATTE.CRITICAL: if (line.Critical > 0) { return(line.Critical); } break; case COMBATATTE.DECRITICAL: if (line.Decritical > 0) { return(line.Decritical); } break; case COMBATATTE.STRIKE: if (line.Strike > 0) { return(line.Strike); } break; case COMBATATTE.DUCTICAL: if (line.Ductical > 0) { return(line.Ductical); } break; case COMBATATTE.CRITIADD: if (line.CritiAdd > 0) { return(line.CritiAdd); } break; case COMBATATTE.CRITIMIS: if (line.CritiMis > 0) { return(line.CritiMis); } break; case COMBATATTE.MOVESPEED: break; case COMBATATTE.ATTACKSPEED: break; default: break; } } return(0); }