Legion story work (SPOILERS!)

This commit is contained in:
Michael 2017-04-09 15:56:14 -04:00
parent c17eadf177
commit 2ac1033c2d
9 changed files with 707 additions and 10 deletions

View file

@ -23,38 +23,43 @@ namespace ShiftOS.Objects
public enum UserClass
{
/// <summary>
/// The user has no class.
/// </summary>
None = 0,
/// <summary>
/// Skinners, otherwise known as "Shifters" due to their excessive use of the Shifter application, like to customize ShiftOS to look like other operating systems or even have an entirely different UI. They gain heaps of codepoints from it, and like to sell their skins for even more Codepoints.
/// </summary>
Skinner,
Skinner = 1,
/// <summary>
/// Hackers are notorious for taking down large groups and individuals of which have many useful documents and Codepoints on their system. Hackers enjoy the rush of typing malicious commands into their terminals and seeing how they affect their target.
/// </summary>
Hacker,
Hacker = 2,
/// <summary>
/// Much like hackers, investigators are skilled with a terminal and breaching systems, but they don't do it directly for monetary gain. They will search a target's system for any files and clues that may lead to them being guilty of a crime within the digital society. Unlike Hackers, Investigators mostly have higher reputations in society, and go after those with lower reputations.
/// </summary>
Investigator,
Investigator = 3,
/// <summary>
/// Explorers like to venture the vast regions of the multi-user domain and Shiftnet looking for secrets, hidden tools and software, and finding the hidden truths behind their screen. Explorers don't always know how to hack, but if it involves finding a secret about ShiftOS, they will do it. They typically do not have malicious intent.
/// </summary>
Explorer,
Explorer = 4,
/// <summary>
/// Safety Activists are skilled with exploitation and hacking, but they only go after the worst there is in the multi-user domain. Crime rings, large hacker groups, you name it. Their primary goal is keeping the multi-user domain safe.
/// </summary>
SafetyActivist,
SafetyActivist = 5,
/// <summary>
/// Penetration testers go hand-in-hand with Safety Activists. They go after the good guys, but rather than attacking them, they alert them that an exploit was found in their service and that this exploit should be fixed. They are a gray subject though - you never know if you are dealing with a genuine pen-tester or a hacker skilled with social engineering. Be careful.
/// </summary>
PenetrationTester,
PenetrationTester = 6,
/// <summary>
/// Collectors go well with Explorers - however, Collectors are the ones who open shops. They like to find rare objects and sell them for Codepoints.
/// </summary>
Collector,
Collector = 7,
/// <summary>
/// Programmers are the ones who write applications and services for ShiftOS and the multi-user domain. Depending on the code that they write, they can be seen as either morally wrong sentiences or morally correct sentiences, it's up to their decisions.
/// </summary>
Programmer
Programmer = 8
}
}

View file

@ -0,0 +1,104 @@
namespace ShiftOS.WinForms.Applications
{
partial class Installer
{
/// <summary>
/// Required designer variable.
/// </summary>
private System.ComponentModel.IContainer components = null;
/// <summary>
/// Clean up any resources being used.
/// </summary>
/// <param name="disposing">true if managed resources should be disposed; otherwise, false.</param>
protected override void Dispose(bool disposing)
{
if (disposing && (components != null))
{
components.Dispose();
}
base.Dispose(disposing);
}
#region Component Designer generated code
/// <summary>
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
/// </summary>
private void InitializeComponent()
{
this.lbtitle = new System.Windows.Forms.Label();
this.pnlselectfile = new System.Windows.Forms.Panel();
this.pginstall = new ShiftOS.WinForms.Controls.ShiftedProgressBar();
this.lbprogress = new System.Windows.Forms.Label();
this.SuspendLayout();
//
// lbtitle
//
this.lbtitle.AutoSize = true;
this.lbtitle.Location = new System.Drawing.Point(14, 13);
this.lbtitle.Name = "lbtitle";
this.lbtitle.Size = new System.Drawing.Size(155, 13);
this.lbtitle.TabIndex = 0;
this.lbtitle.Tag = "header2";
this.lbtitle.Text = "Installing MUD Control Centre...";
//
// pnlselectfile
//
this.pnlselectfile.Anchor = ((System.Windows.Forms.AnchorStyles)((((System.Windows.Forms.AnchorStyles.Top | System.Windows.Forms.AnchorStyles.Bottom)
| System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.pnlselectfile.Location = new System.Drawing.Point(17, 48);
this.pnlselectfile.Name = "pnlselectfile";
this.pnlselectfile.Size = new System.Drawing.Size(414, 85);
this.pnlselectfile.TabIndex = 1;
this.pnlselectfile.VisibleChanged += new System.EventHandler(this.pnlselectfile_VisibleChanged);
//
// pginstall
//
this.pginstall.Anchor = ((System.Windows.Forms.AnchorStyles)(((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)
| System.Windows.Forms.AnchorStyles.Right)));
this.pginstall.BlockSize = 5;
this.pginstall.Location = new System.Drawing.Point(17, 161);
this.pginstall.Maximum = 100;
this.pginstall.Name = "pginstall";
this.pginstall.Size = new System.Drawing.Size(414, 23);
this.pginstall.Style = System.Windows.Forms.ProgressBarStyle.Continuous;
this.pginstall.TabIndex = 2;
this.pginstall.Text = "shiftedProgressBar1";
this.pginstall.Value = 0;
//
// lbprogress
//
this.lbprogress.Anchor = ((System.Windows.Forms.AnchorStyles)((System.Windows.Forms.AnchorStyles.Bottom | System.Windows.Forms.AnchorStyles.Left)));
this.lbprogress.AutoSize = true;
this.lbprogress.Location = new System.Drawing.Point(17, 140);
this.lbprogress.Name = "lbprogress";
this.lbprogress.Size = new System.Drawing.Size(35, 13);
this.lbprogress.TabIndex = 3;
this.lbprogress.Text = "label1";
//
// Installer
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font;
this.Controls.Add(this.lbprogress);
this.Controls.Add(this.pginstall);
this.Controls.Add(this.pnlselectfile);
this.Controls.Add(this.lbtitle);
this.Name = "Installer";
this.Size = new System.Drawing.Size(447, 203);
this.ResumeLayout(false);
this.PerformLayout();
}
#endregion
private System.Windows.Forms.Label lbtitle;
private System.Windows.Forms.Panel pnlselectfile;
private Controls.ShiftedProgressBar pginstall;
private System.Windows.Forms.Label lbprogress;
}
}

View file

@ -0,0 +1,150 @@
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Drawing;
using System.Data;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using ShiftOS.Engine;
namespace ShiftOS.WinForms.Applications
{
public partial class Installer : UserControl, IShiftOSWindow
{
public Installer()
{
InitializeComponent();
lbtitle.Text = "Select file";
}
public void InitiateInstall(Installation install)
{
pnlselectfile.Hide();
install.ProgressReported += (p) =>
{
this.Invoke(new Action(() =>
{
pginstall.Value = p;
}));
};
install.StatusReported += (s) =>
{
this.Invoke(new Action(() =>
{
lbprogress.Text = s;
}));
};
install.InstallCompleted += () =>
{
this.Invoke(new Action(() =>
{
lbtitle.Text = "Select file";
pnlselectfile.Show();
}));
isInstalling = false;
InstallCompleted?.Invoke();
};
isInstalling = true;
install.Install();
}
public void OnLoad()
{
}
private bool isInstalling = false;
public void OnSkinLoad()
{
}
public bool OnUnload()
{
return !isInstalling; //Don't close if an install is running.
}
public void OnUpgrade()
{
}
private void pnlselectfile_VisibleChanged(object sender, EventArgs e)
{
if(this.ParentForm != null)
{
this.ParentForm.Height = (pnlselectfile.Visible == true) ? this.ParentForm.Height + pnlselectfile.Height : this.ParentForm.Height - pnlselectfile.Height;
}
}
public event Action InstallCompleted;
}
public abstract class Installation
{
/// <summary>
/// The display name of the installation.
/// </summary>
public string Name { get; set; }
/// <summary>
/// Occurs when the installation updates its status.
/// </summary>
public event Action<string> StatusReported;
/// <summary>
/// Occurs when the installation updates its progress percentage.
/// </summary>
public event Action<int> ProgressReported;
/// <summary>
/// Occurs when the installation completes.
/// </summary>
public event Action InstallCompleted;
/// <summary>
/// Start the installation.
/// </summary>
public void Install()
{
var t = new System.Threading.Thread(() =>
{
ProgressReported?.Invoke(0);
StatusReported?.Invoke("");
Run();
ProgressReported?.Invoke(100);
StatusReported?.Invoke("Installation completed.");
InstallCompleted?.Invoke();
});
t.IsBackground = true;
t.Start();
}
/// <summary>
/// Sets the install progress percentage.
/// </summary>
/// <param name="value">The installation percentage.</param>
protected void SetProgress(int value)
{
if (value < 0 || value > 100)
throw new ArgumentOutOfRangeException("value", "A percentage is typically between 0 and 100.... derp...");
ProgressReported?.Invoke(value);
}
/// <summary>
/// Sets the install status text.
/// </summary>
/// <param name="status">Text to display as status.</param>
protected void SetStatus(string status)
{
StatusReported?.Invoke(status);
}
/// <summary>
/// User-defined code to run during install. Once this code is ran, the installation is complete.
/// </summary>
protected abstract void Run();
}
}

View file

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="utf-8"?>
<root>
<!--
Microsoft ResX Schema
Version 2.0
The primary goals of this format is to allow a simple XML format
that is mostly human readable. The generation and parsing of the
various data types are done through the TypeConverter classes
associated with the data types.
Example:
... ado.net/XML headers & schema ...
<resheader name="resmimetype">text/microsoft-resx</resheader>
<resheader name="version">2.0</resheader>
<resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
<resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
<data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
<data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
<data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
<value>[base64 mime encoded serialized .NET Framework object]</value>
</data>
<data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
<value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
<comment>This is a comment</comment>
</data>
There are any number of "resheader" rows that contain simple
name/value pairs.
Each data row contains a name, and value. The row also contains a
type or mimetype. Type corresponds to a .NET class that support
text/value conversion through the TypeConverter architecture.
Classes that don't support this are serialized and stored with the
mimetype set.
The mimetype is used for serialized objects, and tells the
ResXResourceReader how to depersist the object. This is currently not
extensible. For a given mimetype the value must be set accordingly:
Note - application/x-microsoft.net.object.binary.base64 is the format
that the ResXResourceWriter will generate, however the reader can
read any of the formats listed below.
mimetype: application/x-microsoft.net.object.binary.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.soap.base64
value : The object must be serialized with
: System.Runtime.Serialization.Formatters.Soap.SoapFormatter
: and then encoded with base64 encoding.
mimetype: application/x-microsoft.net.object.bytearray.base64
value : The object must be serialized into a byte array
: using a System.ComponentModel.TypeConverter
: and then encoded with base64 encoding.
-->
<xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
<xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
<xsd:element name="root" msdata:IsDataSet="true">
<xsd:complexType>
<xsd:choice maxOccurs="unbounded">
<xsd:element name="metadata">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" />
</xsd:sequence>
<xsd:attribute name="name" use="required" type="xsd:string" />
<xsd:attribute name="type" type="xsd:string" />
<xsd:attribute name="mimetype" type="xsd:string" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="assembly">
<xsd:complexType>
<xsd:attribute name="alias" type="xsd:string" />
<xsd:attribute name="name" type="xsd:string" />
</xsd:complexType>
</xsd:element>
<xsd:element name="data">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
<xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
<xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
<xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
<xsd:attribute ref="xml:space" />
</xsd:complexType>
</xsd:element>
<xsd:element name="resheader">
<xsd:complexType>
<xsd:sequence>
<xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
</xsd:sequence>
<xsd:attribute name="name" type="xsd:string" use="required" />
</xsd:complexType>
</xsd:element>
</xsd:choice>
</xsd:complexType>
</xsd:element>
</xsd:schema>
<resheader name="resmimetype">
<value>text/microsoft-resx</value>
</resheader>
<resheader name="version">
<value>2.0</value>
</resheader>
<resheader name="reader">
<value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
<resheader name="writer">
<value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
</resheader>
</root>

View file

@ -144,6 +144,12 @@ namespace ShiftOS.WinForms.Applications
this.you_memos = new System.Windows.Forms.Panel();
this.flmemos = new System.Windows.Forms.FlowLayoutPanel();
this.label3 = new System.Windows.Forms.Label();
this.pnlclasses = new System.Windows.Forms.Panel();
this.lbclasstitle = new System.Windows.Forms.Label();
this.lbclassdesc = new System.Windows.Forms.Label();
this.lbclasses = new System.Windows.Forms.ListBox();
this.flowLayoutPanel6 = new System.Windows.Forms.FlowLayoutPanel();
this.btnchooseclass = new System.Windows.Forms.Button();
this.menuStrip1.SuspendLayout();
this.toolStripContainer1.ContentPanel.SuspendLayout();
this.toolStripContainer1.TopToolStripPanel.SuspendLayout();
@ -172,6 +178,8 @@ namespace ShiftOS.WinForms.Applications
this.panel3.SuspendLayout();
this.flowLayoutPanel2.SuspendLayout();
this.you_memos.SuspendLayout();
this.pnlclasses.SuspendLayout();
this.flowLayoutPanel6.SuspendLayout();
this.SuspendLayout();
//
// menuStrip1
@ -301,6 +309,7 @@ namespace ShiftOS.WinForms.Applications
//
// toolStripContainer1.ContentPanel
//
this.toolStripContainer1.ContentPanel.Controls.Add(this.pnlclasses);
this.toolStripContainer1.ContentPanel.Controls.Add(this.you_systemstatus);
this.toolStripContainer1.ContentPanel.Controls.Add(this.shop_all);
this.toolStripContainer1.ContentPanel.Controls.Add(this.shop_view);
@ -1182,6 +1191,75 @@ namespace ShiftOS.WinForms.Applications
this.label3.Tag = "header1";
this.label3.Text = "Memos";
//
// pnlclasses
//
this.pnlclasses.Controls.Add(this.flowLayoutPanel6);
this.pnlclasses.Controls.Add(this.lbclasses);
this.pnlclasses.Controls.Add(this.lbclassdesc);
this.pnlclasses.Controls.Add(this.lbclasstitle);
this.pnlclasses.Dock = System.Windows.Forms.DockStyle.Fill;
this.pnlclasses.Location = new System.Drawing.Point(0, 0);
this.pnlclasses.Name = "pnlclasses";
this.pnlclasses.Size = new System.Drawing.Size(756, 464);
this.pnlclasses.TabIndex = 3;
//
// lbclasstitle
//
this.lbclasstitle.AutoSize = true;
this.lbclasstitle.Dock = System.Windows.Forms.DockStyle.Top;
this.lbclasstitle.Location = new System.Drawing.Point(0, 0);
this.lbclasstitle.Name = "lbclasstitle";
this.lbclasstitle.Padding = new System.Windows.Forms.Padding(10);
this.lbclasstitle.Size = new System.Drawing.Size(82, 33);
this.lbclasstitle.TabIndex = 0;
this.lbclasstitle.Tag = "header1";
this.lbclasstitle.Text = "Join a class";
//
// lbclassdesc
//
this.lbclassdesc.AutoSize = true;
this.lbclassdesc.Dock = System.Windows.Forms.DockStyle.Top;
this.lbclassdesc.Location = new System.Drawing.Point(0, 33);
this.lbclassdesc.Name = "lbclassdesc";
this.lbclassdesc.Padding = new System.Windows.Forms.Padding(10);
this.lbclassdesc.Size = new System.Drawing.Size(727, 33);
this.lbclassdesc.TabIndex = 1;
this.lbclassdesc.Text = "A class is a way for the multi-user domain to better understand you. It defines w" +
"ho you are as a sentient being, what you do, what you like, and so on.";
//
// lbclasses
//
this.lbclasses.Dock = System.Windows.Forms.DockStyle.Fill;
this.lbclasses.FormattingEnabled = true;
this.lbclasses.Location = new System.Drawing.Point(0, 66);
this.lbclasses.Name = "lbclasses";
this.lbclasses.Size = new System.Drawing.Size(756, 398);
this.lbclasses.TabIndex = 2;
//
// flowLayoutPanel6
//
this.flowLayoutPanel6.AutoSize = true;
this.flowLayoutPanel6.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.flowLayoutPanel6.Controls.Add(this.btnchooseclass);
this.flowLayoutPanel6.Dock = System.Windows.Forms.DockStyle.Bottom;
this.flowLayoutPanel6.Location = new System.Drawing.Point(0, 415);
this.flowLayoutPanel6.Name = "flowLayoutPanel6";
this.flowLayoutPanel6.Padding = new System.Windows.Forms.Padding(10);
this.flowLayoutPanel6.Size = new System.Drawing.Size(756, 49);
this.flowLayoutPanel6.TabIndex = 3;
//
// btnchooseclass
//
this.btnchooseclass.AutoSize = true;
this.btnchooseclass.AutoSizeMode = System.Windows.Forms.AutoSizeMode.GrowAndShrink;
this.btnchooseclass.Location = new System.Drawing.Point(13, 13);
this.btnchooseclass.Name = "btnchooseclass";
this.btnchooseclass.Size = new System.Drawing.Size(53, 23);
this.btnchooseclass.TabIndex = 0;
this.btnchooseclass.Text = "Choose";
this.btnchooseclass.UseVisualStyleBackColor = true;
this.btnchooseclass.Click += new System.EventHandler(this.btnchooseclass_Click);
//
// MUDControlCentre
//
this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F);
@ -1242,6 +1320,10 @@ namespace ShiftOS.WinForms.Applications
this.flowLayoutPanel2.PerformLayout();
this.you_memos.ResumeLayout(false);
this.you_memos.PerformLayout();
this.pnlclasses.ResumeLayout(false);
this.pnlclasses.PerformLayout();
this.flowLayoutPanel6.ResumeLayout(false);
this.flowLayoutPanel6.PerformLayout();
this.ResumeLayout(false);
}
@ -1339,5 +1421,11 @@ namespace ShiftOS.WinForms.Applications
private System.Windows.Forms.ToolStripMenuItem chatToolStripMenuItem;
private System.Windows.Forms.ToolStripMenuItem joinAChatToolStripMenuItem;
private System.Windows.Forms.Button btndeletesave;
private System.Windows.Forms.Panel pnlclasses;
private System.Windows.Forms.FlowLayoutPanel flowLayoutPanel6;
private System.Windows.Forms.Button btnchooseclass;
private System.Windows.Forms.ListBox lbclasses;
private System.Windows.Forms.Label lbclassdesc;
private System.Windows.Forms.Label lbclasstitle;
}
}

View file

@ -39,7 +39,7 @@ using ShiftOS.WinForms.Tools;
namespace ShiftOS.WinForms.Applications
{
[MultiplayerOnly]
[RequiresUpgrade("mud_fundamentals")]
[RequiresUpgrade("mud_control_centre")]
[Launcher("MUD Control Centre", true, "al_mud_control_centre", "Networking")]
[WinOpen("mud_control_centre")]
[DefaultIcon("iconSysinfo")]
@ -177,6 +177,42 @@ namespace ShiftOS.WinForms.Applications
};
}
internal void ShowClasses()
{
var descriptions = new Dictionary<UserClass, string> {
{ UserClass.Skinner, "Skinners, otherwise known as \"Shifters\" due to their excessive use of the Shifter application, like to customize ShiftOS to look like other operating systems or even have an entirely different UI. They gain heaps of codepoints from it, and like to sell their skins for even more Codepoints." },
{ UserClass.Hacker, "Hackers are notorious for taking down large groups and individuals of which have many useful documents and Codepoints on their system. Hackers enjoy the rush of typing malicious commands into their terminals and seeing how they affect their target." },
{ UserClass.Investigator, "Much like hackers, investigators are skilled with a terminal and breaching systems, but they don't do it directly for monetary gain. They will search a target's system for any files and clues that may lead to them being guilty of a crime within the digital society. Unlike Hackers, Investigators mostly have higher reputations in society, and go after those with lower reputations."},
{ UserClass.Explorer, "Explorers like to venture the vast regions of the multi-user domain and Shiftnet looking for secrets, hidden tools and software, and finding the hidden truths behind their screen. Explorers don't always know how to hack, but if it involves finding a secret about ShiftOS, they will do it. They typically do not have malicious intent."},
{ UserClass.SafetyActivist, "Safety Activists are skilled with exploitation and hacking, but they only go after the worst there is in the multi-user domain. Crime rings, large hacker groups, you name it. Their primary goal is keeping the multi-user domain safe." },
{ UserClass.PenetrationTester, "Penetration testers go hand-in-hand with Safety Activists. They go after the good guys, but rather than attacking them, they alert them that an exploit was found in their service and that this exploit should be fixed. They are a gray subject though - you never know if you are dealing with a genuine pen-tester or a hacker skilled with social engineering. Be careful." },
{ UserClass.Collector, "Collectors go well with Explorers - however, Collectors are the ones who open shops. They like to find rare objects and sell them for Codepoints." },
{UserClass.Programmer, "Programmers are the ones who write applications and services for ShiftOS and the multi-user domain. Depending on the code that they write, they can be seen as either morally wrong sentiences or morally correct sentiences, it's up to their decisions." },
};
lbclasses.Items.Clear();
lbclasses.SelectedIndexChanged += (o, a) =>
{
newClass = (UserClass)Enum.Parse(typeof(UserClass), lbclasses.SelectedItem.ToString());
lbclassdesc.Text = descriptions[newClass];
lbclasstitle.Text = newClass.ToString();
};
foreach (var kv in descriptions)
{
lbclasses.Items.Add(kv.Key.ToString());
}
menuStrip1.Hide();
pnlclasses.Show();
pnlclasses.BringToFront();
}
UserClass newClass = UserClass.None;
public void ListAllChats(Channel[] channels)
{
shop_all.BringToFront();
@ -890,5 +926,21 @@ Current legions: {legionname}";
}
});
}
public event Action ClassChanged;
private void btnchooseclass_Click(object sender, EventArgs e)
{
if(newClass != UserClass.None)
{
SaveSystem.CurrentSave.Class = newClass;
SaveSystem.SaveGame();
ClassChanged?.Invoke();
menuStrip1.Show();
pnlclasses.SendToBack();
this.SetupSystemStatus();
return;
}
}
}
}

View file

@ -64,7 +64,6 @@ namespace ShiftOS.WinForms.Controls
public void Write(string text)
{
this.HideSelection = true;
this.Select(this.TextLength, 0);
this.SelectionFont = ConstructFont();
this.SelectionColor = ControlManager.ConvertColor(ConsoleEx.ForegroundColor);
this.SelectionBackColor = ControlManager.ConvertColor(ConsoleEx.BackgroundColor);

View file

@ -131,6 +131,12 @@
<Compile Include="Applications\GraphicPicker.Designer.cs">
<DependentUpon>GraphicPicker.cs</DependentUpon>
</Compile>
<Compile Include="Applications\Installer.cs">
<SubType>UserControl</SubType>
</Compile>
<Compile Include="Applications\Installer.Designer.cs">
<DependentUpon>Installer.cs</DependentUpon>
</Compile>
<Compile Include="Applications\ShiftLetters.cs">
<SubType>UserControl</SubType>
</Compile>
@ -279,6 +285,7 @@
<Compile Include="ScriptingTestFunctions.cs" />
<Compile Include="ShiftOSAudioProvider.cs" />
<Compile Include="ShiftOSConfigFile.cs" />
<Compile Include="Stories\LegionStory.cs" />
<Compile Include="Tools\ColorPickerDataBackend.cs" />
<Compile Include="Tools\ControlManager.cs" />
<Compile Include="Tools\DitheringEngine.cs" />
@ -336,6 +343,9 @@
<EmbeddedResource Include="Applications\GraphicPicker.resx">
<DependentUpon>GraphicPicker.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Applications\Installer.resx">
<DependentUpon>Installer.cs</DependentUpon>
</EmbeddedResource>
<EmbeddedResource Include="Applications\ShiftLetters.resx">
<DependentUpon>ShiftLetters.cs</DependentUpon>
</EmbeddedResource>

View file

@ -0,0 +1,169 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using ShiftOS.Engine;
namespace ShiftOS.WinForms.Stories
{
public static class LegionStory
{
private static void WriteLine(string text, bool showCharacterName=true)
{
Console.WriteLine();
if (showCharacterName == true)
{
ConsoleEx.Bold = true;
ConsoleEx.ForegroundColor = ConsoleColor.DarkMagenta;
Console.Write("DevX");
Console.ForegroundColor = ConsoleColor.White;
Console.Write("@");
ConsoleEx.ForegroundColor = ConsoleColor.Yellow;
Console.Write("mud: ");
}
ConsoleEx.ForegroundColor = ConsoleColor.Gray;
ConsoleEx.Bold = false;
foreach (var c in text)
{
Desktop.InvokeOnWorkerThread(() =>
{
Console.Write(c);
});
Thread.Sleep(75);
}
Thread.Sleep(1000);
}
public static bool terminalOpen()
{
foreach(var win in AppearanceManager.OpenForms)
{
if (win.ParentWindow is Applications.Terminal)
return true;
}
return false;
}
[Story("mud_control_centre")]
public static void MCC_Placeholder()
{
//What a way to create unbuyable, engine-managed Shiftorium Upgrades... :P
}
[Story("devx_legions")]
public static void DevXLegionStory()
{
bool waiting = false;
//Used for DevX dialogue.
//Used for legion selection.
var mud = new Applications.MUDControlCentre();
//For installing the MCC
var installer = new Applications.Installer();
installer.InstallCompleted += () =>
{
Desktop.InvokeOnWorkerThread(() =>
{
AppearanceManager.Close(installer);
});
waiting = false;
};
if (!terminalOpen())
{
var term = new Applications.Terminal();
AppearanceManager.SetupWindow(term);
}
var t = new Thread(() =>
{
WriteLine("DevX@mud - user connecting to your system.", false);
Thread.Sleep(2000);
WriteLine($"Hello, {SaveSystem.CurrentSave.Username}. It's been a while.");
WriteLine("My intelligence suggests you've installed all GUI-based Shiftorium upgrades.");
WriteLine("Bet you're liking ShiftOS now that the terminal isn't the only way you can control it.");
WriteLine("Well, now it's time to introduce your next task.");
WriteLine("In the multi-user domain, each user has a reputation value associated with them.");
WriteLine("Right now, you have a reputation of 0, Neutral.");
WriteLine("This means that nobody has an opinion on you, yet.");
WriteLine("What a good time to make your presence known?");
WriteLine("I have an application for you to try, that will help you out in the multi-user domain, and help you make yourself famous.");
WriteLine("In the digital society, you can't survive long as a lone sentience. You must kongregate with a group, and these groups are called \"legions\".");
WriteLine("This application will assist you in finding one. A legion is a group of sentiences who carry out actions together. They're like... a pack of wolves, or a family, if you will.");
WriteLine("They share Codepoints, documents, applications, and other things with each other.");
WriteLine("And they all have their own goals.");
WriteLine("Up until now, you've been blindly following my directions, with the goal of upgrading ShiftOS. Now, it's time for you to join a legion, and fulfill their goals, to become known within the digital society.");
WriteLine("You'll do all of this through the MUD Control Centre.");
WriteLine("I'll set it up on your system now.");
//Set up an Installer.
waiting = true;
Desktop.InvokeOnWorkerThread(() =>
{
AppearanceManager.SetupWindow(installer);
installer.InitiateInstall(new MCCInstallation());
});
while (waiting == true)
Thread.Sleep(25);
WriteLine("There, it's all installed, so let's get you set up with a legion, shall we?");
Desktop.InvokeOnWorkerThread(() =>
{
AppearanceManager.SetupWindow(mud);
mud.ShowClasses();
mud.ClassChanged += () =>
{
waiting = false;
};
});
WriteLine("First, select a class. A class will help define your personality within the multi-user domain. It'll determine the best legions for you.");
waiting = true;
while (waiting == true)
Thread.Sleep(25);
TerminalBackend.PrefixEnabled = true;
TerminalBackend.PrintPrompt();
});
t.IsBackground = true;
t.Start();
TerminalBackend.PrefixEnabled = false;
}
public class MCCInstallation : Applications.Installation
{
protected override void Run()
{
SetStatus("Beginning installation...");
Thread.Sleep(1270);
SetProgress(10);
SetStatus("Installing base application...");
for(int i = 0; i < 45; i++)
{
Thread.Sleep(25);
SetProgress(10 + i);
}
SetStatus("Configuring system...");
//First, we initialize the user's legion value.
SaveSystem.CurrentSave.CurrentLegions = new List<string>();
Thread.Sleep(250);
SetProgress(65);
//Now we initialize their shop value.
SaveSystem.CurrentSave.MyShop = null;
Thread.Sleep(200);
SetProgress(75);
//Now for their reputation...
SaveSystem.CurrentSave.RawReputation = 0.000;
Thread.Sleep(250);
SetProgress(90);
//Now their class.
SaveSystem.CurrentSave.Class = Objects.UserClass.None;
Thread.Sleep(200);
Story.Start("mud_control_centre");
SaveSystem.SaveGame();
SetProgress(100);
}
}
}
}