Example #1
0
        public override IEnumerator Dispatch(FightBehaviour context)
        {
            context.isOcurring = true;

            float chance = UnityEngine.Random.Range(0, 1);

            if (chance >= minimumChanceToAttackPlayer)
            {
                battler.Attack();

                // Wait Until We Trigger Attack Animation
                yield return(new WaitUntil(() => battler.IsAttacking() == true));

                // Now Wait Until Attack Animation Is Over
                yield return(new WaitUntil(() => battler.IsAttacking() == false));
            }
            else
            {
                battler.Defend();

                // Wait Until We Trigger Attack Animation
                yield return(new WaitUntil(() => battler.IsDefending() == true));

                // Now Wait Until Attack Animation Is Over
                yield return(new WaitUntil(() => battler.IsDefending() == false));
            }

            context.isOcurring = false;
        }
        public override IEnumerator Dispatch(FightBehaviour context)
        {
            battler.Attack();

            // Wait Until We Trigger Attack Animation
            yield return(new WaitUntil(() => battler.IsAttacking() == true));

            // Now Wait Until Attack Animation Is Over
            yield return(new WaitUntil(() => battler.IsAttacking() == false));
        }
Example #3
0
        public override IEnumerator Dispatch(FightBehaviour context)
        {
            context.isOcurring = true;

            battler.Defend();

            // Wait Until We Trigger Attack Animation
            yield return(new WaitUntil(() => battler.IsDefending() == true));

            // Now Wait Until Attack Animation Is Over
            yield return(new WaitUntil(() => battler.IsDefending() == false));

            context.isOcurring = false;
        }
Example #4
0
 public virtual IEnumerator Dispatch(FightBehaviour context)
 {
     yield return(null);
 }
 public override IEnumerator Dispatch(FightBehaviour context)
 {
     StartCoroutine(customBehaviour.Dispatch(context));
     yield return(null);
 }