vanilla-wow-addons – Blame information for rev 1
?pathlinks?
Rev | Author | Line No. | Line |
---|---|---|---|
1 | office | 1 | function Tetris_stone_is_down_retris (r) |
2 | local linie = Tetris["game"]["score"]["linie"]; |
||
3 | local lines = 0; |
||
4 | --stein in feldliste speichern |
||
5 | Tetris_save_stone (); |
||
6 | --überprüfen ob eine linie komplett ist |
||
7 | while 1 do |
||
8 | local ergebnis = Tetris_complet_zeile_test (); |
||
9 | if (ergebnis == 0) then |
||
10 | break |
||
11 | else |
||
12 | --linie löschen und steine runterfallen lassen |
||
13 | Tetris_delet_line (ergebnis); |
||
14 | --linie um 1 erhöhen |
||
15 | linie = linie + 1; |
||
16 | --anzahl der linien speichern |
||
17 | lines = lines +1; |
||
18 | Tetris_GF_gamewindow_Update (); |
||
19 | end |
||
20 | end |
||
21 | --linie speichern |
||
22 | Tetris["game"]["score"]["linie"] = linie ; |
||
23 | --score berechnen |
||
24 | Tetris_score_handler_retris (r, lines); |
||
25 | --eventuell lvlup ? |
||
26 | Tetris_lvl_handler_retris (); |
||
27 | Tetris_new_stone (); |
||
28 | --sound |
||
29 | if (lines == 4) then |
||
30 | Tetris_play_sound ("tet"); |
||
31 | else |
||
32 | if (lines == 0) then |
||
33 | Tetris_play_sound ("d"); |
||
34 | else |
||
35 | Tetris_play_sound ("dl"); |
||
36 | end |
||
37 | end |
||
38 | end |
||
39 | |||
40 | function Tetris_gameover_retris () |
||
41 | --variablen holen und setzen |
||
42 | local highscore = Tetris["highscore"]["retris"]; |
||
43 | local score = Tetris["game"]["score"]["points"]; |
||
44 | --score speichern |
||
45 | if (score > highscore) then |
||
46 | Tetris["highscore"]["retris"] = score; |
||
47 | Tetris_GF_highscore_Show (); |
||
48 | end |
||
49 | --ingamestatus ändern |
||
50 | Tetris_ingame (0); |
||
51 | end |
||
52 | |||
53 | function Tetris_newgame_retris () |
||
54 | local ingame = Tetris["ingame"]; |
||
55 | if (ingame == 1) then |
||
56 | Tetris_gameover (); |
||
57 | end |
||
58 | --alles reseten |
||
59 | Tetris["game"]= { }; |
||
60 | Tetris["game"]["feld"]= { }; |
||
61 | Tetris["game"]["s_temp"]= { }; |
||
62 | Tetris["game"]["s_temp"]["temp"]= { }; |
||
63 | Tetris["game"]["s_NS_temp"]= { }; |
||
64 | Tetris["game"]["s_gost"] = { }; |
||
65 | Tetris["game"]["s_gost"]["temp"] = { }; |
||
66 | --spiel typ |
||
67 | Tetris["game"]["gametyp"]=3; |
||
68 | Tetris["game"]["gametypc"]=0; |
||
69 | --x spalten |
||
70 | Tetris["game"]["x"]=30; |
||
71 | --y zeilen |
||
72 | Tetris["game"]["y"]=40; |
||
73 | --x NS spalten |
||
74 | Tetris["game"]["NS_x"]=4; |
||
75 | --y NS zeilen |
||
76 | Tetris["game"]["NS_y"]=3; |
||
77 | --nummer des nächsten bausteins |
||
78 | Tetris["game"]["s_next"]=0; |
||
79 | --nummer des aktuellen bausteins |
||
80 | Tetris["game"]["s"]=0; |
||
81 | --anz_steine des aktuellen bausteins |
||
82 | Tetris["game"]["s_anz_s"]=0; |
||
83 | --anz_lagen aktuellen bausteins |
||
84 | Tetris["game"]["s_anz_l"]=0; |
||
85 | --aktuelle lage des bausteins |
||
86 | Tetris["game"]["s_lage"]=0; |
||
87 | --x pos des hauptbausteins |
||
88 | Tetris["game"]["s_pos_x"]=0; |
||
89 | --y pos des hauptbausteins |
||
90 | Tetris["game"]["s_pos_y"]=0; |
||
91 | --start timer |
||
92 | Tetris["game"]["timer"] = 0.5; |
||
93 | Tetris["game"]["timer_go"] = 1; |
||
94 | --scores |
||
95 | Tetris["game"]["score"] = {}; |
||
96 | Tetris["game"]["score"]["points"]=0; |
||
97 | Tetris["game"]["score"]["lvl"]=0; |
||
98 | Tetris["game"]["score"]["linie"]=0; |
||
99 | Tetris["game"]["stones"] = { |
||
100 | 41, |
||
101 | 1, |
||
102 | 2, |
||
103 | 45, |
||
104 | 55, |
||
105 | 39, |
||
106 | 10, |
||
107 | }; |
||
108 | --grösse des table speichern |
||
109 | Tetris["game"]["stones"]["anz_stones"]=table.getn(Tetris["game"]["stones"]); |
||
110 | Tetris_GF_gamewindow_Clear (); |
||
111 | Tetris_ingame(1); |
||
112 | Tetris_GF_create (); |
||
113 | Tetris_GF_NS_create (); |
||
114 | Tetris_fieldlist_create (); |
||
115 | Tetris_creat_custom_lines (6); |
||
116 | Tetris_GF_gamewindow_Update (); |
||
117 | Tetris_GF_SetFramesPos(); |
||
118 | Tetris_new_stone (); |
||
119 | Tetris_GF_timer_Update (); |
||
120 | Tetris_GF_Titeltext_Update (); |
||
121 | Tetris_GF_highscore_Show (); |
||
122 | end |
||
123 | |||
124 | function Tetris_lvl_handler_retris () |
||
125 | |||
126 | --variablen holen und setzen |
||
127 | local level = Tetris["game"]["score"]["lvl"]; |
||
128 | local linie = Tetris["game"]["score"]["linie"]; |
||
129 | local timer = Tetris["game"]["timer"]; |
||
130 | local lvl = nil; |
||
131 | if (linie < 9) then |
||
132 | lvl = 0; |
||
133 | timer = 0.5; |
||
134 | end |
||
135 | if (linie > 8) then |
||
136 | lvl = 1; |
||
137 | timer = 0.49; |
||
138 | end |
||
139 | if (linie > 16) then |
||
140 | lvl = 2; |
||
141 | timer = 0.48; |
||
142 | end |
||
143 | if (linie > 24) then |
||
144 | lvl = 3; |
||
145 | timer = 0.47; |
||
146 | end |
||
147 | if (linie > 32) then |
||
148 | lvl = 4; |
||
149 | timer = 0.46; |
||
150 | end |
||
151 | if (linie > 40) then |
||
152 | lvl = 5; |
||
153 | timer = 0.45; |
||
154 | end |
||
155 | if (linie > 48) then |
||
156 | lvl = 6; |
||
157 | timer = 0.44; |
||
158 | end |
||
159 | if (linie > 56) then |
||
160 | lvl = 7; |
||
161 | timer = 0.43; |
||
162 | end |
||
163 | if (linie > 64) then |
||
164 | lvl = 8; |
||
165 | timer = 0.42; |
||
166 | end |
||
167 | if (linie > 72) then |
||
168 | lvl = 9; |
||
169 | timer = 0.41; |
||
170 | end |
||
171 | if (linie > 80) then |
||
172 | lvl = 10; |
||
173 | timer = 0.40; |
||
174 | end |
||
175 | if (linie > 88) then |
||
176 | lvl = 11; |
||
177 | timer = 0.39; |
||
178 | end |
||
179 | if (linie > 96) then |
||
180 | lvl = 12; |
||
181 | timer = 0.38; |
||
182 | end |
||
183 | if (linie > 104) then |
||
184 | lvl = 13; |
||
185 | timer = 0.37; |
||
186 | end |
||
187 | if (linie > 112) then |
||
188 | lvl = 14; |
||
189 | timer = 0.36; |
||
190 | end |
||
191 | if (linie > 120) then |
||
192 | lvl = 15; |
||
193 | timer = 0.35; |
||
194 | end |
||
195 | if (linie > 128) then |
||
196 | lvl = 16; |
||
197 | timer = 0.34; |
||
198 | end |
||
199 | if (linie > 136) then |
||
200 | lvl = 17; |
||
201 | timer = 0.33; |
||
202 | end |
||
203 | if (linie > 144) then |
||
204 | lvl = 18; |
||
205 | timer = 0.32; |
||
206 | end |
||
207 | if (linie > 152) then |
||
208 | lvl = 19; |
||
209 | timer = 0.31; |
||
210 | end |
||
211 | if (linie > 160) then |
||
212 | lvl = 20; |
||
213 | timer = 0.30; |
||
214 | end |
||
215 | if (linie > 168) then |
||
216 | lvl = 21; |
||
217 | timer = 0.29; |
||
218 | end |
||
219 | if (linie > 176) then |
||
220 | lvl = 22; |
||
221 | timer = 0.28; |
||
222 | end |
||
223 | if (linie > 184) then |
||
224 | lvl = 23; |
||
225 | timer = 0.27; |
||
226 | end |
||
227 | if (linie > 192) then |
||
228 | lvl = 24; |
||
229 | timer = 0.26; |
||
230 | end |
||
231 | if (linie > 200) then |
||
232 | lvl = 25; |
||
233 | timer = 0.25; |
||
234 | end |
||
235 | if (linie > 208) then |
||
236 | lvl = 26; |
||
237 | timer = 0.24; |
||
238 | end |
||
239 | if (linie > 216) then |
||
240 | lvl = 27; |
||
241 | timer = 0.23; |
||
242 | end |
||
243 | if (linie > 224) then |
||
244 | lvl = 28; |
||
245 | timer = 0.22; |
||
246 | end |
||
247 | if (linie > 232) then |
||
248 | lvl = 29; |
||
249 | timer = 0.21; |
||
250 | end |
||
251 | if (linie > 240) then |
||
252 | lvl = 30; |
||
253 | timer = 0.20; |
||
254 | end |
||
255 | if (linie > 248) then |
||
256 | lvl = 31; |
||
257 | timer = 0.19; |
||
258 | end |
||
259 | if (linie > 256) then |
||
260 | lvl = 32; |
||
261 | timer = 0.18; |
||
262 | end |
||
263 | if (linie > 264) then |
||
264 | lvl = 33; |
||
265 | timer = 0.17; |
||
266 | end |
||
267 | if (linie > 272) then |
||
268 | lvl = 34; |
||
269 | timer = 0.16; |
||
270 | end |
||
271 | if (linie > 280) then |
||
272 | lvl = 35; |
||
273 | timer = 0.15; |
||
274 | end |
||
275 | if (linie > 288) then |
||
276 | lvl = 36; |
||
277 | timer = 0.14; |
||
278 | end |
||
279 | if (linie > 296) then |
||
280 | lvl = 37; |
||
281 | timer = 0.13; |
||
282 | end |
||
283 | if (linie > 304) then |
||
284 | lvl = 38; |
||
285 | timer = 0.12; |
||
286 | end |
||
287 | if (linie > 312) then |
||
288 | lvl = 39; |
||
289 | timer = 0.11; |
||
290 | end |
||
291 | if (linie > 320) then |
||
292 | lvl = 40; |
||
293 | timer = 0.10; |
||
294 | end |
||
295 | |||
296 | --wenn es ein levelveränderung gab, neue steine |
||
297 | if ((level ~= lvl) and (Tetris["game"]["gametypc"]~=1)) then |
||
298 | Tetris_stone_handler_retris (lvl); |
||
299 | end |
||
300 | |||
301 | --lvl speichern |
||
302 | Tetris["game"]["score"]["lvl"] = lvl; |
||
303 | --timer speichern |
||
304 | Tetris["game"]["timer"] = timer; |
||
305 | end |
||
306 | |||
307 | function Tetris_stone_handler_retris (lvl) |
||
308 | --lvl = das aktuelle level |
||
309 | if (lvl == 1) then |
||
310 | local s1 = 24; |
||
311 | local s2 = 25; |
||
312 | |||
313 | table.insert(Tetris["game"]["stones"], s1) |
||
314 | table.insert(Tetris["game"]["stones"], s2) |
||
315 | --grösse des table speichern |
||
316 | Tetris["game"]["stones"]["anz_stones"]=table.getn(Tetris["game"]["stones"]); |
||
317 | end |
||
318 | |||
319 | if (lvl == 2) then |
||
320 | local s1 = 28; |
||
321 | local s2 = 29; |
||
322 | |||
323 | table.insert(Tetris["game"]["stones"], s1) |
||
324 | table.insert(Tetris["game"]["stones"], s2) |
||
325 | --grösse des table speichern |
||
326 | Tetris["game"]["stones"]["anz_stones"]=table.getn(Tetris["game"]["stones"]); |
||
327 | end |
||
328 | if (lvl == 3) then |
||
329 | local s1 = 46; |
||
330 | local s2 = 11; |
||
331 | |||
332 | table.insert(Tetris["game"]["stones"], s1) |
||
333 | table.insert(Tetris["game"]["stones"], s2) |
||
334 | --grösse des table speichern |
||
335 | Tetris["game"]["stones"]["anz_stones"]=table.getn(Tetris["game"]["stones"]); |
||
336 | end |
||
337 | if (lvl == 4) then |
||
338 | local s1 = 5; |
||
339 | local s2 = 6; |
||
340 | |||
341 | table.insert(Tetris["game"]["stones"], s1) |
||
342 | table.insert(Tetris["game"]["stones"], s2) |
||
343 | --grösse des table speichern |
||
344 | Tetris["game"]["stones"]["anz_stones"]=table.getn(Tetris["game"]["stones"]); |
||
345 | end |
||
346 | if (lvl == 5) then |
||
347 | local s1 = 3; |
||
348 | local s2 = 4; |
||
349 | |||
350 | table.insert(Tetris["game"]["stones"], s1) |
||
351 | table.insert(Tetris["game"]["stones"], s2) |
||
352 | --grösse des table speichern |
||
353 | Tetris["game"]["stones"]["anz_stones"]=table.getn(Tetris["game"]["stones"]); |
||
354 | end |
||
355 | if (lvl == 6) then |
||
356 | local s1 = 17; |
||
357 | local s2 = 12; |
||
358 | |||
359 | table.insert(Tetris["game"]["stones"], s1) |
||
360 | table.insert(Tetris["game"]["stones"], s2) |
||
361 | --grösse des table speichern |
||
362 | Tetris["game"]["stones"]["anz_stones"]=table.getn(Tetris["game"]["stones"]); |
||
363 | end |
||
364 | if (lvl == 7) then |
||
365 | local s1 = 37; |
||
366 | local s2 = 38; |
||
367 | |||
368 | table.insert(Tetris["game"]["stones"], s1) |
||
369 | table.insert(Tetris["game"]["stones"], s2) |
||
370 | --grösse des table speichern |
||
371 | Tetris["game"]["stones"]["anz_stones"]=table.getn(Tetris["game"]["stones"]); |
||
372 | end |
||
373 | if (lvl == 8) then |
||
374 | local s1 = 44; |
||
375 | local s2 = 45; |
||
376 | |||
377 | table.insert(Tetris["game"]["stones"], s1) |
||
378 | table.insert(Tetris["game"]["stones"], s2) |
||
379 | --grösse des table speichern |
||
380 | Tetris["game"]["stones"]["anz_stones"]=table.getn(Tetris["game"]["stones"]); |
||
381 | end |
||
382 | if (lvl == 9) then |
||
383 | local s1 = 7; |
||
384 | local s2 = 13; |
||
385 | |||
386 | table.insert(Tetris["game"]["stones"], s1) |
||
387 | table.insert(Tetris["game"]["stones"], s2) |
||
388 | --grösse des table speichern |
||
389 | Tetris["game"]["stones"]["anz_stones"]=table.getn(Tetris["game"]["stones"]); |
||
390 | end |
||
391 | if (lvl == 10) then |
||
392 | local s1 = 14; |
||
393 | local s2 = 18; |
||
394 | |||
395 | table.insert(Tetris["game"]["stones"], s1) |
||
396 | table.insert(Tetris["game"]["stones"], s2) |
||
397 | --grösse des table speichern |
||
398 | Tetris["game"]["stones"]["anz_stones"]=table.getn(Tetris["game"]["stones"]); |
||
399 | end |
||
400 | if (lvl == 11) then |
||
401 | local s1 = 15; |
||
402 | local s2 = 16; |
||
403 | |||
404 | table.insert(Tetris["game"]["stones"], s1) |
||
405 | table.insert(Tetris["game"]["stones"], s2) |
||
406 | --grösse des table speichern |
||
407 | Tetris["game"]["stones"]["anz_stones"]=table.getn(Tetris["game"]["stones"]); |
||
408 | end |
||
409 | if (lvl == 12) then |
||
410 | local s1 = 19; |
||
411 | local s2 = 26; |
||
412 | |||
413 | table.insert(Tetris["game"]["stones"], s1) |
||
414 | table.insert(Tetris["game"]["stones"], s2) |
||
415 | --grösse des table speichern |
||
416 | Tetris["game"]["stones"]["anz_stones"]=table.getn(Tetris["game"]["stones"]); |
||
417 | end |
||
418 | if (lvl == 13) then |
||
419 | local s1 = 30; |
||
420 | local s2 = 31; |
||
421 | |||
422 | table.insert(Tetris["game"]["stones"], s1) |
||
423 | table.insert(Tetris["game"]["stones"], s2) |
||
424 | --grösse des table speichern |
||
425 | Tetris["game"]["stones"]["anz_stones"]=table.getn(Tetris["game"]["stones"]); |
||
426 | end |
||
427 | if (lvl == 14) then |
||
428 | local s1 = 32; |
||
429 | local s2 = 33; |
||
430 | |||
431 | table.insert(Tetris["game"]["stones"], s1) |
||
432 | table.insert(Tetris["game"]["stones"], s2) |
||
433 | --grösse des table speichern |
||
434 | Tetris["game"]["stones"]["anz_stones"]=table.getn(Tetris["game"]["stones"]); |
||
435 | end |
||
436 | if (lvl == 15) then |
||
437 | local s1 = 58; |
||
438 | local s2 = 59; |
||
439 | |||
440 | table.insert(Tetris["game"]["stones"], s1) |
||
441 | table.insert(Tetris["game"]["stones"], s2) |
||
442 | --grösse des table speichern |
||
443 | Tetris["game"]["stones"]["anz_stones"]=table.getn(Tetris["game"]["stones"]); |
||
444 | end |
||
445 | if (lvl == 16) then |
||
446 | local s1 = 34; |
||
447 | local s2 = 39; |
||
448 | |||
449 | table.insert(Tetris["game"]["stones"], s1) |
||
450 | table.insert(Tetris["game"]["stones"], s2) |
||
451 | --grösse des table speichern |
||
452 | Tetris["game"]["stones"]["anz_stones"]=table.getn(Tetris["game"]["stones"]); |
||
453 | end |
||
454 | if (lvl == 17) then |
||
455 | local s1 = 47; |
||
456 | local s2 = 48; |
||
457 | |||
458 | table.insert(Tetris["game"]["stones"], s1) |
||
459 | table.insert(Tetris["game"]["stones"], s2) |
||
460 | --grösse des table speichern |
||
461 | Tetris["game"]["stones"]["anz_stones"]=table.getn(Tetris["game"]["stones"]); |
||
462 | end |
||
463 | if (lvl == 18) then |
||
464 | local s1 = 22; |
||
465 | local s2 = 23; |
||
466 | |||
467 | table.insert(Tetris["game"]["stones"], s1) |
||
468 | table.insert(Tetris["game"]["stones"], s2) |
||
469 | --grösse des table speichern |
||
470 | Tetris["game"]["stones"]["anz_stones"]=table.getn(Tetris["game"]["stones"]); |
||
471 | end |
||
472 | if (lvl == 19) then |
||
473 | local s1 = 35; |
||
474 | local s2 = 36; |
||
475 | |||
476 | table.insert(Tetris["game"]["stones"], s1) |
||
477 | table.insert(Tetris["game"]["stones"], s2) |
||
478 | --grösse des table speichern |
||
479 | Tetris["game"]["stones"]["anz_stones"]=table.getn(Tetris["game"]["stones"]); |
||
480 | end |
||
481 | if (lvl == 20) then |
||
482 | local s1 = 43; |
||
483 | local s2 = 27; |
||
484 | |||
485 | table.insert(Tetris["game"]["stones"], s1) |
||
486 | table.insert(Tetris["game"]["stones"], s2) |
||
487 | --grösse des table speichern |
||
488 | Tetris["game"]["stones"]["anz_stones"]=table.getn(Tetris["game"]["stones"]); |
||
489 | end |
||
490 | if (lvl == 21) then |
||
491 | local s1 = 56; |
||
492 | local s2 = 57; |
||
493 | |||
494 | table.insert(Tetris["game"]["stones"], s1) |
||
495 | table.insert(Tetris["game"]["stones"], s2) |
||
496 | --grösse des table speichern |
||
497 | Tetris["game"]["stones"]["anz_stones"]=table.getn(Tetris["game"]["stones"]); |
||
498 | end |
||
499 | if (lvl == 22) then |
||
500 | local s1 = 20; |
||
501 | local s2 = 40; |
||
502 | |||
503 | table.insert(Tetris["game"]["stones"], s1) |
||
504 | table.insert(Tetris["game"]["stones"], s2) |
||
505 | --grösse des table speichern |
||
506 | Tetris["game"]["stones"]["anz_stones"]=table.getn(Tetris["game"]["stones"]); |
||
507 | end |
||
508 | |||
509 | |||
510 | end |
||
511 | |||
512 | |||
513 | function Tetris_score_handler_retris (r, l) |
||
514 | --r = wie erechnet sich die score |
||
515 | -- d = instant drop |
||
516 | -- timer = normaler fall durch timer |
||
517 | --l = anzahl der linien die vollständig sind |
||
518 | local score = Tetris["game"]["score"]["points"]; |
||
519 | local lvl = Tetris["game"]["score"]["lvl"]; |
||
520 | local s_plus = 0; |
||
521 | |||
522 | if (l == 1) then |
||
523 | s_plus = 1+lvl; |
||
524 | end |
||
525 | if (l == 2) then |
||
526 | s_plus = 3+lvl; |
||
527 | end |
||
528 | if (l == 3) then |
||
529 | s_plus = 7+lvl; |
||
530 | end |
||
531 | if (l == 4) then |
||
532 | s_plus = 20+(lvl*2); |
||
533 | end |
||
534 | |||
535 | if (r == "timer") then |
||
536 | s_plus = s_plus+1; |
||
537 | else |
||
538 | s_plus = s_plus+1+2; |
||
539 | end |
||
540 | |||
541 | --neue score speichern |
||
542 | Tetris["game"]["score"]["points"] = score+s_plus; |
||
543 | end |
||
544 | |||
545 | function Tetris_gameresume_retris () |
||
546 | Tetris_GF_NS_create (); |
||
547 | Tetris_GF_NS_Clear (); |
||
548 | Tetris_GF_NS_Show (); |
||
549 | Tetris_GF_create (); |
||
550 | Tetris_GF_gamewindow_Update (); |
||
551 | Tetris_GF_SetFramesPos(); |
||
552 | Tetris_GF_timer_Update (); |
||
553 | Tetris_GF_Titeltext_Update (); |
||
554 | Tetris_GF_Text_Score_Update (); |
||
555 | Tetris_GF_highscore_Show (); |
||
556 | Tetris_gost_stone (); |
||
557 | Tetris_GF_gamewindow_falling_stone_Show (); |
||
558 | end |
||
559 |