Пример #1
0
        private void UpdateArmies(int attackerArmiesLost, int defenderArmiesLost)
        {
            attackerTerritory.LoseArmies(attackerArmiesLost);
            defenderTerritory.LoseArmies(defenderArmiesLost);

            if (attackerTerritory.GetTerritory().GetArmies() <= 3)
            {
                maxAttackerTanks = attackerTerritory.GetTerritory().GetArmies() - 1;
            }
            if (defenderTerritory.GetTerritory().GetArmies() < 3)
            {
                maxDefenderTanks = defenderTerritory.GetTerritory().GetArmies();
            }
            attackerHealth.value = maxAttackerTanks;
            defenderHealth.value = maxDefenderTanks;
        }
Пример #2
0
        public void StartAttack()
        {
            this.attacker          = GetGameManager().CurrentPlayerController;
            this.defender          = GetGameManager().DestinationTerritory.OwnerController;
            this.attackerTerritory = GetGameManager().SelectedTerritoy;
            this.defenderTerritory = GetGameManager().DestinationTerritory;

            maxAttackerTanks = attackerTerritory.GetTerritory().GetArmies() - 1;
            maxDefenderTanks = defenderTerritory.GetTerritory().GetArmies();

            attackerHealth.maxValue = maxAttackerTanks;
            defenderHealth.maxValue = maxDefenderTanks;
            attackerHealth.value    = maxAttackerTanks;
            defenderHealth.value    = maxDefenderTanks;
        }