public void Init(CharacterLogic ch, int index = -1)//数值在GameChar里面有函数计算 { Text_Attack.text = ch.GetAttack().ToString(); Text_Hit.text = ch.GetHit().ToString(); Text_Critical.text = ch.GetCritical().ToString(); Text_Range.text = ch.GetAttackRangeMin() + "-" + ch.GetAttackRangeMax(); Text_Anger.text = ch.GetAnger().ToString(); Text_AttackSpeed.text = ch.GetAttackSpeed().ToString(); Text_AttackEffect.text = "攻击特效显示";//medifyneed Text_Avoid.text = ch.GetAvoid().ToString(); Text_critAvoid.text = ch.GetCriticalAvoid().ToString(); Text_Movement.text = ch.GetMovement().ToString(); }
public static int GetAttackDamage(CharacterLogic attacker, CharacterLogic defender) { int dmg = attacker.GetAttack() - defender.GetPhysicalDefense(); return(Mathf.Max(0, dmg)); }
/// <summary> /// 考虑武器能力特效,克制关系,职业特效,技能修正等 /// </summary> /// <param name="attacker"></param> /// <param name="defender"></param> /// <returns></returns> public static int GetDamage(CharacterLogic attacker, CharacterLogic defender) { return(attacker.GetAttack() - defender.GetPhysicalDefense()); }