vanilla-wow-addons – Blame information for rev 1

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 office 1 function Tetris_stone_is_down_ms_dos (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 --lines um 1 erhöhen
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_ms_dos (r);
25 --eventuell lvlup ?
26 Tetris_lvl_handler_ms_dos ();
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_ms_dos ()
41 --variablen holen und setzen
42 local highscore = Tetris["highscore"]["ms_dos"];
43 local score = Tetris["game"]["score"]["points"];
44 --score speichern
45 if (score > highscore) then
46 Tetris["highscore"]["ms_dos"] = score;
47 Tetris_GF_highscore_Show ();
48 end
49 --ingamestatus ändern
50 Tetris_ingame (0);
51 end
52  
53 function Tetris_newgame_ms_dos ()
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"]=1;
68 --x spalten
69 Tetris["game"]["x"]=10;
70 --y zeilen
71 Tetris["game"]["y"]=20;
72 --x NS spalten
73 Tetris["game"]["NS_x"]=4;
74 --y NS zeilen
75 Tetris["game"]["NS_y"]=3;
76 --nummer des nächsten bausteins
77 Tetris["game"]["s_next"]=0;
78 --nummer des aktuellen bausteins
79 Tetris["game"]["s"]=0;
80 --anz_steine des aktuellen bausteins
81 Tetris["game"]["s_anz_s"]=0;
82 --anz_lagen aktuellen bausteins
83 Tetris["game"]["s_anz_l"]=0;
84 --aktuelle lage des bausteins
85 Tetris["game"]["s_lage"]=0;
86 --x pos des hauptbausteins
87 Tetris["game"]["s_pos_x"]=0;
88 --y pos des hauptbausteins
89 Tetris["game"]["s_pos_y"]=0;
90 --start timer
91 Tetris["game"]["timer"] = 0.5;
92 Tetris["game"]["timer_go"] = 1;
93 --scores
94 Tetris["game"]["score"] = {};
95 Tetris["game"]["score"]["points"]=0;
96 Tetris["game"]["score"]["lvl"]=0;
97 Tetris["game"]["score"]["linie"]=0;
98 Tetris["game"]["stones"] = {
99 1,
100 2,
101 3,
102 4,
103 5,
104 6,
105 7
106 };
107 --grösse des table speichern
108 Tetris["game"]["stones"]["anz_stones"]=table.getn(Tetris["game"]["stones"]);
109 --x spalten
110 Tetris["game"]["x"]=10;
111 --y zeilen
112 Tetris["game"]["y"]=20;
113 Tetris_GF_gamewindow_Clear ();
114 Tetris_ingame(1);
115 Tetris_GF_create ();
116 Tetris_GF_NS_create ();
117 Tetris_fieldlist_create ();
118 Tetris_GF_gamewindow_Update ();
119 Tetris_GF_SetFramesPos();
120 Tetris_new_stone ();
121 Tetris_GF_timer_Update ();
122 Tetris_GF_Titeltext_Update ();
123 Tetris_GF_highscore_Show ();
124 end
125  
126 function Tetris_lvl_handler_ms_dos ()
127  
128 --variablen holen und setzen
129 local lvl = Tetris["game"]["score"]["lvl"];
130 local linie = Tetris["game"]["score"]["linie"];
131 local timer = Tetris["game"]["timer"];
132  
133 if (linie < 11) then
134 lvl = 0;
135 timer = 0.5;
136 end
137 if (linie > 10) then
138 lvl = 1;
139 timer = 0.45;
140 end
141 if (linie > 20) then
142 lvl = 2;
143 timer = 0.40;
144 end
145 if (linie > 30) then
146 lvl = 3;
147 timer = 0.35;
148 end
149 if (linie > 40) then
150 lvl = 4;
151 timer = 0.30;
152 end
153 if (linie > 50) then
154 lvl = 5;
155 timer = 0.25;
156 end
157 if (linie > 60) then
158 lvl = 6;
159 timer = 0.20;
160 end
161 if (linie > 70) then
162 lvl = 7;
163 timer = 0.15;
164 end
165 if (linie > 80) then
166 lvl = 8;
167 timer = 0.10;
168 end
169 if (linie > 90) then
170 lvl = 9;
171 timer = 0.05;
172 end
173 --lvl speichern
174 Tetris["game"]["score"]["lvl"] = lvl;
175 --timer speichern
176 Tetris["game"]["timer"] = timer;
177 end
178  
179 function Tetris_score_handler_ms_dos (r)
180 --r = wie erechnet sich die score
181 -- d = instant drop
182 -- timer = normaler fall durch timer
183 local score = Tetris["game"]["score"]["points"];
184 local lvl = Tetris["game"]["score"]["lvl"];
185 local s_plus = 0;
186  
187 if (lvl == 0) then
188 if (r == "timer") then
189 s_plus = 6;
190 else
191 s_plus = 24;
192 end
193 end
194 if (lvl == 1) then
195 if (r == "timer") then
196 s_plus = 9;
197 else
198 s_plus = 27;
199 end
200 end
201 if (lvl == 2) then
202 if (r == "timer") then
203 s_plus = 12;
204 else
205 s_plus = 30;
206 end
207 end
208 if (lvl == 3) then
209 if (r == "timer") then
210 s_plus = 15;
211 else
212 s_plus = 33;
213 end
214 end
215 if (lvl == 4) then
216 if (r == "timer") then
217 s_plus = 18;
218 else
219 s_plus = 36;
220 end
221 end
222 if (lvl == 5) then
223 if (r == "timer") then
224 s_plus = 21;
225 else
226 s_plus = 39;
227 end
228 end
229 if (lvl == 6) then
230 if (r == "timer") then
231 s_plus = 24;
232 else
233 s_plus = 42;
234 end
235 end
236 if (lvl == 7) then
237 if (r == "timer") then
238 s_plus = 27;
239 else
240 s_plus = 45;
241 end
242 end
243 if (lvl == 8) then
244 if (r == "timer") then
245 s_plus = 30;
246 else
247 s_plus = 48;
248 end
249 end
250 if (lvl == 9) then
251 if (r == "timer") then
252 s_plus = 33;
253 else
254 s_plus = 51;
255 end
256 end
257 --neue score speichern
258 Tetris["game"]["score"]["points"] = score+s_plus;
259 end
260  
261 function Tetris_gameresume_ms_dos ()
262 Tetris_GF_NS_create ();
263 Tetris_GF_NS_Clear ();
264 Tetris_GF_NS_Show ();
265 Tetris_GF_create ();
266 Tetris_GF_gamewindow_Update ();
267 Tetris_GF_SetFramesPos();
268 Tetris_GF_timer_Update ();
269 Tetris_GF_Titeltext_Update ();
270 Tetris_GF_Text_Score_Update ();
271 Tetris_GF_highscore_Show ();
272 Tetris_gost_stone ();
273 Tetris_GF_gamewindow_falling_stone_Show ();
274 end
275