Ejemplo n.º 1
0
 public void Behaviors()
 {
     decisionTimer--;
     antiAirTimer--;
     if (AIcontrols.FreeToMakeDecisions() && !TimeControl.inSuperStartup[0] && !TimeControl.inSuperStartup[1])
     {
         if (animator.GetBool("isAirborne") == true && animator.GetBool("isLiftingOff") == false)
         {
             decision = Random.Range(0, 100);
             if (decision <= 1)
             {
                 AIcontrols.AIJumpFierce();
             }
             else if (decision <= 6 && decision > 1)
             {
                 AIcontrols.AIJumpRoundhouse();
             }
             AIcontrols.AICharges();
             character.SetBackPressed(true);
         }
         else if (character.GetKnockDown() == true)
         {
             AIcontrols.AICrouch();
             AIcontrols.AICharges();
             character.SetBackPressed(true);
         }
         else if (sharedProperties.GetAbDistanceFromOtherFighter() >= 2f)
         {
             if (player != null)
             {
                 if (playerCharacter.GetKnockDown() == true && playerCharacter.GetAirborne() == false)
                 {
                     KnockDownFromFarDecisions();
                 }
                 else if (playerCharacter.GetComponent <Ken>() != null || playerCharacter.GetComponent <Sagat>() != null)
                 {
                     DecisionMade(5, 1);
                     VsKenFromDistanceDecisions();
                 }
                 else
                 {
                     RegularFarRangeDecisions();
                 }
             }
             else if (opponent != null)
             {
                 if (opponentCharacter.GetKnockDown() == true && opponentCharacter.GetAirborne() == false)
                 {
                     KnockDownFromFarDecisions();
                 }
                 else if (opponentCharacter.GetComponent <Ken>() != null || opponentCharacter.GetComponent <Sagat>() != null)
                 {
                     DecisionMade(5, 1);
                     VsKenFromDistanceDecisions();
                 }
                 else
                 {
                     RegularFarRangeDecisions();
                 }
             }
         }
         else if (sharedProperties.GetAbDistanceFromOtherFighter() >= 1f && sharedProperties.GetAbDistanceFromOtherFighter() < 2f)
         {
             if (player != null)
             {
                 if (playerCharacter.GetKnockDown() == true && playerCharacter.GetAirborne() == false)
                 {
                     KnockDownFromMidRangeDecisions();
                 }
                 else
                 {
                     RegularMidRangeDecisions();
                 }
             }
             else if (opponent != null)
             {
                 if (opponentCharacter.GetKnockDown() == true && opponentCharacter.GetAirborne() == false)
                 {
                     KnockDownFromMidRangeDecisions();
                 }
                 else
                 {
                     RegularMidRangeDecisions();
                 }
             }
         }
         else
         {
             if (player != null)
             {
                 if (playerCharacter.GetBlockStunned() == true)
                 {
                     OtherFighterBlockedDecisions();
                 }
                 else if (playerCharacter.GetHitStunned() == true)
                 {
                     OtherFighterGotHitDecisions();
                 }
                 else if (playerCharacter.GetKnockDown() == true && playerCharacter.GetAirborne() == false)
                 {
                     KnockDownFromCloseRangeDecisions();
                 }
                 else if (playerCharacter.GetAirborne() == true && playerCharacter.GetKnockDown() == false && playerCharacter.GetThrown() == false)
                 {
                     if (antiAirTimer <= 0f)
                     {
                         sharedProperties.AIAntiAirDecision(60, RegularCloseRangeDecisions, PreparationForAntiAir);
                         antiAirTimer = antiAirTimerInput;
                     }
                     else
                     {
                         RegularCloseRangeDecisions();
                     }
                 }
                 else
                 {
                     RegularCloseRangeDecisions();
                 }
             }
             else if (opponent != null)
             {
                 if (opponentCharacter.GetBlockStunned() == true)
                 {
                     OtherFighterBlockedDecisions();
                 }
                 else if (opponentCharacter.GetHitStunned() == true)
                 {
                     OtherFighterGotHitDecisions();
                 }
                 else if (opponentCharacter.GetKnockDown() == true && opponentCharacter.GetAirborne() == false)
                 {
                     KnockDownFromCloseRangeDecisions();
                 }
                 else if (opponentCharacter.GetAirborne() == true && opponentCharacter.GetKnockDown() == false && opponentCharacter.GetThrown() == false)
                 {
                     if (antiAirTimer <= 0f)
                     {
                         sharedProperties.AIAntiAirDecision(60, RegularCloseRangeDecisions, PreparationForAntiAir);
                         antiAirTimer = antiAirTimerInput;
                     }
                     else
                     {
                         RegularCloseRangeDecisions();
                     }
                 }
                 else
                 {
                     RegularCloseRangeDecisions();
                 }
             }
         }
         AIcontrols.AIWalks();
     }
 }