Exemplo n.º 1
0
        public int Fire(CSimpleArtillary ActualTarget, SlimEnemy SlimEnemy, SingleTargetFriendly Cannon)
        {
            int IsEnemyDead = 0;

            if (SlimEnemy.Health > 0 && this.CheckFireConstraints(ActualTarget))
            {
                SlimEnemy.Health -= this.Damage;
                SlimEnemy.HittedBy.Add(Cannon.CannonUID);

                if (SlimEnemy.Health <= 0)
                {
                    IsEnemyDead = 1;
                }
            }

            return(IsEnemyDead);
        }
Exemplo n.º 2
0
        public int Fire(CSimpleArtillary ActualTargets, SlimEnemy SlimEnemy, SlimFriendly Cannon)
        {
            int IsEnemyDead = 0;

            if (Cannon.Targets.Length > Cannon.ShotsTaken)
            {
                if (SlimEnemy.Health > 0 && this.CheckFireConstraints(ActualTargets))
                {
                    SlimEnemy.Health -= this.Damage;
                    SlimEnemy.HittedBy.Add(this.UID);

                    if (SlimEnemy.Health <= 0)
                    {
                        IsEnemyDead = 1;
                    }
                }

                Cannon.ShotsTaken++;
            }

            return(IsEnemyDead);
        }