Exemplo n.º 1
0
        public void WarpControls()
        {
            if (this.Damaged())
            {
                this.SetMaxWarpFactor();
            }

            int distance;
            int direction;

            if (this.Movement.InvalidCourseCheck(out direction))
            {
                return;
            }


            if (this.Warp.InvalidWarpFactorCheck(this.MaxWarpFactor, out distance))
            {
                return;
            }

            int lastRegionY;
            int lastRegionX;

            if (!Warp.Engage(direction, distance, out lastRegionY, out lastRegionX, this.Game.Map))
            {
                return;
            }

            this.RepairOrTakeDamage(lastRegionX, lastRegionY);

            var crs = CombinedRangeScan.For(this.ShipConnectedTo);

            if (crs.Damaged())
            {
                ShortRangeScan.For(this.ShipConnectedTo).Controls();
            }
            else
            {
                crs.Controls();
            }

            //todo: upon arriving in Region, all damaged controls need to be enumerated
            //this.Game.Write.OutputConditionAndWarnings(this.ShipConnectedTo, this.Game.Config.GetSetting<int>("ShieldsDownLevel"));
        }
Exemplo n.º 2
0
        public void SublightControls()
        {
            int distance;
            int direction;

            if (this.Movement.InvalidCourseCheck(out direction))
            {
                return;
            }

            if (this.Impulse.InvalidSublightFactorCheck(this.MaxWarpFactor, out distance))
            {
                return;
            }

            int lastRegionY;
            int lastRegionX;

            if (!Impulse.Engage(direction, distance, out lastRegionY, out lastRegionX, this.Game.Map))
            {
                return;
            }

            this.RepairOrTakeDamage(lastRegionX, lastRegionY);

            var crs = CombinedRangeScan.For(this.ShipConnectedTo);

            if (crs.Damaged())
            {
                ShortRangeScan.For(this.ShipConnectedTo).Controls();
            }
            else
            {
                crs.Controls();
            }
        }
Exemplo n.º 3
0
        //output this as KeyValueCollection that the UI can display as it likes.

        public void PrintCurrentStatus(IMap map, int computerDamage, Ship ship, Region currentRegion)
        {
            if (this.Damaged())
            {
                return;
            }

            //todo: completely redo this

            this.Game.Write.Console.WriteLine("");
            this.Game.Write.Console.WriteLine(this.Game.Config.GetText("CSTimeRemaining"), map.timeRemaining);
            this.Game.Write.Console.WriteLine(this.Game.Config.GetText("CSHostilesRemaining"), map.Regions.GetHostileCount());
            this.Game.Write.Console.WriteLine(this.Game.Config.GetText("CSHostilesInRegion"), currentRegion.GetHostiles().Count);
            this.Game.Write.Console.WriteLine(this.Game.Config.GetText("CSStarbases"), map.starbases);
            this.Game.Write.Console.WriteLine(this.Game.Config.GetText("CSWarpEngineDamage"), Navigation.For(ship).Damage);
            this.Game.Write.Console.WriteLine(this.Game.Config.GetText("CSSRSDamage"), ShortRangeScan.For(ship).Damage);
            this.Game.Write.Console.WriteLine(this.Game.Config.GetText("CSLRSDamage"), LongRangeScan.For(ship).Damage);
            this.Game.Write.Console.WriteLine(this.Game.Config.GetText("CSCRSDamage"), CombinedRangeScan.For(ship).Damage);
            this.Game.Write.Console.WriteLine(this.Game.Config.GetText("CSShieldsDamage"), Shields.For(ship).Damage);
            this.Game.Write.Console.WriteLine(this.Game.Config.GetText("CSComputerDamage"), computerDamage);
            this.Game.Write.Console.WriteLine(this.Game.Config.GetText("CSPhotonDamage"), Torpedoes.For(ship).Damage);
            this.Game.Write.Console.WriteLine(this.Game.Config.GetText("CSPhaserDamage"), Phasers.For(ship).Damage);
            this.Game.Write.Console.WriteLine();

            //foreach (var badGuy in currentRegion.Hostiles)
            //{
            //
            //}

            this.Game.Write.Console.WriteLine();

            //todo: Display all baddie names in Region when encountered.
        }