-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathItem.cs
73 lines (59 loc) · 2.46 KB
/
Item.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
using System;
using System.Collections.Generic;
namespace ttc_wtc
{
[Serializable]
class Item
{
public enum ItemId
{
TrainingShield = 0,
TrainingSword = 1,
OldHelmet = 2,
OldBreastPlate = 3,
OldGreave = 4,
HeroesSword = 5,
HealPotion = 6,
UminekoStone = 7,
OldKey = 8,
}
public string Name { get; set; }
public static List<Item> Items;
public Item(string name)
{
Name = name;
}
public static void Initialise()
{
Weapon TrainingSword = new Weapon("Тренировачный меч", PutOnItem.Slot.RightHand, 50, 0);
Weapon TrainingShield = new Weapon("Тренировачный щит", PutOnItem.Slot.LeftHand, 0, 20);
Armor OldHelmet = new Armor("Старый шлем", PutOnItem.Slot.Head, 10);
Armor OldBreastPlate = new Armor("Старый нагрудник", PutOnItem.Slot.Body, 20);
Armor OldGreave = new Armor("Старые поножи", PutOnItem.Slot.Legs, 15);
Weapon HeroesSword = new Weapon("Меч героя", PutOnItem.Slot.RightHand, 200, 0);
Consumable HealPotion = new Consumable("Зелье лечения", 0);
Key UminekoStone = new Key("Статуэтка чайки");
Key OldKey = new Key("Ключ от старых ворот");
Items = new List<Item> { TrainingShield, TrainingSword, OldHelmet, OldBreastPlate, OldGreave, HeroesSword, HealPotion, UminekoStone, OldKey };
}
public static PutOnItem GenerateItem(int level)
{
int slot = new Random().Next(0, 5);
switch (slot)
{
case 0:
return new Weapon("Щит " + level, PutOnItem.Slot.LeftHand, 0, 30 + level);
case 1:
return new Weapon("Меч " + level, PutOnItem.Slot.RightHand, 100 + level * 10, 0);
case 2:
return new Armor("Шлем " + level, PutOnItem.Slot.Head, 10 + level);
case 3:
return new Armor("Нагрудник " + level, PutOnItem.Slot.Body, 20 + level);
case 4:
return new Armor("Поножи " + level, PutOnItem.Slot.Legs, 15 + level);
default:
return null;
}
}
}
}