Пример #1
0
    public void OnEnable()
    {
        FightStages attacker = fightersManager.GetAttacker();

        LanguagesFillers.FillAttackerSection(
            Title, AttackBaseTitle, DefenseBaseTitle, SabotageBaseTitle,
            AttackTotalTitle, DefenseTotalTitle, SabotageTotalTitle, TotalAttackTitle,
            Continue, attacker.IsPlayer, Round, attacker.Round
            );
        TotalAttackValue.text = attacker.Attack.TotalAttackPower.ToString();
        InitiliazeAttack(attacker);
        InitiliazeDefense(attacker);
        InitiliazeSabotage(attacker);
    }
Пример #2
0
    public void OnEnable()
    {
        FightStages attacker = fightersManager.GetAttacker();
        FightStages defender = fightersManager.GetDefender();

        LanguagesFillers.FillDamageResultPanel(
            Round, attacker.Round, PercentageTitle, DamageTitle, NormalTotalTitle,
            CriticalTotalTitle, PassiveTotalTitle, NormalDmgTitle, CriticalDmgTitle,
            PassiveDmgTitle, FaintedTitle, ReviveTitle, HealTitle, EndRoundBtn,
            AttackTotalHpTitle, DefenseTotalHpTitle
            );
        monsterPercentagesPanel.Initialize(attacker, defender);
        FillTotalDamageValues(attacker);
        FillAttackPanel(attacker, defender);
        FillDefensePanel(attacker, defender);
        FillSabotagePanel(attacker, defender);
        FillSquadHps(attacker, defender);
        fightersManager.ChangeStances();
    }
Пример #3
0
    public void Fight()
    {
        FightStages attacker = fightersManager.GetAttacker();
        FightStages defender = fightersManager.GetDefender();

        fightersManager.ManageRounds(attacker, defender);
        attacker.BuildAttackStats();
        defender.BuildDefenseStats();
        attacker.Attack.ProcessPowers(defender.Defense);
        defender.Defense.ProcessPowers(attacker.Attack);
        defender.Defense.CalculatePercentagesOfDamage();
        CalculateDamage(attacker, defender);
        defender.ApplyDamage(attacker.Attack.DamageToAttack, attacker.Attack.DamageToDefense, attacker.Attack.DamageToSabotage);
        if (defender.ProcessInjuries())
        {
            GameFinished = true;
            attacker.Won = true;
        }
        else
        {
            defender.RestoreHealth();
        }
    }