vanilla-wow-addons – Blame information for rev 1

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 office 1 function Tetris_stone_is_down_highest_hopes (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_highest_hopes (r, lines);
25 --eventuell lvlup ?
26 Tetris_lvl_handler_highest_hopes ();
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_highest_hopes ()
41 --variablen holen und setzen
42 local highscore = Tetris["highscore"]["highest_hopes"];
43 local score = Tetris["game"]["score"]["points"];
44 --score speichern
45 if (score > highscore) then
46 Tetris["highscore"]["highest_hopes"] = score;
47 Tetris_GF_highscore_Show ();
48 end
49 --ingamestatus ändern
50 Tetris_ingame (0);
51 end
52  
53 function Tetris_newgame_highest_hopes ()
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"]=4;
68 --x spalten
69 Tetris["game"]["x"]=5;
70 --y zeilen
71 Tetris["game"]["y"]=40;
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 2,
100 7,
101 10,
102 11,
103 12,
104 13,
105 14,
106 15,
107 16,
108 17,
109 18
110 };
111 --grösse des table speichern
112 Tetris["game"]["stones"]["anz_stones"]=table.getn(Tetris["game"]["stones"]);
113 Tetris_GF_gamewindow_Clear ();
114 Tetris_ingame(1);
115 Tetris_GF_create ();
116 Tetris_GF_NS_create ();
117 Tetris_fieldlist_create ();
118 Tetris_creat_custom_lines (20);
119 Tetris_GF_gamewindow_Update ();
120 Tetris_GF_SetFramesPos();
121 Tetris_new_stone ();
122 Tetris_GF_timer_Update ();
123 Tetris_GF_Titeltext_Update ();
124 Tetris_GF_highscore_Show ();
125 end
126  
127 function Tetris_lvl_handler_highest_hopes ()
128  
129 --variablen holen und setzen
130 local lvl = Tetris["game"]["score"]["lvl"];
131 local linie = Tetris["game"]["score"]["linie"];
132 local timer = Tetris["game"]["timer"];
133  
134 if (linie < 6) then
135 lvl = 0;
136 timer = 0.5;
137 end
138 if (linie > 5) then
139 lvl = 1;
140 timer = 0.45;
141 end
142 if (linie > 10) then
143 lvl = 2;
144 timer = 0.40;
145 end
146 if (linie > 15) then
147 lvl = 3;
148 timer = 0.35;
149 end
150 if (linie > 20) then
151 lvl = 4;
152 timer = 0.30;
153 end
154 if (linie > 25) then
155 lvl = 5;
156 timer = 0.25;
157 end
158 if (linie > 30) then
159 lvl = 6;
160 timer = 0.20;
161 end
162 if (linie > 35) then
163 lvl = 7;
164 timer = 0.15;
165 end
166 if (linie > 40) then
167 lvl = 8;
168 timer = 0.10;
169 end
170 if (linie > 45) then
171 lvl = 9;
172 timer = 0.05;
173 end
174 if (linie > 50) then
175 lvl = 10;
176 timer = 0.04;
177 end
178 if (linie > 55) then
179 lvl = 11;
180 timer = 0.03;
181 end
182 if (linie > 60) then
183 lvl = 12;
184 timer = 0.025;
185 end
186 if (linie > 65) then
187 lvl = 13;
188 timer = 0.02;
189 end
190 if (linie > 70) then
191 lvl = 14;
192 timer = 0.015;
193 end
194 --lvl speichern
195 Tetris["game"]["score"]["lvl"] = lvl;
196 --timer speichern
197 Tetris["game"]["timer"] = timer;
198 end
199  
200 function Tetris_score_handler_highest_hopes (r, l)
201 --r = wie erechnet sich die score
202 -- d = instant drop
203 -- timer = normaler fall durch timer
204 --l = anzahl der linien die vollständig sind
205 local score = Tetris["game"]["score"]["points"];
206 local lvl = Tetris["game"]["score"]["lvl"];
207 local s_plus = 0;
208  
209 if (l == 1) then
210 s_plus = 1+lvl;
211 end
212 if (l == 2) then
213 s_plus = 3+lvl;
214 end
215 if (l == 3) then
216 s_plus = 6+lvl;
217 end
218 if (l == 4) then
219 s_plus = 10+lvl;
220 end
221  
222 if (r == "timer") then
223 s_plus = s_plus+1;
224 else
225 s_plus = s_plus+1+2;
226 end
227  
228 --neue score speichern
229 Tetris["game"]["score"]["points"] = score+s_plus;
230 end
231  
232 function Tetris_gameresume_highest_hopes ()
233 Tetris_GF_NS_create ();
234 Tetris_GF_NS_Clear ();
235 Tetris_GF_NS_Show ();
236 Tetris_GF_create ();
237 Tetris_GF_gamewindow_Update ();
238 Tetris_GF_SetFramesPos();
239 Tetris_GF_timer_Update ();
240 Tetris_GF_Titeltext_Update ();
241 Tetris_GF_Text_Score_Update ();
242 Tetris_GF_highscore_Show ();
243 Tetris_gost_stone ();
244 Tetris_GF_gamewindow_falling_stone_Show ();
245 end
246