예제 #1
0
        private string BuildScript(string currentSystem, bool expeditionSystem)
        {
            string script = _scanCompletePhrases.GetRandomPhrase();

            if (!expeditionSystem)
            {
                return(script);
            }

            if (_navigator.GetSystem(currentSystem).Celestials.Any(c => c.Scanned == false))
            {
                int scansRemaining = _navigator.GetRemainingCelestials(currentSystem).Count();

                if (scansRemaining == 1)
                {
                    return(script += _oneRemainingPhrases.GetRandomPhrase());
                }

                return(script += _multipleRemainingPhrases.GetRandomPhraseWith(scansRemaining));
            }

            if (_navigator.ExpeditionComplete)
            {
                return(script += _expeditionCompletePhrases.GetRandomPhrase());
            }

            return(script += _allScansCompletePhrases.GetRandomPhrase());
        }
예제 #2
0
        private string BuildSystemValueScript(StarSystem system)
        {
            var scanOnlyValue = system.Celestials
                                .Where(c => !c.Scanned)
                                .Sum(c => _values.ScanValue(c.Classification));

            var totalValue = system.Celestials
                             .Where(c => !c.Scanned)
                             .Sum(c => _values.SurfaceScanValue(c.Classification));

            return(_systemValueBook.GetRandomPhraseWith(totalValue.ToSpeakableString(), scanOnlyValue.ToSpeakableString()));
        }
예제 #3
0
        public void Handle(IEvent @event)
        {
            List <StarSystem> systems = _navigator.GetAllExpeditionSystems();

            double totalSystems   = systems.Count;
            double scannedSystems = systems.Where(s => s.Scanned).Count();

            double progressPercentage = Math.Round(scannedSystems / totalSystems * 100);

            TimeSpan expeditionLength = _playerStatus.ExpeditionLength;

            _communicator.Communicate(_progressPhrases.GetRandomPhraseWith(expeditionLength.Days, expeditionLength.Hours, expeditionLength.Minutes, progressPercentage));
            _communicator.Communicate(_systemsScannedPhrases.GetRandomPhraseWith(scannedSystems, totalSystems));
        }
        private string BuildScript(string currentSystem, bool expeditionSystem)
        {
            string script = _surfaceScanCompletePhrases.GetRandomPhrase();

            if (!expeditionSystem)
            {
                return(script);
            }

            if (_navigator.GetSystem(currentSystem).Celestials.Any(c => c.SurfaceScanned == false))
            {
                int scansRemaining = _navigator.GetRemainingCelestials(currentSystem, onlySurfaceScans: true).Count();

                if (scansRemaining == 1)
                {
                    return(script += _oneSurfaceRemainingPhrases.GetRandomPhrase());
                }

                return(script += _multipleSurfacesRemainingPhrases.GetRandomPhraseWith(scansRemaining));
            }

            if (_navigator.ExpeditionComplete)
            {
                script += _expeditionCompletePhrases.GetRandomPhrase();
                script += _expeditionValuePhrases.GetRandomPhraseWith(_navigator.ValueForExpedition().ToSpeakableString());
                if (!String.IsNullOrEmpty(_playerStatus.Destination))
                {
                    script += _finalDestinationPhrases.GetRandomPhrase();
                }

                return(script);
            }

            script += _allSurfaceScansCompletePhrases.GetRandomPhrase();
            return(script += _expeditionValuePhrases.GetRandomPhraseWith(_navigator.ValueForExpedition().ToSpeakableString()));
        }
예제 #5
0
        private string BuildScript(Celestial nextToScan)
        {
            if (nextToScan == null)
            {
                return(_completePhrases.GetRandomPhrase());
            }

            string script = _nextScanPhrases.GetRandomPhraseWith(nextToScan.ShortName);

            if (nextToScan.Scanned == true && nextToScan.SurfaceScanned == false)
            {
                script += _surfacePhrases.GetRandomPhrase();
            }

            return(script);
        }
        public void Handle(IEvent @event)
        {
            string     currentSystem = _playerStatus.Location;
            StarSystem system        = _navigator.GetSystem(currentSystem);

            if (system == null)
            {
                _communicator.Communicate(_skipPhrases.GetRandomPhrase());
                return;
            }

            Celestial nextToScan = system.Celestials
                                   .Where(c => c.Scanned == false)
                                   .OrderBy(r => r.ShortName)
                                   .FirstOrDefault();

            if (nextToScan == null)
            {
                _communicator.Communicate(_completePhrases.GetRandomPhrase());
                return;
            }

            _communicator.Communicate(_nextScanPhrases.GetRandomPhraseWith(nextToScan.ShortName));
        }
예제 #7
0
        private string BuildScript(string currentSystem, string celestialName)
        {
            string script = _scanCompletePhrases.GetRandomPhrase();

            StarSystem system = _navigator.GetSystem(currentSystem);
            bool       exhaustedCelestialType = false;

            if (system.Celestials.Any(c => c.Scanned == false))
            {
                Celestial celestial = system.Celestials.First(c => c.Name == celestialName);
                if (celestial != null)
                {
                    // See if there are any more of the same celestial type
                    if (!system.Celestials.Any(c => c.Scanned == false && c.Classification == celestial.Classification))
                    {
                        // We've scanned all the planets of this classification

                        exhaustedCelestialType = true;
                        // "You've completed all the Terraformable water worlds."
                        script += _classificationCompletePhrases.GetRandomPhraseWith(celestial.LongClassification(_values));
                    }
                }

                List <Celestial> remainingCelestials = _navigator.GetRemainingCelestials(currentSystem);
                int scansRemaining = remainingCelestials.Count();

                if (scansRemaining == 1)
                {
                    script += _oneRemainingPhrases.GetRandomPhrase();
                    if (exhaustedCelestialType)
                    {
                        // "1 scan remains, a high metal content planet."
                        script += " a " + remainingCelestials.First().LongClassification(_values);
                    }
                }
                else
                {
                    script += _multipleRemainingPhrases.GetRandomPhraseWith(scansRemaining);
                    if (exhaustedCelestialType)
                    {
                        // "2 scans remain, 2 high metal content planets."
                        script += _navigator.SpokenCelestialList(remainingCelestials);
                    }
                }

                return(script);
            }

            if (_navigator.ExpeditionComplete)
            {
                script += _expeditionCompletePhrases.GetRandomPhrase();
                if (!String.IsNullOrEmpty(_playerStatus.Destination))
                {
                    script += _finalDestinationPhrases.GetRandomPhrase();
                }

                return(script);
            }

            script += _allScansCompletePhrases.GetRandomPhrase();
            script += _switchtoSurfacesPhrases.GetRandomPhrase();
            script += _systemValuePhrases.GetRandomPhraseWith(_navigator.ValueForSystem(currentSystem).ToSpeakableString());
            return(script);
        }