SHOW:
|
|
- or go back to the newest paste.
1 | ///@description Check the sum of possible moves that we can use to match gems. If it goes to 0, AHM will be activated | |
2 | make_gems_fallen() | |
3 | #region Variable settings | |
4 | var rows = global.board_rows; | |
5 | var skin; | |
6 | var list_of_cubes = 0; | |
7 | for(i=0;i<=rows-1;i++) | |
8 | { | |
9 | for(j=0;j<=7;j++) | |
10 | { | |
11 | if gems_fallen[i,j] != noone //&& instance_exists(gems_fallen[i,j]) | |
12 | { | |
13 | if gems_fallen[i,j].amHype list_of_cubes++ | |
14 | gemboard[i,j] = gems_fallen[i,j].skinnum | |
15 | } | |
16 | else | |
17 | { | |
18 | gemboard[i,j] = -1 | |
19 | } | |
20 | } | |
21 | } | |
22 | summoves2 = list_of_cubes //+ future_summoves | |
23 | #endregion | |
24 | ||
25 | #region SHAPE DRAWING | |
26 | //1 O - O | |
27 | // Θ | |
28 | ||
29 | //2 Θ | |
30 | // O - O | |
31 | ||
32 | //3 O | |
33 | // - Θ | |
34 | // Ο | |
35 | ||
36 | //4 Ο | |
37 | // Θ - | |
38 | // Ο | |
39 | ||
40 | //5 Ο | |
41 | // Ο | |
42 | // - Θ | |
43 | ||
44 | //6 Ο | |
45 | // Ο | |
46 | // Θ - | |
47 | ||
48 | //7 - Θ | |
49 | // Ο | |
50 | // O | |
51 | ||
52 | //8 Θ - | |
53 | // Ο | |
54 | // O | |
55 | ||
56 | //9 - O O | |
57 | // Θ | |
58 | ||
59 | //10 Θ | |
60 | // - O O | |
61 | ||
62 | //11 Θ | |
63 | // O O - | |
64 | ||
65 | //12 O O - | |
66 | // Θ | |
67 | ||
68 | //13 Θ | |
69 | // - | |
70 | // Ο | |
71 | // Ο | |
72 | ||
73 | //14 O | |
74 | // O | |
75 | // - | |
76 | // Θ | |
77 | ||
78 | //15 O Ο - Θ | |
79 | ||
80 | //16 Θ - Ο Ο | |
81 | #endregion | |
82 | ||
83 | #region THE BIG SEX | |
84 | for(i=0;i<=7;i++) | |
85 | { | |
86 | for(j=0;j<=7;j++) | |
87 | { | |
88 | //1 | |
89 | if (i >=1) && (j >= 1 && j <= board_xsize-2) | |
90 | { | |
91 | //first check if the two other gems are the same (and not coal/void) | |
92 | if gemboard[i-1,j-1] = gemboard[i-1,j+1] && (gemboard[i-1,j-1] >= 0 && gemboard[i-1,j-1] <=6) | |
93 | { | |
94 | skin = gemboard[i-1,j-1] | |
95 | if gemboard[i-1,j] != -1 //now check if the clickable gem is also not void | |
96 | { | |
97 | if gems_fallen[i-1,j].amLocked = 0 //and if its not void, check if its locked | |
98 | { | |
99 | if gemboard[i,j] = skin && gems_fallen[i,j].amLocked = 0//all good? last thing to do is check if Θ is same and not locked | |
100 | { | |
101 | i_gemtouse[summoves2] = i //the i position of the bot gem to use | |
102 | j_gemtouse[summoves2] = j // the j position of the bot gem to use | |
103 | dir_gemtouse[summoves2] = "up" //dir of the gem to make a match by moving it. "right", "left", "up" or "down" | |
104 | summoves2++ | |
105 | } | |
106 | } | |
107 | } | |
108 | } | |
109 | } | |
110 | //2 | |
111 | if (i <=rows-2) && (j >= 1 && j <= board_xsize-2) | |
112 | { | |
113 | //first check if the two other gems are the same (and not coal/void) | |
114 | if gemboard[i+1,j-1] = gemboard[i+1,j+1] && (gemboard[i+1,j-1] >= 0 && gemboard[i+1,j-1] <=6) | |
115 | { | |
116 | skin = gemboard[i+1,j-1] | |
117 | if gemboard[i+1,j] != -1 //now check if the clickable gem is also not void | |
118 | { | |
119 | if gems_fallen[i+1,j].amLocked = 0 //and if its not void, check if its locked | |
120 | { | |
121 | if gemboard[i,j] = skin && gems_fallen[i,j].amLocked = 0//all good? last thing to do is check if Θ is same and not locked | |
122 | { | |
123 | i_gemtouse[summoves2] = i //the i position of the bot gem to use | |
124 | j_gemtouse[summoves2] = j // the j position of the bot gem to use | |
125 | dir_gemtouse[summoves2] = "down" //dir of the gem to make a match by moving it. "right", "left", "up" or "down" | |
126 | summoves2++ | |
127 | } | |
128 | } | |
129 | } | |
130 | } | |
131 | } | |
132 | //3 | |
133 | if (i >=1 && i <=rows-2) && (j >= 1) | |
134 | { | |
135 | //first check if the two other gems are the same (and not coal/void) | |
136 | if gemboard[i-1,j-1] = gemboard[i+1,j-1] && (gemboard[i-1,j-1] >= 0 && gemboard[i-1,j-1] <=6) | |
137 | { | |
138 | skin = gemboard[i-1,j-1] | |
139 | if gemboard[i,j-1] != -1 //now check if the clickable gem is also not void | |
140 | { | |
141 | if gems_fallen[i,j-1].amLocked = 0 //and if its not void, check if its locked | |
142 | { | |
143 | if gemboard[i,j] = skin && gems_fallen[i,j].amLocked = 0//all good? last thing to do is check if Θ is same and not locked | |
144 | { | |
145 | i_gemtouse[summoves2] = i //the i position of the bot gem to use | |
146 | j_gemtouse[summoves2] = j // the j position of the bot gem to use | |
147 | dir_gemtouse[summoves2] = "left" //dir of the gem to make a match by moving it. "right", "left", "up" or "down" | |
148 | summoves2++ | |
149 | } | |
150 | } | |
151 | } | |
152 | } | |
153 | } | |
154 | //4 | |
155 | if (i >=1 && i <=rows-2) && (j <= board_xsize-2) | |
156 | { | |
157 | //first check if the two other gems are the same (and not coal/void) | |
158 | skin = gemboard[i-1,j+1] | |
159 | if skin = gemboard[i+1,j+1] && (skin >= 0 && skin <=6) | |
160 | { | |
161 | if gemboard[i,j+1] != -1 //now check if the clickable gem is also not void | |
162 | { | |
163 | if gems_fallen[i,j+1].amLocked = 0 //and if its not void, check if its locked | |
164 | { | |
165 | if gemboard[i,j] = skin && gems_fallen[i,j].amLocked = 0//all good? last thing to do is check if Θ is same and not locked | |
166 | { | |
167 | i_gemtouse[summoves2] = i | |
168 | j_gemtouse[summoves2] = j | |
169 | dir_gemtouse[summoves2] = "right" | |
170 | summoves2++ | |
171 | } | |
172 | } | |
173 | } | |
174 | } | |
175 | } | |
176 | //5 | |
177 | if (i >=2) && (j >= 1) | |
178 | { | |
179 | //first check if the two other gems are the same (and not coal/void) | |
180 | skin = gemboard[i-1,j-1] | |
181 | if skin = gemboard[i-2,j-1] && (skin >= 0 && skin <=6) | |
182 | { | |
183 | if gemboard[i,j-1] != -1 //now check if the clickable gem is also not void | |
184 | { | |
185 | if gems_fallen[i,j-1].amLocked = 0 //and if its not void, check if its locked | |
186 | { | |
187 | if gemboard[i,j] = skin && gems_fallen[i,j].amLocked = 0//all good? last thing to do is check if Θ is same and not locked | |
188 | { | |
189 | i_gemtouse[summoves2] = i | |
190 | j_gemtouse[summoves2] = j | |
191 | dir_gemtouse[summoves2] = "left" | |
192 | summoves2++ | |
193 | } | |
194 | } | |
195 | } | |
196 | } | |
197 | } | |
198 | //6 | |
199 | if (i >=2) && (j <= board_xsize-2) | |
200 | { | |
201 | //first check if the two other gems are the same (and not coal/void) | |
202 | skin = gemboard[i-1,j+1] | |
203 | if skin = gemboard[i-2,j+1] && (skin >= 0 && skin <=6) | |
204 | { | |
205 | if gemboard[i,j+1] != -1 //now check if the clickable gem is also not void | |
206 | { | |
207 | if gems_fallen[i,j+1].amLocked = 0 //and if its not void, check if its locked | |
208 | { | |
209 | if gemboard[i,j] = skin && gems_fallen[i,j].amLocked = 0//all good? last thing to do is check if Θ is same and not locked | |
210 | { | |
211 | i_gemtouse[summoves2] = i | |
212 | j_gemtouse[summoves2] = j | |
213 | dir_gemtouse[summoves2] = "right" | |
214 | summoves2++ | |
215 | } | |
216 | } | |
217 | } | |
218 | } | |
219 | } | |
220 | //7 | |
221 | if (i <=rows-3) && (j >= 1) | |
222 | { | |
223 | //first check if the two other gems are the same (and not coal/void) | |
224 | skin = gemboard[i+1,j-1] | |
225 | if skin = gemboard[i+2,j-1] && (skin >= 0 && skin <=6) | |
226 | { | |
227 | if gemboard[i,j-1] != -1 //now check if the clickable gem is also not void | |
228 | { | |
229 | if gems_fallen[i,j-1].amLocked = 0 //and if its not void, check if its locked | |
230 | { | |
231 | if gemboard[i,j] = skin && gems_fallen[i,j].amLocked = 0//all good? last thing to do is check if Θ is same and not locked | |
232 | { | |
233 | i_gemtouse[summoves2] = i | |
234 | j_gemtouse[summoves2] = j | |
235 | dir_gemtouse[summoves2] = "left" | |
236 | summoves2++ | |
237 | } | |
238 | } | |
239 | } | |
240 | } | |
241 | } | |
242 | //8 | |
243 | if (i <=rows-3) && (j <= board_xsize-2) | |
244 | { | |
245 | //first check if the two other gems are the same (and not coal/void) | |
246 | skin = gemboard[i+1,j+1] | |
247 | if skin = gemboard[i+2,j+1] && (skin >= 0 && skin <=6) | |
248 | { | |
249 | if gemboard[i,j+1] != -1 //now check if the clickable gem is also not void | |
250 | { | |
251 | if gems_fallen[i,j+1].amLocked = 0 //and if its not void, check if its locked | |
252 | { | |
253 | if gemboard[i,j] = skin && gems_fallen[i,j].amLocked = 0//all good? last thing to do is check if Θ is same and not locked | |
254 | { | |
255 | i_gemtouse[summoves2] = i | |
256 | j_gemtouse[summoves2] = j | |
257 | dir_gemtouse[summoves2] = "right" | |
258 | summoves2++ | |
259 | } | |
260 | } | |
261 | } | |
262 | } | |
263 | } | |
264 | //9 | |
265 | if (i >=1) && (j <= board_xsize-3) | |
266 | { | |
267 | //first check if the two other gems are the same (and not coal/void) | |
268 | skin = gemboard[i-1,j+1] | |
269 | if skin = gemboard[i-1,j+2] && (skin >= 0 && skin <=6) | |
270 | { | |
271 | if gemboard[i-1,j] != -1 //now check if the clickable gem is also not void | |
272 | { | |
273 | if gems_fallen[i-1,j].amLocked = 0 //and if its not void, check if its locked | |
274 | { | |
275 | if gemboard[i,j] = skin && gems_fallen[i,j].amLocked = 0//all good? last thing to do is check if Θ is same and not locked | |
276 | { | |
277 | i_gemtouse[summoves2] = i | |
278 | j_gemtouse[summoves2] = j | |
279 | dir_gemtouse[summoves2] = "up" | |
280 | summoves2++ | |
281 | } | |
282 | } | |
283 | } | |
284 | } | |
285 | } | |
286 | //10 | |
287 | if (i <=rows-2) && (j <= board_xsize-3) | |
288 | { | |
289 | //first check if the two other gems are the same (and not coal/void) | |
290 | skin = gemboard[i+1,j+1] | |
291 | if skin = gemboard[i+1,j+2] && (skin >= 0 && skin <=6) | |
292 | { | |
293 | if gemboard[i+1,j] != -1 //now check if the clickable gem is also not void | |
294 | { | |
295 | if gems_fallen[i+1,j].amLocked = 0 //and if its not void, check if its locked | |
296 | { | |
297 | if gemboard[i,j] = skin && gems_fallen[i,j].amLocked = 0//all good? last thing to do is check if Θ is same and not locked | |
298 | { | |
299 | i_gemtouse[summoves2] = i | |
300 | j_gemtouse[summoves2] = j | |
301 | dir_gemtouse[summoves2] = "down" | |
302 | summoves2++ | |
303 | } | |
304 | } | |
305 | } | |
306 | } | |
307 | } | |
308 | //11 | |
309 | if (i <=rows-2) && (j >= 2) | |
310 | { | |
311 | //first check if the two other gems are the same (and not coal/void) | |
312 | skin = gemboard[i+1,j-1] | |
313 | if skin = gemboard[i+1,j-2] && (skin >= 0 && skin <=6) | |
314 | { | |
315 | if gemboard[i+1,j] != -1 //now check if the clickable gem is also not void | |
316 | { | |
317 | if gems_fallen[i+1,j].amLocked = 0 //and if its not void, check if its locked | |
318 | { | |
319 | if gemboard[i,j] = skin && gems_fallen[i,j].amLocked = 0//all good? last thing to do is check if Θ is same and not locked | |
320 | { | |
321 | i_gemtouse[summoves2] = i | |
322 | j_gemtouse[summoves2] = j | |
323 | dir_gemtouse[summoves2] = "down" | |
324 | summoves2++ | |
325 | } | |
326 | } | |
327 | } | |
328 | } | |
329 | } | |
330 | //12 | |
331 | if (i >= 1) && (j >= 2) | |
332 | { | |
333 | //first check if the two other gems are the same (and not coal/void) | |
334 | skin = gemboard[i-1,j-1] | |
335 | if skin = gemboard[i-1,j-2] && (skin >= 0 && skin <=6) | |
336 | { | |
337 | if gemboard[i-1,j] != -1 //now check if the clickable gem is also not void | |
338 | { | |
339 | if gems_fallen[i-1,j].amLocked = 0 //and if its not void, check if its locked | |
340 | { | |
341 | if gemboard[i,j] = skin && gems_fallen[i,j].amLocked = 0//all good? last thing to do is check if Θ is same and not locked | |
342 | { | |
343 | i_gemtouse[summoves2] = i | |
344 | j_gemtouse[summoves2] = j | |
345 | dir_gemtouse[summoves2] = "up" | |
346 | summoves2++ | |
347 | } | |
348 | } | |
349 | } | |
350 | } | |
351 | } | |
352 | //13 | |
353 | if (i <= rows-4) && board_ysize > 3 | |
354 | { | |
355 | //first check if the two other gems are the same (and not coal/void) | |
356 | skin = gemboard[i+2,j] | |
357 | if skin = gemboard[i+3,j] && (skin >= 0 && skin <=6) | |
358 | { | |
359 | if gemboard[i+1,j] != -1 //now check if the clickable gem is also not void | |
360 | { | |
361 | if gems_fallen[i+1,j].amLocked = 0 //and if its not void, check if its locked | |
362 | { | |
363 | if gemboard[i,j] = skin && gems_fallen[i,j].amLocked = 0//all good? last thing to do is check if Θ is same and not locked | |
364 | { | |
365 | i_gemtouse[summoves2] = i | |
366 | j_gemtouse[summoves2] = j | |
367 | dir_gemtouse[summoves2] = "down" | |
368 | summoves2++ | |
369 | } | |
370 | } | |
371 | } | |
372 | } | |
373 | } | |
374 | //14 | |
375 | if (i >= 3) | |
376 | { | |
377 | //first check if the two other gems are the same (and not coal/void) | |
378 | skin = gemboard[i-2,j] | |
379 | if skin = gemboard[i-3,j] && (skin >= 0 && skin <=6) | |
380 | { | |
381 | if gemboard[i-1,j] != -1 //now check if the clickable gem is also not void | |
382 | { | |
383 | if gems_fallen[i-1,j].amLocked = 0 //and if its not void, check if its locked | |
384 | { | |
385 | if gemboard[i,j] = skin && gems_fallen[i,j].amLocked = 0//all good? last thing to do is check if Θ is same and not locked | |
386 | { | |
387 | i_gemtouse[summoves2] = i | |
388 | j_gemtouse[summoves2] = j | |
389 | dir_gemtouse[summoves2] = "up" | |
390 | summoves2++ | |
391 | } | |
392 | } | |
393 | } | |
394 | } | |
395 | } | |
396 | //15 | |
397 | if (j >= 3) | |
398 | { | |
399 | //first check if the two other gems are the same (and not coal/void) | |
400 | skin = gemboard[i,j-2] | |
401 | if skin = gemboard[i,j-3] && (skin >= 0 && skin <=6) | |
402 | { | |
403 | if gemboard[i,j-1] != -1 //now check if the clickable gem is also not void | |
404 | { | |
405 | if gems_fallen[i,j-1].amLocked = 0 //and if its not void, check if its locked | |
406 | { | |
407 | if gemboard[i,j] = skin && gems_fallen[i,j].amLocked = 0//all good? last thing to do is check if Θ is same and not locked | |
408 | { | |
409 | i_gemtouse[summoves2] = i | |
410 | j_gemtouse[summoves2] = j | |
411 | dir_gemtouse[summoves2] = "left" | |
412 | summoves2++ | |
413 | } | |
414 | } | |
415 | } | |
416 | } | |
417 | } | |
418 | //16 | |
419 | if (j <= board_xsize-4) && board_xsize > 3 | |
420 | { | |
421 | //first check if the two other gems are the same (and not coal/void) | |
422 | skin = gemboard[i,j+2] | |
423 | if skin = gemboard[i,j+3] && (skin >= 0 && skin <=6) | |
424 | { | |
425 | if gemboard[i,j+1] != -1 //now check if the clickable gem is also not void | |
426 | { | |
427 | if gems_fallen[i,j+1].amLocked = 0 //and if its not void, check if its locked | |
428 | { | |
429 | if gemboard[i,j] = skin && gems_fallen[i,j].amLocked = 0//all good? last thing to do is check if Θ is same and not locked | |
430 | { | |
431 | i_gemtouse[summoves2] = i | |
432 | j_gemtouse[summoves2] = j | |
433 | dir_gemtouse[summoves2] = "right" | |
434 | summoves2++ | |
435 | } | |
436 | } | |
437 | } | |
438 | } | |
439 | } | |
440 | ||
441 | } | |
442 | } | |
443 | #endregion |