예제 #1
0
        public void ManageActionAndDisplayResult(Catcheur attaquant, Catcheur defenseur) // gère les actions
        {
            switch (attaquant.action)
            {
            case CatcheurAction.Defend:
                if (defenseur.action == CatcheurAction.Attack)
                {
                    defenseur.AttackTarget(attaquant);
                }
                else if (defenseur.action == CatcheurAction.Heal)
                {
                    defenseur.Heal(defenseur.BonusHeal);
                }
                else
                {
                    NothingIsHappening(attaquant, defenseur);
                }

                break;

            case CatcheurAction.Attack:
                if (defenseur.action == CatcheurAction.Attack)
                {
                    if (attaquant.AttackTarget(defenseur))
                    {
                        defenseur.AttackTarget(attaquant);
                    }
                }
                if (defenseur.action == CatcheurAction.Heal)
                {
                    if (attaquant.AttackTarget(defenseur))
                    {
                        defenseur.Heal(defenseur.BonusHeal);
                    }
                }
                else if (defenseur.action == CatcheurAction.Defend)
                {
                    attaquant.AttackTarget(defenseur);
                }
                else if (defenseur.action == CatcheurAction.SpeAttackFailed)
                {
                    attaquant.AttackTarget(defenseur);
                }
                break;

            case CatcheurAction.Heal:
                if (defenseur.action == CatcheurAction.Attack)
                {
                    attaquant.Heal(attaquant.BonusHeal);
                    defenseur.AttackTarget(attaquant);
                }
                if (defenseur.action == CatcheurAction.Heal)
                {
                    attaquant.Heal(attaquant.BonusHeal);
                    defenseur.Heal(defenseur.BonusHeal);
                }
                else if (defenseur.action == CatcheurAction.Defend)
                {
                    attaquant.Heal(attaquant.BonusHeal);
                }
                else if (defenseur.action == CatcheurAction.SpeAttackFailed)
                {
                    attaquant.Heal(attaquant.BonusHeal);
                }
                break;

            case CatcheurAction.SpeAttackFailed:
                if (defenseur.action == CatcheurAction.Attack)
                {
                    defenseur.AttackTarget(attaquant);
                }
                else if (defenseur.action == CatcheurAction.Heal)
                {
                    defenseur.Heal(defenseur.BonusHeal);
                }
                else
                {
                    NothingIsHappening(attaquant, defenseur);
                }
                break;
            }
        }
예제 #2
0
        public void IterationMatchUp(Catcheur c1, Catcheur c2, string trinary) // on génère les actions du round
        {
            switch (trinary)
            {
            // Attaque - Attaque
            case "00":
                Colorer.ColorAttack(c1);
                Colorer.ColorAttack(c2);

                if (c1.AttackTarget(c2))     // Si c1 attaque c2 & c2 ne meurt pas
                {
                    c2.AttackTarget(c1);
                }
                break;

            // Attaque - Defense
            case "01":
                Colorer.ColorAttack(c1);
                Colorer.ColorDefend(c2);
                c1.AttackTarget(c2);
                break;

            // Attaque - AttaqueSpe
            case "02":
                Colorer.ColorAttack(c1);
                Colorer.ColorAttackSpe(c2);
                SpecialAttackManager.instance.SpecialAttackComputing(c2);
                ManageActionAndDisplayResult(c1, c2);
                break;

            // Defense - Attaque
            case "10":
                Colorer.ColorDefend(c1);
                Colorer.ColorAttack(c2);
                c2.AttackTarget(c1);
                break;

            // Defense - Defense
            case "11":
                Colorer.ColorDefend(c1);
                Colorer.ColorDefend(c2);
                NothingIsHappening(c1, c2);
                break;

            // Defense - AttaqueSpe
            case "12":
                Colorer.ColorDefend(c1);
                Colorer.ColorAttackSpe(c2);
                SpecialAttackManager.instance.SpecialAttackComputing(c2);
                ManageActionAndDisplayResult(c1, c2);
                break;

            //AttaqueSpe - Attaque
            case "20":
                Colorer.ColorAttackSpe(c1);
                Colorer.ColorAttack(c2);
                SpecialAttackManager.instance.SpecialAttackComputing(c1);
                ManageActionAndDisplayResult(c1, c2);
                break;

            //AttaqueSpe - Defense
            case "21":
                Colorer.ColorAttackSpe(c1);
                Colorer.ColorDefend(c2);
                SpecialAttackManager.instance.SpecialAttackComputing(c1);
                ManageActionAndDisplayResult(c1, c2);
                break;

            // AttaqueSpe - AttaqueSpe
            case "22":
                Colorer.ColorAttackSpe(c1);
                Colorer.ColorAttackSpe(c2);
                SpecialAttackManager.instance.SpecialAttackComputing(c1);
                SpecialAttackManager.instance.SpecialAttackComputing(c2);
                ManageActionAndDisplayResult(c1, c2);
                break;
            }
        }