Exemple #1
0
 //只有指定的Hit能够通过
 public override bool Check(HitDef hitDef)
 {
     if (!IsActive())
     {
         return(true);
     }
     foreach (var hitInfo in this.m_infos)
     {
         if ((hitInfo.hitFlag & hitDef.hitFlag) != 0 && hitInfo.hitType == hitDef.hitType)
         {
             return(true);
         }
     }
     return(false);
 }
Exemple #2
0
        private static bool CanBeHit(HitDef hitDef, HitBy hitBy, NoHitBy noHitBy, PhysicsType defenderPhysicsType)
        {
            if (hitBy != null && !hitBy.Check(hitDef))
            {
                return(false);
            }
            if (noHitBy != null && noHitBy.Check(hitDef))
            {
                return(false);
            }
            int hitFlag = hitDef.hitFlag;

            if ((hitFlag & (int)HitFlag.H) != 0)
            {
                if (defenderPhysicsType == PhysicsType.Stand)
                {
                    return(true);
                }
            }
            if ((hitFlag & (int)HitFlag.L) != 0)
            {
                if (defenderPhysicsType == PhysicsType.Crouch)
                {
                    return(true);
                }
            }

            /*
             * if ((hitFlag & (int)HitFlag.A) != 0)
             * {
             *  if (defenderPhysicsType == PhysicsType.Air && (this.fsmMgr.stateNo != 5050))
             *      return true;
             * }
             * if ((hitFlag & (int)HitFlag.F) != 0)
             * {
             *  if (defenderPhysicsType == PhysicsType.Air && (fsmMgr.stateNo == 5050))
             *      return true;
             * }
             * if ((hitFlag & (int)HitFlag.D) != 0)
             * {
             * }
             */
            return(false);
        }
Exemple #3
0
        private static bool CanBeGuard(HitDef hitDef, PhysicsType defenderPhysicsType)
        {
            int guardFlag = hitDef.guardFlag;

            if ((guardFlag & (int)GuardFlag.H) != 0)
            {
                if (defenderPhysicsType == PhysicsType.Stand)
                {
                    return(true);
                }
            }
            if ((guardFlag & (int)GuardFlag.L) != 0)
            {
                if (defenderPhysicsType == PhysicsType.Crouch)
                {
                    return(true);
                }
            }
            return(false);
        }
Exemple #4
0
 public virtual bool Check(HitDef hitDef)
 {
     return(false);
 }
Exemple #5
0
 public void SetBeHitDef(HitDef hitDef)
 {
     m_beHitDefData = hitDef;
 }
Exemple #6
0
 public void SetHitDef(HitDef hitDef)
 {
     m_hitDefData = hitDef;
 }