Beispiel #1
0
        /// <summary>
        /// Called every time every players has finished their actions.
        /// </summary>
        protected void OnNewTurn()
        {
            for (int P = 0; P < ListPlayer.Count; P++)
            {
                for (int U = 0; U < ListPlayer[P].ListUnit.Count; U++)
                {
                    UnitConquest ActiveUnit = ListPlayer[P].ListUnit[U];

                    //Remove 5 EN each time the Squad spend a turn in the air.
                    if (ActiveUnit.CurrentMovement == "Air")
                    {
                        ActiveUnit.ConsumeEN(5);
                    }
                }
            }

            UpdateMapEvent(EventTypeTurn, 0);

            ActivePlayerIndex = 0;
            GameTurn++;

            for (int P = 0; P < ListPlayer.Count; P++)
            {
                for (int U = 0; U < ListPlayer[P].ListUnit.Count; U++)
                {
                    UnitConquest ActiveUnit = ListPlayer[P].ListUnit[U];

                    ActiveUnit.StartTurn();

                    ActiveUnit.UpdateSkillsLifetime(SkillEffect.LifetimeTypeTurns);
                }
            }
        }
        public override void OnSelect()
        {
            Map.FinalizeMovement(ActiveUnit);
            ActiveUnit.UpdateSkillsLifetime(SkillEffect.LifetimeTypeOnAction);
            TerrainConquest ActiveTerrain = Map.GetTerrain(ActiveUnit.Components);

            if (ActiveTerrain.CapturedPlayerIndex != Map.ActivePlayerIndex)
            {
                ActiveTerrain.CapturePoints = Math.Max(0, ActiveTerrain.CapturePoints - ActiveUnit.HP);
                if (ActiveTerrain.CapturePoints == 0)
                {
                    ActiveTerrain.CapturedPlayerIndex = Map.ActivePlayerIndex;
                }
            }

            RemoveAllSubActionPanels();
        }
        public override void OnSelect()
        {
            UnitConquest EnemyUnit        = Map.ListPlayer[ListSquadFound[0].Item1].ListUnit[ListSquadFound[0].Item2];
            int          TotalDamage      = 0;
            int          TotalEnemyDamage = 0;

            if (AttackIndex == 1)
            {
                TotalDamage = Map.GetAttackDamageWithWeapon1(ActiveUnit, EnemyUnit, ActiveUnit.HP);
            }
            else if (AttackIndex == 2)
            {
                TotalDamage = Map.GetAttackDamageWithWeapon2(ActiveUnit, EnemyUnit, ActiveUnit.HP);
            }

            List <Tuple <int, int> > ListSquadFoundEnemy = Map.CanSquadAttackWeapon1((int)EnemyUnit.X, (int)EnemyUnit.Y, ListSquadFound[0].Item1, EnemyUnit.ArmourType, EnemyUnit.ListAttack[0]);

            if (ListSquadFoundEnemy != null && ListSquadFoundEnemy.Count > 0 && ListSquadFoundEnemy.Contains(new Tuple <int, int>(Map.ActivePlayerIndex, Map.ListPlayer[Map.ActivePlayerIndex].ListUnit.IndexOf(ActiveUnit))))
            {
                TotalEnemyDamage = Map.GetAttackDamageWithWeapon1(EnemyUnit, ActiveUnit, EnemyUnit.HP - TotalDamage);
            }
            else if (ListSquadFoundEnemy == null || ListSquadFoundEnemy.Count == 0)
            {
                ListSquadFoundEnemy = Map.CanSquadAttackWeapon2((int)EnemyUnit.X, (int)EnemyUnit.Y, ListSquadFound[0].Item1, EnemyUnit.ArmourType, EnemyUnit.ListAttack[1]);
                if (ListSquadFoundEnemy != null && ListSquadFoundEnemy.Count > 0 && ListSquadFoundEnemy.Contains(new Tuple <int, int>(Map.ActivePlayerIndex, Map.ListPlayer[Map.ActivePlayerIndex].ListUnit.IndexOf(ActiveUnit))))
                {
                    TotalEnemyDamage = Map.GetAttackDamageWithWeapon2(EnemyUnit, ActiveUnit, EnemyUnit.HP - TotalDamage);
                }
            }

            Map.PushScreen(new BattleAnimationScreen(Map, ActiveUnit, EnemyUnit, TotalDamage, TotalEnemyDamage, "", true));

            EnemyUnit.DamageUnit(TotalDamage);
            ActiveUnit.DamageUnit(TotalEnemyDamage);

            Map.FinalizeMovement(ActiveUnit);
            ActiveUnit.UpdateSkillsLifetime(SkillEffect.LifetimeTypeOnAction);

            RemoveAllSubActionPanels();
        }
Beispiel #4
0
 public override void OnSelect()
 {
     Map.FinalizeMovement(ActiveUnit);
     ActiveUnit.UpdateSkillsLifetime(SkillEffect.LifetimeTypeOnAction);
     RemoveAllSubActionPanels();
 }