private void CheckWeaponDistance(NebulaObject target, WeaponHitInfo hit) { if (hit.normal && BlockedByDistance(target)) { hit.Interrupt(ShotState.blockedByDistance); } }
private void CheckWeaponBlocked(WeaponHitInfo hit) { if (hit.normal && blocked) { hit.Interrupt(ShotState.blockedBySkill); } }
//private bool IsHitted(NebulaObject target, ref WeaponHitInfo hit) { // if(hit.normal) { // if(BlockedByDistance(target)) { // hit.Interrupt(ShotState.blockedByDistance); // return false; // } else { // float hitProb = 1.0f - ComputeMissProb(target); // hitProb = Mathf.ClampLess(hitProb, 0.0f); // if (Rand.Float01() <= hitProb) { // hit.Interrupt(ShotState.missed); // return false; // } else { // return true; // } // } // } // return false; //} private void CheckWeaponHit(NebulaObject target, WeaponHitInfo hit) { float hitProb = 1.0f - ComputeMissProb(target); hitProb = Mathf.ClampLess(hitProb, 0.0f); if (Rand.Float01() > hitProb) { hit.Interrupt(ShotState.missed); } }