vanilla-wow-addons – Blame information for rev 1

Subversion Repositories:
Rev:
Rev Author Line No. Line
1 office 1 function Tetris_stone_is_down_gameboy (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_gameboy (r, lines);
25 --eventuell lvlup ?
26 Tetris_lvl_handler_gameboy ();
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_gameboy ()
41 --variablen holen und setzen
42 local highscore = Tetris["highscore"]["gameboy"];
43 local score = Tetris["game"]["score"]["points"];
44 --score speichern
45 if (score > highscore) then
46 Tetris["highscore"]["gameboy"] = score;
47 Tetris_GF_highscore_Show ();
48 end
49 --ingamestatus ändern
50 Tetris_ingame (0);
51 end
52  
53 function Tetris_newgame_gameboy ()
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"]=2;
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 Tetris_GF_gamewindow_Clear ();
110 Tetris_ingame(1);
111 Tetris_GF_create ();
112 Tetris_GF_NS_create ();
113 Tetris_fieldlist_create ();
114 Tetris_GF_gamewindow_Update ();
115 Tetris_GF_SetFramesPos();
116 Tetris_new_stone ();
117 Tetris_GF_timer_Update ();
118 Tetris_GF_Titeltext_Update ();
119 Tetris_GF_highscore_Show ();
120 end
121  
122 function Tetris_lvl_handler_gameboy ()
123  
124 --variablen holen und setzen
125 local lvl = Tetris["game"]["score"]["lvl"];
126 local linie = Tetris["game"]["score"]["linie"];
127 local timer = Tetris["game"]["timer"];
128  
129 if (linie < 26) then
130 lvl = 0;
131 timer = 0.5;
132 end
133 if (linie > 25) then
134 lvl = 1;
135 timer = 0.45;
136 end
137 if (linie > 50) then
138 lvl = 2;
139 timer = 0.40;
140 end
141 if (linie > 75) then
142 lvl = 3;
143 timer = 0.35;
144 end
145 if (linie > 100) then
146 lvl = 4;
147 timer = 0.30;
148 end
149 if (linie > 125) then
150 lvl = 5;
151 timer = 0.25;
152 end
153 if (linie > 150) then
154 lvl = 6;
155 timer = 0.20;
156 end
157 if (linie > 175) then
158 lvl = 7;
159 timer = 0.15;
160 end
161 if (linie > 200) then
162 lvl = 8;
163 timer = 0.10;
164 end
165 if (linie > 225) then
166 lvl = 9;
167 timer = 0.05;
168 end
169 --lvl speichern
170 Tetris["game"]["score"]["lvl"] = lvl;
171 --timer speichern
172 Tetris["game"]["timer"] = timer;
173 end
174  
175 function Tetris_score_handler_gameboy (r, l)
176 --r = wie erechnet sich die score
177 -- d = instant drop
178 -- timer = normaler fall durch timer
179 --l = anzahl der linien die vollständig sind
180 local score = Tetris["game"]["score"]["points"];
181 local lvl = Tetris["game"]["score"]["lvl"];
182 local s_plus = 0;
183  
184 if (l == 1) then
185 s_plus = (1+lvl)*40;
186 end
187 if (l == 2) then
188 s_plus = (1+lvl)*100;
189 end
190 if (l == 3) then
191 s_plus = (1+lvl)*300;
192 end
193 if (l == 4) then
194 s_plus = (1+lvl)*1200;
195 end
196  
197 --neue score speichern
198 Tetris["game"]["score"]["points"] = score+s_plus;
199 end
200  
201 function Tetris_gameresume_gameboy ()
202 Tetris_GF_NS_create ();
203 Tetris_GF_NS_Clear ();
204 Tetris_GF_NS_Show ();
205 Tetris_GF_create ();
206 Tetris_GF_gamewindow_Update ();
207 Tetris_GF_SetFramesPos();
208 Tetris_GF_timer_Update ();
209 Tetris_GF_Titeltext_Update ();
210 Tetris_GF_Text_Score_Update ();
211 Tetris_GF_highscore_Show ();
212 Tetris_gost_stone ();
213 Tetris_GF_gamewindow_falling_stone_Show ();
214 end
215