-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGame.cs
More file actions
92 lines (80 loc) · 2.76 KB
/
Game.cs
File metadata and controls
92 lines (80 loc) · 2.76 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
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
using System;
using System.Collections.Generic;
namespace EternityRPG
{
public class Game
{
public static int DefeatedEnemiesToFightTheBoss { get; set; }
public static int DefeatedEnemiesOverall { get; set; }
public static int DefeatedBossesOverall { get; set; }
public static Random random = new Random();
public static Player player = new Player();
public static Enemy enemy;
public static Enemy[] bosses;
public static Biome[] biomes;
public static Item[] inventory;
public static Dictionary<int, string> genders = new Dictionary<int, string>
{
{ 1, "male" },
{ 2, "female" }
};
public static Dictionary<int, string> classes = new Dictionary<int, string>
{
{ 1, "warrior" },
{ 2, "archer" },
{ 3, "mage" }
};
public static Dictionary<int, string> directions = new Dictionary<int, string>
{
{ 1, "SHOP" },
{ 2, "LOCATIONS" },
{ 3, "STATS" }
};
public static Dictionary<int, string> battleOptions = new Dictionary<int, string>
{
{ 1, "attack" },
{ 2, "auto attack" },
{ 3, "healing items" },
{ 4, "power elixirs" },
{ 5, "show player stats" },
{ 6, "run away" }
};
public static void CreatePlayer()
{
//creating player according to the chosen name/gender/class
switch (player.Class)
{
case "warrior":
player = new Warrior(player.Name, player.Gender, player.Class);
break;
case "archer":
player = new Archer(player.Name, player.Gender, player.Class);
break;
case "mage":
player = new Mage(player.Name, player.Gender, player.Class);
break;
}
}
public static void InitializeWorld(int worldSize = 4)
{
bosses = new Enemy[worldSize];
biomes = new Biome[worldSize];
for (int i = 0; i < worldSize; i++)
{
bosses[i] = new Boss(bossType: i + 1);
biomes[i] = new Biome(biomeType: i + 1);
}
inventory = new Item[]
{
new Potion(potionType: 1),
new Potion(potionType: 2),
new Potion(potionType: 3),
new Buff(buffType: 1),
new Buff(buffType: 2),
new Buff(buffType: 3),
new Weapon(player.Class, weaponType: 1),
new Weapon(player.Class, weaponType: 2)
};
}
}
}