Exemplo n.º 1
0
        private void TargetObjectInRegion()
        {
            string replyFromUser;

            this.Game.Write.PromptUser("Target with (T)orpedoes or (P)hasers? ", out replyFromUser);

            switch (replyFromUser.ToUpper())
            {
            case "T":
                Torpedoes.For(this.ShipConnectedTo).TargetObject();
                break;

            case "P":
                Phasers.For(this.ShipConnectedTo).TargetObject();
                break;
            }
        }
Exemplo n.º 2
0
        public override void Controls(string command)
        {
            var starship = this.ShipConnectedTo;

            switch (command.ToLower())
            {
            case "rec":
                Computer.For(this.ShipConnectedTo).PrintGalacticRecord(this.Game.Map.Regions);
                break;

            case "sta":

                //todo: get a list of all baddie names in Region

                this.PrintCurrentStatus(this.Game.Map,
                                        this.Damage,
                                        starship,
                                        this.ShipConnectedTo.GetRegion());
                break;

            case "tor":
                //todo: calculator code will be refactored to this object
                if (this.Damaged())
                {
                    return;
                }
                Torpedoes.For(this.ShipConnectedTo).Calculator();
                break;

            case "toq":
                this.TargetObjectInRegion();
                break;

            case "bas":
                //todo: calculator code will be refactored to this object
                if (this.Damaged())
                {
                    return;
                }
                Navigation.For(this.ShipConnectedTo).StarbaseCalculator(this.ShipConnectedTo);
                break;

            case "nav":
                //todo: calculator code will be refactored to this object
                if (this.Damaged())
                {
                    return;
                }
                Navigation.For(this.ShipConnectedTo).Calculator();
                break;

            case "tlm":

                if (this.Game.LatestTaunts != null && this.Game.LatestTaunts.Count > 0)
                {
                    TranslateLatestTaunt();
                }
                else
                {
                    this.Game.Write.Line("Nothing to translate..");
                }

                break;

            default:
                this.Game.Write.Line("Invalid computer this.Write");
                break;
            }
        }
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.
        }