Rev 2131 | Rev 2133 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 2131 | Rev 2132 | ||
---|---|---|---|
1 | /* ------- ÊÎÑÈËÊÀ ÄËß ÊÎËÈÁÐÈ ------- |
1 | /* ------- ÊÎÑÈËÊÀ ÄËß ÊÎËÈÁÐÈ ------- |
2 | Èãðà ïèøåòñÿ íà C++ (èñïîëüçóåòñÿ MS Visual C++ 6.0). |
2 | Èãðà ïèøåòñÿ íà C++ (èñïîëüçóåòñÿ MS Visual C++ 6.0). |
3 | Ýòî - èñõîäíèê âåðñèè 1.0. |
3 | Ýòî - èñõîäíèê âåðñèè 1.0. |
4 | 4 | ||
5 | Andrey Mihaylovich aka Dron2004 |
5 | Andrey Mihaylovich aka Dron2004 |
6 | */ |
6 | */ |
7 | 7 | ||
8 | 8 | ||
9 | 9 | ||
10 | #include "kosSyst.h" |
10 | #include "kosSyst.h" |
11 | #include "kosFile.h" |
11 | #include "kosFile.h" |
12 | 12 | ||
13 | 13 | ||
14 | 14 | ||
15 | //ÂÍÅØÍÈÅ ÓÐÎÂÍÈ |
15 | //ÂÍÅØÍÈÅ ÓÐÎÂÍÈ |
16 | bool external_levels_available=false; |
16 | bool external_levels_available=false; |
17 | bool external_levels = false; |
17 | bool external_levels = false; |
18 | int level_read_result; |
18 | int level_read_result; |
19 | Byte * externallevels; |
19 | Byte * externallevels; |
20 | Byte external_levels_count[1] = {0}; |
20 | Byte external_levels_count[1] = {0}; |
21 | ///////////////// |
21 | ///////////////// |
22 | 22 | ||
23 | int lastkosilkadirection=1; |
23 | int lastkosilkadirection=1; |
24 | int laststep=0; //Ïîñëåäíèé õîä. Çäåñü |
24 | int laststep=0; //Ïîñëåäíèé õîä. Çäåñü |
25 | // 0 - íåò òàêîâîãî |
25 | // 0 - íåò òàêîâîãî |
26 | // 1 - âíèç |
26 | // 1 - âíèç |
27 | // 2 - ââåðõ |
27 | // 2 - ââåðõ |
28 | // 3 - âëåâî |
28 | // 3 - âëåâî |
29 | // 4 - âïðàâî |
29 | // 4 - âïðàâî |
30 | 30 | ||
31 | 31 | ||
32 | Byte skindata[13824]; |
32 | Byte skindata[13824]; |
33 | int read_result=0; |
33 | int read_result=0; |
34 | bool skin_available=false; |
34 | bool skin_available=false; |
35 | bool w_redraw=true; |
35 | bool w_redraw=true; |
36 | 36 | ||
37 | const char windowTitle[]="®á¨«ª ¤«ï ®«¨¡à¨"; |
37 | const char windowTitle[]="®á¨«ª ¤«ï ®«¨¡à¨"; |
38 | const char version[]="¥àá¨ï 1.11"; |
38 | const char version[]="¥àá¨ï 1.12"; |
39 | int levelcount=7; //×èñëî óðîâíåé |
39 | int levelcount=7; //×èñëî óðîâíåé |
40 | 40 | ||
41 | char gamearea[20][20]; //Êàðòà |
41 | char gamearea[20][20]; //Êàðòà |
42 | 42 | ||
43 | 43 | ||
44 | short int kosilkax; // Ïîëîæåíèå êîñèëêè |
44 | short int kosilkax; // Ïîëîæåíèå êîñèëêè |
45 | short int kosilkay; |
45 | short int kosilkay; |
46 | short int kosilkadirection=1; //Íàïðàâëåíèå ïðîøëîãî øàãà. 1-âíèç, 2-ââåðõ, 3-âëåâî, 4-âïðàâî |
46 | short int kosilkadirection=1; //Íàïðàâëåíèå ïðîøëîãî øàãà. 1-âíèç, 2-ââåðõ, 3-âëåâî, 4-âïðàâî |
47 | short int lives=2; // Æèçíè |
47 | short int lives=2; // Æèçíè |
48 | short int level=1; //Óðîâåíü |
48 | short int level=1; //Óðîâåíü |
49 | short int status=0; //Ãäå 0 - ïðèâåòñòâèå |
49 | short int status=0; //Ãäå 0 - ïðèâåòñòâèå |
50 | // 1 - èãðà |
50 | // 1 - èãðà |
51 | // 2 - èãðà ïðîéäåíà |
51 | // 2 - èãðà ïðîéäåíà |
52 | // 3 - âû ïðîèãðàëè |
52 | // 3 - âû ïðîèãðàëè |
53 | // 4 - âûáîð íàáîðà óðîâíåé (âñòðîåííûé èëè âíåøíèé) |
53 | // 4 - âûáîð íàáîðà óðîâíåé (âñòðîåííûé èëè âíåøíèé) |
54 | // -1 - î ïðîãðàììå |
54 | // -1 - î ïðîãðàììå |
55 | bool gamestarted=false; //Áëîêèðîâêà èãðîâûõ êëàâèø. Åñëè false - èãðàòü íåëüçÿ |
55 | bool gamestarted=false; //Áëîêèðîâêà èãðîâûõ êëàâèø. Åñëè false - èãðàòü íåëüçÿ |
56 | 56 | ||
57 | bool drawgraphics=true; //Ðèñîâàòü ëè äåòàëüíóþ ãðàôèêó (èëè îãðàíè÷èòüñÿ àñêåòè÷íîé) |
57 | bool drawgraphics=true; //Ðèñîâàòü ëè äåòàëüíóþ ãðàôèêó (èëè îãðàíè÷èòüñÿ àñêåòè÷íîé) |
58 | bool drawanimation=true; //Àíèìèðîâàòü ëè |
58 | bool drawanimation=true; //Àíèìèðîâàòü ëè |
59 | bool skinned=false; |
59 | bool skinned=false; |
60 | int grassLeft(); //Ñîîáùèì î íàëè÷èè ôóíêöèè Grass Left |
60 | int grassLeft(); //Ñîîáùèì î íàëè÷èè ôóíêöèè Grass Left |
61 | 61 | ||
62 | //Ãðàôèêà èãðû |
62 | //Ãðàôèêà èãðû |
63 | 63 | ||
64 | RGB kosilka_d[576]; |
64 | RGB kosilka_d[576]; |
65 | RGB kosilka_l[576]; |
65 | RGB kosilka_l[576]; |
66 | RGB kosilka_r[576]; |
66 | RGB kosilka_r[576]; |
67 | RGB kosilka_u[576]; |
67 | RGB kosilka_u[576]; |
68 | RGB grass[576]; |
68 | RGB grass[576]; |
69 | RGB stone[576]; |
69 | RGB stone[576]; |
70 | RGB tree[576]; |
70 | RGB tree[576]; |
71 | RGB skos[576]; |
71 | RGB skos[576]; |
72 | 72 | ||
73 | Byte kosilka_d1[]={0,1,2,3,4,5,5,6,6,6,5,5,5,5,5,6,5,5,5,4,2,2,1,7,1,2,4,6,21 |
73 | Byte kosilka_d1[]={0,1,2,3,4,5,5,6,6,6,5,5,5,5,5,6,5,5,5,4,2,2,1,7,1,2,4,6,21 |
74 | ,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,6,5,2,40,1,4,62,63,63,64,65,66,66 |
74 | ,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,6,5,2,40,1,4,62,63,63,64,65,66,66 |
75 | ,67,66,66,66,66,68,66,66,63,69,65,65,62,4,1,2,6,75,91,64,65,67,92,75,75,75,75,75 |
75 | ,67,66,66,66,66,68,66,66,63,69,65,65,62,4,1,2,6,75,91,64,65,67,92,75,75,75,75,75 |
76 | ,75,75,75,75,93,65,94,94,62,6,2,3,6,76,94,96,67,103,104,104,104,104,104,104,105 |
76 | ,75,75,75,75,93,65,94,94,62,6,2,3,6,76,94,96,67,103,104,104,104,104,104,104,105 |
77 | ,106,107,108,109,93,63,64,75,6,3,3,21,75,94,94,67,115,104,104,104,104,105,105 |
77 | ,106,107,108,109,93,63,64,75,6,3,3,21,75,94,94,67,115,104,104,104,104,105,105 |
78 | ,106,107,108,116,117,92,65,96,76,21,4,3,21,62,64,63,78,115,105,105,105,105,106 |
78 | ,106,107,108,116,117,92,65,96,76,21,4,3,21,62,64,63,78,115,105,105,105,105,106 |
79 | ,107,108,116,116,119,120,92,65,96,77,6,3,4,6,62,96,69,67,123,106,106,107,107,108 |
79 | ,107,108,116,116,119,120,92,65,96,77,6,3,4,6,62,96,69,67,123,106,106,107,107,108 |
80 | ,108,116,119,119,127,124,92,66,64,77,21,4,3,21,62,64,91,67,123,107,108,108,116 |
80 | ,108,116,119,119,127,124,92,66,64,77,21,4,3,21,62,64,91,67,123,107,108,108,116 |
81 | ,116,119,119,127,127,127,124,75,69,64,77,21,4,4,6,62,64,69,68,123,108,116,119 |
81 | ,116,119,119,127,127,127,124,75,69,64,77,21,4,4,6,62,64,69,68,123,108,116,119 |
82 | ,119,127,127,127,129,129,129,125,93,63,64,77,21,4,4,21,62,64,91,67,123,119,119 |
82 | ,119,127,127,127,129,129,129,125,93,63,64,77,21,4,4,21,62,64,91,67,123,119,119 |
83 | ,127,127,129,129,129,129,129,129,125,68,94,64,77,6,4,3,21,62,64,94,63,122,128 |
83 | ,127,127,129,129,129,129,129,129,125,68,94,64,77,6,4,3,21,62,64,94,63,122,128 |
84 | ,128,121,121,121,121,121,121,121,121,76,66,69,91,77,21,4,4,21,62,64,94,69,69,65 |
84 | ,128,121,121,121,121,121,121,121,121,76,66,69,91,77,21,4,4,21,62,64,94,69,69,65 |
85 | ,66,67,68,68,67,68,67,67,66,66,69,91,64,77,21,4,4,21,76,96,64,94,94,64,94,96,69 |
85 | ,66,67,68,68,67,68,67,67,66,66,69,91,64,77,21,4,4,21,76,96,64,94,94,64,94,96,69 |
86 | ,91,94,94,64,69,69,94,64,64,64,77,6,4,3,6,75,64,64,64,64,64,64,64,64,64,64,64,64 |
86 | ,91,94,94,64,69,69,94,64,64,64,77,6,4,3,6,75,64,64,64,64,64,64,64,64,64,64,64,64 |
87 | ,64,64,64,64,64,96,75,21,4,3,6,16,94,64,64,64,64,64,64,64,64,64,64,64,64,64,64 |
87 | ,64,64,64,64,64,96,75,21,4,3,6,16,94,64,64,64,64,64,64,64,64,64,64,64,64,64,64 |
88 | ,64,64,96,75,6,2,2,6,75,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,62 |
88 | ,64,64,96,75,6,2,2,6,75,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64,62 |
89 | ,6,2,1,2,33,95,111,111,111,111,79,79,79,79,79,79,79,79,111,95,79,111,95,33,32,40 |
89 | ,6,2,1,2,33,95,111,111,111,111,79,79,79,79,79,79,79,79,111,95,79,111,95,33,32,40 |
90 | ,7,42,49,44,47,72,44,47,80,49,45,72,45,70,47,47,47,46,71,45,44,49,50,15,15,43,45 |
90 | ,7,42,49,44,47,72,44,47,80,49,45,72,45,70,47,47,47,46,71,45,44,49,50,15,15,43,45 |
91 | ,72,70,71,44,71,43,44,44,46,47,71,49,71,45,47,45,47,80,80,110,0,15,45,45,45,44 |
91 | ,72,70,71,44,71,43,44,44,46,47,71,49,71,45,47,45,47,80,80,110,0,15,45,45,45,44 |
92 | ,44,72,72,70,45,44,71,46,71,80,44,45,47,44,71,72,71,45,9,14,45,47,72,46,73,45,47 |
92 | ,44,72,72,70,45,44,71,46,71,80,44,45,47,44,71,72,71,45,9,14,45,47,72,46,73,45,47 |
93 | ,72,46,45,47,45,70,43,45,45,46,47,44,43,43,42,10,8,32,42,45,46,44,43,44,44,47,45 |
93 | ,72,46,45,47,45,70,43,45,45,46,47,44,43,43,42,10,8,32,42,45,46,44,43,44,44,47,45 |
94 | ,45,49,44,46,46,45,44,45,44,45,42,41,9,10,114,36,36,12,10,12,14,9,11,10,36,13,11 |
94 | ,45,49,44,46,46,45,44,45,44,45,42,41,9,10,114,36,36,12,10,12,14,9,11,10,36,13,11 |
95 | ,10,9,13,12,11,9,10,8,8,8 |
95 | ,10,9,13,12,11,9,10,8,8,8 |
96 | }; |
96 | }; |
97 | 97 | ||
98 | Byte kosilka_u1[]={8,9,9,10,9,11,12,13,9,10,11,13,8,10,11,9,14,12,10,12,14,8,11 |
98 | Byte kosilka_u1[]={8,9,9,10,9,11,12,13,9,10,11,13,8,10,11,9,14,12,10,12,14,8,11 |
99 | ,10,9,41,42,43,44,45,44,45,46,46,44,45,45,45,47,44,44,43,44,46,45,42,32,0,14,42 |
99 | ,10,9,41,42,43,44,45,44,45,46,46,44,45,45,45,47,44,44,43,44,46,45,42,32,0,14,42 |
100 | ,45,43,44,47,46,45,45,43,70,45,71,45,46,72,47,45,73,46,44,71,45,14,11,45,71,72 |
100 | ,45,43,44,47,46,45,45,43,70,45,71,45,46,72,47,45,73,46,44,71,45,14,11,45,71,72 |
101 | ,71,44,47,45,44,80,71,46,71,44,45,70,72,72,44,44,45,45,45,15,0,110,80,80,71,45 |
101 | ,71,44,47,45,44,80,71,46,71,44,45,70,72,72,44,44,45,45,45,15,0,110,80,80,71,45 |
102 | ,47,45,71,49,71,47,46,44,44,43,71,44,71,70,72,43,71,15,15,50,49,44,45,71,46,47 |
102 | ,47,45,71,49,71,47,46,44,44,43,71,44,71,70,72,43,71,15,15,50,49,44,45,71,46,47 |
103 | ,47,71,70,45,72,45,49,80,47,44,72,47,44,45,50,15,1,32,121,95,111,79,95,111,79,79 |
103 | ,47,71,70,45,72,45,49,80,47,44,72,47,44,45,50,15,1,32,121,95,111,79,95,111,79,79 |
104 | ,79,79,79,79,79,79,111,111,111,111,95,121,3,1,2,5,62,96,64,64,64,64,64,64,64,64 |
104 | ,79,79,79,79,79,79,111,111,111,111,95,121,3,1,2,5,62,96,64,64,64,64,64,64,64,64 |
105 | ,64,64,64,64,64,64,64,96,96,75,5,2,2,6,75,94,64,64,64,64,64,64,64,64,64,64,64,64 |
105 | ,64,64,64,64,64,64,64,96,96,75,5,2,2,6,75,94,64,64,64,64,64,64,64,64,64,64,64,64 |
106 | ,64,64,64,64,96,76,6,3,4,21,75,96,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64 |
106 | ,64,64,64,64,96,76,6,3,4,21,75,96,64,64,64,64,64,64,64,64,64,64,64,64,64,64,64 |
107 | ,64,94,76,6,3,4,21,77,64,64,64,94,69,69,64,94,94,91,69,64,94,64,94,94,64,64,16 |
107 | ,64,94,76,6,3,4,21,77,64,64,64,94,69,69,64,94,94,91,69,64,94,64,94,94,64,64,16 |
108 | ,21,4,4,6,77,64,91,69,66,66,66,67,67,67,68,68,67,66,65,69,69,94,64,77,21,4 |
108 | ,21,4,4,6,77,64,91,69,66,66,66,67,67,67,68,68,67,66,65,69,69,94,64,77,21,4 |
109 | ,4,21,77,64,69,66,76,121,121,121,121,121,121,121,121,128,128,122,63,94,64,62,21 |
109 | ,4,21,77,64,69,66,76,121,121,121,121,121,121,121,121,128,128,122,63,94,64,62,21 |
110 | ,3,4,6,77,64,94,67,125,129,129,129,129,129,129,127,127,119,119,123,66,91,64,62 |
110 | ,3,4,6,77,64,94,67,125,129,129,129,129,129,129,127,127,119,119,123,66,91,64,62 |
111 | ,21,4,4,21,77,64,63,92,125,129,129,129,127,127,127,119,119,116,108,123,68,69,64 |
111 | ,21,4,4,21,77,64,63,92,125,129,129,129,127,127,127,119,119,116,108,123,68,69,64 |
112 | ,62,6,4,4,21,77,64,63,92,124,127,127,127,119,119,116,108,108,108,108,123,68,91 |
112 | ,62,6,4,4,21,77,64,63,92,124,127,127,127,119,119,116,108,108,108,108,123,68,91 |
113 | ,64,62,21,3,4,21,77,91,66,92,124,127,119,119,116,108,108,107,107,106,106,123,67 |
113 | ,64,62,21,3,4,21,77,91,66,92,124,127,119,119,116,108,108,107,107,106,106,123,67 |
114 | ,69,64,62,21,3,3,21,77,64,65,92,120,119,116,116,108,107,106,105,105,105,105,115 |
114 | ,69,64,62,21,3,3,21,77,64,65,92,120,119,116,116,108,107,106,105,105,105,105,115 |
115 | ,93,63,64,62,6,3,4,21,75,64,65,92,117,116,108,107,106,105,105,105,104,104,104 |
115 | ,93,63,64,62,6,3,4,21,75,64,65,92,117,116,108,107,106,105,105,105,104,104,104 |
116 | ,115,67,94,96,76,21,3,3,6,75,96,63,93,109,108,107,106,105,104,104,104,104,104 |
116 | ,115,67,94,96,76,21,3,3,6,75,96,63,93,109,108,107,106,105,104,104,104,104,104 |
117 | ,104,136,67,96,94,76,6,3,2,6,62,94,94,65,93,75,75,75,75,75,75,75,92,75,93,67,65 |
117 | ,104,136,67,96,94,76,6,3,2,6,62,94,94,65,93,75,75,75,75,75,75,75,92,75,93,67,65 |
118 | ,64,64,75,6,2,1,4,62,65,65,69,63,65,66,67,66,66,65,65,67,66,66,65,64,63,65,62,4 |
118 | ,64,64,75,6,2,1,4,62,65,65,69,63,65,66,67,66,66,65,65,67,66,66,65,64,63,65,62,4 |
119 | ,1,1,2,6,6,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,6,4,2,1,7,1,2,2,4,5 |
119 | ,1,1,2,6,6,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,21,6,4,2,1,7,1,2,2,4,5 |
120 | ,5,6,6,5,5,5,6,6,6,6,6,5,6,3,4,2,1,0 |
120 | ,5,6,6,5,5,5,6,6,6,6,6,5,6,3,4,2,1,0 |
121 | }; |
121 | }; |
122 | 122 | ||
123 | Byte kosilka_l1[]={10,8,14,15,15,15,1,2,3,2,4,4,3,3,4,3,3,3,3,3,2,1,1,0,11,48,49 |
123 | Byte kosilka_l1[]={10,8,14,15,15,15,1,2,3,2,4,4,3,3,4,3,3,3,3,3,2,1,1,0,11,48,49 |
124 | ,45,47,50,3,6,6,6,21,21,21,21,6,21,21,6,21,6,5,4,2,1,29,42,71,45,74,49,33,75,76 |
124 | ,45,47,50,3,6,6,6,21,21,21,21,6,21,21,6,21,6,5,4,2,1,29,42,71,45,74,49,33,75,76 |
125 | ,76,76,62,62,62,62,62,62,62,76,76,75,62,4,2,14,70,72,45,72,44,95,96,94,94,94,96 |
125 | ,76,76,62,62,62,62,62,62,62,76,76,75,62,4,2,14,70,72,45,72,44,95,96,94,94,94,96 |
126 | ,64,64,64,64,64,96,94,94,94,66,6,3,12,46,46,44,70,47,111,64,96,96,64,94,94,91,69 |
126 | ,64,64,64,64,64,96,94,94,94,66,6,3,12,46,46,44,70,47,111,64,96,96,64,94,94,91,69 |
127 | ,91,69,63,94,96,64,63,21,4,10,44,73,44,71,72,111,64,64,64,94,69,63,66,68,67,67 |
127 | ,91,69,63,94,96,64,63,21,4,10,44,73,44,71,72,111,64,64,64,94,69,63,66,68,67,67 |
128 | ,68,67,67,65,64,21,5,12,43,45,72,44,44,111,64,64,64,94,69,122,123,123,123,123 |
128 | ,68,67,67,65,64,21,5,12,43,45,72,44,44,111,64,64,64,94,69,122,123,123,123,123 |
129 | ,115,115,103,67,63,21,6,14,44,47,72,71,47,111,64,64,64,64,65,128,119,116,107,106 |
129 | ,115,115,103,67,63,21,6,14,44,47,72,71,47,111,64,64,64,64,65,128,119,116,107,106 |
130 | ,105,104,104,93,66,21,6,9,44,72,70,43,80,79,64,64,64,94,66,128,119,116,108,106 |
130 | ,105,104,104,93,66,21,6,9,44,72,70,43,80,79,64,64,64,94,66,128,119,116,108,106 |
131 | ,105,104,104,75,66,21,6,11,47,46,45,44,49,79,64,64,64,64,67,121,127,116,108,107 |
131 | ,105,104,104,75,66,21,6,11,47,46,45,44,49,79,64,64,64,64,67,121,127,116,108,107 |
132 | ,105,104,104,92,67,21,6,10,45,45,44,44,45,79,64,64,64,69,68,121,127,119,116,107 |
132 | ,105,104,104,92,67,21,6,10,45,45,44,44,45,79,64,64,64,69,68,121,127,119,116,107 |
133 | ,106,104,104,75,66,21,6,8,49,47,71,46,72,79,64,64,64,91,68,121,129,127,116,108 |
133 | ,106,104,104,75,66,21,6,8,49,47,71,46,72,79,64,64,64,91,68,121,129,127,116,108 |
134 | ,106,105,104,75,66,21,6,13,45,45,46,47,45,79,64,64,64,94,67,121,129,127,119,108 |
134 | ,106,105,104,75,66,21,6,13,45,45,46,47,45,79,64,64,64,94,67,121,129,127,119,108 |
135 | ,107,105,104,75,66,21,4,11,44,70,71,71,70,79,64,64,64,94,67,121,129,127,119,116 |
135 | ,107,105,104,75,66,21,4,11,44,70,71,71,70,79,64,64,64,94,67,121,129,127,119,116 |
136 | ,108,106,105,75,66,21,5,10,46,43,80,49,47,79,64,64,64,64,67,121,129,129,127,119 |
136 | ,108,106,105,75,66,21,5,10,46,43,80,49,47,79,64,64,64,64,67,121,129,129,127,119 |
137 | ,108,107,106,75,67,21,4,9,46,45,44,71,47,79,64,64,64,69,67,121,129,129,127,119 |
137 | ,108,107,106,75,67,21,4,9,46,45,44,71,47,79,64,64,64,69,67,121,129,129,127,119 |
138 | ,116,108,107,75,66,21,6,13,45,45,45,45,47,111,64,64,64,69,66,121,129,129,127,127 |
138 | ,116,108,107,75,66,21,6,13,45,45,45,45,47,111,64,64,64,69,66,121,129,129,127,127 |
139 | ,119,116,108,75,66,21,6,12,44,46,47,47,46,95,64,64,64,94,66,76,125,125,124,124 |
139 | ,119,116,108,75,66,21,6,12,44,46,47,47,46,95,64,64,64,94,66,76,125,125,124,124 |
140 | ,120,117,109,93,63,21,4,11,45,47,44,45,71,79,64,64,64,64,69,66,68,92,75,92,92,92 |
140 | ,120,117,109,93,63,21,4,11,45,47,44,45,71,79,64,64,64,64,69,66,68,92,75,92,92,92 |
141 | ,93,65,69,21,6,9,44,44,71,47,45,111,64,64,64,64,91,69,94,63,69,66,65,65,63,94,65 |
141 | ,93,65,69,21,6,9,44,44,71,47,45,111,64,64,64,64,91,69,94,63,69,66,65,65,63,94,65 |
142 | ,21,4,10,47,43,72,80,44,95,64,64,64,64,64,64,64,64,64,64,64,64,64,64,63,6,2,9,42 |
142 | ,21,4,10,47,43,72,80,44,95,64,64,64,64,64,64,64,64,64,64,64,64,64,64,63,6,2,9,42 |
143 | ,45,47,80,45,121,62,75,75,77,77,77,77,77,77,77,77,75,75,62,75,5,2,0,48,42,45,71 |
143 | ,45,47,80,45,121,62,75,75,77,77,77,77,77,77,77,77,75,75,62,75,5,2,0,48,42,45,71 |
144 | ,50,2,6,6,21,6,21,21,6,21,21,21,21,21,6,6,4,2,40,8,11,51,9,8,15,1,2,2,4,4,3,4,4 |
144 | ,50,2,6,6,21,6,21,21,6,21,21,21,21,21,6,6,4,2,40,8,11,51,9,8,15,1,2,2,4,4,3,4,4 |
145 | ,4,4,4,3,3,3,2,1,1,7 |
145 | ,4,4,4,3,3,3,2,1,1,7 |
146 | }; |
146 | }; |
147 | 147 | ||
148 | Byte kosilka_r1[]={7,1,1,2,3,3,3,4,4,4,4,4,4,4,4,2,2,1,15,0,9,12,9,8,40,2,4,6,6 |
148 | Byte kosilka_r1[]={7,1,1,2,3,3,3,4,4,4,4,4,4,4,4,2,2,1,15,0,9,12,9,8,40,2,4,6,6 |
149 | ,21,21,21,21,21,6,21,21,6,4,1,15,51,52,53,47,45,23,9,2,6,62,62,75,75,77,77,77,77 |
149 | ,21,21,21,21,21,6,21,21,6,4,1,15,51,52,53,47,45,23,9,2,6,62,62,75,75,77,77,77,77 |
150 | ,77,77,77,77,77,77,78,79,45,80,47,71,42,9,2,6,65,94,94,94,96,64,64,64,64,64,64 |
150 | ,77,77,77,77,77,77,78,79,45,80,47,71,42,9,2,6,65,94,94,94,96,64,64,64,64,64,64 |
151 | ,96,64,64,64,95,44,72,44,43,45,10,4,21,65,94,63,65,65,66,69,63,94,69,91,64,64,64 |
151 | ,96,64,64,64,95,44,72,44,43,45,10,4,21,65,94,63,65,65,66,69,63,94,69,91,64,64,64 |
152 | ,64,79,43,47,71,44,72,9,5,21,69,65,93,92,92,92,92,92,67,66,69,64,64,64,64,79,71 |
152 | ,64,79,43,47,71,44,72,9,5,21,69,65,93,92,92,92,92,92,67,66,69,64,64,64,64,79,71 |
153 | ,45,44,47,43,11,5,21,63,93,109,117,120,124,124,125,125,76,66,94,64,64,64,95,46 |
153 | ,45,44,47,43,11,5,21,63,93,109,117,120,124,124,125,125,76,66,94,64,64,64,95,46 |
154 | ,47,47,46,72,12,6,21,65,75,108,116,119,127,127,129,129,121,66,69,64,64,64,111,47 |
154 | ,47,47,46,72,12,6,21,65,75,108,116,119,127,127,129,129,121,66,69,64,64,64,111,47 |
155 | ,45,45,45,45,13,6,21,66,75,107,108,116,119,127,129,129,121,66,69,64,64,64,79,47 |
155 | ,45,45,45,45,13,6,21,66,75,107,108,116,119,127,129,129,121,66,69,64,64,64,79,47 |
156 | ,71,44,45,44,9,4,21,67,75,106,107,116,119,127,129,129,121,67,64,64,64,64,79,47 |
156 | ,71,44,45,44,9,4,21,67,75,106,107,116,119,127,129,129,121,67,64,64,64,64,79,47 |
157 | ,49,80,43,44,10,5,21,66,75,105,106,108,116,119,127,129,121,67,94,64,64,64,79,70 |
157 | ,49,80,43,44,10,5,21,66,75,105,106,108,116,119,127,129,121,67,94,64,64,64,79,70 |
158 | ,71,71,70,72,11,4,21,66,75,104,105,107,108,119,127,129,121,67,94,64,64,64,79,45 |
158 | ,71,71,70,72,11,4,21,66,75,104,105,107,108,119,127,129,121,67,94,64,64,64,79,45 |
159 | ,47,46,45,45,13,6,21,66,75,104,105,106,108,116,127,129,121,68,91,64,64,64,79,72 |
159 | ,47,46,45,45,13,6,21,66,75,104,105,106,108,116,127,129,121,68,91,64,64,64,79,72 |
160 | ,46,71,47,45,8,6,21,65,75,104,104,105,107,116,119,127,121,68,69,64,64,64,79,45 |
160 | ,46,71,47,45,8,6,21,65,75,104,104,105,107,116,119,127,121,68,69,64,64,64,79,45 |
161 | ,44,44,45,45,10,6,21,67,75,104,104,105,107,108,116,127,121,67,64,64,64,64,79,49 |
161 | ,44,44,45,45,10,6,21,67,75,104,104,105,107,108,116,127,121,67,64,64,64,64,79,49 |
162 | ,44,45,46,46,11,6,21,66,92,104,104,105,106,108,116,119,128,66,94,64,64,64,79,80 |
162 | ,44,45,46,46,11,6,21,66,92,104,104,105,106,108,116,119,128,66,94,64,64,64,79,80 |
163 | ,43,70,72,72,9,6,21,66,92,104,104,105,106,107,108,119,128,65,64,64,64,64,111,47 |
163 | ,43,70,72,72,9,6,21,66,92,104,104,105,106,107,108,119,128,65,64,64,64,64,111,47 |
164 | ,71,72,47,72,14,6,21,65,67,103,115,115,123,123,123,123,122,69,94,64,64,64,111,44 |
164 | ,71,72,47,72,14,6,21,65,67,103,115,115,123,123,123,123,122,69,94,64,64,64,111,44 |
165 | ,44,72,45,47,12,5,21,64,65,67,67,93,68,68,93,66,63,69,94,64,64,64,111,72,71,44 |
165 | ,44,72,45,47,12,5,21,64,65,67,67,93,68,68,93,66,63,69,94,64,64,64,111,72,71,44 |
166 | ,73,72,10,3,21,63,64,96,94,63,69,91,69,91,94,94,64,64,64,64,111,47,70,44,46,44 |
166 | ,73,72,10,3,21,63,64,96,94,63,69,91,69,91,94,94,64,64,64,64,111,47,70,44,46,44 |
167 | ,12,4,6,63,64,64,64,64,64,64,64,64,64,64,64,64,64,64,95,44,72,45,72,45,14,2,4,62 |
167 | ,12,4,6,63,64,64,64,64,64,64,64,64,64,64,64,64,64,64,95,44,72,45,72,45,14,2,4,62 |
168 | ,75,76,76,62,62,62,62,62,62,62,76,62,62,77,79,45,43,45,46,42,36,1,2,5,6,6,21,6 |
168 | ,75,76,76,62,62,62,62,62,62,62,76,62,62,77,79,45,43,45,46,42,36,1,2,5,6,6,21,6 |
169 | ,21,21,6,21,21,21,21,6,6,6,37,52,46,45,45,20,11,0,40,40,2,3,4,4,3,3,4,4,2,4,4,3 |
169 | ,21,21,6,21,21,21,21,6,6,6,37,52,46,45,45,20,11,0,40,40,2,3,4,4,3,3,4,4,2,4,4,3 |
170 | ,3,2,1,15,15,15,14,36,10 |
170 | ,3,2,1,15,15,15,14,36,10 |
171 | }; |
171 | }; |
172 | 172 | ||
173 | Byte skos1[]={13,14,14,14,12,11,10,14,11,14,10,9,13,13,13,14,9,13,8,12,13,11,14 |
173 | Byte skos1[]={13,14,14,14,12,11,10,14,11,14,10,9,13,13,13,14,9,13,8,12,13,11,14 |
174 | ,8,11,10,9,8,10,10,12,11,14,10,9,14,14,9,10,12,10,14,9,11,10,8,10,8,13,14,10,8 |
174 | ,8,11,10,9,8,10,10,12,11,14,10,9,14,14,9,10,12,10,14,9,11,10,8,10,8,13,14,10,8 |
175 | ,10,10,13,13,10,11,11,10,8,14,12,13,9,12,12,12,9,9,9,12,8,13,9,13,8,14,13,8,12 |
175 | ,10,10,13,13,10,11,11,10,8,14,12,13,9,12,12,12,9,9,9,12,8,13,9,13,8,14,13,8,12 |
176 | ,13,11,9,11,14,9,10,10,9,14,10,8,12,12,13,9,10,14,12,14,12,9,9,8,8,10,8,12,8,14 |
176 | ,13,11,9,11,14,9,10,10,9,14,10,8,12,12,13,9,10,14,12,14,12,9,9,8,8,10,8,12,8,14 |
177 | ,13,13,14,8,10,9,10,10,9,13,9,8,9,8,12,12,9,14,14,10,14,14,14,14,9,12,14,12,14 |
177 | ,13,13,14,8,10,9,10,10,9,13,9,8,9,8,12,12,9,14,14,10,14,14,14,14,9,12,14,12,14 |
178 | ,13,10,11,51,12,13,10,14,8,8,11,13,8,8,8,9,14,12,8,13,14,14,9,14,13,9,8,126 |
178 | ,13,10,11,51,12,13,10,14,8,8,11,13,8,8,8,9,14,12,8,13,14,14,9,14,13,9,8,126 |
179 | ,12,8,10,11,10,8,14,14,10,8,12,12,13,12,9,13,10,14,13,11,12,9,11,12,13,13,11,13 |
179 | ,12,8,10,11,10,8,14,14,10,8,12,12,13,12,9,13,10,14,13,11,12,9,11,12,13,13,11,13 |
180 | ,12,13,13,10,8,10,14,12,11,10,11,9,14,10,11,11,11,12,9,8,9,13,14,8,8,14,10,11,9 |
180 | ,12,13,13,10,8,10,14,12,11,10,11,9,14,10,11,11,11,12,9,8,9,13,14,8,8,14,10,11,9 |
181 | ,14,13,9,10,11,12,8,11,8,8,13,9,12,9,10,10,11,12,8,10,11,9,9,10,10,14,14,8,14,8 |
181 | ,14,13,9,10,11,12,8,11,8,8,13,9,12,9,10,10,11,12,8,10,11,9,9,10,10,14,14,8,14,8 |
182 | ,13,14,9,14,11,8,12,12,14,12,14,13,9,11,8,8,14,10,9,11,12,11,10,9,9,9,11,11,14 |
182 | ,13,14,9,14,11,8,12,12,14,12,14,13,9,11,8,8,14,10,9,11,12,11,10,9,9,9,11,11,14 |
183 | ,10,11,14,11,9,8,12,12,9,14,14,10,14,14,14,14,9,12,14,12,14,13,10,11,10,10,10,10 |
183 | ,10,11,14,11,9,8,12,12,9,14,14,10,14,14,14,14,9,12,14,12,14,13,10,11,10,10,10,10 |
184 | ,8,8,8,10,13,9,12,9,12,8,8,14,11,11,13,13,12,13,12,8,11,12,13,11,12,10,13,8,8,8 |
184 | ,8,8,8,10,13,9,12,9,12,8,8,14,11,11,13,13,12,13,12,8,11,12,13,11,12,10,13,8,8,8 |
185 | ,10,9,11,13,14,12,14,12,12,12,8,14,12,13,10,10,8,14,11,13,14,11,9,10,12,13,8,10 |
185 | ,10,9,11,13,14,12,14,12,12,12,8,14,12,13,10,10,8,14,11,13,14,11,9,10,12,13,8,10 |
186 | ,11,13,11,11,14,9,11,8,10,14,10,14,10,12,8,8,14,14,11,13,11,12,8,8,13,12,11,14,9 |
186 | ,11,13,11,11,14,9,11,8,10,14,10,14,10,12,8,8,14,14,11,13,11,12,8,8,13,12,11,14,9 |
187 | ,13,11,8,12,10,10,8,12,12,51,10,9,8,9,13,10,14,8,14,8,9,9,14,8,10,14,13,8,11,8 |
187 | ,13,11,8,12,10,10,8,12,12,51,10,9,8,9,13,10,14,8,14,8,9,9,14,8,10,14,13,8,11,8 |
188 | ,11,13,12,13,10,13,10,10,10,9,12,11,13,14,13,11,8,14,8,10,10,10,14,13,10,11,10 |
188 | ,11,13,12,13,10,13,10,10,10,9,12,11,13,14,13,11,8,14,8,10,10,10,14,13,10,11,10 |
189 | ,11,13,13,12,12,9,11,12,8,13,9,10,14,10,9,9,9,13,12,12,11,8,13,13,36,13,9,10,13 |
189 | ,11,13,13,12,12,9,11,12,8,13,9,10,14,10,9,9,9,13,12,12,11,8,13,13,36,13,9,10,13 |
190 | ,12,8,13,12,9,13,10,11,12,12,10,9,13,8,9,12,10,11,12,14,9,14,14,8,11,14,12,12,10 |
190 | ,12,8,13,12,9,13,10,11,12,12,10,9,13,8,9,12,10,11,12,14,9,14,14,8,11,14,12,12,10 |
191 | ,11,9,8,8,14,14,11,13,11,12,8,8,13,12,8,8,10,13,14,10,11,8,8,8,11,11,14,11,12,10 |
191 | ,11,9,8,8,14,14,11,13,11,12,8,8,13,12,8,8,10,13,14,10,11,8,8,8,11,11,14,11,12,10 |
192 | ,13,9,14,14,9,9,11,9,10,11,8,14,12,10,12,14,9,11,10,8,13,11,10,9,13,12,11,9,10,9 |
192 | ,13,9,14,14,9,9,11,9,10,11,8,14,12,10,12,14,9,11,10,8,13,11,10,9,13,12,11,9,10,9 |
193 | ,9,8 |
193 | ,9,8 |
194 | }; |
194 | }; |
195 | 195 | ||
196 | Byte grass1[]={16,17,17,18,17,19,20,21,22,22,23,22,24,18,23,23,25,18,22,26,27,28 |
196 | Byte grass1[]={16,17,17,18,17,19,20,21,22,22,23,22,24,18,23,23,25,18,22,26,27,28 |
197 | ,28,18,20,24,28,54,55,19,54,56,24,20,54,24,24,20,24,20,20,24,27,24,17,54,54,24 |
197 | ,28,18,20,24,28,54,55,19,54,56,24,20,54,24,24,20,24,20,20,24,27,24,17,54,54,24 |
198 | ,55,55,28,55,55,54,54,55,54,24,54,54,24,24,54,20,54,17,54,54,55,24,81,55,17,19 |
198 | ,55,55,28,55,55,54,54,55,54,24,54,54,24,24,54,20,54,17,54,54,55,24,81,55,17,19 |
199 | ,17,27,81,27,54,19,17,54,41,18,24,24,81,23,19,55,18,27,24,97,20,54,19,112,55,81 |
199 | ,17,27,81,27,54,19,17,54,41,18,24,24,81,23,19,55,18,27,24,97,20,54,19,112,55,81 |
200 | ,18,24,19,24,48,20,55,28,81,28,18,24,112,55,18,81,17,54,24,54,118,19,54,81,23,81 |
200 | ,18,24,19,24,48,20,55,28,81,28,18,24,112,55,18,81,17,54,24,54,118,19,54,81,23,81 |
201 | ,55,41,26,23,26,26,41,20,26,55,19,81,18,17,28,54,19,28,55,54,17,22,17,55,17,17 |
201 | ,55,41,26,23,26,26,41,20,26,55,19,81,18,17,28,54,19,28,55,54,17,22,17,55,17,17 |
202 | ,81,18,28,25,97,18,27,112,112,81,24,24,27,26,81,54,24,54,17,27,55,28,23,97,25,54 |
202 | ,81,18,28,25,97,18,27,112,112,81,24,24,27,26,81,54,24,54,17,27,55,28,23,97,25,54 |
203 | ,28,23,26,26,22,112,55,97,24,28,27,26,16,55,17,27,54,18,19,54,23,16,97,20,54,25 |
203 | ,28,23,26,26,22,112,55,97,24,28,27,26,16,55,17,27,54,18,19,54,23,16,97,20,54,25 |
204 | ,26,26,19,19,48,18,16,28,17,23,20,19,28,55,24,20,19,28,20,48,23,33,19,97,26,26 |
204 | ,26,26,19,19,48,18,16,28,17,23,20,19,28,55,24,20,19,28,20,48,23,33,19,97,26,26 |
205 | ,55,54,18,26,25,19,28,26,28,17,27,55,81,23,19,19,18,20,24,41,54,22,26,81,17,27 |
205 | ,55,54,18,26,25,19,28,26,28,17,27,55,81,23,19,19,18,20,24,41,54,22,26,81,17,27 |
206 | ,17,25,26,28,24,48,22,27,26,55,54,55,55,28,16,33,5,24,41,18,48,55,19,48,97,16,26 |
206 | ,17,25,26,28,24,48,22,27,26,55,54,55,55,28,16,33,5,24,41,18,48,55,19,48,97,16,26 |
207 | ,27,48,33,23,97,22,28,19,54,48,81,21,6,21,41,26,33,33,28,54,20,16,48,18,26,33,16 |
207 | ,27,48,33,23,97,22,28,19,54,48,81,21,6,21,41,26,33,33,28,54,20,16,48,18,26,33,16 |
208 | ,48,23,17,19,112,26,23,48,21,21,131,48,26,33,97,17,17,20,16,25,97,16,16,26,21,20 |
208 | ,48,23,17,19,112,26,23,48,21,21,131,48,26,33,97,17,17,20,16,25,97,16,16,26,21,20 |
209 | ,19,112,54,26,26,21,20,41,6,33,16,25,33,55,19,16,41,25,48,16,26,48,97,24,55,54 |
209 | ,19,112,54,26,26,21,20,41,6,33,16,25,33,55,19,16,41,25,48,16,26,48,97,24,55,54 |
210 | ,24,24,23,21,23,97,48,21,33,24,6,54,54,132,54,18,16,97,28,26,22,28,27,54,20,16 |
210 | ,24,24,23,21,23,97,48,21,33,24,6,54,54,132,54,18,16,97,28,26,22,28,27,54,20,16 |
211 | ,23,33,22,16,26,48,17,20,33,54,24,19,20,25,97,48,54,54,26,27,20,20,41,21,97,6,33 |
211 | ,23,33,22,16,26,48,17,20,33,54,24,19,20,25,97,48,54,54,26,27,20,20,41,21,97,6,33 |
212 | ,23,26,48,19,17,48,24,23,24,27,16,18,16,55,55,19,26,27,54,48,21,24,48,23,33,25 |
212 | ,23,26,48,19,17,48,24,23,24,27,16,18,16,55,55,19,26,27,54,48,21,24,48,23,33,25 |
213 | ,33,28,23,97,97,6,16,16,20,25,48,17,48,97,22,27,24,20,48,22,17,27,48,48,16,22,25 |
213 | ,33,28,23,97,97,6,16,16,20,25,48,17,48,97,22,27,24,20,48,22,17,27,48,48,16,22,25 |
214 | ,24,41,33,25,25,54,23,97,17,18,27,22,97,24,20,18,23,27,17,23,48,25,23,97,27,97 |
214 | ,24,41,33,25,25,54,23,97,17,18,27,22,97,24,20,18,23,27,17,23,48,25,23,97,27,97 |
215 | ,18,26,18,22,26,18,19,17,28,26,23,17,81,97,25,81,27,24,6,97,48,18,97,16,16,81,33 |
215 | ,18,26,18,22,26,18,19,17,28,26,23,17,81,97,25,81,27,24,6,97,48,18,97,16,16,81,33 |
216 | ,18,22,26,24,17,27,23,26,17,27,23,26,26,54,41,33,18,97,22,18,22,48,18,16,97,22 |
216 | ,18,22,26,24,17,27,23,26,17,27,23,26,26,54,41,33,18,97,22,18,22,48,18,16,97,22 |
217 | ,18,18,27,27,26,48,27,17,97,18,27,55,21,20,26,23,26,27,27,22,26,16,23,22,26,27 |
217 | ,18,18,27,27,26,48,27,17,97,18,27,55,21,20,26,23,26,27,27,22,26,16,23,22,26,27 |
218 | ,140,19,20 |
218 | ,140,19,20 |
219 | }; |
219 | }; |
220 | 220 | ||
221 | Byte stone1[]={13,14,14,29,30,31,31,31,30,3,32,33,32,34,35,36,9,13,8,12,13,11,14 |
221 | Byte stone1[]={13,14,14,29,30,31,31,31,30,3,32,33,32,34,35,36,9,13,8,12,13,11,14 |
222 | ,8,11,10,36,30,31,57,58,57,31,59,59,59,59,31,31,30,32,29,11,11,10,8,10,8,13,8,30 |
222 | ,8,11,10,36,30,31,57,58,57,31,59,59,59,59,31,31,30,32,29,11,11,10,8,10,8,13,8,30 |
223 | ,31,58,82,83,82,82,83,84,84,85,84,83,58,59,30,30,51,9,9,9,12,8,98,30,57,99,83,83 |
223 | ,31,58,82,83,82,82,83,84,84,85,84,83,58,59,30,30,51,9,9,9,12,8,98,30,57,99,83,83 |
224 | ,83,83,84,84,85,100,73,49,74,73,82,31,30,8,12,12,13,9,0,30,57,82,83,83,83,83,84 |
224 | ,83,83,84,84,85,100,73,49,74,73,82,31,30,8,12,12,13,9,0,30,57,82,83,83,83,83,84 |
225 | ,84,85,85,73,49,74,113,74,84,59,30,114,10,9,12,0,30,59,58,82,83,83,83,83,84,85 |
225 | ,84,85,85,73,49,74,113,74,84,59,30,114,10,9,12,0,30,59,58,82,83,83,83,83,84,85 |
226 | ,85,73,49,74,74,113,113,83,31,30,11,10,12,13,30,30,57,99,82,83,83,83,84,84,85 |
226 | ,85,73,49,74,74,113,113,83,31,30,11,10,12,13,30,30,57,99,82,83,83,83,84,84,85 |
227 | ,100,49,49,74,113,113,74,99,30,29,13,12,8,0,30,57,82,83,83,83,83,83,84,85,100,73 |
227 | ,100,49,49,74,113,113,74,99,30,29,13,12,8,0,30,57,82,83,83,83,83,83,84,85,100,73 |
228 | ,49,74,113,113,113,85,31,40,12,13,13,1,30,99,83,83,83,83,83,83,84,84,85,73,49,74 |
228 | ,49,74,113,113,113,85,31,40,12,13,13,1,30,99,83,83,83,83,83,83,84,84,85,73,49,74 |
229 | ,74,113,113,74,57,32,8,9,13,30,59,82,83,82,83,83,83,83,83,84,85,100,73,49,74,74 |
229 | ,74,113,113,74,57,32,8,9,13,30,59,82,83,82,83,83,83,83,83,84,85,100,73,49,74,74 |
230 | ,113,113,57,5,51,10,0,30,57,82,82,83,83,83,83,83,83,84,85,85,73,49,74,74,113,113 |
230 | ,113,113,57,5,51,10,0,30,57,82,82,83,83,83,83,83,83,84,85,85,73,49,74,74,113,113 |
231 | ,58,130,11,12,29,30,57,82,82,83,83,83,83,83,83,83,84,85,100,73,49,74,74,74,99,30 |
231 | ,58,130,11,12,29,30,57,82,82,83,83,83,83,83,83,83,84,85,100,73,49,74,74,74,99,30 |
232 | ,11,9,29,30,57,82,82,83,83,83,83,83,83,83,84,84,85,73,49,49,74,74,82,30,0,8,8,30 |
232 | ,11,9,29,30,57,82,82,83,83,83,83,83,83,83,84,84,85,73,49,49,74,74,82,30,0,8,8,30 |
233 | ,31,99,82,82,83,83,83,83,83,83,83,84,85,100,73,49,74,74,83,31,15,12,10,15,30,58 |
233 | ,31,99,82,82,83,83,83,83,83,83,83,84,85,100,73,49,74,74,83,31,15,12,10,15,30,58 |
234 | ,82,82,82,83,83,83,83,83,83,84,84,85,100,73,49,74,84,31,1,11,13,7,30,58,82,82,82 |
234 | ,82,82,82,83,83,83,83,83,83,84,84,85,100,73,49,74,84,31,1,11,13,7,30,58,82,82,82 |
235 | ,82,82,82,83,83,82,83,84,85,85,100,73,49,84,31,15,8,8,7,30,58,82,82,82,82,82,82 |
235 | ,82,82,82,83,83,82,83,84,85,85,100,73,49,84,31,15,8,8,7,30,58,82,82,82,82,82,82 |
236 | ,82,82,82,83,84,84,85,85,73,73,82,30,35,10,10,35,30,57,82,82,82,82,82,82,82,82 |
236 | ,82,82,82,83,84,84,85,85,73,73,82,30,35,10,10,35,30,57,82,82,82,82,82,82,82,82 |
237 | ,83,82,83,84,84,85,85,85,59,30,51,13,10,133,30,59,99,99,82,82,82,82,82,82,82,83 |
237 | ,83,82,83,84,84,85,85,85,59,30,51,13,10,133,30,59,99,99,82,82,82,82,82,82,82,83 |
238 | ,82,83,84,84,84,57,30,35,10,11,13,13,1,31,58,82,99,82,82,82,99,58,58,82,82,83,83 |
238 | ,82,83,84,84,84,57,30,35,10,11,13,13,1,31,58,82,99,82,82,82,99,58,58,82,82,83,83 |
239 | ,99,57,31,40,13,13,8,13,9,0,30,59,99,99,99,99,99,58,59,59,57,57,57,59,31,30,15 |
239 | ,99,57,31,40,13,13,8,13,9,0,30,59,99,99,99,99,99,58,59,59,57,57,57,59,31,30,15 |
240 | ,10,11,12,14,9,14,14,15,30,31,58,58,58,57,30,30,30,30,30,30,32,1,37,8,8,13,12,8 |
240 | ,10,11,12,14,9,14,14,15,30,31,58,58,58,57,30,30,30,30,30,30,32,1,37,8,8,13,12,8 |
241 | ,8,10,13,14,35,30,30,31,30,30,30,8,0,37,0,133,9,14,14,9,9,11,9,10,11,8,14,12,10 |
241 | ,8,10,13,14,35,30,30,31,30,30,30,8,0,37,0,133,9,14,14,9,9,11,9,10,11,8,14,12,10 |
242 | ,37,40,32,1,35,8,13,11,10,9,13,12,11,9,10,9,9,8 |
242 | ,37,40,32,1,35,8,13,11,10,9,13,12,11,9,10,9,9,8 |
243 | }; |
243 | }; |
244 | 244 | ||
245 | Byte tree1[]={13,14,8,36,37,11,10,36,38,39,0,14,13,13,13,14,9,13,8,12,13,11,14,8 |
245 | Byte tree1[]={13,14,8,36,37,11,10,36,38,39,0,14,13,13,13,14,9,13,8,12,13,11,14,8 |
246 | ,11,36,39,39,39,34,38,39,60,61,60,39,34,0,37,37,14,36,15,36,14,8,10,8,11,86,60 |
246 | ,11,36,39,39,39,34,38,39,60,61,60,39,34,0,37,37,14,36,15,36,14,8,10,8,11,86,60 |
247 | ,87,61,60,88,61,89,90,89,61,60,88,39,86,39,88,88,88,39,15,9,12,34,88,87,89,89 |
247 | ,87,61,60,88,61,89,90,89,61,60,88,39,86,39,88,88,88,39,15,9,12,34,88,87,89,89 |
248 | ,101,89,89,89,89,89,89,101,61,61,90,89,89,102,87,60,39,37,13,34,60,89,89,89,89 |
248 | ,101,89,89,89,89,89,89,101,61,61,90,89,89,102,87,60,39,37,13,34,60,89,89,89,89 |
249 | ,89,89,89,89,89,89,89,89,89,89,89,89,89,89,102,88,7,11,15,88,102,101,89,89,89,89 |
249 | ,89,89,89,89,89,89,89,89,89,89,89,89,89,89,102,88,7,11,15,88,102,101,89,89,89,89 |
250 | ,89,89,101,89,89,101,89,89,89,89,89,89,101,60,34,51,8,39,60,102,89,89,89,89,89 |
250 | ,89,89,101,89,89,101,89,89,89,89,89,89,101,60,34,51,8,39,60,102,89,89,89,89,89 |
251 | ,90,102,101,89,101,101,89,89,89,89,89,101,60,39,51,37,34,60,90,101,89,89,101,89 |
251 | ,90,102,101,89,101,101,89,89,89,89,89,101,60,39,51,37,34,60,90,101,89,89,101,89 |
252 | ,101,101,89,89,89,89,89,89,89,89,89,89,87,88,15,37,60,89,89,89,89,101,90,89,89 |
252 | ,101,101,89,89,89,89,89,89,89,89,89,89,87,88,15,37,60,89,89,89,89,101,90,89,89 |
253 | ,89,89,89,89,89,89,89,89,89,89,89,101,102,88,39,102,89,89,89,89,101,90,89,89,89 |
253 | ,89,89,89,89,89,89,89,89,89,89,89,101,102,88,39,102,89,89,89,89,101,90,89,89,89 |
254 | ,89,89,89,101,101,101,101,89,89,89,89,89,61,32,102,89,89,89,89,101,90,90,101,89 |
254 | ,89,89,89,101,101,101,101,89,89,89,89,89,61,32,102,89,89,89,89,101,90,90,101,89 |
255 | ,89,89,101,87,101,89,89,89,89,89,89,89,102,39,61,89,89,89,89,89,89,101,102,101 |
255 | ,89,89,101,87,101,89,89,89,89,89,89,89,102,39,61,89,89,89,89,89,89,101,102,101 |
256 | ,89,89,90,89,89,89,89,89,89,89,89,89,90,9,39,61,101,89,89,89,89,101,102,102,89 |
256 | ,89,89,90,89,89,89,89,89,89,89,89,89,90,9,39,61,101,89,89,89,89,101,102,102,89 |
257 | ,101,101,89,89,89,89,89,89,89,89,89,102,36,34,88,102,89,89,89,89,89,101,101,89 |
257 | ,101,101,89,89,89,89,89,89,89,89,89,102,36,34,88,102,89,89,89,89,89,101,101,89 |
258 | ,89,89,89,89,89,89,89,89,89,101,90,60,8,39,60,101,89,89,89,89,89,89,89,89,89,89 |
258 | ,89,89,89,89,89,89,89,89,89,101,90,60,8,39,60,101,89,89,89,89,89,89,89,89,89,89 |
259 | ,89,89,89,89,89,89,89,101,101,60,34,88,101,89,89,89,89,89,89,89,89,89,89,89,89 |
259 | ,89,89,89,89,89,89,89,101,101,60,34,88,101,89,89,89,89,89,89,89,89,89,89,89,89 |
260 | ,89,89,89,89,101,101,89,89,102,34,60,89,89,89,89,89,89,89,89,89,89,89,89,89,89 |
260 | ,89,89,89,89,101,101,89,89,102,34,60,89,89,89,89,89,89,89,89,89,89,89,89,89,89 |
261 | ,89,89,101,90,101,89,89,101,34,88,87,89,89,101,89,89,89,89,90,102,89,89,89,89,89 |
261 | ,89,89,101,90,101,89,89,101,34,88,87,89,89,101,89,89,89,89,90,102,89,89,89,89,89 |
262 | ,89,89,89,101,89,89,102,37,32,60,102,87,87,89,89,89,134,135,135,101,89,89,89,89 |
262 | ,89,89,89,101,89,89,102,37,32,60,102,87,87,89,89,89,134,135,135,101,89,89,89,89 |
263 | ,89,89,89,101,102,102,60,11,51,37,38,34,88,61,102,61,39,137,131,134,101,101,101 |
263 | ,89,89,89,101,102,102,60,11,51,37,38,34,88,61,102,61,39,137,131,134,101,101,101 |
264 | ,102,90,89,89,102,60,39,37,8,51,11,37,37,0,39,39,32,15,137,137,138,60,61,60,88 |
264 | ,102,90,89,89,102,60,39,37,8,51,11,37,37,0,39,39,32,15,137,137,138,60,61,60,88 |
265 | ,88,102,102,60,39,40,10,11,9,14,8,8,36,40,36,51,51,137,137,137,34,39,34,29,38,39 |
265 | ,88,102,102,60,39,40,10,11,9,14,8,8,36,40,36,51,51,137,137,137,34,39,34,29,38,39 |
266 | ,39,32,15,13,12,8,8,10,51,14,37,37,8,8,8,137,137,137,8,9,139,51,8,7,7,14,11,11,9 |
266 | ,39,32,15,13,12,8,8,10,51,14,37,37,8,8,8,137,137,137,8,9,139,51,8,7,7,14,11,11,9 |
267 | ,10,11,8,14,51,10,12,14,11,11,137,137,137,11,10,9,13,51,14,11,51,9,9,8 |
267 | ,10,11,8,14,51,10,12,14,11,11,137,137,137,11,10,9,13,51,14,11,51,9,9,8 |
268 | }; |
268 | }; |
269 | 269 | ||
270 | 270 | ||
271 | //Ïàëèòðà öâåòîâ. Äåêîäèðóåì â 0xRRGGBB |
271 | //Ïàëèòðà öâåòîâ. Äåêîäèðóåì â 0xRRGGBB |
272 | 272 | ||
273 | char * apppath; |
273 | char * apppath; |
274 | char * levpath; |
274 | char * levpath; |
275 | char * getSkinPathName(){ |
275 | char * getSkinPathName(){ |
276 | 276 | ||
277 | int lastslashindex=0; |
277 | int lastslashindex=0; |
278 | static char skinfilename[]="kosskin.gfx"; |
278 | static char skinfilename[]="kosskin.gfx"; |
279 | int tempslfnd=0; |
279 | int tempslfnd=0; |
280 | 280 | ||
281 | for (tempslfnd=0; tempslfnd < strlen(kosExePath); tempslfnd++){ |
281 | for (tempslfnd=0; tempslfnd < strlen(kosExePath); tempslfnd++){ |
282 | if (kosExePath[tempslfnd]=='/'){lastslashindex=tempslfnd;} |
282 | if (kosExePath[tempslfnd]=='/'){lastslashindex=tempslfnd;} |
283 | } |
283 | } |
284 | 284 | ||
285 | apppath = new char[lastslashindex+strlen(skinfilename)+1]; |
285 | apppath = new char[lastslashindex+strlen(skinfilename)+1]; |
286 | 286 | ||
287 | for (tempslfnd=0; tempslfnd <= lastslashindex; tempslfnd++){ |
287 | for (tempslfnd=0; tempslfnd <= lastslashindex; tempslfnd++){ |
288 | apppath[tempslfnd]=kosExePath[tempslfnd]; |
288 | apppath[tempslfnd]=kosExePath[tempslfnd]; |
289 | } |
289 | } |
290 | for (tempslfnd=0; tempslfnd < strlen(skinfilename); tempslfnd++){ |
290 | for (tempslfnd=0; tempslfnd < strlen(skinfilename); tempslfnd++){ |
291 | apppath[tempslfnd+lastslashindex+1]=skinfilename[tempslfnd]; |
291 | apppath[tempslfnd+lastslashindex+1]=skinfilename[tempslfnd]; |
292 | } |
292 | } |
293 | 293 | ||
294 | 294 | ||
295 | return apppath; |
295 | return apppath; |
296 | 296 | ||
297 | 297 | ||
298 | } |
298 | } |
299 | 299 | ||
300 | char * getLevelsPathName(){ |
300 | char * getLevelsPathName(){ |
301 | 301 | ||
302 | int lastslashindex=0; |
302 | int lastslashindex=0; |
303 | static char levfilename[]="koslevel.pak"; |
303 | static char levfilename[]="koslevel.pak"; |
304 | int tempslfnd=0; |
304 | int tempslfnd=0; |
305 | 305 | ||
306 | for (tempslfnd=0; tempslfnd < strlen(kosExePath); tempslfnd++){ |
306 | for (tempslfnd=0; tempslfnd < strlen(kosExePath); tempslfnd++){ |
307 | if (kosExePath[tempslfnd]=='/'){lastslashindex=tempslfnd;} |
307 | if (kosExePath[tempslfnd]=='/'){lastslashindex=tempslfnd;} |
308 | } |
308 | } |
309 | 309 | ||
310 | levpath = new char[lastslashindex+strlen(levfilename)+1]; |
310 | levpath = new char[lastslashindex+strlen(levfilename)+1]; |
311 | 311 | ||
312 | for (tempslfnd=0; tempslfnd <= lastslashindex; tempslfnd++){ |
312 | for (tempslfnd=0; tempslfnd <= lastslashindex; tempslfnd++){ |
313 | levpath[tempslfnd]=kosExePath[tempslfnd]; |
313 | levpath[tempslfnd]=kosExePath[tempslfnd]; |
314 | } |
314 | } |
315 | for (tempslfnd=0; tempslfnd < strlen(levfilename); tempslfnd++){ |
315 | for (tempslfnd=0; tempslfnd < strlen(levfilename); tempslfnd++){ |
316 | levpath[tempslfnd+lastslashindex+1]=levfilename[tempslfnd]; |
316 | levpath[tempslfnd+lastslashindex+1]=levfilename[tempslfnd]; |
317 | } |
317 | } |
318 | 318 | ||
319 | return levpath; |
319 | return levpath; |
320 | 320 | ||
321 | 321 | ||
322 | } |
322 | } |
323 | 323 | ||
324 | 324 | ||
325 | void decode_graphics(Byte * source, RGB * target){ |
325 | void decode_graphics(Byte * source, RGB * target){ |
326 | static const char palette[] = { |
326 | static const char palette[] = { |
327 | 0x31,0x8A,0x97,0x2E,0x7F,0x8B,0x2B,0x7B,0x86,0x2B,0x76,0x82,0x28,0x74,0x7F,0x2B,0x70,0x79,0x26,0x6C,0x76,0x2E,0x83,0x90, |
327 | 0x31,0x8A,0x97,0x2E,0x7F,0x8B,0x2B,0x7B,0x86,0x2B,0x76,0x82,0x28,0x74,0x7F,0x2B,0x70,0x79,0x26,0x6C,0x76,0x2E,0x83,0x90, |
328 | 0x2F,0x8A,0x97,0x31,0x8C,0x9A,0x32,0x8D,0x9B,0x31,0x8C,0x99,0x33,0x8E,0x9C,0x34,0x8F,0x9D,0x30,0x8B,0x98,0x31,0x85,0x92, |
328 | 0x2F,0x8A,0x97,0x31,0x8C,0x9A,0x32,0x8D,0x9B,0x31,0x8C,0x99,0x33,0x8E,0x9C,0x34,0x8F,0x9D,0x30,0x8B,0x98,0x31,0x85,0x92, |
329 | 0x32,0x75,0x88,0x54,0xA4,0xBA,0x3D,0x8C,0xA1,0x6A,0xB2,0xC6,0x46,0x8E,0xA0,0x26,0x5F,0x6B,0x44,0x98,0xAF,0x3B,0x87,0x9C, |
329 | 0x32,0x75,0x88,0x54,0xA4,0xBA,0x3D,0x8C,0xA1,0x6A,0xB2,0xC6,0x46,0x8E,0xA0,0x26,0x5F,0x6B,0x44,0x98,0xAF,0x3B,0x87,0x9C, |
330 | 0x4D,0x96,0xAB,0x38,0x83,0x98,0x40,0x91,0xA8,0x4C,0x9D,0xB4,0x5C,0xAC,0xC1,0x2F,0x87,0x94,0x30,0x30,0x30,0x35,0x34,0x34, |
330 | 0x4D,0x96,0xAB,0x38,0x83,0x98,0x40,0x91,0xA8,0x4C,0x9D,0xB4,0x5C,0xAC,0xC1,0x2F,0x87,0x94,0x30,0x30,0x30,0x35,0x34,0x34, |
331 | 0x33,0x79,0x82,0x2F,0x6E,0x80,0x34,0x81,0x8B,0x32,0x86,0x93,0x2F,0x89,0x96,0x33,0x8C,0x98,0x3B,0x87,0x8F,0x39,0x9F,0x7E, |
331 | 0x33,0x79,0x82,0x2F,0x6E,0x80,0x34,0x81,0x8B,0x32,0x86,0x93,0x2F,0x89,0x96,0x33,0x8C,0x98,0x3B,0x87,0x8F,0x39,0x9F,0x7E, |
332 | 0x2D,0x81,0x8E,0x3F,0x80,0x92,0x5C,0x71,0x75,0x62,0x64,0x67,0x68,0x6A,0x6D,0x60,0x62,0x66,0x66,0x68,0x6B,0x64,0x66,0x6A, |
332 | 0x2D,0x81,0x8E,0x3F,0x80,0x92,0x5C,0x71,0x75,0x62,0x64,0x67,0x68,0x6A,0x6D,0x60,0x62,0x66,0x66,0x68,0x6B,0x64,0x66,0x6A, |
333 | 0x35,0x7B,0x8E,0x61,0x61,0x62,0x41,0x76,0x79,0x33,0x8E,0x9B,0x54,0x79,0x7F,0x67,0x6A,0x77,0x55,0x9E,0xB2,0x5E,0xA7,0xBC, |
333 | 0x35,0x7B,0x8E,0x61,0x61,0x62,0x41,0x76,0x79,0x33,0x8E,0x9B,0x54,0x79,0x7F,0x67,0x6A,0x77,0x55,0x9E,0xB2,0x5E,0xA7,0xBC, |
334 | 0x3E,0x8C,0x97,0x3D,0x3E,0x3E,0x45,0x42,0x43,0x38,0x39,0x37,0x37,0x97,0x3C,0x37,0x94,0x20,0x34,0x79,0xB9,0x3E,0x86,0xE6, |
334 | 0x3E,0x8C,0x97,0x3D,0x3E,0x3E,0x45,0x42,0x43,0x38,0x39,0x37,0x37,0x97,0x3C,0x37,0x94,0x20,0x34,0x79,0xB9,0x3E,0x86,0xE6, |
335 | 0x41,0x8C,0xF2,0x3D,0x83,0xE2,0x3B,0x80,0xDD,0x3A,0x7C,0xD7,0x38,0x79,0xD1,0x3F,0x88,0xEA,0x5B,0x5D,0x60,0x63,0x65,0x68, |
335 | 0x41,0x8C,0xF2,0x3D,0x83,0xE2,0x3B,0x80,0xDD,0x3A,0x7C,0xD7,0x38,0x79,0xD1,0x3F,0x88,0xEA,0x5B,0x5D,0x60,0x63,0x65,0x68, |
336 | 0x6B,0x6D,0x70,0x5E,0x5F,0x5F,0x66,0x65,0x65,0x31,0x69,0xB5,0x3B,0x66,0xAC,0x36,0x7D,0xC1,0x38,0x83,0xC8,0x46,0x72,0x99, |
336 | 0x6B,0x6D,0x70,0x5E,0x5F,0x5F,0x66,0x65,0x65,0x31,0x69,0xB5,0x3B,0x66,0xAC,0x36,0x7D,0xC1,0x38,0x83,0xC8,0x46,0x72,0x99, |
337 | 0x71,0x72,0x73,0x46,0x95,0xA8,0x4E,0x4D,0x4D,0x52,0x51,0x51,0x56,0x56,0x56,0x59,0x5A,0x5A,0x41,0x7B,0x68,0x33,0x89,0x09, |
337 | 0x71,0x72,0x73,0x46,0x95,0xA8,0x4E,0x4D,0x4D,0x52,0x51,0x51,0x56,0x56,0x56,0x59,0x5A,0x5A,0x41,0x7B,0x68,0x33,0x89,0x09, |
338 | 0x38,0x9B,0x5B,0x36,0x90,0x00,0x36,0x91,0x06,0x41,0x8B,0xF1,0x34,0x70,0xC2,0x37,0x77,0xCD,0x40,0x8A,0xEE,0x4B,0x77,0xA0, |
338 | 0x38,0x9B,0x5B,0x36,0x90,0x00,0x36,0x91,0x06,0x41,0x8B,0xF1,0x34,0x70,0xC2,0x37,0x77,0xCD,0x40,0x8A,0xEE,0x4B,0x77,0xA0, |
339 | 0x41,0x8C,0xF1,0x37,0x80,0x94,0x34,0x8B,0x98,0x4A,0x48,0x49,0x5D,0x5D,0x5D,0x36,0x90,0x03,0x36,0x92,0x0E,0x7B,0x6B,0xB0, |
339 | 0x41,0x8C,0xF1,0x37,0x80,0x94,0x34,0x8B,0x98,0x4A,0x48,0x49,0x5D,0x5D,0x5D,0x36,0x90,0x03,0x36,0x92,0x0E,0x7B,0x6B,0xB0, |
340 | 0xF8,0x9C,0x94,0xF6,0x85,0x7C,0xF5,0x74,0x6A,0xF4,0x66,0x5A,0xF1,0x53,0x46,0xB6,0x53,0x5F,0x62,0x64,0x72,0x49,0x74,0x9C, |
340 | 0xF8,0x9C,0x94,0xF6,0x85,0x7C,0xF5,0x74,0x6A,0xF4,0x66,0x5A,0xF1,0x53,0x46,0xB6,0x53,0x5F,0x62,0x64,0x72,0x49,0x74,0x9C, |
341 | 0x72,0xC4,0xD0,0x69,0x69,0x69,0x32,0x8B,0x99,0x76,0x66,0x9D,0xDD,0x47,0x3B,0xA0,0x49,0x53,0x77,0xCD,0xD8,0xC1,0x3E,0x34, |
341 | 0x72,0xC4,0xD0,0x69,0x69,0x69,0x32,0x8B,0x99,0x76,0x66,0x9D,0xDD,0x47,0x3B,0xA0,0x49,0x53,0x77,0xCD,0xD8,0xC1,0x3E,0x34, |
342 | 0x8C,0x43,0x4F,0x38,0x55,0x8E,0x41,0x73,0xC3,0x71,0x5D,0x89,0x74,0x3B,0x48,0x59,0x33,0x43,0x34,0x8D,0x9C,0x9A,0x32,0x2A, |
342 | 0x8C,0x43,0x4F,0x38,0x55,0x8E,0x41,0x73,0xC3,0x71,0x5D,0x89,0x74,0x3B,0x48,0x59,0x33,0x43,0x34,0x8D,0x9C,0x9A,0x32,0x2A, |
343 | 0x49,0x5F,0x99,0x6D,0x23,0x1D,0x37,0x6E,0x75,0x19,0x48,0x52,0x48,0x88,0x8D,0x34,0x8D,0x9B,0x2F,0x7F,0x15,0x28,0x6C,0x2D, |
343 | 0x49,0x5F,0x99,0x6D,0x23,0x1D,0x37,0x6E,0x75,0x19,0x48,0x52,0x48,0x88,0x8D,0x34,0x8D,0x9B,0x2F,0x7F,0x15,0x28,0x6C,0x2D, |
344 | 0x8B,0x77,0xAA,0x15,0x3C,0x66,0x24,0x59,0x4E,0x31,0x8F,0x9D,0x48,0xAD,0xBC |
344 | 0x8B,0x77,0xAA,0x15,0x3C,0x66,0x24,0x59,0x4E,0x31,0x8F,0x9D,0x48,0xAD,0xBC |
345 | }; |
345 | }; |
346 | 346 | ||
347 | for (int lc=0;lc<576;lc++) |
347 | for (int lc=0;lc<576;lc++) |
348 | target[lc] = ((RGB*)palette)[source[lc]]; |
348 | target[lc] = ((RGB*)palette)[source[lc]]; |
349 | } |
349 | } |
350 | 350 | ||
351 | 351 | ||
352 | void interlevelpause(){ //Ïàóçà ìåæäó óðîâíÿìè |
352 | void interlevelpause(){ //Ïàóçà ìåæäó óðîâíÿìè |
353 | Byte tempCode; |
353 | Byte tempCode; |
354 | RGB tmprgb; |
354 | RGB tmprgb; |
355 | int tmpa=0; |
355 | int tmpa=0; |
356 | laststep=0; |
356 | laststep=0; |
357 | static int yellow_pal[] = {0xA8A93D,0xBEBF4C,0xD6D856,0xDFE15A,0xECEE5B, |
357 | static int yellow_pal[] = {0xA8A93D,0xBEBF4C,0xD6D856,0xDFE15A,0xECEE5B, |
358 | 0xECEE5B,0xDFE15A,0xD6D856,0xBEBF4C,0xA8A93D}; |
358 | 0xECEE5B,0xDFE15A,0xD6D856,0xBEBF4C,0xA8A93D}; |
359 | for (int iic=0;iic<240;iic++){ |
359 | for (int iic=0;iic<240;iic++){ |
360 | kos_WaitForEvent(1); |
360 | kos_WaitForEvent(1); |
361 | kos_GetKey(tempCode); |
361 | kos_GetKey(tempCode); |
362 | 362 | ||
363 | kos_DrawBar(iic*2,0,2,480,yellow_pal[tmpa]); |
363 | kos_DrawBar(iic*2,0,2,480,yellow_pal[tmpa]); |
364 | 364 | ||
365 | tmpa++; |
365 | tmpa++; |
366 | if (tmpa>9){tmpa=0;} |
366 | if (tmpa>9){tmpa=0;} |
367 | } |
367 | } |
368 | } |
368 | } |
369 | 369 | ||
370 | void draw_element(int elx, int ely){ //Îòðèñîâêà ýëåìåíòà êàðòû |
370 | void draw_element(int elx, int ely){ //Îòðèñîâêà ýëåìåíòà êàðòû |
371 | switch (gamearea[elx][ely]){ |
371 | switch (gamearea[elx][ely]){ |
372 | case 'g': |
372 | case 'g': |
373 | if (drawgraphics==true){ |
373 | if (drawgraphics==true){ |
374 | kos_PutImage((RGB*)grass,24,24,elx*24,ely*24); |
374 | kos_PutImage((RGB*)grass,24,24,elx*24,ely*24); |
375 | } |
375 | } |
376 | else |
376 | else |
377 | { |
377 | { |
378 | kos_DrawBar(elx*24,ely*24,24,24,0xAAAA00); |
378 | kos_DrawBar(elx*24,ely*24,24,24,0xAAAA00); |
379 | } |
379 | } |
380 | 380 | ||
381 | break; |
381 | break; |
382 | case 'k': |
382 | case 'k': |
383 | if (drawgraphics==true){ |
383 | if (drawgraphics==true){ |
384 | switch(kosilkadirection){ |
384 | switch(kosilkadirection){ |
385 | case 1: |
385 | case 1: |
386 | kos_PutImage((RGB*)kosilka_d,24,24,elx*24,ely*24); |
386 | kos_PutImage((RGB*)kosilka_d,24,24,elx*24,ely*24); |
387 | break; |
387 | break; |
388 | case 2: |
388 | case 2: |
389 | kos_PutImage((RGB*)kosilka_u,24,24,elx*24,ely*24); |
389 | kos_PutImage((RGB*)kosilka_u,24,24,elx*24,ely*24); |
390 | break; |
390 | break; |
391 | case 3: |
391 | case 3: |
392 | kos_PutImage((RGB*)kosilka_l,24,24,elx*24,ely*24); |
392 | kos_PutImage((RGB*)kosilka_l,24,24,elx*24,ely*24); |
393 | break; |
393 | break; |
394 | case 4: |
394 | case 4: |
395 | kos_PutImage((RGB*)kosilka_r,24,24,elx*24,ely*24); |
395 | kos_PutImage((RGB*)kosilka_r,24,24,elx*24,ely*24); |
396 | break; |
396 | break; |
397 | } |
397 | } |
398 | 398 | ||
399 | 399 | ||
400 | } |
400 | } |
401 | else |
401 | else |
402 | { |
402 | { |
403 | kos_DrawBar(elx*24,ely*24,24,24,0x00AAAA); |
403 | kos_DrawBar(elx*24,ely*24,24,24,0x00AAAA); |
404 | } |
404 | } |
405 | 405 | ||
406 | 406 | ||
407 | 407 | ||
408 | break; |
408 | break; |
409 | case 'n': |
409 | case 'n': |
410 | if (drawgraphics==true){ |
410 | if (drawgraphics==true){ |
411 | kos_PutImage((RGB*)skos,24,24,elx*24,ely*24); |
411 | kos_PutImage((RGB*)skos,24,24,elx*24,ely*24); |
412 | } |
412 | } |
413 | else |
413 | else |
414 | { |
414 | { |
415 | kos_DrawBar(elx*24,ely*24,24,24,0xAAAAAA); |
415 | kos_DrawBar(elx*24,ely*24,24,24,0xAAAAAA); |
416 | } |
416 | } |
417 | 417 | ||
418 | 418 | ||
419 | break; |
419 | break; |
420 | case 's': |
420 | case 's': |
421 | if (drawgraphics==true){ |
421 | if (drawgraphics==true){ |
422 | kos_PutImage((RGB*)stone,24,24,elx*24,ely*24); |
422 | kos_PutImage((RGB*)stone,24,24,elx*24,ely*24); |
423 | } |
423 | } |
424 | else |
424 | else |
425 | { |
425 | { |
426 | kos_DrawBar(elx*24,ely*24,24,24,0x555555); |
426 | kos_DrawBar(elx*24,ely*24,24,24,0x555555); |
427 | } |
427 | } |
428 | 428 | ||
429 | 429 | ||
430 | break; |
430 | break; |
431 | 431 | ||
432 | case 't': |
432 | case 't': |
433 | if (drawgraphics==true){ |
433 | if (drawgraphics==true){ |
434 | kos_PutImage((RGB*)tree,24,24,elx*24,ely*24); |
434 | kos_PutImage((RGB*)tree,24,24,elx*24,ely*24); |
435 | } |
435 | } |
436 | else |
436 | else |
437 | { |
437 | { |
438 | kos_DrawBar(elx*24,ely*24,24,24,0x005500); |
438 | kos_DrawBar(elx*24,ely*24,24,24,0x005500); |
439 | } |
439 | } |
440 | 440 | ||
441 | 441 | ||
442 | break; |
442 | break; |
443 | 443 | ||
444 | } |
444 | } |
445 | 445 | ||
446 | } |
446 | } |
447 | 447 | ||
448 | 448 | ||
449 | void display_grass_left(){ //Âûâîäèì íà ýêðàí êîëè÷åñòâî îñòàâøåéñÿ òðàâû |
449 | void display_grass_left(){ //Âûâîäèì íà ýêðàí êîëè÷åñòâî îñòàâøåéñÿ òðàâû |
450 | kos_DrawBar(605,120,20,10,0xEEEEEE); |
450 | kos_DrawBar(605,120,20,10,0xEEEEEE); |
451 | kos_DisplayNumberToWindow(grassLeft(),3,605,120,0x0000FF,nbDecimal,false); |
451 | kos_DisplayNumberToWindow(grassLeft(),3,605,120,0x0000FF,nbDecimal,false); |
452 | } |
452 | } |
453 | 453 | ||
454 | 454 | ||
455 | void animate(int initcellx, int initcelly, int direction){ //àíèìàöèÿ äâèæåíèÿ êîñèëêè |
455 | void animate(int initcellx, int initcelly, int direction){ //àíèìàöèÿ äâèæåíèÿ êîñèëêè |
456 | int tmpp=0; |
456 | int tmpp=0; |
457 | 457 | ||
458 | switch (direction){ |
458 | switch (direction){ |
459 | case 1: |
459 | case 1: |
460 | for (tmpp=0; tmpp<23;tmpp++){ |
460 | for (tmpp=0; tmpp<23;tmpp++){ |
461 | if (drawgraphics==true){ |
461 | if (drawgraphics==true){ |
462 | kos_PutImage((RGB*)skos,24,24,initcellx*24,initcelly*24); |
462 | kos_PutImage((RGB*)skos,24,24,initcellx*24,initcelly*24); |
463 | kos_PutImage((RGB*)kosilka_d,24,24,initcellx*24,initcelly*24+tmpp); |
463 | kos_PutImage((RGB*)kosilka_d,24,24,initcellx*24,initcelly*24+tmpp); |
464 | } else { |
464 | } else { |
465 | kos_DrawBar(initcellx*24,initcelly*24,24,24,0xAAAAAA); |
465 | kos_DrawBar(initcellx*24,initcelly*24,24,24,0xAAAAAA); |
466 | kos_DrawBar(initcellx*24,initcelly*24+tmpp,24,24,0x00AAAA); |
466 | kos_DrawBar(initcellx*24,initcelly*24+tmpp,24,24,0x00AAAA); |
467 | 467 | ||
468 | } |
468 | } |
469 | kos_Pause(1); |
469 | kos_Pause(1); |
470 | } |
470 | } |
471 | break; |
471 | break; |
472 | case 2: |
472 | case 2: |
473 | for (tmpp=0; tmpp<23;tmpp++){ |
473 | for (tmpp=0; tmpp<23;tmpp++){ |
474 | if (drawgraphics==true){ |
474 | if (drawgraphics==true){ |
475 | kos_PutImage((RGB*)skos,24,24,initcellx*24,initcelly*24); |
475 | kos_PutImage((RGB*)skos,24,24,initcellx*24,initcelly*24); |
476 | kos_PutImage((RGB*)kosilka_u,24,24,initcellx*24,initcelly*24-tmpp); |
476 | kos_PutImage((RGB*)kosilka_u,24,24,initcellx*24,initcelly*24-tmpp); |
477 | } else { |
477 | } else { |
478 | kos_DrawBar(initcellx*24,initcelly*24,24,24,0xAAAAAA); |
478 | kos_DrawBar(initcellx*24,initcelly*24,24,24,0xAAAAAA); |
479 | kos_DrawBar(initcellx*24,initcelly*24-tmpp,24,24,0x00AAAA); |
479 | kos_DrawBar(initcellx*24,initcelly*24-tmpp,24,24,0x00AAAA); |
480 | } |
480 | } |
481 | kos_Pause(1); |
481 | kos_Pause(1); |
482 | } |
482 | } |
483 | break; |
483 | break; |
484 | case 3: |
484 | case 3: |
485 | for (tmpp=0; tmpp<23;tmpp++){ |
485 | for (tmpp=0; tmpp<23;tmpp++){ |
486 | if (drawgraphics==true){ |
486 | if (drawgraphics==true){ |
487 | kos_PutImage((RGB*)skos,24,24,initcellx*24,initcelly*24); |
487 | kos_PutImage((RGB*)skos,24,24,initcellx*24,initcelly*24); |
488 | kos_PutImage((RGB*)kosilka_r,24,24,initcellx*24+tmpp,initcelly*24); |
488 | kos_PutImage((RGB*)kosilka_r,24,24,initcellx*24+tmpp,initcelly*24); |
489 | } else { |
489 | } else { |
490 | kos_DrawBar(initcellx*24,initcelly*24,24,24,0xAAAAAA); |
490 | kos_DrawBar(initcellx*24,initcelly*24,24,24,0xAAAAAA); |
491 | kos_DrawBar(initcellx*24+tmpp,initcelly*24,24,24,0x00AAAA); |
491 | kos_DrawBar(initcellx*24+tmpp,initcelly*24,24,24,0x00AAAA); |
492 | 492 | ||
493 | } |
493 | } |
494 | kos_Pause(1); |
494 | kos_Pause(1); |
495 | } |
495 | } |
496 | break; |
496 | break; |
497 | case 4: |
497 | case 4: |
498 | for (tmpp=0; tmpp<23;tmpp++){ |
498 | for (tmpp=0; tmpp<23;tmpp++){ |
499 | if (drawgraphics==true){ |
499 | if (drawgraphics==true){ |
500 | kos_PutImage((RGB*)skos,24,24,initcellx*24,initcelly*24); |
500 | kos_PutImage((RGB*)skos,24,24,initcellx*24,initcelly*24); |
501 | kos_PutImage((RGB*)kosilka_l,24,24,initcellx*24-tmpp,initcelly*24); |
501 | kos_PutImage((RGB*)kosilka_l,24,24,initcellx*24-tmpp,initcelly*24); |
502 | } else { |
502 | } else { |
503 | kos_DrawBar(initcellx*24,initcelly*24,24,24,0xAAAAAA); |
503 | kos_DrawBar(initcellx*24,initcelly*24,24,24,0xAAAAAA); |
504 | kos_DrawBar(initcellx*24-tmpp,initcelly*24,24,24,0x00AAAA); |
504 | kos_DrawBar(initcellx*24-tmpp,initcelly*24,24,24,0x00AAAA); |
505 | 505 | ||
506 | } |
506 | } |
507 | kos_Pause(1); |
507 | kos_Pause(1); |
508 | } |
508 | } |
509 | break; |
509 | break; |
510 | } |
510 | } |
511 | 511 | ||
512 | 512 | ||
513 | } |
513 | } |
514 | 514 | ||
515 | 515 | ||
516 | void draw_window(void){ //Ïåðåðèñîâêà îêíà |
516 | void draw_window(void){ //Ïåðåðèñîâêà îêíà |
517 | //----Leency |
517 | //----Leency |
518 | sProcessInfo sPI; |
518 | sProcessInfo sPI; |
519 | 519 | ||
520 | if (w_redraw) |
520 | if (w_redraw) |
521 | { |
521 | { |
522 | kos_WindowRedrawStatus(1); //Íà÷àëî ïåðåðèñîâêè |
522 | kos_WindowRedrawStatus(1); //Íà÷àëî ïåðåðèñîâêè |
523 | //kos_DefineAndDrawWindow(50,50,640,506,0x74,0xEEEEEE,0,0,(Dword)windowTitle); |
523 | //kos_DefineAndDrawWindow(50,50,640,506,0x74,0xEEEEEE,0,0,(Dword)windowTitle); |
524 | kos_DefineAndDrawWindow(50,50,640,506-22+kos_GetSkinWidth(),0x74,0xEEEEEE,0,0,(Dword)windowTitle); |
524 | kos_DefineAndDrawWindow(50,50,640,506-22+kos_GetSkinWidth(),0x74,0xEEEEEE,0,0,(Dword)windowTitle); |
525 | kos_WindowRedrawStatus(2); //Êîíåö ïåðåðèñîâêè |
525 | kos_WindowRedrawStatus(2); //Êîíåö ïåðåðèñîâêè |
526 | } |
526 | } |
527 | w_redraw=false; |
527 | w_redraw=false; |
528 | 528 | ||
529 | kos_ProcessInfo( &sPI ); |
529 | kos_ProcessInfo( &sPI ); |
530 | if (sPI.processInfo.y_size==kos_GetSkinWidth()+3) return; //íè÷åãî íå äåëàòü åñëè îêíî ñõëîïíóòî â çàãîëîâîê |
530 | if (sPI.processInfo.y_size==kos_GetSkinWidth()+3) return; //íè÷åãî íå äåëàòü åñëè îêíî ñõëîïíóòî â çàãîëîâîê |
531 | 531 | ||
532 | //Ïåðåðèñîâêà êàðòû |
532 | //Ïåðåðèñîâêà êàðòû |
533 | if ((status!=0)&&(status!=-1)&&(status!=4)) |
533 | if ((status!=0)&&(status!=-1)&&(status!=4)) |
534 | { |
534 | { |
535 | kos_DrawBar(631-151,0,151,480,0xEEEEEE); |
535 | kos_DrawBar(631-151,0,151,480,0xEEEEEE); |
536 | 536 | ||
537 | kos_WriteTextToWindow(505,30,0x80, 0 ," ",19); |
537 | kos_WriteTextToWindow(505,30,0x80, 0 ," ",19); |
538 | kos_WriteTextToWindow(522,40,0x80, 0 ,"¤«ï ®«¨¡à¨ ",14); |
538 | kos_WriteTextToWindow(522,40,0x80, 0 ,"¤«ï ®«¨¡à¨ ",14); |
539 | 539 | ||
540 | kos_WriteTextToWindow(495,80,0x80, 0 ,"஢¥ì:",6); |
540 | kos_WriteTextToWindow(495,80,0x80, 0 ,"஢¥ì:",6); |
541 | kos_DisplayNumberToWindow(level,3,605,80,0x0000FF,nbDecimal,false); |
541 | kos_DisplayNumberToWindow(level,3,605,80,0x0000FF,nbDecimal,false); |
542 | 542 | ||
543 | kos_WriteTextToWindow(495,95,0x80, 0 ,"áâ «®áì ¯®¯ë⮪:",11); |
543 | kos_WriteTextToWindow(495,95,0x80, 0 ,"áâ «®áì ¯®¯ë⮪:",11); |
544 | kos_DisplayNumberToWindow(lives,1,605,95,0x0000FF,nbDecimal,false); |
544 | kos_DisplayNumberToWindow(lives,1,605,95,0x0000FF,nbDecimal,false); |
545 | 545 | ||
546 | kos_WriteTextToWindow(495,120,0x80, 0 ,"áâ «®áì âà ¢ë:",11); |
546 | kos_WriteTextToWindow(495,120,0x80, 0 ,"áâ «®áì âà ¢ë:",11); |
547 | display_grass_left(); |
547 | display_grass_left(); |
548 | 548 | ||
549 | kos_WriteTextToWindow(526,450,0x80, 0 ,(char*)version,12); |
549 | kos_WriteTextToWindow(526,450,0x80, 0 ,(char*)version,12); |
550 | 550 | ||
551 | for (int cy=0;cy<20;cy++) for (int cx=0;cx<20;cx++) draw_element(cx,cy); |
551 | for (int cy=0;cy<20;cy++) for (int cx=0;cx<20;cx++) draw_element(cx,cy); |
552 | } |
552 | } |
553 | 553 | ||
554 | if (status==0){ |
554 | if (status==0){ |
555 | kos_DrawBar(0,0,4,480,0x000000); |
555 | kos_DrawBar(0,0,4,480,0x000000); |
556 | kos_DrawBar(628,0,3,480,0x000000); |
556 | kos_DrawBar(628,0,3,480,0x000000); |
557 | //Leency---- |
557 | //Leency---- |
558 | 558 | ||
559 | 559 | ||
560 | for (int tmpppy=0;tmpppy<20;tmpppy++){ |
560 | for (int tmpppy=0;tmpppy<20;tmpppy++){ |
561 | for (int tmpppx=0;tmpppx<26;tmpppx++){ |
561 | for (int tmpppx=0;tmpppx<26;tmpppx++){ |
562 | if ((tmpppx==0) || (tmpppx==25) || (tmpppy==0) || (tmpppy==19)){ |
562 | if ((tmpppx==0) || (tmpppx==25) || (tmpppy==0) || (tmpppy==19)){ |
563 | kos_PutImage((RGB*)stone,24,24,4+tmpppx*24,tmpppy*24); |
563 | kos_PutImage((RGB*)stone,24,24,4+tmpppx*24,tmpppy*24); |
564 | } |
564 | } |
565 | else |
565 | else |
566 | { |
566 | { |
567 | kos_PutImage((RGB*)skos,24,24,4+tmpppx*24,tmpppy*24); |
567 | kos_PutImage((RGB*)skos,24,24,4+tmpppx*24,tmpppy*24); |
568 | } |
568 | } |
569 | } |
569 | } |
570 | } |
570 | } |
571 | 571 | ||
572 | if (drawgraphics==true){ |
572 | if (drawgraphics==true){ |
573 | kos_PutImage((RGB*)kosilka_d,24,24,305,150); |
573 | kos_PutImage((RGB*)kosilka_d,24,24,305,150); |
574 | } |
574 | } |
575 | else |
575 | else |
576 | { |
576 | { |
577 | kos_DrawBar(305,150,24,24,0x00AAAA); |
577 | kos_DrawBar(305,150,24,24,0x00AAAA); |
578 | } |
578 | } |
579 | 579 | ||
580 | 580 | ||
581 | if (drawanimation==true){ |
581 | if (drawanimation==true){ |
582 | kos_DrawBar(335,150,24,24,0x00AA00); |
582 | kos_DrawBar(335,150,24,24,0x00AA00); |
583 | } |
583 | } |
584 | else |
584 | else |
585 | { |
585 | { |
586 | kos_DrawBar(335,150,24,24,0xAA0000); |
586 | kos_DrawBar(335,150,24,24,0xAA0000); |
587 | } |
587 | } |
588 | 588 | ||
589 | kos_WriteTextToWindow(257,200,0x80, 0xFFFFFF ," ",19); |
589 | kos_WriteTextToWindow(257,200,0x80, 0xFFFFFF ," ",19); |
590 | kos_WriteTextToWindow(290, 220,0x80, 0xFFFFFF ,"¤«ï ®«¨¡à¨ ",14); |
590 | kos_WriteTextToWindow(290, 220,0x80, 0xFFFFFF ,"¤«ï ®«¨¡à¨ ",14); |
591 | kos_WriteTextToWindow(239, 240,0x80, 0xFFFFFF ,"<¤«ï ç « ¨£àë ¦¬¨â¥ ENTER>",30); |
591 | kos_WriteTextToWindow(239, 240,0x80, 0xFFFFFF ,"<¤«ï ç « ¨£àë ¦¬¨â¥ ENTER>",30); |
592 | kos_WriteTextToWindow(30, 380,0x80, 0xFFFFFF ,"< ¦¬¨â¥ |
592 | kos_WriteTextToWindow(30, 380,0x80, 0xFFFFFF ,"< ¦¬¨â¥ |
593 | kos_WriteTextToWindow(30, 400,0x80, 0xFFFFFF ,"< ¦¬¨â¥ ¤«ï ¢ª«î票ï/¢ëª«îç¥¨ï ¨¬ 樨>",41); |
593 | kos_WriteTextToWindow(30, 400,0x80, 0xFFFFFF ,"< ¦¬¨â¥ ¤«ï ¢ª«î票ï/¢ëª«îç¥¨ï ¨¬ 樨>",41); |
594 | kos_WriteTextToWindow(30, 420,0x80, 0xFFFFFF ,"< ¦¬¨â¥ |
594 | kos_WriteTextToWindow(30, 420,0x80, 0xFFFFFF ,"< ¦¬¨â¥ |
595 | if (skin_available==true) {kos_WriteTextToWindow(30, 440,0x80, 0xFFFFFF ,"< ¦¬¨â¥ |
595 | if (skin_available==true) {kos_WriteTextToWindow(30, 440,0x80, 0xFFFFFF ,"< ¦¬¨â¥ |
596 | 596 | ||
597 | 597 | ||
598 | // kos_WriteTextToWindow(470, 440,0x80, 0xFFFFFF ," ¦¬¨â¥ |
598 | // kos_WriteTextToWindow(470, 440,0x80, 0xFFFFFF ," ¦¬¨â¥ |
599 | // kos_DisplayNumberToWindow(external_levels_count[0],3,200,340,0x0000FF,nbDecimal,false); |
599 | // kos_DisplayNumberToWindow(external_levels_count[0],3,200,340,0x0000FF,nbDecimal,false); |
600 | 600 | ||
601 | 601 | ||
602 | 602 | ||
603 | kos_WriteTextToWindow(533, 440,0x80, 0xFFFFFF ,(char*)version,0); |
603 | kos_WriteTextToWindow(533, 440,0x80, 0xFFFFFF ,(char*)version,0); |
604 | } |
604 | } |
605 | if (status==2){ |
605 | if (status==2){ |
606 | kos_DrawBar(10,150,610,200,0x528B4C); |
606 | kos_DrawBar(10,150,610,200,0x528B4C); |
607 | kos_DrawBar(15,155,601,190,0x3BCF46); |
607 | kos_DrawBar(15,155,601,190,0x3BCF46); |
608 | kos_WriteTextToWindow(240,230,0x80, 0xFFFFFF ,"ë ¢ë¨£à «¨!",13); |
608 | kos_WriteTextToWindow(240,230,0x80, 0xFFFFFF ,"ë ¢ë¨£à «¨!",13); |
609 | kos_WriteTextToWindow(240,250,0x80, 0xFFFFFF ,"< ¦¬¨â¥ q ¤«ï ¢®§¢à â ¢ ¬¥î>",17); |
609 | kos_WriteTextToWindow(240,250,0x80, 0xFFFFFF ,"< ¦¬¨â¥ q ¤«ï ¢®§¢à â ¢ ¬¥î>",17); |
610 | } |
610 | } |
611 | if (status==3){ |
611 | if (status==3){ |
612 | kos_DrawBar(10,150,610,200,0x8B4C4C); |
612 | kos_DrawBar(10,150,610,200,0x8B4C4C); |
613 | kos_DrawBar(15,155,601,190,0xCF3B3B); |
613 | kos_DrawBar(15,155,601,190,0xCF3B3B); |
614 | kos_WriteTextToWindow(220,220,0x80, 0xFFFFFF ,"£à ®ª®ç¥ ...",13); |
614 | kos_WriteTextToWindow(220,220,0x80, 0xFFFFFF ,"£à ®ª®ç¥ ...",13); |
615 | kos_WriteTextToWindow(220,240,0x80, 0xFFFFFF ,"< ¦¬¨â¥ r ¤«ï ⮣®, ç⮡ë áë£à âì ¥éñ à §>",23); |
615 | kos_WriteTextToWindow(220,240,0x80, 0xFFFFFF ,"< ¦¬¨â¥ r ¤«ï ⮣®, ç⮡ë áë£à âì ¥éñ à §>",23); |
616 | kos_WriteTextToWindow(220,260,0x80, 0xFFFFFF ,"< ¦¬¨â¥ q ¤«ï ¢®§¢à â ¢ ¬¥î>",17); |
616 | kos_WriteTextToWindow(220,260,0x80, 0xFFFFFF ,"< ¦¬¨â¥ q ¤«ï ¢®§¢à â ¢ ¬¥î>",17); |
617 | } |
617 | } |
618 | if (status==-1){ |
618 | if (status==-1){ |
619 | 619 | ||
620 | kos_DrawBar(0,0,4,480,0x000000); |
620 | kos_DrawBar(0,0,4,480,0x000000); |
621 | kos_DrawBar(631-3,0,3,480,0x000000); |
621 | kos_DrawBar(631-3,0,3,480,0x000000); |
622 | 622 | ||
623 | for (int tmpppy=0;tmpppy<20;tmpppy++){ |
623 | for (int tmpppy=0;tmpppy<20;tmpppy++){ |
624 | for (int tmpppx=0;tmpppx<26;tmpppx++){ |
624 | for (int tmpppx=0;tmpppx<26;tmpppx++){ |
625 | if ((tmpppx==0) || (tmpppx==25) || (tmpppy==0) || (tmpppy==19)){ |
625 | if ((tmpppx==0) || (tmpppx==25) || (tmpppy==0) || (tmpppy==19)){ |
626 | kos_PutImage((RGB*)stone,24,24,4+tmpppx*24,tmpppy*24); |
626 | kos_PutImage((RGB*)stone,24,24,4+tmpppx*24,tmpppy*24); |
627 | } |
627 | } |
628 | else |
628 | else |
629 | { |
629 | { |
630 | kos_PutImage((RGB*)skos,24,24,4+tmpppx*24,tmpppy*24); |
630 | kos_PutImage((RGB*)skos,24,24,4+tmpppx*24,tmpppy*24); |
631 | } |
631 | } |
632 | } |
632 | } |
633 | } |
633 | } |
634 | 634 | ||
635 | kos_WriteTextToWindow(40,40,0x80, 0xFFFFFF ,"®á¨«ª ¤«ï ®«¨¡à¨",22); |
635 | kos_WriteTextToWindow(40,40,0x80, 0xFFFFFF ,"®á¨«ª ¤«ï ®«¨¡à¨",22); |
636 | kos_WriteTextToWindow(40,60,0x80, 0xFFFFFF ,(char*)version,12); |
636 | kos_WriteTextToWindow(40,60,0x80, 0xFFFFFF ,(char*)version,12); |
637 | kos_WriteTextToWindow(40,75,0x80, 0xFFFFFF ,"________________________________________",40); |
637 | kos_WriteTextToWindow(40,75,0x80, 0xFFFFFF ,"________________________________________",40); |
638 | 638 | ||
639 | kos_WriteTextToWindow(40,120,0x80, 0xFFFFFF ,"®««¥ªâ¨¢ à §à ¡®â稪®¢:",18); |
639 | kos_WriteTextToWindow(40,120,0x80, 0xFFFFFF ,"®««¥ªâ¨¢ à §à ¡®â稪®¢:",18); |
640 | kos_WriteTextToWindow(40,150,0x80, 0xEEFFEE ,"¤à¥© ¨å ©«®¢¨ç aka Dron2004 - ¯à®£à ¬¬¨à®¢ ¨¥, ¢áâ஥ ï £à 䨪 (¡¥§ ᪨ )",32); |
640 | kos_WriteTextToWindow(40,150,0x80, 0xEEFFEE ,"¤à¥© ¨å ©«®¢¨ç aka Dron2004 - ¯à®£à ¬¬¨à®¢ ¨¥, ¢áâ஥ ï £à 䨪 (¡¥§ ᪨ )",32); |
641 | kos_WriteTextToWindow(40,170,0x80, 0xDDFFDD ,"Mario79 - â¥áâ¨à®¢ ¨¥, ¯®¬®éì ¢ à §à ¡®âª¥, ¢ ¦ë¥ ¨¤¥¨",35); |
641 | kos_WriteTextToWindow(40,170,0x80, 0xDDFFDD ,"Mario79 - â¥áâ¨à®¢ ¨¥, ¯®¬®éì ¢ à §à ¡®âª¥, ¢ ¦ë¥ ¨¤¥¨",35); |
642 | kos_WriteTextToWindow(40,190,0x80, 0xCCFFCC ,"Ataualpa - â¥áâ¨à®¢ ¨¥, ¯®¬®éì ¢ à §à ¡®âª¥",36); |
642 | kos_WriteTextToWindow(40,190,0x80, 0xCCFFCC ,"Ataualpa - â¥áâ¨à®¢ ¨¥, ¯®¬®éì ¢ à §à ¡®âª¥",36); |
643 | kos_WriteTextToWindow(40,210,0x80, 0xBBFFBB ,"Leency - â¥áâ¨à®¢ ¨¥, ¯®¬®éì ¢ à §à ¡®âª¥, § ¬¥ç ⥫ìë¥ áª¨ë, ¢ ¦ë¥ ¨¤¥¨",62); |
643 | kos_WriteTextToWindow(40,210,0x80, 0xBBFFBB ,"Leency - â¥áâ¨à®¢ ¨¥, ¯®¬®éì ¢ à §à ¡®âª¥, § ¬¥ç ⥫ìë¥ áª¨ë, ¢ ¦ë¥ ¨¤¥¨",62); |
644 | kos_WriteTextToWindow(40,230,0x80, 0xAAFFAA ,"Mike - â¥áâ¨à®¢ ¨¥, ¯®¬®éì ¢ à §à ¡®âª¥",34); |
644 | kos_WriteTextToWindow(40,230,0x80, 0xAAFFAA ,"Mike - â¥áâ¨à®¢ ¨¥, ¯®¬®éì ¢ à §à ¡®âª¥",34); |
645 | kos_WriteTextToWindow(40,250,0x80, 0x99FF99 ,"bw - â¥áâ¨à®¢ ¨¥, ¯®¬®éì ¢ à §à ¡®âª¥, ¢ ¦ë¥ ¨¤¥¨",49); |
645 | kos_WriteTextToWindow(40,250,0x80, 0x99FF99 ,"bw - â¥áâ¨à®¢ ¨¥, ¯®¬®éì ¢ à §à ¡®âª¥, ¢ ¦ë¥ ¨¤¥¨",49); |
646 | kos_WriteTextToWindow(40,270,0x80, 0x99FF99 ,"diamond - ¨¤¥ï ®â¬¥ë 室 , â¥áâ¨à®¢ ¨¥",49); |
646 | kos_WriteTextToWindow(40,270,0x80, 0x99FF99 ,"diamond - ¨¤¥ï ®â¬¥ë 室 , â¥áâ¨à®¢ ¨¥",49); |
647 | 647 | ||
648 | kos_WriteTextToWindow(40,300,0x80, 0x88FF88 ,"⤥«ì®¥ ᯠᨡ®:",16); |
648 | kos_WriteTextToWindow(40,300,0x80, 0x88FF88 ,"⤥«ì®¥ ᯠᨡ®:",16); |
649 | kos_WriteTextToWindow(40,330,0x80, 0x77FF77 ,"ᥬ, ªâ® ¨£à ¥â ¢ íâã ¨£àã :-) !",50); |
649 | kos_WriteTextToWindow(40,330,0x80, 0x77FF77 ,"ᥬ, ªâ® ¨£à ¥â ¢ íâã ¨£àã :-) !",50); |
650 | 650 | ||
651 | 651 | ||
652 | kos_WriteTextToWindow(40,430,0x80, 0x66FF66 ," ¦¬¨â¥ |
652 | kos_WriteTextToWindow(40,430,0x80, 0x66FF66 ," ¦¬¨â¥ |
653 | } |
653 | } |
654 | 654 | ||
655 | 655 | ||
656 | if (status==4){ |
656 | if (status==4){ |
657 | kos_DrawBar(0,0,631,480,0x000000); |
657 | kos_DrawBar(0,0,631,480,0x000000); |
658 | 658 | ||
659 | 659 | ||
660 | for (int tmpppy=0;tmpppy<20;tmpppy++){ |
660 | for (int tmpppy=0;tmpppy<20;tmpppy++){ |
661 | for (int tmpppx=0;tmpppx<26;tmpppx++){ |
661 | for (int tmpppx=0;tmpppx<26;tmpppx++){ |
662 | if ((tmpppx==0) || (tmpppx==25) || (tmpppy==0) || (tmpppy==19)){ |
662 | if ((tmpppx==0) || (tmpppx==25) || (tmpppy==0) || (tmpppy==19)){ |
663 | kos_PutImage((RGB*)stone,24,24,4+tmpppx*24,tmpppy*24); |
663 | kos_PutImage((RGB*)stone,24,24,4+tmpppx*24,tmpppy*24); |
664 | } |
664 | } |
665 | else |
665 | else |
666 | { |
666 | { |
667 | kos_PutImage((RGB*)skos,24,24,4+tmpppx*24,tmpppy*24); |
667 | kos_PutImage((RGB*)skos,24,24,4+tmpppx*24,tmpppy*24); |
668 | } |
668 | } |
669 | } |
669 | } |
670 | } |
670 | } |
671 | 671 | ||
672 | kos_WriteTextToWindow(215, 200,0x80, 0xFFFFFF ,"ë¡¥à¨â¥ ¡®à ã஢¥© ( ¦¬¨â¥ <1> ¨«¨ <2>):",0); |
672 | kos_WriteTextToWindow(215, 200,0x80, 0xFFFFFF ,"ë¡¥à¨â¥ ¡®à ã஢¥© ( ¦¬¨â¥ <1> ¨«¨ <2>):",0); |
673 | kos_WriteTextToWindow(215, 220,0x80, 0xFFFFFF ,"1. áâà®¥ë¥ ã஢¨",0); |
673 | kos_WriteTextToWindow(215, 220,0x80, 0xFFFFFF ,"1. áâà®¥ë¥ ã஢¨",0); |
674 | kos_WriteTextToWindow(215, 240,0x80, 0xFFFFFF ,"2. ¥è¨© ¡®à ã஢¥©",0); |
674 | kos_WriteTextToWindow(215, 240,0x80, 0xFFFFFF ,"2. ¥è¨© ¡®à ã஢¥©",0); |
675 | 675 | ||
676 | } |
676 | } |
677 | 677 | ||
678 | } |
678 | } |
679 | 679 | ||
680 | 680 | ||
681 | 681 | ||
682 | //Îïèñàíèå óðîâíåé èãðû |
682 | //Îïèñàíèå óðîâíåé èãðû |
683 | //, ãäå k - êîñèëêà |
683 | //, ãäå k - êîñèëêà |
684 | // g - òðàâà |
684 | // g - òðàâà |
685 | // n - ñêîøåííàÿ òðàâà |
685 | // n - ñêîøåííàÿ òðàâà |
686 | // s - êàìåíü |
686 | // s - êàìåíü |
687 | // t - äåðåâî |
687 | // t - äåðåâî |
688 | void initializeLevel(int levnum){ |
688 | void initializeLevel(int levnum){ |
689 | laststep=0; |
689 | laststep=0; |
690 | if (external_levels==false){ |
690 | if (external_levels==false){ |
691 | 691 | ||
692 | kosilkadirection=1; |
692 | kosilkadirection=1; |
693 | if (levnum==1){ |
693 | if (levnum==1){ |
694 | static char tmparea[20][20]={{'k','t','g','g','g','g','g','s','g','g','g','g','g','g','g','g','g','g','g','g'}, |
694 | static char tmparea[20][20]={{'k','t','g','g','g','g','g','s','g','g','g','g','g','g','g','g','g','g','g','g'}, |
695 | {'g','s','g','s','g','g','g','s','g','s','g','g','s','g','g','g','g','g','g','g'}, |
695 | {'g','s','g','s','g','g','g','s','g','s','g','g','s','g','g','g','g','g','g','g'}, |
696 | {'g','t','g','s','g','g','g','s','g','s','g','g','s','g','g','g','g','g','g','g'}, |
696 | {'g','t','g','s','g','g','g','s','g','s','g','g','s','g','g','g','g','g','g','g'}, |
697 | {'g','s','g','s','g','g','g','s','g','s','g','g','s','g','g','g','g','g','g','g'}, |
697 | {'g','s','g','s','g','g','g','s','g','s','g','g','s','g','g','g','g','g','g','g'}, |
698 | {'g','t','g','s','g','g','g','s','g','s','g','g','s','g','g','g','g','g','g','g'}, |
698 | {'g','t','g','s','g','g','g','s','g','s','g','g','s','g','g','g','g','g','g','g'}, |
699 | {'g','s','g','s','g','g','g','s','g','g','g','g','s','g','g','g','g','g','g','g'}, |
699 | {'g','s','g','s','g','g','g','s','g','g','g','g','s','g','g','g','g','g','g','g'}, |
700 | {'g','t','g','s','g','g','g','s','g','g','g','g','s','g','g','s','s','s','g','g'}, |
700 | {'g','t','g','s','g','g','g','s','g','g','g','g','s','g','g','s','s','s','g','g'}, |
701 | {'g','s','g','s','g','g','g','s','g','g','g','g','s','g','g','s','s','s','g','g'}, |
701 | {'g','s','g','s','g','g','g','s','g','g','g','g','s','g','g','s','s','s','g','g'}, |
702 | {'g','t','g','s','g','g','g','s','g','g','g','g','s','g','g','s','s','s','g','g'}, |
702 | {'g','t','g','s','g','g','g','s','g','g','g','g','s','g','g','s','s','s','g','g'}, |
703 | {'g','s','g','s','g','g','g','s','g','g','g','g','s','g','g','s','g','g','g','g'}, |
703 | {'g','s','g','s','g','g','g','s','g','g','g','g','s','g','g','s','g','g','g','g'}, |
704 | {'g','t','g','s','g','g','g','s','g','g','g','g','s','g','g','g','g','g','g','g'}, |
704 | {'g','t','g','s','g','g','g','s','g','g','g','g','s','g','g','g','g','g','g','g'}, |
705 | {'g','s','g','s','g','g','g','s','g','g','g','g','s','g','g','g','g','g','g','g'}, |
705 | {'g','s','g','s','g','g','g','s','g','g','g','g','s','g','g','g','g','g','g','g'}, |
706 | {'g','t','g','s','g','g','g','s','g','g','g','g','s','g','g','g','g','g','g','g'}, |
706 | {'g','t','g','s','g','g','g','s','g','g','g','g','s','g','g','g','g','g','g','g'}, |
707 | {'g','s','g','s','g','g','g','s','g','g','g','g','s','g','g','g','g','g','g','g'}, |
707 | {'g','s','g','s','g','g','g','s','g','g','g','g','s','g','g','g','g','g','g','g'}, |
708 | {'g','t','g','s','g','g','g','s','g','g','g','g','s','g','g','g','g','g','g','g'}, |
708 | {'g','t','g','s','g','g','g','s','g','g','g','g','s','g','g','g','g','g','g','g'}, |
709 | {'g','s','g','s','g','g','g','s','g','g','g','g','s','g','g','g','g','g','g','g'}, |
709 | {'g','s','g','s','g','g','g','s','g','g','g','g','s','g','g','g','g','g','g','g'}, |
710 | {'g','t','g','s','g','g','g','s','g','g','g','g','s','g','g','g','g','g','g','g'}, |
710 | {'g','t','g','s','g','g','g','s','g','g','g','g','s','g','g','g','g','g','g','g'}, |
711 | {'g','s','g','s','g','g','g','s','g','g','g','g','s','g','g','g','g','g','g','g'}, |
711 | {'g','s','g','s','g','g','g','s','g','g','g','g','s','g','g','g','g','g','g','g'}, |
712 | {'g','t','g','s','g','g','g','s','g','g','g','g','s','g','g','g','g','g','g','g'}, |
712 | {'g','t','g','s','g','g','g','s','g','g','g','g','s','g','g','g','g','g','g','g'}, |
713 | {'g','g','g','s','g','g','g','g','g','s','g','g','s','g','g','g','g','g','g','g'}}; |
713 | {'g','g','g','s','g','g','g','g','g','s','g','g','s','g','g','g','g','g','g','g'}}; |
714 | for (int tyy=0;tyy<20;tyy++){ |
714 | for (int tyy=0;tyy<20;tyy++){ |
715 | for (int txx=0;txx<20;txx++){ |
715 | for (int txx=0;txx<20;txx++){ |
716 | 716 | ||
717 | if (tmparea[txx][tyy]=='k'){ |
717 | if (tmparea[txx][tyy]=='k'){ |
718 | kosilkax=tyy; |
718 | kosilkax=tyy; |
719 | kosilkay=txx; |
719 | kosilkay=txx; |
720 | } |
720 | } |
721 | 721 | ||
722 | gamearea[txx][tyy]=tmparea[tyy][txx]; |
722 | gamearea[txx][tyy]=tmparea[tyy][txx]; |
723 | } |
723 | } |
724 | } |
724 | } |
725 | } |
725 | } |
726 | if (levnum==2){ |
726 | if (levnum==2){ |
727 | static char tmparea[20][20]={{'s','s','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g'}, |
727 | static char tmparea[20][20]={{'s','s','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g'}, |
728 | {'s','s','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','s','s','g'}, |
728 | {'s','s','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','s','s','g'}, |
729 | {'g','k','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','s','s','g'}, |
729 | {'g','k','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','s','s','g'}, |
730 | {'g','g','g','g','g','g','g','g','g','g','g','g','s','s','g','g','g','g','g','g'}, |
730 | {'g','g','g','g','g','g','g','g','g','g','g','g','s','s','g','g','g','g','g','g'}, |
731 | {'g','g','g','g','g','g','g','g','g','g','g','g','s','s','g','g','g','g','g','g'}, |
731 | {'g','g','g','g','g','g','g','g','g','g','g','g','s','s','g','g','g','g','g','g'}, |
732 | {'g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g'}, |
732 | {'g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g'}, |
733 | {'g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g'}, |
733 | {'g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g'}, |
734 | {'g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g'}, |
734 | {'g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g'}, |
735 | {'s','s','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g'}, |
735 | {'s','s','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g'}, |
736 | {'s','s','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g'}, |
736 | {'s','s','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g'}, |
737 | {'g','g','g','g','g','g','g','g','s','s','g','g','g','g','g','g','g','s','s','g'}, |
737 | {'g','g','g','g','g','g','g','g','s','s','g','g','g','g','g','g','g','s','s','g'}, |
738 | {'g','g','g','g','g','g','g','g','s','s','g','g','g','g','g','g','g','s','s','g'}, |
738 | {'g','g','g','g','g','g','g','g','s','s','g','g','g','g','g','g','g','s','s','g'}, |
739 | {'g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g'}, |
739 | {'g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g'}, |
740 | {'g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g'}, |
740 | {'g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g'}, |
741 | {'g','g','g','g','g','g','g','g','g','g','g','g','g','s','s','g','g','g','g','g'}, |
741 | {'g','g','g','g','g','g','g','g','g','g','g','g','g','s','s','g','g','g','g','g'}, |
742 | {'g','g','g','g','g','g','g','g','g','g','g','g','g','s','s','g','g','g','g','g'}, |
742 | {'g','g','g','g','g','g','g','g','g','g','g','g','g','s','s','g','g','g','g','g'}, |
743 | {'g','g','g','s','s','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g'}, |
743 | {'g','g','g','s','s','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g'}, |
744 | {'g','g','g','s','s','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g'}, |
744 | {'g','g','g','s','s','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g'}, |
745 | {'g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g'}, |
745 | {'g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g'}, |
746 | {'g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g'}}; |
746 | {'g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g'}}; |
747 | for (int tyy=0;tyy<20;tyy++){ |
747 | for (int tyy=0;tyy<20;tyy++){ |
748 | for (int txx=0;txx<20;txx++){ |
748 | for (int txx=0;txx<20;txx++){ |
749 | 749 | ||
750 | if (tmparea[txx][tyy]=='k'){ |
750 | if (tmparea[txx][tyy]=='k'){ |
751 | kosilkax=tyy; |
751 | kosilkax=tyy; |
752 | kosilkay=txx; |
752 | kosilkay=txx; |
753 | } |
753 | } |
754 | 754 | ||
755 | gamearea[txx][tyy]=tmparea[tyy][txx]; |
755 | gamearea[txx][tyy]=tmparea[tyy][txx]; |
756 | } |
756 | } |
757 | } |
757 | } |
758 | } |
758 | } |
759 | 759 | ||
760 | if (levnum==3){ |
760 | if (levnum==3){ |
761 | static char tmparea[20][20]={{'t','n','t','n','t','n','t','n','t','n','t','n','t','n','t','n','t','n','t','k'}, |
761 | static char tmparea[20][20]={{'t','n','t','n','t','n','t','n','t','n','t','n','t','n','t','n','t','n','t','k'}, |
762 | {'n','t','g','g','g','g','g','g','g','g','g','g','s','n','n','s','n','s','t','g'}, |
762 | {'n','t','g','g','g','g','g','g','g','g','g','g','s','n','n','s','n','s','t','g'}, |
763 | {'t','n','g','g','g','g','g','g','g','g','g','g','n','t','n','n','n','t','t','g'}, |
763 | {'t','n','g','g','g','g','g','g','g','g','g','g','n','t','n','n','n','t','t','g'}, |
764 | {'n','t','g','g','g','g','g','g','g','g','g','g','n','s','n','s','n','s','t','g'}, |
764 | {'n','t','g','g','g','g','g','g','g','g','g','g','n','s','n','s','n','s','t','g'}, |
765 | {'t','n','g','g','g','g','g','s','s','g','g','g','n','n','n','n','n','t','t','g'}, |
765 | {'t','n','g','g','g','g','g','s','s','g','g','g','n','n','n','n','n','t','t','g'}, |
766 | {'n','t','g','g','g','g','g','g','g','g','g','g','t','n','s','n','n','s','t','g'}, |
766 | {'n','t','g','g','g','g','g','g','g','g','g','g','t','n','s','n','n','s','t','g'}, |
767 | {'t','n','g','g','g','g','g','g','g','g','g','g','n','n','n','n','n','t','t','g'}, |
767 | {'t','n','g','g','g','g','g','g','g','g','g','g','n','n','n','n','n','t','t','g'}, |
768 | {'n','t','g','g','g','g','g','g','g','g','g','g','n','n','s','n','n','s','t','g'}, |
768 | {'n','t','g','g','g','g','g','g','g','g','g','g','n','n','s','n','n','s','t','g'}, |
769 | {'t','n','g','g','g','g','g','g','g','g','g','g','n','s','n','n','n','t','t','g'}, |
769 | {'t','n','g','g','g','g','g','g','g','g','g','g','n','s','n','n','n','t','t','g'}, |
770 | {'n','t','g','g','g','g','g','g','g','g','g','g','s','n','n','n','n','t','g','g'}, |
770 | {'n','t','g','g','g','g','g','g','g','g','g','g','s','n','n','n','n','t','g','g'}, |
771 | {'t','n','g','g','g','s','g','g','g','g','g','g','t','t','t','t','t','t','g','g'}, |
771 | {'t','n','g','g','g','s','g','g','g','g','g','g','t','t','t','t','t','t','g','g'}, |
772 | {'n','t','g','g','g','s','g','g','g','g','g','g','g','g','g','g','g','t','g','g'}, |
772 | {'n','t','g','g','g','s','g','g','g','g','g','g','g','g','g','g','g','t','g','g'}, |
773 | {'t','n','g','g','g','g','g','g','g','g','g','g','t','t','g','g','g','t','g','g'}, |
773 | {'t','n','g','g','g','g','g','g','g','g','g','g','t','t','g','g','g','t','g','g'}, |
774 | {'n','t','g','g','g','g','g','g','t','t','g','g','g','t','g','g','g','t','g','g'}, |
774 | {'n','t','g','g','g','g','g','g','t','t','g','g','g','t','g','g','g','t','g','g'}, |
775 | {'t','n','g','g','g','g','g','g','t','t','g','g','g','t','g','g','g','t','g','g'}, |
775 | {'t','n','g','g','g','g','g','g','t','t','g','g','g','t','g','g','g','t','g','g'}, |
776 | {'n','t','g','g','g','g','g','g','g','g','g','g','g','t','g','g','g','t','g','g'}, |
776 | {'n','t','g','g','g','g','g','g','g','g','g','g','g','t','g','g','g','t','g','g'}, |
777 | {'t','n','g','g','g','g','g','g','g','g','g','g','g','t','t','g','g','t','g','g'}, |
777 | {'t','n','g','g','g','g','g','g','g','g','g','g','g','t','t','g','g','t','g','g'}, |
778 | {'n','t','g','g','g','g','g','g','g','g','g','g','g','g','t','g','g','t','g','g'}, |
778 | {'n','t','g','g','g','g','g','g','g','g','g','g','g','g','t','g','g','t','g','g'}, |
779 | {'t','n','g','g','g','g','g','g','g','g','g','g','g','g','t','g','g','t','g','g'}, |
779 | {'t','n','g','g','g','g','g','g','g','g','g','g','g','g','t','g','g','t','g','g'}, |
780 | {'n','t','s','s','s','s','s','s','s','s','s','s','s','s','t','g','g','g','g','g'}}; |
780 | {'n','t','s','s','s','s','s','s','s','s','s','s','s','s','t','g','g','g','g','g'}}; |
781 | for (int tyy=0;tyy<20;tyy++){ |
781 | for (int tyy=0;tyy<20;tyy++){ |
782 | for (int txx=0;txx<20;txx++){ |
782 | for (int txx=0;txx<20;txx++){ |
783 | 783 | ||
784 | if (tmparea[txx][tyy]=='k'){ |
784 | if (tmparea[txx][tyy]=='k'){ |
785 | kosilkax=tyy; |
785 | kosilkax=tyy; |
786 | kosilkay=txx; |
786 | kosilkay=txx; |
787 | } |
787 | } |
788 | 788 | ||
789 | gamearea[txx][tyy]=tmparea[tyy][txx]; |
789 | gamearea[txx][tyy]=tmparea[tyy][txx]; |
790 | } |
790 | } |
791 | } |
791 | } |
792 | } |
792 | } |
793 | 793 | ||
794 | if (levnum==4){ |
794 | if (levnum==4){ |
795 | static char tmparea[20][20]={{'t','t','t','t','t','t','t','t','t','t','t','t','t','t','t','t','t','t','t','t'}, |
795 | static char tmparea[20][20]={{'t','t','t','t','t','t','t','t','t','t','t','t','t','t','t','t','t','t','t','t'}, |
796 | {'t','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','s','n','t'}, |
796 | {'t','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','s','n','t'}, |
797 | {'t','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','s','n','t'}, |
797 | {'t','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','s','n','t'}, |
798 | {'t','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','s','n','t'}, |
798 | {'t','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','s','n','t'}, |
799 | {'t','g','g','g','g','g','g','g','t','t','g','g','g','g','g','g','g','s','n','t'}, |
799 | {'t','g','g','g','g','g','g','g','t','t','g','g','g','g','g','g','g','s','n','t'}, |
800 | {'t','g','g','g','g','g','g','g','t','t','g','g','g','g','g','g','g','s','n','t'}, |
800 | {'t','g','g','g','g','g','g','g','t','t','g','g','g','g','g','g','g','s','n','t'}, |
801 | {'t','g','g','g','g','g','g','g','t','t','g','g','g','g','g','g','g','s','n','t'}, |
801 | {'t','g','g','g','g','g','g','g','t','t','g','g','g','g','g','g','g','s','n','t'}, |
802 | {'t','g','g','g','g','g','g','g','t','t','g','g','g','g','g','g','g','s','n','t'}, |
802 | {'t','g','g','g','g','g','g','g','t','t','g','g','g','g','g','g','g','s','n','t'}, |
803 | {'t','g','g','g','g','g','g','g','t','t','g','g','g','g','g','g','g','s','s','t'}, |
803 | {'t','g','g','g','g','g','g','g','t','t','g','g','g','g','g','g','g','s','s','t'}, |
804 | {'t','g','g','g','g','t','t','t','t','t','t','t','t','g','g','g','g','g','g','t'}, |
804 | {'t','g','g','g','g','t','t','t','t','t','t','t','t','g','g','g','g','g','g','t'}, |
805 | {'t','g','g','g','g','t','t','t','t','t','t','t','t','g','g','g','g','g','g','t'}, |
805 | {'t','g','g','g','g','t','t','t','t','t','t','t','t','g','g','g','g','g','g','t'}, |
806 | {'t','g','g','g','g','g','g','g','t','t','g','g','g','g','g','g','g','g','g','t'}, |
806 | {'t','g','g','g','g','g','g','g','t','t','g','g','g','g','g','g','g','g','g','t'}, |
807 | {'t','g','g','g','g','g','g','g','t','t','g','g','g','g','g','g','g','g','g','t'}, |
807 | {'t','g','g','g','g','g','g','g','t','t','g','g','g','g','g','g','g','g','g','t'}, |
808 | {'t','g','g','g','g','g','g','g','t','t','g','g','g','g','g','g','g','g','g','t'}, |
808 | {'t','g','g','g','g','g','g','g','t','t','g','g','g','g','g','g','g','g','g','t'}, |
809 | {'t','g','g','g','g','g','g','g','t','t','g','g','g','g','g','g','g','g','g','t'}, |
809 | {'t','g','g','g','g','g','g','g','t','t','g','g','g','g','g','g','g','g','g','t'}, |
810 | {'t','g','g','g','g','g','g','g','t','t','g','g','g','g','g','g','g','g','g','t'}, |
810 | {'t','g','g','g','g','g','g','g','t','t','g','g','g','g','g','g','g','g','g','t'}, |
811 | {'t','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','t'}, |
811 | {'t','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','t'}, |
812 | {'t','k','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','t'}, |
812 | {'t','k','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','t'}, |
813 | {'t','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','t'}, |
813 | {'t','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','t'}, |
814 | {'t','t','t','t','t','t','t','t','t','t','t','t','t','t','t','t','t','t','t','t'}}; |
814 | {'t','t','t','t','t','t','t','t','t','t','t','t','t','t','t','t','t','t','t','t'}}; |
815 | for (int tyy=0;tyy<20;tyy++){ |
815 | for (int tyy=0;tyy<20;tyy++){ |
816 | for (int txx=0;txx<20;txx++){ |
816 | for (int txx=0;txx<20;txx++){ |
817 | 817 | ||
818 | if (tmparea[txx][tyy]=='k'){ |
818 | if (tmparea[txx][tyy]=='k'){ |
819 | kosilkax=tyy; |
819 | kosilkax=tyy; |
820 | kosilkay=txx; |
820 | kosilkay=txx; |
821 | } |
821 | } |
822 | 822 | ||
823 | gamearea[txx][tyy]=tmparea[tyy][txx]; |
823 | gamearea[txx][tyy]=tmparea[tyy][txx]; |
824 | } |
824 | } |
825 | } |
825 | } |
826 | } |
826 | } |
827 | 827 | ||
828 | if (levnum==5){ |
828 | if (levnum==5){ |
829 | static char tmparea[20][20]={{'t','t','t','t','t','t','t','t','t','t','t','t','t','t','t','t','t','t','t','t'}, |
829 | static char tmparea[20][20]={{'t','t','t','t','t','t','t','t','t','t','t','t','t','t','t','t','t','t','t','t'}, |
830 | {'t','s','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','t'}, |
830 | {'t','s','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','t'}, |
831 | {'t','t','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','t'}, |
831 | {'t','t','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','t'}, |
832 | {'t','s','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','t'}, |
832 | {'t','s','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','t'}, |
833 | {'t','s','g','g','g','g','g','t','g','g','t','g','g','g','g','g','g','g','g','t'}, |
833 | {'t','s','g','g','g','g','g','t','g','g','t','g','g','g','g','g','g','g','g','t'}, |
834 | {'t','t','g','g','g','g','t','n','t','t','t','g','g','g','g','g','g','g','g','t'}, |
834 | {'t','t','g','g','g','g','t','n','t','t','t','g','g','g','g','g','g','g','g','t'}, |
835 | {'t','s','g','g','g','g','t','n','n','n','t','g','g','g','g','g','g','g','g','t'}, |
835 | {'t','s','g','g','g','g','t','n','n','n','t','g','g','g','g','g','g','g','g','t'}, |
836 | {'t','k','g','g','g','g','t','n','n','n','t','g','g','g','g','g','g','g','g','t'}, |
836 | {'t','k','g','g','g','g','t','n','n','n','t','g','g','g','g','g','g','g','g','t'}, |
837 | {'t','g','g','g','g','g','t','n','n','n','t','g','g','g','g','g','g','g','g','t'}, |
837 | {'t','g','g','g','g','g','t','n','n','n','t','g','g','g','g','g','g','g','g','t'}, |
838 | {'t','g','g','g','g','g','t','n','n','t','g','g','g','g','g','g','g','g','g','t'}, |
838 | {'t','g','g','g','g','g','t','n','n','t','g','g','g','g','g','g','g','g','g','t'}, |
839 | {'t','g','g','g','g','g','t','n','n','t','g','g','g','g','g','g','g','g','g','t'}, |
839 | {'t','g','g','g','g','g','t','n','n','t','g','g','g','g','g','g','g','g','g','t'}, |
840 | {'t','g','g','g','g','g','t','n','n','n','t','g','g','g','g','g','g','g','g','t'}, |
840 | {'t','g','g','g','g','g','t','n','n','n','t','g','g','g','g','g','g','g','g','t'}, |
841 | {'t','g','g','g','g','g','t','n','n','n','t','g','g','g','g','g','g','g','g','t'}, |
841 | {'t','g','g','g','g','g','t','n','n','n','t','g','g','g','g','g','g','g','g','t'}, |
842 | {'t','g','g','g','g','g','g','t','n','t','t','g','g','g','g','g','g','g','g','t'}, |
842 | {'t','g','g','g','g','g','g','t','n','t','t','g','g','g','g','g','g','g','g','t'}, |
843 | {'t','g','g','g','g','g','g','t','t','g','g','g','g','g','g','g','g','g','g','t'}, |
843 | {'t','g','g','g','g','g','g','t','t','g','g','g','g','g','g','g','g','g','g','t'}, |
844 | {'t','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','t'}, |
844 | {'t','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','t'}, |
845 | {'t','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','t'}, |
845 | {'t','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','t'}, |
846 | {'t','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','t'}, |
846 | {'t','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','t'}, |
847 | {'t','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','t'}, |
847 | {'t','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','t'}, |
848 | {'t','t','t','t','t','t','t','t','t','t','t','t','t','t','t','t','t','t','t','t'}}; |
848 | {'t','t','t','t','t','t','t','t','t','t','t','t','t','t','t','t','t','t','t','t'}}; |
849 | for (int tyy=0;tyy<20;tyy++){ |
849 | for (int tyy=0;tyy<20;tyy++){ |
850 | for (int txx=0;txx<20;txx++){ |
850 | for (int txx=0;txx<20;txx++){ |
851 | 851 | ||
852 | if (tmparea[txx][tyy]=='k'){ |
852 | if (tmparea[txx][tyy]=='k'){ |
853 | kosilkax=tyy; |
853 | kosilkax=tyy; |
854 | kosilkay=txx; |
854 | kosilkay=txx; |
855 | } |
855 | } |
856 | 856 | ||
857 | gamearea[txx][tyy]=tmparea[tyy][txx]; |
857 | gamearea[txx][tyy]=tmparea[tyy][txx]; |
858 | } |
858 | } |
859 | } |
859 | } |
860 | } |
860 | } |
861 | 861 | ||
862 | if (levnum==6){ |
862 | if (levnum==6){ |
863 | static char tmparea[20][20]={{'s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','s'}, |
863 | static char tmparea[20][20]={{'s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','s'}, |
864 | {'s','k','t','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','s'}, |
864 | {'s','k','t','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','s'}, |
865 | {'s','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','s'}, |
865 | {'s','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','s'}, |
866 | {'s','g','g','s','s','s','s','s','s','s','s','s','s','s','s','s','s','g','g','s'}, |
866 | {'s','g','g','s','s','s','s','s','s','s','s','s','s','s','s','s','s','g','g','s'}, |
867 | {'s','g','g','g','g','g','g','g','g','g','g','g','g','g','t','t','s','g','g','s'}, |
867 | {'s','g','g','g','g','g','g','g','g','g','g','g','g','g','t','t','s','g','g','s'}, |
868 | {'s','g','g','s','g','g','g','g','g','g','g','g','g','g','t','t','s','g','g','s'}, |
868 | {'s','g','g','s','g','g','g','g','g','g','g','g','g','g','t','t','s','g','g','s'}, |
869 | {'s','g','g','s','g','g','g','g','g','g','g','g','g','g','t','t','s','g','g','s'}, |
869 | {'s','g','g','s','g','g','g','g','g','g','g','g','g','g','t','t','s','g','g','s'}, |
870 | {'s','g','g','s','g','g','g','g','g','t','t','g','g','g','g','g','s','g','g','s'}, |
870 | {'s','g','g','s','g','g','g','g','g','t','t','g','g','g','g','g','s','g','g','s'}, |
871 | {'s','g','g','s','g','g','g','g','g','t','t','t','g','g','g','g','s','g','g','s'}, |
871 | {'s','g','g','s','g','g','g','g','g','t','t','t','g','g','g','g','s','g','g','s'}, |
872 | {'s','g','g','s','g','g','g','t','t','t','t','t','t','g','g','g','s','g','g','s'}, |
872 | {'s','g','g','s','g','g','g','t','t','t','t','t','t','g','g','g','s','g','g','s'}, |
873 | {'s','g','g','s','g','g','g','t','t','t','t','t','t','g','g','g','s','g','g','s'}, |
873 | {'s','g','g','s','g','g','g','t','t','t','t','t','t','g','g','g','s','g','g','s'}, |
874 | {'s','g','g','s','g','g','g','g','g','t','t','g','g','g','g','g','s','g','g','s'}, |
874 | {'s','g','g','s','g','g','g','g','g','t','t','g','g','g','g','g','s','g','g','s'}, |
875 | {'s','g','g','s','g','g','g','g','g','t','t','g','g','g','g','g','s','g','g','s'}, |
875 | {'s','g','g','s','g','g','g','g','g','t','t','g','g','g','g','g','s','g','g','s'}, |
876 | {'s','g','g','s','g','g','g','g','g','g','g','g','g','g','g','g','s','g','g','s'}, |
876 | {'s','g','g','s','g','g','g','g','g','g','g','g','g','g','g','g','s','g','g','s'}, |
877 | {'s','g','g','s','g','g','g','g','g','g','g','g','g','g','g','g','s','g','g','s'}, |
877 | {'s','g','g','s','g','g','g','g','g','g','g','g','g','g','g','g','s','g','g','s'}, |
878 | {'s','g','g','s','g','g','g','g','g','g','g','g','g','g','g','g','s','g','g','s'}, |
878 | {'s','g','g','s','g','g','g','g','g','g','g','g','g','g','g','g','s','g','g','s'}, |
879 | {'s','g','g','s','s','s','s','s','s','s','s','s','s','s','s','s','s','g','g','s'}, |
879 | {'s','g','g','s','s','s','s','s','s','s','s','s','s','s','s','s','s','g','g','s'}, |
880 | {'s','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','s'}, |
880 | {'s','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','s'}, |
881 | {'s','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','s'}, |
881 | {'s','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','s'}, |
882 | {'s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','s'}}; |
882 | {'s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','s'}}; |
883 | for (int tyy=0;tyy<20;tyy++){ |
883 | for (int tyy=0;tyy<20;tyy++){ |
884 | for (int txx=0;txx<20;txx++){ |
884 | for (int txx=0;txx<20;txx++){ |
885 | 885 | ||
886 | if (tmparea[txx][tyy]=='k'){ |
886 | if (tmparea[txx][tyy]=='k'){ |
887 | kosilkax=tyy; |
887 | kosilkax=tyy; |
888 | kosilkay=txx; |
888 | kosilkay=txx; |
889 | } |
889 | } |
890 | 890 | ||
891 | gamearea[txx][tyy]=tmparea[tyy][txx]; |
891 | gamearea[txx][tyy]=tmparea[tyy][txx]; |
892 | } |
892 | } |
893 | } |
893 | } |
894 | } |
894 | } |
895 | 895 | ||
896 | 896 | ||
897 | if (levnum==7){ |
897 | if (levnum==7){ |
898 | static char tmparea[20][20]={{'s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','s'}, |
898 | static char tmparea[20][20]={{'s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','s'}, |
899 | {'s','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','s','t','t','s'}, |
899 | {'s','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','s','t','t','s'}, |
900 | {'s','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','s','t','t','s'}, |
900 | {'s','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','s','t','t','s'}, |
901 | {'s','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','s','t','t','s'}, |
901 | {'s','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','s','t','t','s'}, |
902 | {'s','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','s','t','t','s'}, |
902 | {'s','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','s','t','t','s'}, |
903 | {'s','g','g','g','g','g','t','t','t','t','t','t','g','g','g','g','s','t','t','s'}, |
903 | {'s','g','g','g','g','g','t','t','t','t','t','t','g','g','g','g','s','t','t','s'}, |
904 | {'s','g','g','g','g','g','t','k','g','g','g','t','g','g','g','g','s','t','t','s'}, |
904 | {'s','g','g','g','g','g','t','k','g','g','g','t','g','g','g','g','s','t','t','s'}, |
905 | {'s','g','g','g','g','g','t','g','g','g','g','t','g','g','g','g','s','t','t','s'}, |
905 | {'s','g','g','g','g','g','t','g','g','g','g','t','g','g','g','g','s','t','t','s'}, |
906 | {'s','g','g','g','g','g','t','g','g','g','g','t','g','g','g','g','s','t','t','s'}, |
906 | {'s','g','g','g','g','g','t','g','g','g','g','t','g','g','g','g','s','t','t','s'}, |
907 | {'s','g','g','g','g','g','t','g','g','g','g','t','g','g','g','g','s','s','s','s'}, |
907 | {'s','g','g','g','g','g','t','g','g','g','g','t','g','g','g','g','s','s','s','s'}, |
908 | {'s','g','g','g','g','g','t','g','g','g','g','t','g','g','g','g','g','g','g','s'}, |
908 | {'s','g','g','g','g','g','t','g','g','g','g','t','g','g','g','g','g','g','g','s'}, |
909 | {'s','g','g','g','g','g','t','t','t','t','g','t','g','g','g','g','g','g','g','s'}, |
909 | {'s','g','g','g','g','g','t','t','t','t','g','t','g','g','g','g','g','g','g','s'}, |
910 | {'s','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','s'}, |
910 | {'s','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','s'}, |
911 | {'s','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','s'}, |
911 | {'s','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','s'}, |
912 | {'s','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','s'}, |
912 | {'s','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','s'}, |
913 | {'s','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','s'}, |
913 | {'s','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','s'}, |
914 | {'s','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','s'}, |
914 | {'s','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','g','s'}, |
915 | {'s','g','g','g','g','g','g','g','g','t','g','g','t','g','g','g','g','g','g','s'}, |
915 | {'s','g','g','g','g','g','g','g','g','t','g','g','t','g','g','g','g','g','g','s'}, |
916 | {'s','g','g','g','g','g','g','g','g','t','g','g','t','g','g','g','g','g','g','s'}, |
916 | {'s','g','g','g','g','g','g','g','g','t','g','g','t','g','g','g','g','g','g','s'}, |
917 | {'s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','s'}}; |
917 | {'s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','s','s'}}; |
918 | for (int tyy=0;tyy<20;tyy++){ |
918 | for (int tyy=0;tyy<20;tyy++){ |
919 | for (int txx=0;txx<20;txx++){ |
919 | for (int txx=0;txx<20;txx++){ |
920 | 920 | ||
921 | if (tmparea[txx][tyy]=='k'){ |
921 | if (tmparea[txx][tyy]=='k'){ |
922 | kosilkax=tyy; |
922 | kosilkax=tyy; |
923 | kosilkay=txx; |
923 | kosilkay=txx; |
924 | } |
924 | } |
925 | 925 | ||
926 | gamearea[txx][tyy]=tmparea[tyy][txx]; |
926 | gamearea[txx][tyy]=tmparea[tyy][txx]; |
927 | } |
927 | } |
928 | } |
928 | } |
929 | } |
929 | } |
930 | } |
930 | } |
931 | else |
931 | else |
932 | { |
932 | { |
933 | //ÂÍÅØÍÈÅ ÓÐÎÂÍÈ |
933 | //ÂÍÅØÍÈÅ ÓÐÎÂÍÈ |
934 | kosilkadirection=1; |
934 | kosilkadirection=1; |
935 | 935 | ||
936 | int currentrow=0; |
936 | int currentrow=0; |
937 | int currentcol=0; |
937 | int currentcol=0; |
938 | 938 | ||
939 | for (int tmpcntr=0;tmpcntr<400;tmpcntr++){ |
939 | for (int tmpcntr=0;tmpcntr<400;tmpcntr++){ |
940 | 940 | ||
941 | currentcol=(int)(tmpcntr/20); |
941 | currentcol=(int)(tmpcntr/20); |
942 | currentrow=tmpcntr-(((int)(tmpcntr/20))*20); |
942 | currentrow=tmpcntr-(((int)(tmpcntr/20))*20); |
943 | switch(externallevels[tmpcntr+(400*(levnum-1))]){ |
943 | switch(externallevels[tmpcntr+(400*(levnum-1))]){ |
944 | 944 | ||
945 | case 0: |
945 | case 0: |
946 | gamearea[currentrow][currentcol]='n'; |
946 | gamearea[currentrow][currentcol]='n'; |
947 | break; |
947 | break; |
948 | case 1: |
948 | case 1: |
949 | gamearea[currentrow][currentcol]='g'; |
949 | gamearea[currentrow][currentcol]='g'; |
950 | break; |
950 | break; |
951 | case 2: |
951 | case 2: |
952 | gamearea[currentrow][currentcol]='k'; |
952 | gamearea[currentrow][currentcol]='k'; |
953 | kosilkax=currentrow; |
953 | kosilkax=currentrow; |
954 | kosilkay=currentcol; |
954 | kosilkay=currentcol; |
955 | break; |
955 | break; |
956 | case 3: |
956 | case 3: |
957 | gamearea[currentrow][currentcol]='s'; |
957 | gamearea[currentrow][currentcol]='s'; |
958 | break; |
958 | break; |
959 | case 4: |
959 | case 4: |
960 | gamearea[currentrow][currentcol]='t'; |
960 | gamearea[currentrow][currentcol]='t'; |
961 | break; |
961 | break; |
962 | 962 | ||
963 | } |
963 | } |
964 | } |
964 | } |
965 | 965 | ||
966 | 966 | ||
967 | } |
967 | } |
968 | 968 | ||
969 | draw_window(); |
969 | draw_window(); |
970 | 970 | ||
971 | } |
971 | } |
972 | 972 | ||
973 | //Ïðåîâåðÿåì îñòàòîê òðàâû |
973 | //Ïðåîâåðÿåì îñòàòîê òðàâû |
974 | int grassLeft(){ |
974 | int grassLeft(){ |
975 | int leftgrass=0; |
975 | int leftgrass=0; |
976 | for (int chky=0;chky<20;chky++){ |
976 | for (int chky=0;chky<20;chky++){ |
977 | for (int chkx=0;chkx<20;chkx++){ |
977 | for (int chkx=0;chkx<20;chkx++){ |
978 | if (gamearea[chkx][chky]=='g') { |
978 | if (gamearea[chkx][chky]=='g') { |
979 | leftgrass++; |
979 | leftgrass++; |
980 | } |
980 | } |
981 | } |
981 | } |
982 | } |
982 | } |
983 | return leftgrass; |
983 | return leftgrass; |
984 | } |
984 | } |
985 | 985 | ||
986 | 986 | ||
987 | //Ìåíÿåì óðîâåíü èëè âûâîäèì ñîîáùåíèå î òîì, ÷òî âñå óðîâíè ïðîéäåíû |
987 | //Ìåíÿåì óðîâåíü èëè âûâîäèì ñîîáùåíèå î òîì, ÷òî âñå óðîâíè ïðîéäåíû |
988 | void updateStatus(){ |
988 | void updateStatus(){ |
989 | 989 | ||
990 | 990 | ||
991 | if (grassLeft()==0) { |
991 | if (grassLeft()==0) { |
992 | if (level==levelcount){ |
992 | if (level==levelcount){ |
993 | gamestarted=false; |
993 | gamestarted=false; |
994 | status=2; |
994 | status=2; |
995 | draw_window(); |
995 | draw_window(); |
996 | } else { |
996 | } else { |
997 | gamestarted=false; |
997 | gamestarted=false; |
998 | interlevelpause(); |
998 | interlevelpause(); |
999 | level++; |
999 | level++; |
1000 | initializeLevel(level); |
1000 | initializeLevel(level); |
1001 | gamestarted=true; |
1001 | gamestarted=true; |
1002 | } |
1002 | } |
1003 | } |
1003 | } |
1004 | 1004 | ||
1005 | } |
1005 | } |
1006 | 1006 | ||
1007 | 1007 | ||
1008 | 1008 | ||
1009 | 1009 | ||
1010 | void decode_skin(){ |
1010 | void decode_skin(){ |
1011 | int currentbyte3x=0; |
1011 | int currentbyte3x=0; |
1012 | RGB tmpRGB; |
1012 | RGB tmpRGB; |
1013 | int tmpcc1=0; |
1013 | int tmpcc1=0; |
1014 | 1014 | ||
1015 | for (tmpcc1=0;tmpcc1<576;tmpcc1++){ |
1015 | for (tmpcc1=0;tmpcc1<576;tmpcc1++){ |
1016 | 1016 | ||
1017 | tmpRGB.r= skindata[currentbyte3x]; |
1017 | tmpRGB.r= skindata[currentbyte3x]; |
1018 | tmpRGB.g= skindata[currentbyte3x+1]; |
1018 | tmpRGB.g= skindata[currentbyte3x+1]; |
1019 | tmpRGB.b= skindata[currentbyte3x+2]; |
1019 | tmpRGB.b= skindata[currentbyte3x+2]; |
1020 | kosilka_d[tmpcc1]=tmpRGB; |
1020 | kosilka_d[tmpcc1]=tmpRGB; |
1021 | currentbyte3x+=3; |
1021 | currentbyte3x+=3; |
1022 | } |
1022 | } |
1023 | 1023 | ||
1024 | for (tmpcc1=0;tmpcc1<576;tmpcc1++){ |
1024 | for (tmpcc1=0;tmpcc1<576;tmpcc1++){ |
1025 | 1025 | ||
1026 | tmpRGB.r= skindata[currentbyte3x]; |
1026 | tmpRGB.r= skindata[currentbyte3x]; |
1027 | tmpRGB.g= skindata[currentbyte3x+1]; |
1027 | tmpRGB.g= skindata[currentbyte3x+1]; |
1028 | tmpRGB.b= skindata[currentbyte3x+2]; |
1028 | tmpRGB.b= skindata[currentbyte3x+2]; |
1029 | kosilka_u[tmpcc1]=tmpRGB; |
1029 | kosilka_u[tmpcc1]=tmpRGB; |
1030 | currentbyte3x+=3; |
1030 | currentbyte3x+=3; |
1031 | } |
1031 | } |
1032 | 1032 | ||
1033 | for (tmpcc1=0;tmpcc1<576;tmpcc1++){ |
1033 | for (tmpcc1=0;tmpcc1<576;tmpcc1++){ |
1034 | 1034 | ||
1035 | tmpRGB.r= skindata[currentbyte3x]; |
1035 | tmpRGB.r= skindata[currentbyte3x]; |
1036 | tmpRGB.g= skindata[currentbyte3x+1]; |
1036 | tmpRGB.g= skindata[currentbyte3x+1]; |
1037 | tmpRGB.b= skindata[currentbyte3x+2]; |
1037 | tmpRGB.b= skindata[currentbyte3x+2]; |
1038 | kosilka_l[tmpcc1]=tmpRGB; |
1038 | kosilka_l[tmpcc1]=tmpRGB; |
1039 | currentbyte3x+=3; |
1039 | currentbyte3x+=3; |
1040 | } |
1040 | } |
1041 | 1041 | ||
1042 | for (tmpcc1=0;tmpcc1<576;tmpcc1++){ |
1042 | for (tmpcc1=0;tmpcc1<576;tmpcc1++){ |
1043 | 1043 | ||
1044 | tmpRGB.r= skindata[currentbyte3x]; |
1044 | tmpRGB.r= skindata[currentbyte3x]; |
1045 | tmpRGB.g= skindata[currentbyte3x+1]; |
1045 | tmpRGB.g= skindata[currentbyte3x+1]; |
1046 | tmpRGB.b= skindata[currentbyte3x+2]; |
1046 | tmpRGB.b= skindata[currentbyte3x+2]; |
1047 | kosilka_r[tmpcc1]=tmpRGB; |
1047 | kosilka_r[tmpcc1]=tmpRGB; |
1048 | currentbyte3x+=3; |
1048 | currentbyte3x+=3; |
1049 | } |
1049 | } |
1050 | 1050 | ||
1051 | for (tmpcc1=0;tmpcc1<576;tmpcc1++){ |
1051 | for (tmpcc1=0;tmpcc1<576;tmpcc1++){ |
1052 | 1052 | ||
1053 | tmpRGB.r= skindata[currentbyte3x]; |
1053 | tmpRGB.r= skindata[currentbyte3x]; |
1054 | tmpRGB.g= skindata[currentbyte3x+1]; |
1054 | tmpRGB.g= skindata[currentbyte3x+1]; |
1055 | tmpRGB.b= skindata[currentbyte3x+2]; |
1055 | tmpRGB.b= skindata[currentbyte3x+2]; |
1056 | skos[tmpcc1]=tmpRGB; |
1056 | skos[tmpcc1]=tmpRGB; |
1057 | currentbyte3x+=3; |
1057 | currentbyte3x+=3; |
1058 | } |
1058 | } |
1059 | 1059 | ||
1060 | for (tmpcc1=0;tmpcc1<576;tmpcc1++){ |
1060 | for (tmpcc1=0;tmpcc1<576;tmpcc1++){ |
1061 | 1061 | ||
1062 | tmpRGB.r= skindata[currentbyte3x]; |
1062 | tmpRGB.r= skindata[currentbyte3x]; |
1063 | tmpRGB.g= skindata[currentbyte3x+1]; |
1063 | tmpRGB.g= skindata[currentbyte3x+1]; |
1064 | tmpRGB.b= skindata[currentbyte3x+2]; |
1064 | tmpRGB.b= skindata[currentbyte3x+2]; |
1065 | grass[tmpcc1]=tmpRGB; |
1065 | grass[tmpcc1]=tmpRGB; |
1066 | currentbyte3x+=3; |
1066 | currentbyte3x+=3; |
1067 | } |
1067 | } |
1068 | 1068 | ||
1069 | for (tmpcc1=0;tmpcc1<576;tmpcc1++){ |
1069 | for (tmpcc1=0;tmpcc1<576;tmpcc1++){ |
1070 | 1070 | ||
1071 | tmpRGB.r= skindata[currentbyte3x]; |
1071 | tmpRGB.r= skindata[currentbyte3x]; |
1072 | tmpRGB.g= skindata[currentbyte3x+1]; |
1072 | tmpRGB.g= skindata[currentbyte3x+1]; |
1073 | tmpRGB.b= skindata[currentbyte3x+2]; |
1073 | tmpRGB.b= skindata[currentbyte3x+2]; |
1074 | stone[tmpcc1]=tmpRGB; |
1074 | stone[tmpcc1]=tmpRGB; |
1075 | currentbyte3x+=3; |
1075 | currentbyte3x+=3; |
1076 | } |
1076 | } |
1077 | 1077 | ||
1078 | for (tmpcc1=0;tmpcc1<576;tmpcc1++){ |
1078 | for (tmpcc1=0;tmpcc1<576;tmpcc1++){ |
1079 | 1079 | ||
1080 | tmpRGB.r= skindata[currentbyte3x]; |
1080 | tmpRGB.r= skindata[currentbyte3x]; |
1081 | tmpRGB.g= skindata[currentbyte3x+1]; |
1081 | tmpRGB.g= skindata[currentbyte3x+1]; |
1082 | tmpRGB.b= skindata[currentbyte3x+2]; |
1082 | tmpRGB.b= skindata[currentbyte3x+2]; |
1083 | tree[tmpcc1]=tmpRGB; |
1083 | tree[tmpcc1]=tmpRGB; |
1084 | currentbyte3x+=3; |
1084 | currentbyte3x+=3; |
1085 | } |
1085 | } |
1086 | 1086 | ||
1087 | } |
1087 | } |
1088 | 1088 | ||
1089 | 1089 | ||
1090 | 1090 | ||
1091 | void load_external_levels(){ |
1091 | void load_external_levels(){ |
1092 | 1092 | ||
1093 | CKosFile lev(getLevelsPathName()); |
1093 | CKosFile lev(getLevelsPathName()); |
1094 | 1094 | ||
1095 | level_read_result=lev.Read (external_levels_count,1); |
1095 | level_read_result=lev.Read (external_levels_count,1); |
1096 | 1096 | ||
1097 | if (level_read_result == 1){ |
1097 | if (level_read_result == 1){ |
1098 | external_levels_available=true; |
1098 | external_levels_available=true; |
1099 | } |
1099 | } |
1100 | else |
1100 | else |
1101 | { |
1101 | { |
1102 | external_levels_available=false; |
1102 | external_levels_available=false; |
1103 | }; |
1103 | }; |
1104 | 1104 | ||
1105 | 1105 | ||
1106 | if (external_levels_count[0]==0){ |
1106 | if (external_levels_count[0]==0){ |
1107 | external_levels_available=false; |
1107 | external_levels_available=false; |
1108 | } |
1108 | } |
1109 | else |
1109 | else |
1110 | { |
1110 | { |
1111 | externallevels = new Byte[400*external_levels_count[0]]; |
1111 | externallevels = new Byte[400*external_levels_count[0]]; |
1112 | lev.Read (externallevels,400*external_levels_count[0]); |
1112 | lev.Read (externallevels,400*external_levels_count[0]); |
1113 | } |
1113 | } |
1114 | 1114 | ||
1115 | 1115 | ||
1116 | 1116 | ||
1117 | } |
1117 | } |
1118 | 1118 | ||
1119 | void app_halt(){ |
1119 | void app_halt(){ |
1120 | 1120 | ||
1121 | delete apppath; |
1121 | delete apppath; |
1122 | delete levpath; |
1122 | delete levpath; |
1123 | if (external_levels_available==true) {delete externallevels;} |
1123 | if (external_levels_available==true) {delete externallevels;} |
1124 | kos_ExitApp(); |
1124 | kos_ExitApp(); |
1125 | 1125 | ||
1126 | } |
1126 | } |
1127 | 1127 | ||
1128 | void kos_Main(){ |
1128 | void kos_Main(){ |
1129 | 1129 | ||
1130 | 1130 | ||
1131 | load_external_levels(); |
1131 | load_external_levels(); |
1132 | 1132 | ||
1133 | CKosFile skin(getSkinPathName()); |
1133 | CKosFile skin(getSkinPathName()); |
1134 | 1134 | ||
1135 | read_result=skin.Read (skindata,13824); |
1135 | read_result=skin.Read (skindata,13824); |
1136 | if (read_result != 13824){ |
1136 | if (read_result != 13824){ |
1137 | skin_available=false; |
1137 | skin_available=false; |
1138 | } |
1138 | } |
1139 | else |
1139 | else |
1140 | { |
1140 | { |
1141 | skin_available=true; |
1141 | skin_available=true; |
1142 | }; |
1142 | }; |
1143 | 1143 | ||
1144 | if (skin_available==false){ |
1144 | if (skin_available==false){ |
1145 | decode_graphics(kosilka_d1,kosilka_d); |
1145 | decode_graphics(kosilka_d1,kosilka_d); |
1146 | decode_graphics(kosilka_u1,kosilka_u); |
1146 | decode_graphics(kosilka_u1,kosilka_u); |
1147 | decode_graphics(kosilka_l1,kosilka_l); |
1147 | decode_graphics(kosilka_l1,kosilka_l); |
1148 | decode_graphics(kosilka_r1,kosilka_r); |
1148 | decode_graphics(kosilka_r1,kosilka_r); |
1149 | decode_graphics(skos1,skos); |
1149 | decode_graphics(skos1,skos); |
1150 | decode_graphics(stone1,stone); |
1150 | decode_graphics(stone1,stone); |
1151 | decode_graphics(tree1,tree); |
1151 | decode_graphics(tree1,tree); |
1152 | decode_graphics(grass1,grass); |
1152 | decode_graphics(grass1,grass); |
1153 | skinned=false; |
1153 | skinned=false; |
1154 | } |
1154 | } |
1155 | else |
1155 | else |
1156 | { |
1156 | { |
1157 | decode_skin(); |
1157 | decode_skin(); |
1158 | skinned=true; |
1158 | skinned=true; |
1159 | } |
1159 | } |
1160 | 1160 | ||
1161 | draw_window(); |
1161 | draw_window(); |
1162 | 1162 | ||
1163 | for (;;){ |
1163 | for (;;){ |
1164 | 1164 | ||
1165 | switch (kos_WaitForEvent()){ |
1165 | switch (kos_WaitForEvent()){ |
1166 | case 1: |
1166 | case 1: |
1167 | w_redraw=true; |
1167 | w_redraw=true; |
1168 | draw_window(); |
1168 | draw_window(); |
1169 | break; |
1169 | break; |
1170 | case 2: |
1170 | case 2: |
1171 | Byte keyCode; |
1171 | Byte keyCode; |
1172 | kos_GetKey(keyCode); |
1172 | kos_GetKey(keyCode); |
1173 | if (status==1){ |
1173 | if (status==1){ |
1174 | if (gamestarted==true){ |
1174 | if (gamestarted==true){ |
1175 | switch (keyCode){ |
1175 | switch (keyCode){ |
1176 | case 177: |
1176 | case 177: |
1177 | if (kosilkay<19){ |
1177 | if (kosilkay<19){ |
1178 | if (gamearea[kosilkax][kosilkay+1]=='g'){ |
1178 | if (gamearea[kosilkax][kosilkay+1]=='g'){ |
1179 | gamearea[kosilkax][kosilkay]='n'; |
1179 | gamearea[kosilkax][kosilkay]='n'; |
1180 | gamearea[kosilkax][kosilkay+1]='k'; |
1180 | gamearea[kosilkax][kosilkay+1]='k'; |
1181 | 1181 | ||
1182 | if (drawanimation==true) {animate(kosilkax,kosilkay,1);} |
1182 | if (drawanimation==true) {animate(kosilkax,kosilkay,1);} |
1183 | 1183 | ||
1184 | 1184 | ||
1185 | lastkosilkadirection=kosilkadirection; |
1185 | lastkosilkadirection=kosilkadirection; |
1186 | laststep=1; |
1186 | laststep=1; |
1187 | 1187 | ||
1188 | kosilkay++; |
1188 | kosilkay++; |
1189 | kosilkadirection=1; |
1189 | kosilkadirection=1; |
1190 | draw_element(kosilkax,kosilkay); |
1190 | draw_element(kosilkax,kosilkay); |
1191 | draw_element(kosilkax,kosilkay-1); |
1191 | draw_element(kosilkax,kosilkay-1); |
1192 | display_grass_left(); |
1192 | display_grass_left(); |
1193 | updateStatus(); |
1193 | updateStatus(); |
1194 | } |
1194 | } |
1195 | } |
1195 | } |
1196 | break; |
1196 | break; |
1197 | case 178: |
1197 | case 178: |
1198 | if (kosilkay>0){ |
1198 | if (kosilkay>0){ |
1199 | if (gamearea[kosilkax][kosilkay-1]=='g'){ |
1199 | if (gamearea[kosilkax][kosilkay-1]=='g'){ |
1200 | gamearea[kosilkax][kosilkay]='n'; |
1200 | gamearea[kosilkax][kosilkay]='n'; |
1201 | gamearea[kosilkax][kosilkay-1]='k'; |
1201 | gamearea[kosilkax][kosilkay-1]='k'; |
1202 | 1202 | ||
1203 | if (drawanimation==true) {animate(kosilkax,kosilkay,2);} |
1203 | if (drawanimation==true) {animate(kosilkax,kosilkay,2);} |
1204 | 1204 | ||
1205 | lastkosilkadirection=kosilkadirection; |
1205 | lastkosilkadirection=kosilkadirection; |
1206 | laststep=2; |
1206 | laststep=2; |
1207 | 1207 | ||
1208 | kosilkay--; |
1208 | kosilkay--; |
1209 | kosilkadirection=2; |
1209 | kosilkadirection=2; |
1210 | 1210 | ||
1211 | draw_element(kosilkax,kosilkay); |
1211 | draw_element(kosilkax,kosilkay); |
1212 | draw_element(kosilkax,kosilkay+1); |
1212 | draw_element(kosilkax,kosilkay+1); |
1213 | display_grass_left(); |
1213 | display_grass_left(); |
1214 | updateStatus(); |
1214 | updateStatus(); |
1215 | } |
1215 | } |
1216 | } |
1216 | } |
1217 | break; |
1217 | break; |
1218 | 1218 | ||
1219 | case 179: |
1219 | case 179: |
1220 | if (kosilkax<19){ |
1220 | if (kosilkax<19){ |
1221 | if (gamearea[kosilkax+1][kosilkay]=='g'){ |
1221 | if (gamearea[kosilkax+1][kosilkay]=='g'){ |
1222 | gamearea[kosilkax][kosilkay]='n'; |
1222 | gamearea[kosilkax][kosilkay]='n'; |
1223 | gamearea[kosilkax+1][kosilkay]='k'; |
1223 | gamearea[kosilkax+1][kosilkay]='k'; |
1224 | 1224 | ||
1225 | if (drawanimation==true) {animate(kosilkax,kosilkay,3);} |
1225 | if (drawanimation==true) {animate(kosilkax,kosilkay,3);} |
1226 | 1226 | ||
1227 | 1227 | ||
1228 | lastkosilkadirection=kosilkadirection; |
1228 | lastkosilkadirection=kosilkadirection; |
1229 | laststep=3; |
1229 | laststep=3; |
1230 | 1230 | ||
1231 | kosilkax++; |
1231 | kosilkax++; |
1232 | kosilkadirection=4; |
1232 | kosilkadirection=4; |
1233 | 1233 | ||
1234 | draw_element(kosilkax,kosilkay); |
1234 | draw_element(kosilkax,kosilkay); |
1235 | draw_element(kosilkax-1,kosilkay); |
1235 | draw_element(kosilkax-1,kosilkay); |
1236 | display_grass_left(); |
1236 | display_grass_left(); |
1237 | updateStatus(); |
1237 | updateStatus(); |
1238 | } |
1238 | } |
1239 | } |
1239 | } |
1240 | break; |
1240 | break; |
1241 | 1241 | ||
1242 | case 176: |
1242 | case 176: |
1243 | if (kosilkax>0){ |
1243 | if (kosilkax>0){ |
1244 | if (gamearea[kosilkax-1][kosilkay]=='g'){ |
1244 | if (gamearea[kosilkax-1][kosilkay]=='g'){ |
1245 | gamearea[kosilkax][kosilkay]='n'; |
1245 | gamearea[kosilkax][kosilkay]='n'; |
1246 | gamearea[kosilkax-1][kosilkay]='k'; |
1246 | gamearea[kosilkax-1][kosilkay]='k'; |
1247 | 1247 | ||
1248 | if (drawanimation==true) {animate(kosilkax,kosilkay,4);} |
1248 | if (drawanimation==true) {animate(kosilkax,kosilkay,4);} |
1249 | 1249 | ||
1250 | lastkosilkadirection=kosilkadirection; |
1250 | lastkosilkadirection=kosilkadirection; |
1251 | laststep=4; |
1251 | laststep=4; |
1252 | 1252 | ||
1253 | kosilkax--; |
1253 | kosilkax--; |
1254 | kosilkadirection=3; |
1254 | kosilkadirection=3; |
1255 | 1255 | ||
1256 | draw_element(kosilkax,kosilkay); |
1256 | draw_element(kosilkax,kosilkay); |
1257 | draw_element(kosilkax+1,kosilkay); |
1257 | draw_element(kosilkax+1,kosilkay); |
1258 | display_grass_left(); |
1258 | display_grass_left(); |
1259 | updateStatus(); |
1259 | updateStatus(); |
1260 | } |
1260 | } |
1261 | } |
1261 | } |
1262 | break; |
1262 | break; |
1263 | 1263 | ||
1264 | case 27: |
1264 | case 27: |
1265 | if (lives>0){ |
1265 | if (lives>0){ |
1266 | lives--; |
1266 | lives--; |
1267 | initializeLevel(level); |
1267 | initializeLevel(level); |
1268 | 1268 | ||
1269 | } else { |
1269 | } else { |
1270 | gamestarted=false; |
1270 | gamestarted=false; |
1271 | status=3; |
1271 | status=3; |
1272 | draw_window(); |
1272 | draw_window(); |
1273 | } |
1273 | } |
1274 | break; |
1274 | break; |
1275 | 1275 | ||
1276 | case 8: |
1276 | case 8: |
1277 | if (laststep!=0){ |
1277 | if (laststep!=0){ |
1278 | kosilkadirection=lastkosilkadirection; |
1278 | kosilkadirection=lastkosilkadirection; |
1279 | if (laststep==1){ |
1279 | if (laststep==1){ |
1280 | gamearea[kosilkax][kosilkay]='g'; |
1280 | gamearea[kosilkax][kosilkay]='g'; |
1281 | gamearea[kosilkax][kosilkay-1]='k'; |
1281 | gamearea[kosilkax][kosilkay-1]='k'; |
1282 | draw_element(kosilkax,kosilkay); |
1282 | draw_element(kosilkax,kosilkay); |
1283 | draw_element(kosilkax,kosilkay-1); |
1283 | draw_element(kosilkax,kosilkay-1); |
1284 | kosilkay--; |
1284 | kosilkay--; |
1285 | } |
1285 | } |
1286 | if (laststep==2){ |
1286 | if (laststep==2){ |
1287 | gamearea[kosilkax][kosilkay]='g'; |
1287 | gamearea[kosilkax][kosilkay]='g'; |
1288 | gamearea[kosilkax][kosilkay+1]='k'; |
1288 | gamearea[kosilkax][kosilkay+1]='k'; |
1289 | draw_element(kosilkax,kosilkay); |
1289 | draw_element(kosilkax,kosilkay); |
1290 | draw_element(kosilkax,kosilkay+1); |
1290 | draw_element(kosilkax,kosilkay+1); |
1291 | kosilkay++; |
1291 | kosilkay++; |
1292 | } |
1292 | } |
1293 | 1293 | ||
1294 | if (laststep==3){ |
1294 | if (laststep==3){ |
1295 | gamearea[kosilkax][kosilkay]='g'; |
1295 | gamearea[kosilkax][kosilkay]='g'; |
1296 | gamearea[kosilkax-1][kosilkay]='k'; |
1296 | gamearea[kosilkax-1][kosilkay]='k'; |
1297 | draw_element(kosilkax,kosilkay); |
1297 | draw_element(kosilkax,kosilkay); |
1298 | draw_element(kosilkax-1,kosilkay); |
1298 | draw_element(kosilkax-1,kosilkay); |
1299 | kosilkax--; |
1299 | kosilkax--; |
1300 | } |
1300 | } |
1301 | 1301 | ||
1302 | if (laststep==4){ |
1302 | if (laststep==4){ |
1303 | gamearea[kosilkax][kosilkay]='g'; |
1303 | gamearea[kosilkax][kosilkay]='g'; |
1304 | gamearea[kosilkax+1][kosilkay]='k'; |
1304 | gamearea[kosilkax+1][kosilkay]='k'; |
1305 | draw_element(kosilkax,kosilkay); |
1305 | draw_element(kosilkax,kosilkay); |
1306 | draw_element(kosilkax+1,kosilkay); |
1306 | draw_element(kosilkax+1,kosilkay); |
1307 | kosilkax++; |
1307 | kosilkax++; |
1308 | } |
1308 | } |
1309 | 1309 | ||
1310 | 1310 | ||
1311 | laststep=0; |
1311 | laststep=0; |
1312 | } |
1312 | } |
1313 | break; |
1313 | break; |
1314 | 1314 | ||
1315 | } |
1315 | } |
1316 | 1316 | ||
1317 | } |
1317 | } |
1318 | } |
1318 | } |
1319 | if (status==0){ |
1319 | if (status==0){ |
1320 | if (keyCode==13){ //enter |
1320 | if (keyCode==13){ //enter |
1321 | if (external_levels_available==true){ |
1321 | if (external_levels_available==true){ |
1322 | status=4; |
1322 | status=4; |
1323 | draw_window(); |
1323 | draw_window(); |
1324 | } |
1324 | } |
1325 | else |
1325 | else |
1326 | { |
1326 | { |
1327 | status=1; |
1327 | status=1; |
1328 | initializeLevel(1); |
1328 | initializeLevel(1); |
1329 | gamestarted=true; |
1329 | gamestarted=true; |
1330 | } |
1330 | } |
1331 | 1331 | ||
1332 | } |
1332 | } |
1333 | 1333 | ||
1334 | if (keyCode==103){ |
1334 | if (keyCode==103){ |
1335 | if (drawgraphics==true){ |
1335 | if (drawgraphics==true){ |
1336 | drawgraphics=false; |
1336 | drawgraphics=false; |
1337 | } else { |
1337 | } else { |
1338 | drawgraphics=true; |
1338 | drawgraphics=true; |
1339 | } |
1339 | } |
1340 | 1340 | ||
1341 | if (drawgraphics==true){ |
1341 | if (drawgraphics==true){ |
1342 | kos_PutImage((RGB*)kosilka_d,24,24,305,150); |
1342 | kos_PutImage((RGB*)kosilka_d,24,24,305,150); |
1343 | } |
1343 | } |
1344 | else |
1344 | else |
1345 | { |
1345 | { |
1346 | kos_DrawBar(305,150,24,24,0x00AAAA); |
1346 | kos_DrawBar(305,150,24,24,0x00AAAA); |
1347 | } |
1347 | } |
1348 | } |
1348 | } |
1349 | 1349 | ||
1350 | if (keyCode==97){ |
1350 | if (keyCode==97){ |
1351 | if (drawanimation==true){ |
1351 | if (drawanimation==true){ |
1352 | drawanimation=false; |
1352 | drawanimation=false; |
1353 | } else { |
1353 | } else { |
1354 | drawanimation=true; |
1354 | drawanimation=true; |
1355 | } |
1355 | } |
1356 | 1356 | ||
1357 | if (drawanimation==true){ |
1357 | if (drawanimation==true){ |
1358 | kos_DrawBar(335,150,24,24,0x00AA00); |
1358 | kos_DrawBar(335,150,24,24,0x00AA00); |
1359 | } |
1359 | } |
1360 | else |
1360 | else |
1361 | { |
1361 | { |
1362 | kos_DrawBar(335,150,24,24,0xAA0000); |
1362 | kos_DrawBar(335,150,24,24,0xAA0000); |
1363 | } |
1363 | } |
1364 | } |
1364 | } |
1365 | if (keyCode==104){ |
1365 | if (keyCode==104){ |
1366 | status=-1; |
1366 | status=-1; |
1367 | draw_window(); |
1367 | draw_window(); |
1368 | } |
1368 | } |
1369 | 1369 | ||
1370 | if (keyCode==115){ |
1370 | if (keyCode==115){ |
1371 | 1371 | ||
1372 | if (skin_available==true){ |
1372 | if (skin_available==true){ |
1373 | if (skinned==true){ |
1373 | if (skinned==true){ |
1374 | skinned=false; |
1374 | skinned=false; |
1375 | decode_graphics(kosilka_d1,kosilka_d); |
1375 | decode_graphics(kosilka_d1,kosilka_d); |
1376 | decode_graphics(kosilka_u1,kosilka_u); |
1376 | decode_graphics(kosilka_u1,kosilka_u); |
1377 | decode_graphics(kosilka_l1,kosilka_l); |
1377 | decode_graphics(kosilka_l1,kosilka_l); |
1378 | decode_graphics(kosilka_r1,kosilka_r); |
1378 | decode_graphics(kosilka_r1,kosilka_r); |
1379 | decode_graphics(skos1,skos); |
1379 | decode_graphics(skos1,skos); |
1380 | decode_graphics(stone1,stone); |
1380 | decode_graphics(stone1,stone); |
1381 | decode_graphics(tree1,tree); |
1381 | decode_graphics(tree1,tree); |
1382 | decode_graphics(grass1,grass); |
1382 | decode_graphics(grass1,grass); |
1383 | } else { |
1383 | } else { |
1384 | skinned=true; |
1384 | skinned=true; |
1385 | decode_skin(); |
1385 | decode_skin(); |
1386 | } |
1386 | } |
1387 | 1387 | ||
1388 | draw_window(); |
1388 | draw_window(); |
1389 | 1389 | ||
1390 | } |
1390 | } |
1391 | 1391 | ||
1392 | } |
1392 | } |
1393 | if (keyCode==27){ |
1393 | if (keyCode==27){ |
1394 | app_halt(); |
1394 | app_halt(); |
1395 | } |
1395 | } |
1396 | 1396 | ||
1397 | } |
1397 | } |
1398 | 1398 | ||
1399 | if (status==4){ |
1399 | if (status==4){ |
1400 | if (keyCode==49){ //1 |
1400 | if (keyCode==49){ //1 |
1401 | external_levels=false; |
1401 | external_levels=false; |
1402 | status=1; |
1402 | status=1; |
1403 | initializeLevel(1); |
1403 | initializeLevel(1); |
1404 | gamestarted=true; |
1404 | gamestarted=true; |
1405 | 1405 | ||
1406 | } |
1406 | } |
1407 | 1407 | ||
1408 | if (keyCode==50){ //2 |
1408 | if (keyCode==50){ //2 |
1409 | external_levels=true; |
1409 | external_levels=true; |
1410 | levelcount=external_levels_count[0]; |
1410 | levelcount=external_levels_count[0]; |
1411 | status=1; |
1411 | status=1; |
1412 | initializeLevel(1); |
1412 | initializeLevel(1); |
1413 | gamestarted=true; |
1413 | gamestarted=true; |
1414 | 1414 | ||
1415 | } |
1415 | } |
1416 | } |
1416 | } |
1417 | 1417 | ||
1418 | if (status==2){ |
1418 | if (status==2){ |
1419 | if (keyCode==113){ |
1419 | if (keyCode==113){ |
1420 | lives=2; |
1420 | lives=2; |
1421 | status=0; |
1421 | status=0; |
1422 | level=1; |
1422 | level=1; |
1423 | draw_window(); |
1423 | draw_window(); |
1424 | gamestarted=true; |
1424 | gamestarted=true; |
1425 | } |
1425 | } |
1426 | } |
1426 | } |
1427 | 1427 | ||
1428 | if (status==3){ |
1428 | if (status==3){ |
1429 | if (keyCode==113){ |
1429 | if (keyCode==113){ |
1430 | lives=2; |
1430 | lives=2; |
1431 | status=0; |
1431 | status=0; |
1432 | level=1; |
1432 | level=1; |
1433 | draw_window(); |
1433 | draw_window(); |
1434 | gamestarted=true; |
1434 | gamestarted=true; |
1435 | 1435 | ||
1436 | } |
1436 | } |
1437 | if (keyCode==114){ |
1437 | if (keyCode==114){ |
1438 | lives=2; |
1438 | lives=2; |
1439 | status=1; |
1439 | status=1; |
1440 | level=1; |
1440 | level=1; |
1441 | initializeLevel(1); |
1441 | initializeLevel(1); |
1442 | gamestarted=true; |
1442 | gamestarted=true; |
1443 | } |
1443 | } |
1444 | 1444 | ||
1445 | } |
1445 | } |
1446 | 1446 | ||
1447 | if (status==-1){ |
1447 | if (status==-1){ |
1448 | if (keyCode==8){ |
1448 | if (keyCode==8){ |
1449 | status=0; |
1449 | status=0; |
1450 | draw_window(); |
1450 | draw_window(); |
1451 | } |
1451 | } |
1452 | } |
1452 | } |
1453 | 1453 | ||
1454 | //Âûâîäèì êîä íàæàòîé êëàâèøè. Ôè÷à âðåìåííàÿ |
1454 | //Âûâîäèì êîä íàæàòîé êëàâèøè. Ôè÷à âðåìåííàÿ |
1455 | /* kos_DrawBar(20,250,150,10,0xEEEEEE); |
1455 | /* kos_DrawBar(20,250,150,10,0xEEEEEE); |
1456 | kos_WriteTextToWindow(20,250,0x80, 0 ,"Button",0); |
1456 | kos_WriteTextToWindow(20,250,0x80, 0 ,"Button",0); |
1457 | kos_DisplayNumberToWindow(keyCode,3,70,250,0x0000FF,nbDecimal,false); */ |
1457 | kos_DisplayNumberToWindow(keyCode,3,70,250,0x0000FF,nbDecimal,false); */ |
1458 | break; |
1458 | break; |
1459 | case 3: |
1459 | case 3: |
1460 | 1460 | ||
1461 | app_halt(); |
1461 | app_halt(); |
1462 | break; |
1462 | break; |
1463 | } |
1463 | } |
1464 | } |
1464 | } |
1465 | } |
1465 | } |
1466 | 1466 | ||
1467 | // Êîíåö èñõîäíèêà ;-)19){ |
1467 | // Êîíåö èñõîäíèêà ;-)19){ |
1468 | >19){ |
1468 | >19){ |
1469 | >576;tmpcc1++){ |
1469 | >576;tmpcc1++){ |
1470 | 1470 | ||
1471 | >576;tmpcc1++){ |
1471 | >576;tmpcc1++){ |
1472 | 1472 | ||
1473 | >576;tmpcc1++){ |
1473 | >576;tmpcc1++){ |
1474 | 1474 | ||
1475 | >576;tmpcc1++){ |
1475 | >576;tmpcc1++){ |
1476 | 1476 | ||
1477 | >576;tmpcc1++){ |
1477 | >576;tmpcc1++){ |
1478 | 1478 | ||
1479 | >576;tmpcc1++){ |
1479 | >576;tmpcc1++){ |
1480 | 1480 | ||
1481 | >576;tmpcc1++){ |
1481 | >576;tmpcc1++){ |
1482 | 1482 | ||
1483 | >576;tmpcc1++){ |
1483 | >576;tmpcc1++){ |
1484 | 1484 | ||
1485 | >20;chkx++){ |
1485 | >20;chkx++){ |
1486 | >20;chky++){ |
1486 | >20;chky++){ |
1487 | >400;tmpcntr++){ |
1487 | >400;tmpcntr++){ |
1488 | >20;txx++){ |
1488 | >20;txx++){ |
1489 | >20;tyy++){ |
1489 | >20;tyy++){ |
1490 | >20;txx++){ |
1490 | >20;txx++){ |
1491 | >20;tyy++){ |
1491 | >20;tyy++){ |
1492 | >20;txx++){ |
1492 | >20;txx++){ |
1493 | >20;tyy++){ |
1493 | >20;tyy++){ |
1494 | >20;txx++){ |
1494 | >20;txx++){ |
1495 | >20;tyy++){ |
1495 | >20;tyy++){ |
1496 | >20;txx++){ |
1496 | >20;txx++){ |
1497 | >20;tyy++){ |
1497 | >20;tyy++){ |
1498 | >20;txx++){ |
1498 | >20;txx++){ |
1499 | >20;tyy++){ |
1499 | >20;tyy++){ |
1500 | >20;txx++){ |
1500 | >20;txx++){ |
1501 | >20;tyy++){ |
1501 | >20;tyy++){ |
1502 | >2>1>26;tmpppx++){ |
1502 | >2>1>26;tmpppx++){ |
1503 | >20;tmpppy++){ |
1503 | >20;tmpppy++){ |
1504 | >26;tmpppx++){ |
1504 | >26;tmpppx++){ |
1505 | >20;tmpppy++){ |
1505 | >20;tmpppy++){ |
1506 | > ¦¬¨â¥> ¦¬¨â¥> ¦¬¨â¥> ¦¬¨â¥> ¦¬¨â¥> ¦¬¨â¥> ¦¬¨â¥>¤«ï>26;tmpppx++){ |
1506 | > ¦¬¨â¥> ¦¬¨â¥> ¦¬¨â¥> ¦¬¨â¥> ¦¬¨â¥> ¦¬¨â¥> ¦¬¨â¥>¤«ï>26;tmpppx++){ |
1507 | >20;tmpppy++){ |
1507 | >20;tmpppy++){ |
1508 | >20;cx++)>20;cy++)>23;tmpp++){ |
1508 | >20;cx++)>20;cy++)>23;tmpp++){ |
1509 | >23;tmpp++){ |
1509 | >23;tmpp++){ |
1510 | >23;tmpp++){ |
1510 | >23;tmpp++){ |
1511 | >23;tmpp++){ |
1511 | >23;tmpp++){ |
1512 | >240;iic++){ |
1512 | >240;iic++){ |
1513 | >576;lc++) |
1513 | >576;lc++) |
1514 | >>=>>>=>> |
1514 | >>=>>>=>> |