-
Notifications
You must be signed in to change notification settings - Fork 0
/
Program.cs
241 lines (228 loc) · 8.23 KB
/
Program.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
using System.Collections.Immutable;
using System.Runtime.CompilerServices;
using System.Security.Cryptography.X509Certificates;
namespace Space_Conqueror
{
public class Weapon
{
public int Id = 1;
public string Name = "Basic Weapon";
public Image PNG = Properties.Resources.NoItemWeapon;
public double Price = 1000;
public int Dam = 1; //Damage
}
public class Armor
{
public int Id = 1;
public string Name = "Basic Armor";
public Image PNG = Properties.Resources.NoItemArmor;
public double Price = 1000;
public int Plating = 5;
}
public class Ship
{
public int Id = 1;
public string Name ="Voyager";
public Image PNG = Properties.Resources.Voyager;
public int Level = 0;
public int DamBonus = 1;
public int PlatingBonus = 5;
public Weapon Arm = new();
public Armor Plate = new();
public void CopyShip(Ship Ship)
{
Id = Ship.Id;
Name = Ship.Name;
PNG = Ship.PNG;
Level = Ship.Level;
DamBonus = Ship.DamBonus;
PlatingBonus = Ship.PlatingBonus;
//if (Arm.Id < Ship.Arm.Id)
//{
// Arm.Id = Ship.Arm.Id;
// Arm.Name = Ship.Arm.Name;
// Arm.Dam = Ship.Arm.Dam;
//}
//if (Plate.Id < Ship.Plate.Id)
//{
// Plate.Id = Ship.Plate.Id;
// Plate.Name = Ship.Plate.Name;
// Plate.Plating = Ship.Plate.Plating;
//}
}
public void EquipWeapon(Weapon Weapon)
{
Arm.Id = Weapon.Id;
Arm.Name= Weapon.Name;
Arm.Dam= Weapon.Dam;
}
public void EquipArmor(Armor Armor)
{
Plate.Id=Armor.Id;
Plate.Name=Armor.Name;
Plate.Plating=Armor.Plating;
}
}
public class PS // Player Stats
{
public string Name = "";
public Ship PShip = new();
public int Exp = 0; // Experience
public int Level = 0;
public double Dollars = 3800.01;
}
[Serializable]
public class SavedGame
{
public string Name;
public int ShipId;
public int ArmId;
public int PlateId;
public int Exp;
public int Level;
public double Dollars;
}
internal static class Program
{
public static MainForm MF = new();
public static PlayingForm? Playing;
public static Ship[] Ships = new Ship[10];
public static Weapon[] Weapons = new Weapon[10];
public static Armor[] Armors = new Armor[10];
/// <summary>
/// The main entry point for the application.
/// </summary>
[STAThread]
static void Main()
{
// To customize application configuration such as set high DPI settings or default font,
// see https://aka.ms/applicationconfiguration.
ApplicationConfiguration.Initialize();
InitWeapons();
InitArmors();
InitShips();
Application.Run(MF);
}
private static void InitShips()
{
int i;
int j = 3;
for (i = 0; i < 10; i++)
{
Ships[i] = new Ship();
Ships[i].Id = i + 1;
Ships[i].Level = i * 5;
Ships[i].EquipWeapon(Weapons[i]);
Ships[i].EquipArmor(Armors[i]);
if(i>0)
{
Ships[i].DamBonus = Ships[i - 1].DamBonus + j;
Ships[i].PlatingBonus = Ships[i].DamBonus * 5;
j += 3;
}
}
Ships[1].Name = "Dryad";
Ships[2].Name = "Polip";
Ships[3].Name = "Commenter";
Ships[4].Name = "Stealth Striker";
Ships[5].Name = "Star Flyer";
Ships[6].Name = "Battleship";
Ships[7].Name = "U. F. O.";
Ships[8].Name = "Wright Flyer";
Ships[9].Name = "Hexapla";
Ships[1].PNG = Properties.Resources.Dryad;
Ships[2].PNG = Properties.Resources.Polip;
Ships[3].PNG = Properties.Resources.Commenter;
Ships[4].PNG = Properties.Resources.StealthStriker;
Ships[5].PNG = Properties.Resources.StarFlyer;
Ships[6].PNG = Properties.Resources.Battleship;
Ships[7].PNG = Properties.Resources.UFO;
Ships[8].PNG = Properties.Resources.WrightFlyer;
Ships[9].PNG = Properties.Resources.Hexapla;
}
private static void InitWeapons()
{
int i;
int j = 300;
for (i = 0; i < 10; i++)
{
Weapons[i] = new Weapon();
Weapons[i].Id = i + 1;
if (i > 0)
{
Weapons[i].Price = Weapons[i - 1].Price + j * 3;
j += 300;
}
}
Weapons[1].Name = "Laser Rifles";
Weapons[2].Name = "Laser Canon";
Weapons[3].Name = "Tesla Coils";
Weapons[4].Name = "Turrets";
Weapons[5].Name = "Automatic Turrets";
Weapons[6].Name = "Missiles";
Weapons[7].Name = "Photon Torpedos";
Weapons[8].Name = "Silver Bullet";
Weapons[9].Name = "Doomsday Device";
Weapons[1].PNG = Properties.Resources.LaserRifles;
Weapons[2].PNG = Properties.Resources.LaserCanon;
Weapons[3].PNG = Properties.Resources.TeslaCoils;
Weapons[4].PNG = Properties.Resources.Turrets;
Weapons[5].PNG = Properties.Resources.AutomaticTurrets;
Weapons[6].PNG = Properties.Resources.Missiles;
Weapons[7].PNG = Properties.Resources.PhotonTorpedos;
Weapons[8].PNG = Properties.Resources.SilverBullet;
Weapons[9].PNG = Properties.Resources.DoomsdayDevice;
Weapons[1].Dam = 5;
Weapons[2].Dam = 12;
Weapons[3].Dam = 22;
Weapons[4].Dam = 35;
Weapons[5].Dam = 51;
Weapons[6].Dam = 70;
Weapons[7].Dam = 92;
Weapons[8].Dam = 117;
Weapons[9].Dam = 145;
}
private static void InitArmors()
{
int i;
int j = 300;
for (i = 0; i < 10; i++)
{
Armors[i] = new Armor();
Armors[i].Id = i + 1;
if (i > 0)
{
Armors[i].Price = Armors[i - 1].Price + j * 3;
j += 300;
}
}
Armors[1].Name = "Insulated Fiber";
Armors[2].Name = "Aluminum Sheets";
Armors[3].Name = "Iron Plating";
Armors[4].Name = "Steel Plating";
Armors[5].Name = "Reinforced Steel";
Armors[6].Name = "Titanium Plating";
Armors[7].Name = "Aft Shields";
Armors[8].Name = "Invisibility";
Armors[9].Name = "Divine Protection";
Armors[1].PNG = Properties.Resources.InsulatedFiber;
Armors[2].PNG = Properties.Resources.AluminumSheets;
Armors[3].PNG = Properties.Resources.IronPlating;
Armors[4].PNG = Properties.Resources.SteelPlating;
Armors[5].PNG = Properties.Resources.ReinforcedSteel;
Armors[6].PNG = Properties.Resources.TitaniumPlating;
Armors[7].PNG = Properties.Resources.AftShields;
Armors[8].PNG = Properties.Resources.Invisibility;
Armors[9].PNG = Properties.Resources.DivineProtection;
Armors[1].Plating = 25;
Armors[2].Plating = 60;
Armors[3].Plating = 110;
Armors[4].Plating = 175;
Armors[5].Plating = 255;
Armors[6].Plating = 350;
Armors[7].Plating = 460;
Armors[8].Plating = 585;
Armors[9].Plating = 725;
}
}
}