-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGameSystem.cs
More file actions
71 lines (68 loc) · 2.7 KB
/
Copy pathGameSystem.cs
File metadata and controls
71 lines (68 loc) · 2.7 KB
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
public class GameSystem
{
public BattleSystem Battle = new BattleSystem();
private Character MakeHero() //represent true programmer character with name supplied by user
{
Console.WriteLine("Welcome hero! Please enter your name: ");
string input = Console.ReadLine();
Console.Clear();
return new TrueProgrammer(input);
}
//Adds each party to a list.
Party[] monsterParties = new Party[] { OneSkeletonParty(), TwoSkeletonParty(), TwoStoneAmarokParty(), UncodedParty() };
//sets up a monster party.
public static Party OneSkeletonParty()
{
var monsterParty = new Party();
monsterParty.PartyList = new List<Character> { new Skeleton() { Weapon = new Dagger() } };
monsterParty.PartyItems = new List<Item> { new Potion(1) };
return monsterParty;
}
public static Party TwoSkeletonParty()
{
var monsterParty = new Party();
monsterParty.PartyList = new List<Character> { new Skeleton(), new Skeleton() };
monsterParty.PartyItems = new List<Item> { new Potion(2) };
monsterParty.PartyEquipment = new List<Equipment> { new Dagger(), new Dagger() };
return monsterParty;
}
public static Party TwoStoneAmarokParty()
{
var monsterParty = new Party();
monsterParty.PartyList = new List<Character> { new StoneAmarok(), new StoneAmarok() };
return monsterParty;
}
public static Party UncodedParty()
{
var monsterParty = new Party();
monsterParty.PartyList = new List<Character> { new UncodedOne() };
monsterParty.PartyItems = new List<Item> { new Potion(1) };
return monsterParty;
}
//Create the hero party
private void HeroParty()
{
var heroParty = Battle.HeroParty;
heroParty.PartyList = new List<Character> { MakeHero(), new Vin() };
heroParty.PartyItems = new List<Item> { new Potion(3) };
heroParty.PartyEquipment = new List<Equipment> { new Dagger(), new Axe() };
}
public void RunGame()
{
HeroParty();
//Run through a series of battles equal to the amount of monster parties.
for (int battleNumber = 1; battleNumber <= monsterParties.Length; battleNumber++)
{
//loop through the list of monster parties, set them to battle's monster party list.
foreach (var monsterParty in monsterParties)
{
Battle.MonsterParty = monsterParty;
Battle.runBattle();
}
}
//Game is finished.
Console.WriteLine("The game is over!\nPress any key to close.");
Console.ReadKey();
}
}