From 1c0c7c6fa8cbc2c20f4a25457b934c61ffe4ec43 Mon Sep 17 00:00:00 2001 From: AShifter Date: Tue, 7 Mar 2017 18:53:41 -0700 Subject: Added ShiftLotto Added ShiftLotto. It's a new shiftorium upgrade that lets you make (and lose) codepoints FAST. --- .../Applications/ShiftLotto.Designer.cs | 202 +++++++++++++++++++++ 1 file changed, 202 insertions(+) create mode 100644 ShiftOS.WinForms/Applications/ShiftLotto.Designer.cs (limited to 'ShiftOS.WinForms/Applications/ShiftLotto.Designer.cs') diff --git a/ShiftOS.WinForms/Applications/ShiftLotto.Designer.cs b/ShiftOS.WinForms/Applications/ShiftLotto.Designer.cs new file mode 100644 index 0000000..3af5d38 --- /dev/null +++ b/ShiftOS.WinForms/Applications/ShiftLotto.Designer.cs @@ -0,0 +1,202 @@ +namespace ShiftOS.WinForms.Applications +{ + partial class ShiftLotto + { + /// + /// Required designer variable. + /// + private System.ComponentModel.IContainer components = null; + + /// + /// Clean up any resources being used. + /// + /// true if managed resources should be disposed; otherwise, false. + protected override void Dispose(bool disposing) + { + if (disposing && (components != null)) + { + components.Dispose(); + } + base.Dispose(disposing); + } + + #region Component Designer generated code + + /// + /// Required method for Designer support - do not modify + /// the contents of this method with the code editor. + /// + private void InitializeComponent() + { + this.components = new System.ComponentModel.Container(); + System.ComponentModel.ComponentResourceManager resources = new System.ComponentModel.ComponentResourceManager(typeof(ShiftLotto)); + this.label2 = new System.Windows.Forms.Label(); + this.label3 = new System.Windows.Forms.Label(); + this.label4 = new System.Windows.Forms.Label(); + this.button1 = new System.Windows.Forms.Button(); + this.label5 = new System.Windows.Forms.Label(); + this.label6 = new System.Windows.Forms.Label(); + this.cpUpDown = new System.Windows.Forms.NumericUpDown(); + this.difUpDown = new System.Windows.Forms.NumericUpDown(); + this.label1 = new System.Windows.Forms.Label(); + this.timer1 = new System.Windows.Forms.Timer(this.components); + this.label7 = new System.Windows.Forms.Label(); + ((System.ComponentModel.ISupportInitialize)(this.cpUpDown)).BeginInit(); + ((System.ComponentModel.ISupportInitialize)(this.difUpDown)).BeginInit(); + this.SuspendLayout(); + // + // label2 + // + this.label2.AutoSize = true; + this.label2.Location = new System.Drawing.Point(19, 49); + this.label2.Name = "label2"; + this.label2.Size = new System.Drawing.Size(376, 39); + this.label2.TabIndex = 2; + this.label2.Text = resources.GetString("label2.Text"); + // + // label3 + // + this.label3.AutoSize = true; + this.label3.Location = new System.Drawing.Point(35, 122); + this.label3.Name = "label3"; + this.label3.Size = new System.Drawing.Size(60, 13); + this.label3.TabIndex = 3; + this.label3.Text = "Codepoints\r\n"; + // + // label4 + // + this.label4.AutoSize = true; + this.label4.Location = new System.Drawing.Point(319, 122); + this.label4.Name = "label4"; + this.label4.Size = new System.Drawing.Size(47, 13); + this.label4.TabIndex = 4; + this.label4.Text = "Difficulty"; + // + // button1 + // + this.button1.Location = new System.Drawing.Point(22, 164); + this.button1.Name = "button1"; + this.button1.Size = new System.Drawing.Size(369, 23); + this.button1.TabIndex = 6; + this.button1.Text = "Go!"; + this.button1.UseVisualStyleBackColor = true; + this.button1.Click += new System.EventHandler(this.button1_Click); + // + // label5 + // + this.label5.Location = new System.Drawing.Point(120, 136); + this.label5.Name = "label5"; + this.label5.RightToLeft = System.Windows.Forms.RightToLeft.No; + this.label5.Size = new System.Drawing.Size(173, 23); + this.label5.TabIndex = 7; + this.label5.Text = "0 CP"; + this.label5.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // label6 + // + this.label6.AutoSize = true; + this.label6.Location = new System.Drawing.Point(173, 122); + this.label6.Name = "label6"; + this.label6.Size = new System.Drawing.Size(74, 13); + this.label6.TabIndex = 8; + this.label6.Text = "You could win"; + // + // cpUpDown + // + this.cpUpDown.Location = new System.Drawing.Point(22, 138); + this.cpUpDown.Maximum = new decimal(new int[] { + 10000000, + 0, + 0, + 0}); + this.cpUpDown.Minimum = new decimal(new int[] { + 1, + 0, + 0, + 0}); + this.cpUpDown.Name = "cpUpDown"; + this.cpUpDown.Size = new System.Drawing.Size(92, 20); + this.cpUpDown.TabIndex = 9; + this.cpUpDown.Value = new decimal(new int[] { + 1, + 0, + 0, + 0}); + // + // difUpDown + // + this.difUpDown.Location = new System.Drawing.Point(299, 138); + this.difUpDown.Minimum = new decimal(new int[] { + 10, + 0, + 0, + 0}); + this.difUpDown.Name = "difUpDown"; + this.difUpDown.Size = new System.Drawing.Size(92, 20); + this.difUpDown.TabIndex = 10; + this.difUpDown.Value = new decimal(new int[] { + 10, + 0, + 0, + 0}); + // + // label1 + // + this.label1.AutoSize = true; + this.label1.Location = new System.Drawing.Point(147, 20); + this.label1.Name = "label1"; + this.label1.Size = new System.Drawing.Size(115, 13); + this.label1.TabIndex = 11; + this.label1.Text = "Welcome to ShiftLotto!"; + // + // timer1 + // + this.timer1.Tick += new System.EventHandler(this.timer1_Tick); + // + // label7 + // + this.label7.Location = new System.Drawing.Point(22, 190); + this.label7.Name = "label7"; + this.label7.RightToLeft = System.Windows.Forms.RightToLeft.No; + this.label7.Size = new System.Drawing.Size(369, 23); + this.label7.TabIndex = 12; + this.label7.Text = "Current CP: 0 CP"; + this.label7.TextAlign = System.Drawing.ContentAlignment.MiddleCenter; + // + // ShiftLotto + // + this.AutoScaleDimensions = new System.Drawing.SizeF(6F, 13F); + this.AutoScaleMode = System.Windows.Forms.AutoScaleMode.Font; + this.Controls.Add(this.label7); + this.Controls.Add(this.label1); + this.Controls.Add(this.difUpDown); + this.Controls.Add(this.cpUpDown); + this.Controls.Add(this.label6); + this.Controls.Add(this.label5); + this.Controls.Add(this.button1); + this.Controls.Add(this.label4); + this.Controls.Add(this.label3); + this.Controls.Add(this.label2); + this.Name = "ShiftLotto"; + this.Size = new System.Drawing.Size(419, 252); + ((System.ComponentModel.ISupportInitialize)(this.cpUpDown)).EndInit(); + ((System.ComponentModel.ISupportInitialize)(this.difUpDown)).EndInit(); + this.ResumeLayout(false); + this.PerformLayout(); + + } + + #endregion + private System.Windows.Forms.Label label2; + private System.Windows.Forms.Label label3; + private System.Windows.Forms.Label label4; + private System.Windows.Forms.Button button1; + private System.Windows.Forms.Label label5; + private System.Windows.Forms.Label label6; + private System.Windows.Forms.NumericUpDown cpUpDown; + private System.Windows.Forms.NumericUpDown difUpDown; + private System.Windows.Forms.Label label1; + private System.Windows.Forms.Timer timer1; + private System.Windows.Forms.Label label7; + } +} -- cgit v1.2.3 From ed26b419631065bd743598a249d58589d2eda646 Mon Sep 17 00:00:00 2001 From: AShifter Date: Tue, 7 Mar 2017 19:36:16 -0700 Subject: Fixed ShiftLotto Fixed a bug in ShiftLotto where the amount of codepoints you had wasn't actually checked. This lead to me having -6732946923443264 Codepoints. Oops. --- .../Applications/ShiftLotto.Designer.cs | 2 +- ShiftOS.WinForms/Applications/ShiftLotto.cs | 64 +++++++++++++--------- 2 files changed, 40 insertions(+), 26 deletions(-) (limited to 'ShiftOS.WinForms/Applications/ShiftLotto.Designer.cs') diff --git a/ShiftOS.WinForms/Applications/ShiftLotto.Designer.cs b/ShiftOS.WinForms/Applications/ShiftLotto.Designer.cs index 3af5d38..653e3db 100644 --- a/ShiftOS.WinForms/Applications/ShiftLotto.Designer.cs +++ b/ShiftOS.WinForms/Applications/ShiftLotto.Designer.cs @@ -105,7 +105,7 @@ // this.cpUpDown.Location = new System.Drawing.Point(22, 138); this.cpUpDown.Maximum = new decimal(new int[] { - 10000000, + 10000, 0, 0, 0}); diff --git a/ShiftOS.WinForms/Applications/ShiftLotto.cs b/ShiftOS.WinForms/Applications/ShiftLotto.cs index a070d43..cc38582 100644 --- a/ShiftOS.WinForms/Applications/ShiftLotto.cs +++ b/ShiftOS.WinForms/Applications/ShiftLotto.cs @@ -76,41 +76,55 @@ namespace ShiftOS.WinForms.Applications private void button1_Click(object sender, EventArgs e) { - // Convert the NumericUpDown to Int + // Make codePoints and difficulty in this function int codePoints = Convert.ToInt32(Math.Round(cpUpDown.Value, 0)); int difficulty = Convert.ToInt32(Math.Round(difUpDown.Value, 0)); - // Create Random Ints - Random rnd = new Random(); + if (SaveSystem.CurrentSave.Codepoints <= 1) + { + Infobox.Show("Not enough Codepoints", "You do not have enough Codepoints to use ShiftLotto!"); + } + else + { + if (SaveSystem.CurrentSave.Codepoints - (codePoints * difficulty) <= 0) + { + Infobox.Show("Not enough Codepoints", "You do not have enough Codepoints to gamble this amount!"); + } + else + { + // Create Random Ints + Random rnd = new Random(); - // Set their highest possible number to Difficulty - int guessedNumber = rnd.Next(0, difficulty); - int winningNumber = rnd.Next(0, difficulty); + // Set their highest possible number to Difficulty + int guessedNumber = rnd.Next(0, difficulty); + int winningNumber = rnd.Next(0, difficulty); - // Multiply CodePoints * Difficulty - int jackpot = codePoints * difficulty; + // Multiply CodePoints * Difficulty + int jackpot = codePoints * difficulty; - // Test the random ints - if (guessedNumber == winningNumber) - { - // If you win + // Test the random ints + if (guessedNumber == winningNumber) + { + // If you win - // Add Codepoints - SaveSystem.TransferCodepointsFrom("shiftlotto", jackpot); + // Add Codepoints + SaveSystem.TransferCodepointsFrom("shiftlotto", jackpot); - // Infobox - Infobox.Show("YOU WON!", "Good Job! " + jackpot.ToString() + " CP has been added to your account. "); - } - else - { - // If you fail + // Infobox + Infobox.Show("YOU WON!", "Good Job! " + jackpot.ToString() + " CP has been added to your account. "); + } + else + { + // If you fail - // Remove Codepoints - SaveSystem.TransferCodepointsToVoid(jackpot); + // Remove Codepoints + SaveSystem.TransferCodepointsToVoid(jackpot); - // Infobox - Infobox.Show("YOU FAILED!", "Sorry! " + jackpot.ToString() + " CP has been removed from your account."); - } + // Infobox + Infobox.Show("YOU FAILED!", "Sorry! " + jackpot.ToString() + " CP has been removed from your account."); + } + } + } } } } \ No newline at end of file -- cgit v1.2.3 From 369aefc5e81eba25e31d52c1031f3e8ec750cb04 Mon Sep 17 00:00:00 2001 From: AShifter Date: Tue, 7 Mar 2017 20:04:59 -0700 Subject: Added ShiftLotto Icon I added a ShiftLotto Icon (and probably did other stuff) --- .../Applications/ShiftLotto.Designer.cs | 26 ++++++++++++++++++++- ShiftOS.WinForms/Applications/ShiftLotto.cs | 1 + ShiftOS.WinForms/Properties/Resources.Designer.cs | 24 ++++++++++++------- ShiftOS.WinForms/Properties/Resources.resx | 3 +++ ShiftOS.WinForms/ShiftOS.WinForms.csproj | 1 + ShiftOS.WinForms/SystemIcons/iconShiftLotto.png | Bin 0 -> 299 bytes 6 files changed, 45 insertions(+), 10 deletions(-) create mode 100644 ShiftOS.WinForms/SystemIcons/iconShiftLotto.png (limited to 'ShiftOS.WinForms/Applications/ShiftLotto.Designer.cs') diff --git a/ShiftOS.WinForms/Applications/ShiftLotto.Designer.cs b/ShiftOS.WinForms/Applications/ShiftLotto.Designer.cs index 653e3db..943322e 100644 --- a/ShiftOS.WinForms/Applications/ShiftLotto.Designer.cs +++ b/ShiftOS.WinForms/Applications/ShiftLotto.Designer.cs @@ -1,4 +1,28 @@ -namespace ShiftOS.WinForms.Applications +/* + * MIT License + * + * Copyright (c) 2017 Michael VanOverbeek and ShiftOS devs + * + * Permission is hereby granted, free of charge, to any person obtaining a copy + * of this software and associated documentation files (the "Software"), to deal + * in the Software without restriction, including without limitation the rights + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell + * copies of the Software, and to permit persons to whom the Software is + * furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in all + * copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE + * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE + * SOFTWARE. + */ + +namespace ShiftOS.WinForms.Applications { partial class ShiftLotto { diff --git a/ShiftOS.WinForms/Applications/ShiftLotto.cs b/ShiftOS.WinForms/Applications/ShiftLotto.cs index cc38582..7acba3e 100644 --- a/ShiftOS.WinForms/Applications/ShiftLotto.cs +++ b/ShiftOS.WinForms/Applications/ShiftLotto.cs @@ -35,6 +35,7 @@ using ShiftOS.Engine; namespace ShiftOS.WinForms.Applications { [Launcher("ShiftLotto", true, "al_shiftlotto", "Games")] + [DefaultIcon("iconShiftLotto")] [RequiresUpgrade("shiftlotto")] [WinOpen("shiftlotto")] public partial class ShiftLotto : UserControl, IShiftOSWindow diff --git a/ShiftOS.WinForms/Properties/Resources.Designer.cs b/ShiftOS.WinForms/Properties/Resources.Designer.cs index 2df6f11..6628f0b 100644 --- a/ShiftOS.WinForms/Properties/Resources.Designer.cs +++ b/ShiftOS.WinForms/Properties/Resources.Designer.cs @@ -729,6 +729,16 @@ namespace ShiftOS.WinForms.Properties { } } + /// + /// Looks up a localized resource of type System.Drawing.Bitmap. + /// + internal static System.Drawing.Bitmap iconShiftLotto { + get { + object obj = ResourceManager.GetObject("iconShiftLotto", resourceCulture); + return ((System.Drawing.Bitmap)(obj)); + } + } + /// /// Looks up a localized resource of type System.Drawing.Bitmap. /// @@ -923,15 +933,11 @@ namespace ShiftOS.WinForms.Properties { /// Company: "ShiftSoft" /// }, /// { - /// Company: "" - /// }, - /// { - /// - /// }, - /// { - /// - /// }, - ///]. + /// Company: "Shiftcast", + /// Name: "NetXtreme Hyper Edition", + /// CostPerMonth: 1500, + /// DownloadSpeed: 524288, //512 kb/s + /// Description: "It's time to supercharge your Shif [rest of string was truncated]";. /// internal static string ShiftnetServices { get { diff --git a/ShiftOS.WinForms/Properties/Resources.resx b/ShiftOS.WinForms/Properties/Resources.resx index 5100329..bef4f99 100644 --- a/ShiftOS.WinForms/Properties/Resources.resx +++ b/ShiftOS.WinForms/Properties/Resources.resx @@ -475,4 +475,7 @@ ..\Resources\ShiftnetServices.txt;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;Windows-1252 + + ..\systemicons\iconshiftlotto.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a + \ No newline at end of file diff --git a/ShiftOS.WinForms/ShiftOS.WinForms.csproj b/ShiftOS.WinForms/ShiftOS.WinForms.csproj index 2c36f6c..3a603db 100644 --- a/ShiftOS.WinForms/ShiftOS.WinForms.csproj +++ b/ShiftOS.WinForms/ShiftOS.WinForms.csproj @@ -609,6 +609,7 @@ + diff --git a/ShiftOS.WinForms/SystemIcons/iconShiftLotto.png b/ShiftOS.WinForms/SystemIcons/iconShiftLotto.png new file mode 100644 index 0000000..b2a3ad5 Binary files /dev/null and b/ShiftOS.WinForms/SystemIcons/iconShiftLotto.png differ -- cgit v1.2.3 From 5a8cb0cdf76d65e096bd9aeda6ee9c6246a31134 Mon Sep 17 00:00:00 2001 From: AShifter Date: Sat, 11 Mar 2017 09:24:15 -0700 Subject: I don't think Michael liked the ShiftLotto limits so i fixed it - 1 billion limit combined --- ShiftOS.WinForms/Applications/ShiftLotto.Designer.cs | 7 ++++++- ShiftOS.WinForms/Applications/ShiftLotto.cs | 4 +++- 2 files changed, 9 insertions(+), 2 deletions(-) (limited to 'ShiftOS.WinForms/Applications/ShiftLotto.Designer.cs') diff --git a/ShiftOS.WinForms/Applications/ShiftLotto.Designer.cs b/ShiftOS.WinForms/Applications/ShiftLotto.Designer.cs index 943322e..8b43636 100644 --- a/ShiftOS.WinForms/Applications/ShiftLotto.Designer.cs +++ b/ShiftOS.WinForms/Applications/ShiftLotto.Designer.cs @@ -129,7 +129,7 @@ namespace ShiftOS.WinForms.Applications // this.cpUpDown.Location = new System.Drawing.Point(22, 138); this.cpUpDown.Maximum = new decimal(new int[] { - 10000, + 1000000, 0, 0, 0}); @@ -150,6 +150,11 @@ namespace ShiftOS.WinForms.Applications // difUpDown // this.difUpDown.Location = new System.Drawing.Point(299, 138); + this.difUpDown.Maximum = new decimal(new int[] { + 1000, + 0, + 0, + 0}); this.difUpDown.Minimum = new decimal(new int[] { 10, 0, diff --git a/ShiftOS.WinForms/Applications/ShiftLotto.cs b/ShiftOS.WinForms/Applications/ShiftLotto.cs index 7acba3e..4b1c983 100644 --- a/ShiftOS.WinForms/Applications/ShiftLotto.cs +++ b/ShiftOS.WinForms/Applications/ShiftLotto.cs @@ -81,7 +81,7 @@ namespace ShiftOS.WinForms.Applications int codePoints = Convert.ToInt32(Math.Round(cpUpDown.Value, 0)); int difficulty = Convert.ToInt32(Math.Round(difUpDown.Value, 0)); - if (SaveSystem.CurrentSave.Codepoints <= 1) + if (SaveSystem.CurrentSave.Codepoints <= 9) { Infobox.Show("Not enough Codepoints", "You do not have enough Codepoints to use ShiftLotto!"); } @@ -121,6 +121,8 @@ namespace ShiftOS.WinForms.Applications // Remove Codepoints SaveSystem.TransferCodepointsToVoid(jackpot); + + // Infobox Infobox.Show("YOU FAILED!", "Sorry! " + jackpot.ToString() + " CP has been removed from your account."); } -- cgit v1.2.3