Пример #1
0
        public void addListingsForGroup()
        {
            List <ActiveMission> branchMissions = this.os.branchMissions;

            this.os.branchMissions = (List <ActiveMission>)null;
            bool flag = false;

            if (!this.NeedsCustomFolderLoad && this.groupName.ToLower().Equals("entropy"))
            {
                this.NeedsCustomFolderLoad = true;
                this.CustomFolderLoadPath  = "Content/Missions/Entropy/StartingSet/";
                flag = true;
            }
            if (this.NeedsCustomFolderLoad)
            {
                foreach (FileSystemInfo file in new DirectoryInfo(this.CustomFolderLoadPath).GetFiles("*.xml"))
                {
                    string filename = this.CustomFolderLoadPath + file.Name;
                    this.os.branchMissions = new List <ActiveMission>();
                    this.addMisison((ActiveMission)ComputerLoader.readMission(filename), false);
                }
                if (flag)
                {
                    for (int index = 0; index < 2; ++index)
                    {
                        this.os.branchMissions = new List <ActiveMission>();
                        this.addMisison((ActiveMission)MissionGenerator.generate(2), false);
                    }
                }
            }
            else if (this.groupName.ToLower().Equals("netedu"))
            {
                this.addMisison((ActiveMission)ComputerLoader.readMission("Content/Missions/Misc/EducationArticles/Education4.0.xml"), false);
                this.addMisison((ActiveMission)ComputerLoader.readMission("Content/Missions/Misc/EducationArticles/Education2.xml"), false);
                this.addMisison((ActiveMission)ComputerLoader.readMission("Content/Missions/Misc/EducationArticles/Education3.xml"), false);
                this.addMisison((ActiveMission)ComputerLoader.readMission("Content/Missions/Misc/EducationArticles/Education1.xml"), false);
                this.addMisison((ActiveMission)ComputerLoader.readMission("Content/Missions/Misc/EducationArticles/Education4.1.xml"), false);
                this.addMisison((ActiveMission)ComputerLoader.readMission("Content/Missions/Misc/EducationArticles/Education5.xml"), false);
                this.addMisison((ActiveMission)ComputerLoader.readMission("Content/Missions/Misc/EducationArticles/Education6.xml"), false);
            }
            else if (this.groupName.ToLower().Equals("slashbot"))
            {
                this.addMisison((ActiveMission)ComputerLoader.readMission("Content/Missions/Entropy/NewsArticles/EntropyNews1.xml"), false);
                this.addMisison((ActiveMission)ComputerLoader.readMission("Content/Missions/Entropy/NewsArticles/EntropyNews3.xml"), false);
                this.addMisison((ActiveMission)ComputerLoader.readMission("Content/Missions/Entropy/NewsArticles/EntropyNews2.xml"), false);
                this.addMisison((ActiveMission)ComputerLoader.readMission("Content/Missions/Entropy/NewsArticles/EntropyNews4.xml"), false);
                this.addMisison((ActiveMission)ComputerLoader.readMission("Content/Missions/Entropy/NewsArticles/EntropyNews5.xml"), false);
            }
            else if (this.groupName.ToLower().Equals("kellis biotech"))
            {
                this.addMisison((ActiveMission)ComputerLoader.readMission("Content/Missions/MainHub/PacemakerSet/HardwareArticles/Hardware1.xml"), false);
                this.addMisison((ActiveMission)ComputerLoader.readMission("Content/Missions/MainHub/PacemakerSet/HardwareArticles/Hardware2.xml"), false);
                this.addMisison((ActiveMission)ComputerLoader.readMission("Content/Missions/MainHub/PacemakerSet/HardwareArticles/Hardware3.xml"), false);
                this.addMisison((ActiveMission)ComputerLoader.readMission("Content/Missions/MainHub/PacemakerSet/HardwareArticles/Hardware4.xml"), false);
                this.addMisison((ActiveMission)ComputerLoader.readMission("Content/Missions/MainHub/PacemakerSet/HardwareArticles/Hardware5.xml"), false);
            }
            this.os.branchMissions = branchMissions;
        }
Пример #2
0
        public static object generate(int secutiryLevel)
        {
            int type = 0;

            if (secutiryLevel <= 3)
            {
                type = 0;
            }
            else
            {
                type = 0;
                if (Utils.flipCoin())
                {
                    type = 1;
                }
            }
            int    index    = (int)((double)(MissionGenerator.MissionLists[type].Count - 1) * Utils.random.NextDouble() + 0.5);
            string filename = MissionGenerator.MissionLists[type][index];

            MissionGenerator.customKeysWereSet     = false;
            MissionGenerationParser.Client         = NameGenerator.generateName();
            MissionGenerationParser.Other          = "Unknown";
            MissionGenerationParser.Target         = NameGenerator.generateName();
            ComputerLoader.MissionPreLoadComplete += (Action)(() =>
            {
                Computer computer1 = (Computer)MissionGenerator.generateComputer(secutiryLevel, MissionGenerationParser.Target);
                Computer computer2;
                switch (type)
                {
                case 1:
                    computer2 = MissionGenerator.addWebsiteChangeRequirements(computer1, OS.currentInstance);
                    break;

                default:
                    computer2 = MissionGenerator.addFileDeletionRequirements(computer1, OS.currentInstance);
                    break;
                }
                computer2.idName = "Gen" + (object)MissionGenerator.generationCount;
                MissionGenerationParser.Comp = computer2.idName;
                OS.currentInstance.netMap.nodes.Add(computer2);
            });
            ActiveMission activeMission = (ActiveMission)ComputerLoader.readMission(filename);

            ComputerLoader.MissionPreLoadComplete = (Action)null;
            activeMission.wasAutoGenerated        = true;
            activeMission.genTarget     = MissionGenerationParser.Comp;
            activeMission.genPath       = MissionGenerationParser.Path;
            activeMission.genFile       = MissionGenerationParser.File;
            activeMission.client        = MissionGenerationParser.Client;
            activeMission.genTargetName = MissionGenerationParser.Target;
            activeMission.genOther      = MissionGenerationParser.Other;
            ++MissionGenerator.generationCount;
            return((object)activeMission);
        }
Пример #3
0
        protected override void LoadContent()
        {
            if (!CanLoadContent)
            {
                return;
            }
            PortExploits.populate();
            sman.controllingPlayer = PlayerIndex.One;
            if (Settings.isConventionDemo)
            {
                setWindowPosition(new Vector2(200f, 200f));
            }
            LoadGraphicsContent();
            LoadRegenSafeContent();
            var content = Content;

            GuiData.font        = content.Load <SpriteFont>("Font23");
            GuiData.titlefont   = content.Load <SpriteFont>("Kremlin");
            GuiData.smallfont   = Content.Load <SpriteFont>("Font12");
            GuiData.UISmallfont = GuiData.smallfont;
            GuiData.tinyfont    = Content.Load <SpriteFont>("Font10");
            GuiData.UITinyfont  = GuiData.tinyfont;
            GuiData.detailfont  = Content.Load <SpriteFont>("Font7");
            GuiData.spriteBatch = sman.SpriteBatch;
            GuiData.font        = content.Load <SpriteFont>("Font23");
            GuiData.titlefont   = content.Load <SpriteFont>("Kremlin");
            GuiData.smallfont   = Content.Load <SpriteFont>("Font12");
            GuiData.UISmallfont = GuiData.smallfont;
            GuiData.tinyfont    = Content.Load <SpriteFont>("Font10");
            GuiData.UITinyfont  = GuiData.tinyfont;
            GuiData.detailfont  = Content.Load <SpriteFont>("Font7");
            GuiData.init(Window);
            GuiData.InitFontOptions(Content);
            VehicleInfo.init();
            WorldLocationLoader.init();
            ThemeManager.init(content);
            MissionGenerationParser.init();
            MissionGenerator.init(content);
            UsernameGenerator.init();
            MusicManager.init(content);
            SFX.init(content);
            OldSystemSaveFileManifest.Load();
            SaveFileManager.Init();
            HasLoadedContent = true;
            LoadInitialScreens();
        }
Пример #4
0
        public void addListingsForGroup()
        {
            var list = os.branchMissions;

            os.branchMissions = null;
            if (groupName.ToLower().Equals("entropy"))
            {
                foreach (
                    FileSystemInfo fileSystemInfo in
                    new DirectoryInfo("Content/Missions/Entropy/StartingSet/").GetFiles("*.xml"))
                {
                    var filename = "Content/Missions/Entropy/StartingSet/" + fileSystemInfo.Name;
                    os.branchMissions = new List <ActiveMission>();
                    addMisison((ActiveMission)ComputerLoader.readMission(filename));
                }
                for (var index = 0; index < 2; ++index)
                {
                    os.branchMissions = new List <ActiveMission>();
                    addMisison((ActiveMission)MissionGenerator.generate(2));
                }
            }
            else if (groupName.ToLower().Equals("netedu"))
            {
                addMisison(
                    (ActiveMission)
                    ComputerLoader.readMission("Content/Missions/Misc/EducationArticles/Education4.0.xml"));
                addMisison(
                    (ActiveMission)ComputerLoader.readMission("Content/Missions/Misc/EducationArticles/Education2.xml"));
                addMisison(
                    (ActiveMission)ComputerLoader.readMission("Content/Missions/Misc/EducationArticles/Education3.xml"));
                addMisison(
                    (ActiveMission)ComputerLoader.readMission("Content/Missions/Misc/EducationArticles/Education1.xml"));
                addMisison(
                    (ActiveMission)
                    ComputerLoader.readMission("Content/Missions/Misc/EducationArticles/Education4.1.xml"));
                addMisison(
                    (ActiveMission)ComputerLoader.readMission("Content/Missions/Misc/EducationArticles/Education5.xml"));
                addMisison(
                    (ActiveMission)ComputerLoader.readMission("Content/Missions/Misc/EducationArticles/Education6.xml"));
            }
            else if (groupName.ToLower().Equals("slashbot"))
            {
                addMisison(
                    (ActiveMission)ComputerLoader.readMission("Content/Missions/Entropy/NewsArticles/EntropyNews1.xml"));
                addMisison(
                    (ActiveMission)ComputerLoader.readMission("Content/Missions/Entropy/NewsArticles/EntropyNews3.xml"));
                addMisison(
                    (ActiveMission)ComputerLoader.readMission("Content/Missions/Entropy/NewsArticles/EntropyNews2.xml"));
                addMisison(
                    (ActiveMission)ComputerLoader.readMission("Content/Missions/Entropy/NewsArticles/EntropyNews4.xml"));
                addMisison(
                    (ActiveMission)ComputerLoader.readMission("Content/Missions/Entropy/NewsArticles/EntropyNews5.xml"));
            }
            else if (groupName.ToLower().Equals("kellis biotech"))
            {
                addMisison(
                    (ActiveMission)
                    ComputerLoader.readMission(
                        "Content/Missions/MainHub/PacemakerSet/HardwareArticles/Hardware1.xml"));
                addMisison(
                    (ActiveMission)
                    ComputerLoader.readMission(
                        "Content/Missions/MainHub/PacemakerSet/HardwareArticles/Hardware2.xml"));
                addMisison(
                    (ActiveMission)
                    ComputerLoader.readMission(
                        "Content/Missions/MainHub/PacemakerSet/HardwareArticles/Hardware3.xml"));
                addMisison(
                    (ActiveMission)
                    ComputerLoader.readMission(
                        "Content/Missions/MainHub/PacemakerSet/HardwareArticles/Hardware4.xml"));
                addMisison(
                    (ActiveMission)
                    ComputerLoader.readMission(
                        "Content/Missions/MainHub/PacemakerSet/HardwareArticles/Hardware5.xml"));
            }
            os.branchMissions = list;
        }
Пример #5
0
        protected override void LoadContent()
        {
            if (!this.CanLoadContent)
            {
                return;
            }
            PortExploits.populate();
            this.sman.controllingPlayer = PlayerIndex.One;
            if (Settings.isConventionDemo)
            {
                this.setWindowPosition(new Vector2(200f, 200f));
            }
            this.LoadGraphicsContent();
            this.LoadRegenSafeContent();
            ContentManager content = this.Content;

            GuiData.font        = content.Load <SpriteFont>("Font23");
            GuiData.titlefont   = content.Load <SpriteFont>("Kremlin");
            GuiData.smallfont   = this.Content.Load <SpriteFont>("Font12");
            GuiData.UISmallfont = GuiData.smallfont;
            GuiData.tinyfont    = this.Content.Load <SpriteFont>("Font10");
            GuiData.UITinyfont  = this.Content.Load <SpriteFont>("Font10");
            GuiData.detailfont  = this.Content.Load <SpriteFont>("Font7");
            GuiData.spriteBatch = this.sman.SpriteBatch;
            GuiData.InitFontOptions(this.Content);
            GuiData.init(this.Window);
            DLC1SessionUpgrader.CheckForDLCFiles();
            VehicleInfo.init();
            WorldLocationLoader.init();
            ThemeManager.init(content);
            MissionGenerationParser.init();
            MissionGenerator.init(content);
            UsernameGenerator.init();
            MusicManager.init(content);
            SFX.init(content);
            OldSystemSaveFileManifest.Load();
            try
            {
                SaveFileManager.Init(true);
            }
            catch (UnauthorizedAccessException ex)
            {
                MainMenu.AccumErrors += " ---- WARNING ---\nHacknet cannot access the Save File Folder (Path Below) to read/write save files.\nNO PROGRESS WILL BE SAVED.\n";
                MainMenu.AccumErrors += "Check folder permissions, run Hacknet.exe as Administrator, and try again.\n";
                MainMenu.AccumErrors += "If Errors Persist, search for \"Hacknet Workaround\" for a steam forums thread with more options.\n";
                MainMenu.AccumErrors  = MainMenu.AccumErrors + ":: Error Details ::\n" + Utils.GenerateReportFromException((Exception)ex);
            }
            if (this.NeedsSettingsLocaleActivation)
            {
                if (!Settings.ForceEnglish)
                {
                    string forActiveLanguage = PlatformAPISettings.GetCodeForActiveLanguage(LocaleActivator.SupportedLanguages);
                    LocaleActivator.ActivateLocale(forActiveLanguage, this.Content);
                    Settings.ActiveLocale = forActiveLanguage;
                }
            }
            else if (SettingsLoader.didLoad && Settings.ActiveLocale != "en-us")
            {
                LocaleActivator.ActivateLocale(Settings.ActiveLocale, this.Content);
            }
            Helpfile.init();
            FileEntry.init(this.Content);
            this.HasLoadedContent = true;
            this.LoadInitialScreens();
            if (!WebRenderer.Enabled)
            {
                return;
            }
            XNAWebRenderer.XNAWR_Initialize("file:///nope.html", WebRenderer.textureUpdated, 512, 512);
            WebRenderer.setSize(512, 512);
        }