aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS.WinForms
diff options
context:
space:
mode:
authorMichael <[email protected]>2017-05-29 20:08:30 -0400
committerMichael <[email protected]>2017-05-29 20:08:30 -0400
commit37ac4c684ce3904c5ec614362ed99bb9867ca0f3 (patch)
tree0f2418da210f1f3c315d10f3b197c15f61291f49 /ShiftOS.WinForms
parentff47625d2547deed441a853569f9fe84197e23b6 (diff)
downloadshiftos_thereturn-37ac4c684ce3904c5ec614362ed99bb9867ca0f3.tar.gz
shiftos_thereturn-37ac4c684ce3904c5ec614362ed99bb9867ca0f3.tar.bz2
shiftos_thereturn-37ac4c684ce3904c5ec614362ed99bb9867ca0f3.zip
It's amazing what talking to Rylan can do to an integer datatype.
Diffstat (limited to 'ShiftOS.WinForms')
-rw-r--r--ShiftOS.WinForms/Applications/Pong.cs20
-rw-r--r--ShiftOS.WinForms/Applications/ShiftLetters.cs2
-rw-r--r--ShiftOS.WinForms/Applications/ShiftLotto.cs4
-rw-r--r--ShiftOS.WinForms/Applications/ShiftSweeper.cs8
-rw-r--r--ShiftOS.WinForms/Applications/Shifter.cs2
-rw-r--r--ShiftOS.WinForms/Applications/ShiftoriumFrontend.cs4
-rw-r--r--ShiftOS.WinForms/Applications/ShopItemCreator.cs4
-rw-r--r--ShiftOS.WinForms/HackerCommands.cs2
-rw-r--r--ShiftOS.WinForms/JobTasks.cs4
-rw-r--r--ShiftOS.WinForms/ShiftnetSites/AppscapeMain.cs4
-rw-r--r--ShiftOS.WinForms/WinformsDesktop.cs2
11 files changed, 28 insertions, 28 deletions
diff --git a/ShiftOS.WinForms/Applications/Pong.cs b/ShiftOS.WinForms/Applications/Pong.cs
index 84177b7..6d81c64 100644
--- a/ShiftOS.WinForms/Applications/Pong.cs
+++ b/ShiftOS.WinForms/Applications/Pong.cs
@@ -58,10 +58,10 @@ namespace ShiftOS.WinForms.Applications
double incrementy = 0.2;
int levelxspeed = 3;
int levelyspeed = 3;
- int beatairewardtotal;
- int beataireward = 1;
- int[] levelrewards = new int[50];
- int totalreward;
+ ulong beatairewardtotal;
+ ulong beataireward = 1;
+ ulong[] levelrewards = new ulong[50];
+ ulong totalreward;
int countdown = 3;
bool aiShouldIsbeEnabled = true;
@@ -297,11 +297,11 @@ namespace ShiftOS.WinForms.Applications
lblmissedout.Text = Localization.Parse("{YOU_MISSED_OUT_ON}:") + Environment.NewLine + lblstatscodepoints.Text.Replace(Localization.Parse("{CODEPOINTS}: "), "") + Localization.Parse(" {CODEPOINTS}");
if (ShiftoriumFrontend.UpgradeInstalled("pong_upgrade_2"))
{
- totalreward = levelrewards[level - 1] + beatairewardtotal;
+ totalreward = (ulong)(levelrewards[level - 1] + beatairewardtotal);
double onePercent = (totalreward / 100);
lblbutyougained.Show();
lblbutyougained.Text = Localization.Parse("{BUT_YOU_GAINED}:") + Environment.NewLine + onePercent.ToString("") + (Localization.Parse(" {CODEPOINTS}"));
- SaveSystem.TransferCodepointsFrom("pong", (totalreward / 100));
+ SaveSystem.TransferCodepointsFrom("pong", (ulong)(totalreward / 100));
}
else
{
@@ -715,10 +715,10 @@ namespace ShiftOS.WinForms.Applications
{
if (ShiftoriumFrontend.UpgradeInstalled("pong_upgrade"))
{
- beataireward = level * 10;
+ beataireward = (ulong)(level * 10);
} else
{
- beataireward = level * 5;
+ beataireward = (ulong)(level * 5);
}
}
else
@@ -726,11 +726,11 @@ namespace ShiftOS.WinForms.Applications
if (ShiftoriumFrontend.UpgradeInstalled("pong_upgrade"))
{
double br = levelrewards[level - 1] / 10;
- beataireward = (int)Math.Round(br) * 10;
+ beataireward = (ulong)Math.Round(br) * 10;
} else
{
double br = levelrewards[level - 1] / 10;
- beataireward = (int)Math.Round(br) * 5;
+ beataireward = (ulong)Math.Round(br) * 5;
}
}
diff --git a/ShiftOS.WinForms/Applications/ShiftLetters.cs b/ShiftOS.WinForms/Applications/ShiftLetters.cs
index 42e19f8..0e9f74a 100644
--- a/ShiftOS.WinForms/Applications/ShiftLetters.cs
+++ b/ShiftOS.WinForms/Applications/ShiftLetters.cs
@@ -217,7 +217,7 @@ namespace ShiftOS.WinForms.Applications
if (!lblword.Text.Contains("_"))
{
int oldlives = lives;
- int cp = (word.Length * oldlives) * 2; //drunky michael made this 5x...
+ ulong cp = (ulong)(word.Length * oldlives) * 2; //drunky michael made this 5x...
SaveSystem.TransferCodepointsFrom("shiftletters", cp);
StartGame();
}
diff --git a/ShiftOS.WinForms/Applications/ShiftLotto.cs b/ShiftOS.WinForms/Applications/ShiftLotto.cs
index 5ab8154..3f940c7 100644
--- a/ShiftOS.WinForms/Applications/ShiftLotto.cs
+++ b/ShiftOS.WinForms/Applications/ShiftLotto.cs
@@ -88,7 +88,7 @@ namespace ShiftOS.WinForms.Applications
}
else
{
- if (SaveSystem.CurrentSave.Codepoints - (codePoints * difficulty) <= 0)
+ if (SaveSystem.CurrentSave.Codepoints - (ulong)(codePoints * difficulty) <= 0)
{
Infobox.Show("Not enough Codepoints", "You do not have enough Codepoints to gamble this amount!");
}
@@ -102,7 +102,7 @@ namespace ShiftOS.WinForms.Applications
int winningNumber = rnd.Next(0, difficulty);
// Multiply CodePoints * Difficulty
- int jackpot = codePoints * difficulty;
+ ulong jackpot = (ulong)(codePoints * difficulty);
// Test the random ints
if (guessedNumber == winningNumber)
diff --git a/ShiftOS.WinForms/Applications/ShiftSweeper.cs b/ShiftOS.WinForms/Applications/ShiftSweeper.cs
index f23ed73..772ec26 100644
--- a/ShiftOS.WinForms/Applications/ShiftSweeper.cs
+++ b/ShiftOS.WinForms/Applications/ShiftSweeper.cs
@@ -300,12 +300,12 @@ namespace ShiftOS.WinForms.Applications {
}
public void winGame() {
- int cp = 0;
- int origminecount = gameBombCount * 10;
+ ulong cp = 0;
+ ulong origminecount = (ulong)(gameBombCount * 10);
if (minetimer < 31) cp = (origminecount * 3);
- else if (minetimer < 61) cp = (Int32)(origminecount * 2.5);
+ else if (minetimer < 61) cp = (ulong)(origminecount * 2.5);
else if (minetimer < 91) cp = (origminecount * 2);
- else if (minetimer < 121) cp = (Int32)(origminecount * 1.5);
+ else if (minetimer < 121) cp = (ulong)(origminecount * 1.5);
else if (minetimer > 120) cp = (origminecount * 1);
SaveSystem.TransferCodepointsFrom("shiftsweeper", cp);
panelGameStatus.Image = Properties.Resources.SweeperWinFace;
diff --git a/ShiftOS.WinForms/Applications/Shifter.cs b/ShiftOS.WinForms/Applications/Shifter.cs
index 1a59c80..3b3a4f1 100644
--- a/ShiftOS.WinForms/Applications/Shifter.cs
+++ b/ShiftOS.WinForms/Applications/Shifter.cs
@@ -391,7 +391,7 @@ namespace ShiftOS.WinForms.Applications
}
- public int CodepointValue = 0;
+ public uint CodepointValue = 0;
public List<ShifterSetting> settings = new List<ShifterSetting>();
public Skin LoadedSkin = null;
diff --git a/ShiftOS.WinForms/Applications/ShiftoriumFrontend.cs b/ShiftOS.WinForms/Applications/ShiftoriumFrontend.cs
index 08e6c8f..d6b014d 100644
--- a/ShiftOS.WinForms/Applications/ShiftoriumFrontend.cs
+++ b/ShiftOS.WinForms/Applications/ShiftoriumFrontend.cs
@@ -213,9 +213,9 @@ namespace ShiftOS.WinForms.Applications
private void btnbuy_Click(object sender, EventArgs e)
{
- long cpCost = 0;
+ ulong cpCost = 0;
backend.Silent = true;
- Dictionary<string, long> UpgradesToBuy = new Dictionary<string, long>();
+ Dictionary<string, ulong> UpgradesToBuy = new Dictionary<string, ulong>();
foreach (var itm in lbupgrades.SelectedItems)
{
cpCost += upgrades[itm.ToString()].Cost;
diff --git a/ShiftOS.WinForms/Applications/ShopItemCreator.cs b/ShiftOS.WinForms/Applications/ShopItemCreator.cs
index 61e7491..d2836ee 100644
--- a/ShiftOS.WinForms/Applications/ShopItemCreator.cs
+++ b/ShiftOS.WinForms/Applications/ShopItemCreator.cs
@@ -73,7 +73,7 @@ namespace ShiftOS.WinForms.Applications
Infobox.Show("No file chosen.", "Please select a file to sell.");
return;
}
- Item.Cost = Convert.ToInt32(txtcost.Text);
+ Item.Cost = Convert.ToUInt64(txtcost.Text);
Item.Description = txtdescription.Text;
Item.Name = txtitemname.Text;
Callback?.Invoke(Item);
@@ -101,7 +101,7 @@ namespace ShiftOS.WinForms.Applications
{
try
{
- Item.Cost = Convert.ToInt32(txtcost.Text);
+ Item.Cost = Convert.ToUInt64(txtcost.Text);
}
catch
{
diff --git a/ShiftOS.WinForms/HackerCommands.cs b/ShiftOS.WinForms/HackerCommands.cs
index 47b486d..f467eb2 100644
--- a/ShiftOS.WinForms/HackerCommands.cs
+++ b/ShiftOS.WinForms/HackerCommands.cs
@@ -504,7 +504,7 @@ namespace ShiftOS.WinForms
string usr = args["user"].ToString();
string sys = args["sys"].ToString();
string pass = args["pass"].ToString();
- long amount = (long)args["amount"];
+ ulong amount = (ulong)args["amount"];
if(amount < 0)
{
Console.WriteLine("--invalid codepoint amount - halting...");
diff --git a/ShiftOS.WinForms/JobTasks.cs b/ShiftOS.WinForms/JobTasks.cs
index 622e287..d862961 100644
--- a/ShiftOS.WinForms/JobTasks.cs
+++ b/ShiftOS.WinForms/JobTasks.cs
@@ -35,12 +35,12 @@ namespace ShiftOS.WinForms
{
public class AcquireCodepointsJobTask : JobTask
{
- public AcquireCodepointsJobTask(int amount)
+ public AcquireCodepointsJobTask(uint amount)
{
CodepointsRequired = SaveSystem.CurrentSave.Codepoints + amount;
}
- public long CodepointsRequired { get; private set; }
+ public ulong CodepointsRequired { get; private set; }
public override bool IsComplete
{
diff --git a/ShiftOS.WinForms/ShiftnetSites/AppscapeMain.cs b/ShiftOS.WinForms/ShiftnetSites/AppscapeMain.cs
index fa575f4..c7830d0 100644
--- a/ShiftOS.WinForms/ShiftnetSites/AppscapeMain.cs
+++ b/ShiftOS.WinForms/ShiftnetSites/AppscapeMain.cs
@@ -372,7 +372,7 @@ namespace ShiftOS.WinForms
/// </summary>
public class AppscapeEntryAttribute : RequiresUpgradeAttribute
{
- public AppscapeEntryAttribute(string name, string description, int downloadSize, long cost, string dependencies = "", string category = "Misc") : base(name.ToLower().Replace(' ', '_'))
+ public AppscapeEntryAttribute(string name, string description, int downloadSize, ulong cost, string dependencies = "", string category = "Misc") : base(name.ToLower().Replace(' ', '_'))
{
Name = name;
Description = description;
@@ -385,7 +385,7 @@ namespace ShiftOS.WinForms
public string Name { get; private set; }
public string Description { get; private set; }
public string Category { get; private set; }
- public long Cost { get; private set; }
+ public ulong Cost { get; private set; }
public string DependencyString { get; private set; }
public int DownloadSize { get; private set; }
}
diff --git a/ShiftOS.WinForms/WinformsDesktop.cs b/ShiftOS.WinForms/WinformsDesktop.cs
index 85eab55..95e7c1a 100644
--- a/ShiftOS.WinForms/WinformsDesktop.cs
+++ b/ShiftOS.WinForms/WinformsDesktop.cs
@@ -192,7 +192,7 @@ namespace ShiftOS.WinForms
SetupDesktop();
};
- long lastcp = 0;
+ ulong lastcp = 0;
var storythread = new Thread(() =>
{