Subversion Repositories Kolibri OS

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
5312 Anton_K 1
 
2
3
 
4
5
 
6
.Height = 25
7
8
 
9
w equ level1.OtherWall
10
_ equ level1.PassableArea
11
0 equ level1.NotPassableArea
12
 
13
I equ level1.IronDoor
14
L equ level1.WallWithLever1
15
q equ level1.WallWithLever2
16
v equ level1.WallWithLever3
17
e equ level1.WallWithLever4
18
c equ level1.ColumnArea
19
o equ level1.OgreArea
20
P equ level1.PortalArea
21
22
 
23
dd W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,W
24
dd W,_,_,W,W,_,_,W,_,W,_,W,_,_,_,_,W,W,W,W,W,W,W,W
25
dd W,_,_,W,W,_,_,W,_,W,_,W,_,_,_,_,_,_,_,_,_,_,_,W
26
dd W,_,_,_,_,_,_,W,_,W,_,W,_,_,_,_,_,_,_,_,_,_,_,W
27
dd W,W,W,_,_,W,W,W,_,W,L,W,_,_,_,W,W,W,_,_,_,W,W,W
28
dd W,_,_,_,_,_,_,W,_,_,_,W,_,_,_,W,0,W,_,_,_,W,0,W
29
dd W,_,W,_,W,_,_,W,_,W,W,W,W,W,_,W,c,_,_,_,_,_,c,W
30
dd W,_,W,_,W,_,_,W,_,W,W,W,W,W,_,W,_,_,_,c,_,_,_,W
31
dd W,W,W,_,W,W,W,W,%,W,W,W,W,W,_,W,_,_,W,0,W,_,_,W
32
dd W,_,W,_,W,_,_,_,_,_,_,_,W,W,_,W,_,_,W,W,W,_,_,W
33
dd W,_,W,W,W,_,_,_,_,_,_,_,I,_,_,W,_,_,_,_,_,_,_,W
34
dd W,_,_,_,W,_,_,_,_,_,_,_,W,W,W,W,W,W,W,W,W,%,W,W
35
dd W,_,_,_,W,W,W,W,q,v,e,W,W,_,_,_,_,_,_,_,_,_,_,W
36
dd W,_,_,_,_,_,_,_,_,_,_,_,W,_,W,W,W,W,W,W,W,W,W,W
37
dd W,_,_,_,W,_,_,_,_,_,_,_,W,o,W,_,_,_,_,_,_,_,_,W
38
dd W,_,_,_,W,W,W,W,W,W,W,W,W,0,W,W,W,W,_,_,_,_,_,W
39
dd W,_,_,_,W,_,_,_,_,_,_,W,_,_,_,_,_,W,w,w,w,w,w,w
40
dd W,_,_,_,_,_,_,_,_,_,_,W,_,_,_,_,_,_,_,_,_,_,_,w
41
dd W,_,_,_,_,_,_,_,_,_,_,W,W,W,W,W,_,w,w,_,w,w,_,w
42
dd W,_,_,_,_,_,_,_,_,_,_,_,_,_,_,w,_,w,_,_,_,w,_,w
43
dd W,_,_,_,_,_,_,_,_,_,_,_,_,_,_,w,_,_,_,P,_,_,_,w
44
dd W,_,_,_,_,_,_,_,_,_,_,_,_,_,_,w,_,w,_,_,_,w,_,w
45
dd W,_,_,_,_,_,_,_,_,_,_,_,_,_,_,w,_,w,w,_,w,w,_,w
46
dd W,_,_,_,_,_,_,_,_,_,_,_,_,_,_,w,_,_,_,_,_,_,_,w
47
dd W,W,W,W,W,W,W,W,W,W,W,W,W,W,W,w,w,w,w,w,w,w,w,w
48
49
 
50
51
 
52
.Column1                akode.Object            textures.Column1, <16, 5>, 1, 0
53
.Column2                akode.Object            textures.Column2, <19, 8>, 1, 0
54
.Column3                akode.Object            textures.Column3, <22, 5>, 1, 0
55
.Ogre                   akode.Object            textures.Ogre, <13, 15>, 1, 0
56
.Portal                 akode.Object            textures.Portal, <19, 20>, 1, 1
57
58
 
59
60
 
61
                                                , \
62
                                                , \
63
                                                , \
64
                                                <0, 0>,                    \
65
                                                <0, 0>,                    \
66
                                                0, 0
67
68
 
69
                                                , \
70
                                                , \
71
                                                , \
72
                                                <0, 0>,                    \
73
                                                <0, 0>,                    \
74
                                                0, 0
75
76
 
77
                                                , \
78
                                                , \
79
                                                , \
80
                                                <0, 0>,                                         \
81
                                                <0, 0>,                                         \
82
                                                0, 0
83
84
 
85
                                                , \
86
                                                , \
87
                                                , \
88
                                                <0, 0>,                 \
89
                                                <0, 0>,                 \
90
                                                0, 0
91
92
 
93
                                                ,  \
94
                                                ,                      \
95
                                                ,    \
96
                                                <0, 0>,                                         \
97
                                                <0, 0>,                                         \
98
                                                0, 0
99
100
 
101
                                                ,    \
102
                                                ,                      \
103
                                                ,  \
104
                                                <0, 0>,                                         \
105
                                                <0, 0>,                                         \
106
                                                0, 0
107
108
 
109
                                                ,    \
110
                                                ,                      \
111
                                                ,  \
112
                                                <0, 0>,                                         \
113
                                                <0, 0>,                                         \
114
                                                0, 0
115
116
 
117
                                                ,    \
118
                                                ,                      \
119
                                                ,  \
120
                                                <0, 0>,                                         \
121
                                                <0, 0>,                                         \
122
                                                0, 0
123
124
 
125
                                                <0, 0>,                     \
126
                                                <0, 0>,                     \
127
                                                <0, 0>,                     \
128
                                                , \
129
                                                , \
130
                                                1, 0
131
132
 
133
                                                <0, 0>,                     \
134
                                                <0, 0>,                     \
135
                                                <0, 0>,                     \
136
                                                , \
137
                                                , \
138
                                                0, 0
139
140
 
141
                                                <0, 0>,                     \
142
                                                <0, 0>,                     \
143
                                                <0, 0>,                     \
144
                                                , \
145
                                                , \
146
                                                1, level1.columns
147
148
 
149
                                                <0, 0>,                     \
150
                                                <0, 0>,                     \
151
                                                <0, 0>,                     \
152
                                                , \
153
                                                , \
154
                                                1, level1.ogre
155
156
 
157
                                                <0, 0>,                     \
158
                                                <0, 0>,                     \
159
                                                <0, 0>,                     \
160
                                                ,  \
161
                                                , \
162
                                                1, level1.portal
163
164
 
165
.Sun1ImagePtr           dd 0
166
.Sun2ImagePtr           dd 0
167
.Sun3ImagePtr           dd 0
168
169
 
170
        stdcall load_object_image, .coin_file_path
171
        mov     [level1.CoinImagePtr], eax
172
        stdcall load_object_image, .sun1_file_path
173
        mov     [level1.Sun1ImagePtr], eax
174
        stdcall load_object_image, .sun2_file_path
175
        mov     [level1.Sun2ImagePtr], eax
176
        stdcall load_object_image, .sun3_file_path
177
        mov     [level1.Sun3ImagePtr], eax
178
179
 
180
        ret
181
182
 
183
.sun1_file_path db 'Resources/Textures/Objects/Sun1.png', 0
184
.sun2_file_path db 'Resources/Textures/Objects/Sun2.png', 0
185
.sun3_file_path db 'Resources/Textures/Objects/Sun3.png', 0
186
187
 
188
'Вы - искатель сокровищ. Тяга к наживе привела вас в    ', 10, \
189
'лесную пещеру, где, по рассказам селян, пару столетий  ', 10, \
190
'назад, один правитель, спрятал свою казну. В пещере вы ', 10, \
191
'нашли... дверь. Усилие - дверь открыта! Вы вошли внутрь', 10, \
192
'и дверь с грохотом захлопнулась. Возможно, это ваш шанс', 10, \
193
'найти несметные богатства или погибнуть...             '      >
194
195
 
196
197
 
198
        mov     eax, [action]
199
        mov     ebx, [cell_x]
200
        mov     ecx, [cell_y]
201
202
 
203
        imul    edx, level1.Width
204
        add     edx, ebx
205
        lea     edx, [level1.Grid + edx * 4]
206
207
 
208
        jne     .check_next_action
209
210
 
211
        jne     @f
212
        cmp     dword [level1.Grid + (8 * level1.Width + 8) * 4], level1.WallWithCrazyWoodDoor
213
        jne     .exit_no_message
214
215
 
216
        jmp     .exit
217
.message_door1_closed                           langstr0 ru, < \
218
'Заперто. У двери нет ни ручки, ни замочной скважины.   ', 10, \
219
'Вероятно, где-то должен быть скрытый механизм...       '      >
220
221
 
222
        jne     @f
223
        cmp     dword [level1.Grid + (11 * level1.Width + 21) * 4], level1.WallWithCrazyWoodDoor
224
        jne     .exit_no_message
225
226
 
227
        jmp     .exit
228
.message_door3_closed                           langstr0 ru, < \
229
'Такую дверь вы уже видели, и в прошлый раз она так     ', 10, \
230
'просто не открылась.                                   '      >
231
232
 
233
        jne     @f
234
        cmp     dword [level1.Grid + (8 * level1.Width + 8) * 4], level1.WallWithCrazyWoodDoor
235
        jne     .exit_no_message
236
237
 
238
        mov     dword [level1.Grid + (8 * level1.Width + 8) * 4], level1.PassableArea
239
240
 
241
        jmp     .exit
242
.message_door1_opens                            langstr0 ru, < \
243
'Вы слышите звук лебёдки и скрежет шестерёнок.          '      >
244
245
 
246
        jne     @f
247
        mov     eax, [level1.WallWithLever2.WallTexture2.DescPtr2]
248
        mov     ebx, [level1.WallWithLever2.WallTexture4.DescPtr2]
249
        mov     [level1.WallWithLever2.WallTexture2.DescPtr2], ebx
250
        mov     [level1.WallWithLever2.WallTexture4.DescPtr2], eax
251
        jmp     .3levers
252
253
 
254
        jne     @f
255
        mov     eax, [level1.WallWithLever3.WallTexture2.DescPtr2]
256
        mov     ebx, [level1.WallWithLever3.WallTexture4.DescPtr2]
257
        mov     [level1.WallWithLever3.WallTexture2.DescPtr2], ebx
258
        mov     [level1.WallWithLever3.WallTexture4.DescPtr2], eax
259
        jmp     .3levers
260
261
 
262
        jne     @f
263
        mov     eax, [level1.WallWithLever4.WallTexture2.DescPtr2]
264
        mov     ebx, [level1.WallWithLever4.WallTexture4.DescPtr2]
265
        mov     [level1.WallWithLever4.WallTexture2.DescPtr2], ebx
266
        mov     [level1.WallWithLever4.WallTexture4.DescPtr2], eax
267
        jmp     .3levers
268
269
 
270
        jne     @f
271
        cmp     dword [level1.Grid + (10 * level1.Width + 12) * 4], level1.IronDoor
272
        jne     .exit_no_message
273
        mov     eax, .message_door2_closed
274
        jmp     .exit
275
276
 
277
278
 
279
        cmp     ax, AKODE_ACTION.CELL_ENTER
280
        jne     .exit_no_message
281
282
 
283
        jne     @f
284
        cmp     [level1.Chest.Visible], 1
285
        jne     .exit_no_message
286
287
 
288
        stdcall add_object_to_inventory, 1, [level1.Sun1ImagePtr]
289
        stdcall add_object_to_inventory, 2, [level1.Sun2ImagePtr]
290
        stdcall add_object_to_inventory, 3, [level1.Sun3ImagePtr]
291
292
 
293
        mov     eax, .message_chest
294
        jmp     .exit
295
.message_chest                                  langstr0 ru, < \
296
'Вы нашли сундук с барахлом: 1 золотой монеткой и       ', 10, \
297
'3-мя монетами с изображением солнца в разных фазах.    '      >
298
299
 
300
        jne     @f
301
        cmp     [level1.Ogre.Visible], 1
302
        jne     .exit_no_message
303
        mov     eax, .message_ogre
304
        jmp     .exit
305
306
 
307
'- Стой! Куда это ты? Дальше хода нет.                  '      >
308
309
 
310
311
 
312
        xor     eax, eax
313
314
 
315
        ret
316
317
 
318
        mov     eax, [level1.WallWithLever2.WallTexture2.DescPtr2]
319
        mov     ebx, [level1.WallWithLever3.WallTexture2.DescPtr2]
320
        mov     ecx, [level1.WallWithLever4.WallTexture2.DescPtr2]
321
322
 
323
        jne     @f
324
        cmp     ebx, textures.RedLeverUp
325
        jne     @f
326
        cmp     ecx, textures.RedLeverDown
327
        jne     @f
328
        mov     dword [level1.Grid + (10 * level1.Width + 12) * 4], level1.PassableArea
329
        mov     eax, .message_door2_opens
330
        jmp     .exit
331
332
 
333
        mov     eax, .message_3levers
334
        jmp     .exit
335
336
 
337
'Вы переставили этот рычаг в другое положение.          '      >
338
.message_door2_closed                           langstr0 ru, < \
339
'Хоть вы и полны сил, но сдвинуть эту дверь хоть на     ', 10, \
340
'миллиметр у вас не получилось.                         '      >
341
.message_door2_opens                            langstr0 ru, < \
342
'До вас донёсся металлический скрежет.                  '      >
343
endp
344
345
 
346
        mov     eax, [action]
347
        cmp     ax, ACTION.USE_OBJECT
348
        jne     .exit_no_message
349
350
 
351
        mov     ebx, eax
352
353
 
354
355
 
356
        jne     @f
357
        cmp     ebx, 1
358
        jne     .exit_no_message
359
        stdcall remove_object_from_inventory, 1
360
        mov     eax, [level1.Column4TextureDescPtr]
361
        mov     [level1.Column1.TextureDescPtr], eax
362
        mov     [level1.Column1.DisableShading], 1
363
        mov     eax, .message_activated
364
        jmp     .exit
365
366
 
367
        jne     @f
368
        cmp     ebx, 2
369
        jne     .exit_no_message
370
        stdcall remove_object_from_inventory, 2
371
        mov     eax, [level1.Column4TextureDescPtr]
372
        mov     [level1.Column2.TextureDescPtr], eax
373
        mov     [level1.Column2.DisableShading], 1
374
        mov     eax, .message_activated
375
        jmp     .exit
376
377
 
378
        jne     @f
379
        cmp     ebx, 3
380
        jne     .exit_no_message
381
        stdcall remove_object_from_inventory, 3
382
        mov     eax, [level1.Column4TextureDescPtr]
383
        mov     [level1.Column3.TextureDescPtr], eax
384
        mov     [level1.Column3.DisableShading], 1
385
        mov     eax, .message_activated
386
        jmp     .exit
387
388
 
389
.exit_no_message:
390
        xor     eax, eax
391
        ret
392
393
 
394
        mov     ecx, [level1.Column1.DisableShading]
395
        and     ecx, [level1.Column2.DisableShading]
396
        and     ecx, [level1.Column3.DisableShading]
397
        jecxz   @f
398
        mov     dword [level1.Grid + (11 * level1.Width + 21) * 4], level1.PassableArea
399
@@:
400
        ret
401
402
 
403
'Колонна начала светиться странным светом, а надпись    ', 10, \
404
'исчезла.'                                                     >
405
endp
406
407
 
408
        mov     eax, [action]
409
410
 
411
        jne     @f
412
        stdcall player_death
413
        xor     eax, eax
414
        jmp     .exit
415
416
 
417
        jne     .exit_default
418
        shr     eax, 16
419
        cmp     eax, 4
420
        jne     .exit_default
421
422
 
423
        mov     [level1.Ogre.Visible], 0
424
        stdcall remove_object_from_inventory, 4
425
        mov     eax, .message_ogre
426
        jmp     .exit
427
428
 
429
        xor     eax, eax
430
        dec     eax
431
.exit:
432
        ret
433
434
 
435
'- Ой! Монетка! А ну вернись!!!                         '      >
436
endp
437
438
 
439
        mov     eax, [action]
440
        cmp     ax, AKODE_ACTION.CELL_ENTER
441
        jne     @f
442
        stdcall game_over
443
@@:
444
        xor     eax, eax
445
        ret
446
endp
447