Esempio n. 1
0
        public static void ShiftnetStoryFeaturingTheBlueSmileyFaceHolyFuckThisFunctionNameIsLong()
        {
            CharacterName = "aiden";
            SysName       = "appscape_main";
            bool waiting   = false;
            var  installer = new Applications.Installer();

            installer.InstallCompleted += () =>
            {
                Desktop.InvokeOnWorkerThread(() =>
                {
                    AppearanceManager.Close(installer);
                });
                waiting = false;
            };

            if (!terminalOpen())
            {
                var term = new Applications.Terminal();
                AppearanceManager.SetupWindow(term);
            }

            WriteLine("aiden@appscape_main - user connecting to your system.", false);
            Thread.Sleep(2000);
            WriteLine("Hello there! My name's Aiden Nirh.");
            WriteLine("I run a small Shiftnet website known simply as \"Appscape\".");
            WriteLine("Oh - wait... you don't know what the Shiftnet is...");
            WriteLine("Well, the Shiftnet is like... a private Internet, only accessible through ShiftOS.");
            WriteLine("It has many sites and companies on it - banks, software centres, service providers, you name it.");
            WriteLine("Appscape is one of them. I host many applications on Appscape, from games to utilities to productivity programs, and anything in between. If it exists as a ShiftOS program, it's either on the Shiftorium or Appscape.");
            WriteLine("I'm going to assume you're interested... and I'll install the Shiftnet just in case.");
            WriteLine("Beginning installation of Shiftnet...");
            //Set up an Installer.
            waiting = true;
            Desktop.InvokeOnWorkerThread(() =>
            {
                SaveSystem.CurrentSave.StoriesExperienced.Add("installer");
                SaveSystem.CurrentSave.StoriesExperienced.Add("downloader");

                while (!Shiftorium.UpgradeInstalled("installer"))
                {
                    Thread.Sleep(20);
                }
                AppearanceManager.SetupWindow(installer);
                installer.InitiateInstall(new ShiftnetInstallation());
            });
            while (waiting == true)
            {
                Thread.Sleep(25);
            }

            WriteLine("All good to go! Once I disconnect, type win.open to see a list of your new apps.");
            WriteLine("I've installed everything you need, for free.");
            WriteLine("You've got the Downloader, a simple application to help you track Shiftnet file downloads...");
            WriteLine("...the Installer which will help you unpack programs from .stp files and install them to your system...");
            WriteLine("...and lastly, the Shiftnet browser itself. This program lets you browse the Shiftnet, much like you would the real Internet.");
            WriteLine("I'd stay on the shiftnet/ cluster though, because although there are many services on the Shiftnet, some of them may try to scam you into losing loads of Codepoints, or worse, wrecking your system with viruses.");
            WriteLine("If you want a nice list of safe Shiftnet services, head to ShiftSoft's \"Ping\" site, at shiftnet/shiftsoft/ping.");
            WriteLine("Oh, also, the Shiftnet, much like the real internet, is not free.");
            WriteLine("It requires a service provider. Service providers cost a fair amount of Codepoints, but if you want to get faster speeds and more reliable connections on the Shiftnet, finding a good service provider is a necessity.");
            WriteLine("Right now, you are on ShiftSoft's free trial plan, Freebie Solutions, which gives you access to the Shiftnet however you are locked at 256 bytes per second file downloads and can't leave the shiftnet/ cluster.");
            WriteLine("It's enough to get you started - you'll want to find a faster provider though..");
            WriteLine("Anyways, that's all I'll say for now. Have fun on the Shiftnet. I have to go work on something.");
            WriteLine("One of my friends'll contact you once you've gotten a new service provider.");



            Story.Context.MarkComplete();
            Story.Start("aiden_shiftnet2");
        }
Esempio n. 2
0
        public void ViewMoreInfo(ShiftoriumUpgrade upg)
        {
            lbtitle.Text = upg.Name;
            pnlappslist.Controls.Clear();

            var cp_display = new Panel();

            cp_display.Height = 30;
            cp_display.Dock   = DockStyle.Bottom;
            pnlappslist.Controls.Add(cp_display);
            cp_display.Show();

            var cp_value = new Label();

            if (Shiftorium.UpgradeInstalled(upg.ID))
            {
                cp_value.Text = "Already Purchased.";
            }
            else
            {
                cp_value.Text = $"{upg.Cost} CP";
            }
            cp_value.AutoSize = true;
            cp_value.Top      = (cp_display.Height - cp_value.Height) / 2;
            cp_value.Left     = 5;
            cp_display.Controls.Add(cp_value);
            cp_value.Show();


            if (cp_value.Text != "Already Purchased.")
            {
                var more_info = new Button();
                more_info.Text   = "Buy";
                more_info.Click += (o, a) =>
                {
                    //Detect if dependencies are installed.
                    if (DependenciesInstalled(upg))
                    {
                        //Detect sufficient codepoints
                        if (SaveSystem.CurrentSave.Codepoints >= upg.Cost)
                        {
                            Infobox.PromptYesNo("Confirm Purchase", "Do you want to purchase " + upg.Name + " from Appscape for " + upg.Cost.ToString() + " Codepoints?", (result) =>
                            {
                                if (result == true)
                                {
                                    SaveSystem.CurrentSave.Codepoints -= upg.Cost;
                                    foreach (var type in ReflectMan.Types)
                                    {
                                        var attrib = type.GetCustomAttributes(false).FirstOrDefault(x => x is AppscapeEntryAttribute) as AppscapeEntryAttribute;
                                        if (attrib != null)
                                        {
                                            if (attrib.Name == upg.Name)
                                            {
                                                var installer    = new Applications.Installer();
                                                var installation = new AppscapeInstallation(upg.Name, attrib.DownloadSize, upg.ID);
                                                AppearanceManager.SetupWindow(installer);
                                                installer.InitiateInstall(installation);
                                                return;
                                            }
                                        }
                                    }
                                }
                            });
                        }
                        else
                        {
                            Infobox.Show("Not enough Codepoints", "You do not have enough Codepoints to buy this package.");
                        }
                    }
                    else
                    {
                        Infobox.Show("Missing dependencies", "You are missing some Shiftorium upgrades that this package requires. Please upgrade your system and try again!");
                    }
                };
                more_info.AutoSize     = false;
                more_info.AutoSizeMode = AutoSizeMode.GrowAndShrink;
                more_info.Top          = (cp_display.Height - more_info.Height) / 2;
                more_info.Left         = cp_display.Width - more_info.Width - 5;
                cp_display.Controls.Add(more_info);
                more_info.Show();
                ControlManager.SetupControls(pnlappslist);
            }

            var desc = new Label();

            desc.Text     = upg.Description;
            desc.AutoSize = false;
            desc.Dock     = DockStyle.Fill;
            pnlappslist.Controls.Add(desc);
            desc.Show();
            desc.BringToFront();

            desc.Text += Environment.NewLine + Environment.NewLine + "Dependencies:" + Environment.NewLine;
            string[] deplist = upg.Dependencies.Split(';');
            if (deplist.Length > 1)
            {
                for (int i = 1; i < deplist.Length; i++)
                {
                    ShiftoriumUpgrade dep = Shiftorium.GetDefaults().FirstOrDefault(x => x.ID == deplist[i]);
                    if (dep != null)
                    {
                        desc.Text += $" - {dep.Name}{Environment.NewLine}";
                    }
                }
            }
            else
            {
                desc.Text += " - No dependencies.";
            }
        }