-
Notifications
You must be signed in to change notification settings - Fork 2
/
icother.h
103 lines (85 loc) · 1.85 KB
/
icother.h
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
ItemClassRef
icHealth25,
icGibs,
icDoor, icExit, icKey1, icKey2, icKey3, icKey4, icKey5;
ItemClass *__icKeys[MAX_DOORS] = { &icKey1, &icKey2, &icKey3, &icKey4, &icKey5 };
tblib::carray <ItemClass*, MAX_DOORS> icKeys(__icKeys);
void InitClassDoor ()
{
ItemClass& ic = icDoor;
ic.type = IT_DOOR;
ic.width = DOOR_WIDTH;
ic.height = DOOR_HEIGHT;
ic.draw = DrawDoor;
ic.move = MoveDoor;
ic.needGround = false;
ic.LoadPictures("door.bmp");
}
void InitClassHealth25 ()
{
ItemClass& ic = icHealth25;
ic.type = IT_HEALTH;
ic.width = 8;
ic.height = 8;
ic.draw = DrawItem;
ic.move = MoveItem;
ic.needGround = true;
ic.LoadPictures("h25.bmp");
ic.itemMessage = "Òû ïîäîáðàë àïòå÷êó +25";
ic.hlCount = 25;
}
void InitClassGibs ()
{
ItemClass& ic = icGibs;
ic.type = IT_GIBS;
ic.width = 6;
ic.height = 6;
ic.draw = DrawItem;
ic.move = MoveGibs;
ic.needGround = false;
ic.LoadPictures("gibs.bmp");
}
void InitClassExit ()
{
ItemClass& ic = icExit;
ic.type = IT_EXIT;
ic.width = 8;
ic.height = 32;
ic.draw = DrawExit;
ic.move = MoveItem;
ic.needGround = true;
ic.LoadPictures("exit.bmp");
}
tblib::stringref __keyMessages[MAX_DOORS] =
{
"Òû ïîäîáðàë ðæàâûé êëþ÷",
"Òû ïîäîáðàë ìåäíûé êëþ÷",
"Òû ïîäîáðàë ñåðåáðÿííûé êëþ÷",
"Òû ïîäîáðàë çîëîòîé êëþ÷",
"Òû ïîäîáðàë òð¸õãðàííûé êëþ÷"
};
tblib::carray<tblib::stringref, MAX_DOORS> keyMessages (__keyMessages);
void InitClassKeys ()
{
for (int i=0; i<MAX_DOORS; ++i)
{
ItemClass& ic = *icKeys[i];
ic.type = IT_KEY;
ic.width = 8;
ic.height = 8;
ic.draw = DrawItem;
ic.move = MoveItem;
ic.needGround = true;
ic.LoadPictures((std::string("key") + tblib::to_string(i+1) + std::string(".bmp")).c_str());
ic.itemMessage = keyMessages[i];
ic.keyCode = i;
}
}
void InitOther ()
{
InitClassHealth25 ();
InitClassGibs ();
InitClassDoor ();
InitClassKeys ();
InitClassExit ();
}