// 英雄最大属性值 [6/4/2015 Zmy] public float GetHeroMaxAttributeValue(EM_ATTRIBUTE _type) { float[] _attriValue = new float[GlobalMembers.MAX_TEAM_CELL_COUNT]; for (int i = 0; i < GlobalMembers.MAX_TEAM_CELL_COUNT; i++) { ObjectCard pHero = ObjectSelf.GetInstance().HeroContainerBag.FindHero(m_HeroInfo[i]); if (pHero != null) { switch (_type) { case EM_ATTRIBUTE.EM_ATTRIBUTE_MAXHP: _attriValue[i] = pHero.GetMaxHP(); break; case EM_ATTRIBUTE.EM_ATTRIBUTE_PHYSICALATTACK: _attriValue[i] = pHero.GetPhysicalAttack(); break; case EM_ATTRIBUTE.EM_ATTRIBUTE_MAGICATTACK: _attriValue[i] = pHero.GetMagicAttack(); break; case EM_ATTRIBUTE.EM_ATTRIBUTE_PHYSICALDEFENCE: _attriValue[i] = pHero.GetPhysicalDefence(); break; case EM_ATTRIBUTE.EM_ATTRIBUTE_MAGICDEFENCE: _attriValue[i] = pHero.GetMagicDefence(); break; case EM_ATTRIBUTE.EM_ATTRIBUTE_HIT: _attriValue[i] = pHero.GetHit(); break; case EM_ATTRIBUTE.EM_ATTRIBUTE_DODGE: _attriValue[i] = pHero.GetDodge(); break; case EM_ATTRIBUTE.EM_ATTRIBUTE_CRITICAL: _attriValue[i] = pHero.GetCritical(); break; case EM_ATTRIBUTE.EM_ATTRIBUTE_TENACITY: _attriValue[i] = pHero.GetTenacity(); break; case EM_ATTRIBUTE.EM_ATTRIBUTE_MOVESPEED: break; case EM_ATTRIBUTE.EM_ATTRIBUTE_SPEED: _attriValue[i] = pHero.GetSpeed(); break; case EM_ATTRIBUTE.EM_ATTRIBUTE_HIT_RATE: _attriValue[i] = pHero.GetHitRate(); break; case EM_ATTRIBUTE.EM_ATTRIBUTE_DODGE_RATE: _attriValue[i] = pHero.GetDodgeRate(); break; case EM_ATTRIBUTE.EM_ATTRIBUTE_CRITICAL_RATE: _attriValue[i] = pHero.GetCriticalRate(); break; case EM_ATTRIBUTE.EM_ATTRIBUTE_TENACITY_RATE: _attriValue[i] = pHero.GetTenacityRate(); break; case EM_ATTRIBUTE.EM_ATTRIBUTE_PHYSICAL_HURT_ADD_PERMIL: _attriValue[i] = pHero.GetPhysicalHurtAddPermil(); break; case EM_ATTRIBUTE.EM_ATTRIBUTE_PHYSICAL_HRUT_REDUCE_PERMIL: _attriValue[i] = pHero.GetPhysicalHurtReducePermil(); break; case EM_ATTRIBUTE.EM_ATTRIBUTE_MAGIC_HURT_ADD_PERMIL: _attriValue[i] = pHero.GetMagicHurtAddPermil(); break; case EM_ATTRIBUTE.EM_ATTRIBUTE_MAGIC_HURT_REDUCE_PERMIL: _attriValue[i] = pHero.GetMagicHurtReducePermil(); break; case EM_ATTRIBUTE.EM_ATTRIBUTE_CRITICAL_HURT_ADD_RATE: _attriValue[i] = pHero.GetCriticalHurtAddRate(); break; case EM_ATTRIBUTE.EM_ATTRIBUTE_CRITICAL_HURT_REDUCE_RATE: _attriValue[i] = pHero.GetCriticalHurtReduceRate(); break; case EM_ATTRIBUTE.EM_ATTRIBUTE_EXTRA_HURT: _attriValue[i] = pHero.GetExtraHurt(); break; case EM_ATTRIBUTE.EM_ATTRIBUTE_REDUCE_HURT_POINT: _attriValue[i] = pHero.GetReduceHurtPoint(); break; case EM_ATTRIBUTE.EM_ATTRIBUTE_HPRECOVER: _attriValue[i] = pHero.GetHpRecover(); break; default: break; } } } return(GameUtils.MaxValue(_attriValue)); }
// 极限试炼怪物属性计算 [6/4/2015 Zmy] // 公式:怪物属性=怪物基础属性*属性系数+玩家队伍英雄最高对应属性*附加系数 public int GetLimitMonsterAttribute(EM_ATTRIBUTE _type, float _curValue) { float nSum = 0; int nCurRound = m_RoundNum; UltimatetrialmonsterTemplate _row = (UltimatetrialmonsterTemplate)DataTemplate.GetInstance().m_UltimatetrialmonsterTable.getTableData(nCurRound); switch (_type) { case EM_ATTRIBUTE.EM_ATTRIBUTE_MAXHP: nSum = _curValue * _row.getMaxHPCoefficient() + GetHeroMaxAttributeValue(EM_ATTRIBUTE.EM_ATTRIBUTE_MAXHP) * _row.getAdditionalMaxHP(); break; case EM_ATTRIBUTE.EM_ATTRIBUTE_PHYSICALATTACK: nSum = _curValue * _row.getPhysicalAttackCoefficient() + GetHeroMaxAttributeValue(EM_ATTRIBUTE.EM_ATTRIBUTE_PHYSICALATTACK) * _row.getAdditionalPhysicalAttack(); break; case EM_ATTRIBUTE.EM_ATTRIBUTE_MAGICATTACK: nSum = _curValue * _row.getMagicAttackCoefficient() + GetHeroMaxAttributeValue(EM_ATTRIBUTE.EM_ATTRIBUTE_MAGICATTACK) * _row.getAdditionalMagicAttack(); break; case EM_ATTRIBUTE.EM_ATTRIBUTE_PHYSICALDEFENCE: nSum = _curValue * _row.getPhysicalDefenceCoefficient() + GetHeroMaxAttributeValue(EM_ATTRIBUTE.EM_ATTRIBUTE_PHYSICALDEFENCE) * _row.getAdditionalPhysicalDefence(); break; case EM_ATTRIBUTE.EM_ATTRIBUTE_MAGICDEFENCE: nSum = _curValue * _row.getMagicDefenceCoefficient() + GetHeroMaxAttributeValue(EM_ATTRIBUTE.EM_ATTRIBUTE_MAGICDEFENCE) * _row.getAdditionalMagicDefence(); break; case EM_ATTRIBUTE.EM_ATTRIBUTE_HIT: nSum = _curValue * _row.getHitCoefficient() + GetHeroMaxAttributeValue(EM_ATTRIBUTE.EM_ATTRIBUTE_HIT) * _row.getAdditionalHit(); break; case EM_ATTRIBUTE.EM_ATTRIBUTE_DODGE: nSum = _curValue * _row.getDodgeCoefficient() + GetHeroMaxAttributeValue(EM_ATTRIBUTE.EM_ATTRIBUTE_DODGE) * _row.getAdditionalDodge(); break; case EM_ATTRIBUTE.EM_ATTRIBUTE_CRITICAL: nSum = _curValue * _row.getCriticalCoefficient() + GetHeroMaxAttributeValue(EM_ATTRIBUTE.EM_ATTRIBUTE_CRITICAL) * _row.getAdditionalCritical(); break; case EM_ATTRIBUTE.EM_ATTRIBUTE_TENACITY: nSum = _curValue * _row.getTenacityCoefficient() + GetHeroMaxAttributeValue(EM_ATTRIBUTE.EM_ATTRIBUTE_TENACITY) * _row.getAdditionalTenacity(); break; case EM_ATTRIBUTE.EM_ATTRIBUTE_SPEED: nSum = _curValue /** _row.getPhysicalAttackCoefficient()*/ + GetHeroMaxAttributeValue(EM_ATTRIBUTE.EM_ATTRIBUTE_SPEED) * _row.getAdditionalSpeed(); break; case EM_ATTRIBUTE.EM_ATTRIBUTE_HIT_RATE: nSum = _curValue /** _row.getPhysicalAttackCoefficient()*/ + GetHeroMaxAttributeValue(EM_ATTRIBUTE.EM_ATTRIBUTE_HIT_RATE) * _row.getAdditionalBaseHit(); break; case EM_ATTRIBUTE.EM_ATTRIBUTE_DODGE_RATE: nSum = _curValue /** _row.getPhysicalAttackCoefficient()*/ + GetHeroMaxAttributeValue(EM_ATTRIBUTE.EM_ATTRIBUTE_DODGE_RATE) * _row.getAdditionalBaseDodge(); break; case EM_ATTRIBUTE.EM_ATTRIBUTE_CRITICAL_RATE: nSum = _curValue /** _row.getPhysicalAttackCoefficient()*/ + GetHeroMaxAttributeValue(EM_ATTRIBUTE.EM_ATTRIBUTE_CRITICAL_RATE) * _row.getAdditionalBaseCritical(); break; case EM_ATTRIBUTE.EM_ATTRIBUTE_TENACITY_RATE: nSum = _curValue /** _row.getPhysicalAttackCoefficient()*/ + GetHeroMaxAttributeValue(EM_ATTRIBUTE.EM_ATTRIBUTE_TENACITY_RATE) * _row.getAdditionalBaseTenacity(); break; case EM_ATTRIBUTE.EM_ATTRIBUTE_PHYSICAL_HURT_ADD_PERMIL: nSum = _curValue /** _row.getPhysicalAttackCoefficient()*/ + GetHeroMaxAttributeValue(EM_ATTRIBUTE.EM_ATTRIBUTE_PHYSICAL_HURT_ADD_PERMIL) * _row.getAdditionalBasePhyDamageIncrease(); break; case EM_ATTRIBUTE.EM_ATTRIBUTE_PHYSICAL_HRUT_REDUCE_PERMIL: nSum = _curValue /** _row.getPhysicalAttackCoefficient()*/ + GetHeroMaxAttributeValue(EM_ATTRIBUTE.EM_ATTRIBUTE_PHYSICAL_HRUT_REDUCE_PERMIL) * _row.getAdditionalBasePhyDamageDecrease(); break; case EM_ATTRIBUTE.EM_ATTRIBUTE_MAGIC_HURT_ADD_PERMIL: nSum = _curValue /** _row.getPhysicalAttackCoefficient()*/ + GetHeroMaxAttributeValue(EM_ATTRIBUTE.EM_ATTRIBUTE_MAGIC_HURT_ADD_PERMIL) * _row.getAdditionalBaseMagDamageIncrease(); break; case EM_ATTRIBUTE.EM_ATTRIBUTE_MAGIC_HURT_REDUCE_PERMIL: nSum = _curValue /** _row.getPhysicalAttackCoefficient()*/ + GetHeroMaxAttributeValue(EM_ATTRIBUTE.EM_ATTRIBUTE_MAGIC_HURT_REDUCE_PERMIL) * _row.getAdditionalBaseMagDamageDecrease(); break; case EM_ATTRIBUTE.EM_ATTRIBUTE_CRITICAL_HURT_ADD_RATE: nSum = _curValue /** _row.getPhysicalAttackCoefficient()*/ + GetHeroMaxAttributeValue(EM_ATTRIBUTE.EM_ATTRIBUTE_CRITICAL_HURT_ADD_RATE) * _row.getAdditionalBaseCriticalDamage(); break; case EM_ATTRIBUTE.EM_ATTRIBUTE_CRITICAL_HURT_REDUCE_RATE: nSum = _curValue /** _row.getPhysicalAttackCoefficient()*/ + GetHeroMaxAttributeValue(EM_ATTRIBUTE.EM_ATTRIBUTE_CRITICAL_HURT_REDUCE_RATE) * _row.getAdditionalBaseCriticalDamage(); break; case EM_ATTRIBUTE.EM_ATTRIBUTE_EXTRA_HURT: nSum = _curValue /** _row.getPhysicalAttackCoefficient()*/ + GetHeroMaxAttributeValue(EM_ATTRIBUTE.EM_ATTRIBUTE_EXTRA_HURT) * _row.getAdditionalDamageIncrease(); break; case EM_ATTRIBUTE.EM_ATTRIBUTE_REDUCE_HURT_POINT: nSum = _curValue /** _row.getPhysicalAttackCoefficient()*/ + GetHeroMaxAttributeValue(EM_ATTRIBUTE.EM_ATTRIBUTE_REDUCE_HURT_POINT) * _row.getAdditionalDamageDecrease(); break; case EM_ATTRIBUTE.EM_ATTRIBUTE_HPRECOVER: nSum = _curValue /** _row.getPhysicalAttackCoefficient()*/ + GetHeroMaxAttributeValue(EM_ATTRIBUTE.EM_ATTRIBUTE_HPRECOVER) * _row.getAdditionallifeRestoringForce(); break; default: break; } return((int)nSum); }
public void SetBitFlag(EM_ATTRIBUTE nType) { m_DirtyMask.UpdateBits((int)nType, true); }
public void ClearBitFlag(EM_ATTRIBUTE nType) { m_DirtyMask.UpdateBits((int)nType, false); }
public bool IsBitSet(EM_ATTRIBUTE nType) { return(m_DirtyMask.isSetBit((int)nType)); }