-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbejewledalike.rpy
315 lines (311 loc) · 11.5 KB
/
bejewledalike.rpy
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
#cl1, cl2, cl3, cl4, cl5, cl6, cl7 are the horizontal rows
#krix- selected stone
#krix0- 2 stone you want to change
#kricol - it seems that something superfluous
#pointka - number of points
#ktmr - timer
#clp1, clp2, clp3, clp4, clp5, clp6, clp7- this is for animation
#mcnn - Style
# image any one can write down, simply changing the value here
# imagebutton idle ("k" + str (globals () ["cl" + str (z)] [i]) + ". w")
# on
# imagebutton idle ("k" + str (globals () ["cl" + str (z)] [i]) + ". png")
image kg="kg.w" #background image
init python:
import time
style.mcnn=Style(style.default)
style.mcnn.set_parent(style.button)
style.mcnn.color="#beddff"
style.mcnn.size=70
style.mcnn.outlines=[(2,"#6e6e6e",0,0)]
def krib():
global cl1,cl2,cl3,cl4,cl5,cl6,cl7,kricol,krix,krix0,pointka,ktmr,clp1,clp2,clp3,clp4,clp5,clp6,clp7
for i in range(0,9):
if cl1[i]>0:
clzz=1
if i<7:
if cl1[i]==cl1[i+1]==cl1[i+2]:
pointka+=(cl1[i]+cl1[i+1]+cl1[i+2])*2
if i<6 and cl1[i]==cl1[i+3]:
if i<5 and cl1[i]==cl1[i+4]:
pointka+=cl1[i+4]*4
ktmr+=4
cl1[i+4]=0
pointka+=cl1[i+3]*3
ktmr+=2
cl1[i+3]=0
clzz,cl1[i+1],cl1[i+2]=0,0,0
if cl1[i]==cl2[i]==cl3[i]:
pointka+=(cl1[i]+cl2[i]+cl3[i])*2
if cl1[i]==cl4[i]:
if cl1[i]==cl5[i]:
pointka+=cl5[i]*4
ktmr+=4
cl5[i]=0
pointka+=cl4[i]*3
ktmr+=2
cl4[i]=0
clzz,cl2[i],cl3[i]=0,0,0
if clzz==0:
cl1[i]=0
renpy.pause(0.05)
for i in range(0,9):
if cl2[i]>0:
clzz=1
if i<7:
if cl2[i]==cl2[i+1]==cl2[i+2]:
pointka+=(cl2[i]+cl2[i+1]+cl2[i+2])*2
if i<6 and cl2[i]==cl2[i+3]:
if i<5 and cl2[i]==cl2[i+4]:
pointka+=cl2[i+4]*4
ktmr+=4
cl2[i+4]=0
pointka+=cl2[i+3]*3
ktmr+=2
cl2[i+3]=0
clzz,cl2[i+1],cl2[i+2]=0,0,0
if cl2[i]==cl3[i]==cl4[i]:
pointka+=(cl2[i]+cl3[i]+cl4[i])*2
if cl2[i]==cl5[i]:
if cl2[i]==cl6[i]:
pointka+=cl6[i]*4
ktmr+=4
cl6[i]=0
pointka+=cl5[i]*3
ktmr+=2
cl5[i]=0
clzz,cl3[i],cl4[i]=0,0,0
if clzz==0:
cl2[i]=0
renpy.pause(0.05)
for i in range(0,9):
if cl3[i]>0:
clzz=1
if i<7:
if cl3[i]==cl3[i+1]==cl3[i+2]:
pointka=(cl3[i]+cl3[i+1]+cl3[i+2])*2
if i<6 and cl3[i]==cl3[i+3]:
if i<5 and cl3[i]==cl3[i+4]:
pointka+=cl3[i+4]*4
ktmr+=4
cl3[i+4]=0
pointka+=cl3[i+3]*3
ktmr+=2
cl3[i+3]=0
clzz,cl3[i+1],cl3[i+2]=0,0,0
if cl3[i]==cl4[i]==cl5[i]:
pointka+=(cl3[i]+cl4[i]+cl5[i])*2
if cl3[i]==cl6[i]:
pointka+=cl6[i]*3
ktmr+=2
cl6[i]=0
clzz,cl4[i],cl5[i]=0,0,0
if clzz==0:
cl3[i]=0
renpy.pause(0.05)
for i in range(0,9):
if cl4[i]>0:
clzz=1
if i<7:
if cl4[i]==cl4[i+1]==cl4[i+2]:
pointka+=(cl4[i]+cl4[i+1]+cl4[i+2])*2
if i<6 and cl4[i]==cl4[i+3]:
if i<5 and cl4[i]==cl4[i+4]:
pointka+=cl4[i+4]*4
ktmr+=4
cl4[i+4]=0
pointka+=cl4[i+3]*3
ktmr+=2
cl4[i+3]=0
clzz,cl4[i+1],cl4[i+2]=0,0,0
if cl4[i]==cl5[i]==cl6[i]:
pointka+=(cl4[i]+cl5[i]+cl6[i])*2
clzz,cl5[i],cl6[i]=0,0,0
if clzz==0:
cl4[i]=0
renpy.pause(0.05)
for i in range(0,7):
if cl5[i]>0:
if cl5[i]==cl5[i+1]==cl5[i+2]:
pointka+=(cl5[i]+cl5[i+1]+cl5[i+2])*2
if i<6 and cl5[i]==cl5[i+3]:
if i<5 and cl5[i]==cl5[i+4]:
pointka+=cl5[i+4]*4
ktmr+=4
cl5[i+4]=0
pointka+=cl5[i+3]*3
ktmr+=2
cl5[i+3]=0
cl5[i],cl5[i+1],cl5[i+2]=0,0,0
renpy.pause(0.05)
for i in range(0,7):
if cl6[i]>0:
if cl6[i]==cl6[i+1]==cl6[i+2]:
pointka+=(cl6[i]+cl6[i+1]+cl6[i+2])*2
if i<6 and cl6[i]==cl6[i+3]:
if i<5 and cl6[i]==cl6[i+4]:
pointka+=cl6[i+4]*4
ktmr+=4
cl6[i+4]=0
pointka+=cl6[i+3]*3
ktmr+=2
cl6[i+3]=0
cl6[i],cl6[i+1],cl6[i+2]=0,0,0
for i in range(0,9):
if cl6[i]==0:
clp5[i]-=32
if cl5[i]>0:
cl6[i]=cl5[i]
cl5[i]=0
elif cl4[i]>0:
cl6[i]=cl4[i]
cl4[i]=0
elif cl3[i]>0:
cl6[i]=cl3[i]
cl3[i]=0
elif cl2[i]>0:
cl6[i]=cl2[i]
cl2[i]=0
elif cl1[i]>0:
cl6[i]=cl1[i]
cl1[i]=0
else:
cl6[i]=renpy.random.randint(1,6)
for q in range(4):
clp5[i]+=8
renpy.pause(.0000001)
ktmr+=0.1
for i in range(0,9):
if cl5[i]==0:
clp5[i]-=32
if cl4[i]>0:
cl5[i]=cl4[i]
cl4[i]=0
elif cl3[i]>0:
cl5[i]=cl3[i]
cl3[i]=0
elif cl2[i]>0:
cl5[i]=cl2[i]
cl2[i]=0
elif cl1[i]>0:
cl5[i]=cl1[i]
cl1[i]=0
else:
cl5[i]=renpy.random.randint(1,6)
for q in range(4):
clp5[i]+=8
renpy.pause(.0000001)
ktmr+=0.1
for i in range(0,9):
if cl4[i]==0:
clp4[i]-=32
if cl3[i]>0:
cl4[i]=cl3[i]
cl3[i]=0
elif cl2[i]>0:
cl4[i]=cl2[i]
cl2[i]=0
elif cl1[i]>0:
cl4[i]=cl1[i]
cl1[i]=0
else:
cl4[i]=renpy.random.randint(1,6)
for q in range(4):
clp4[i]+=8
renpy.pause(.0000001)
ktmr+=0.1
for i in range(0,9):
if cl3[i]==0:
clp3[i]-=32
if cl2[i]>0:
cl3[i]=cl2[i]
cl2[i]=0
elif cl1[i]>0:
cl3[i]=cl1[i]
cl1[i]=0
else:
cl3[i]=renpy.random.randint(1,6)
for q in range(4):
clp3[i]+=8
renpy.pause(.0000001)
ktmr+=0.1
for i in range(0,9):
if cl2[i]==0:
clp2[i]-=32
if cl1[i]>0:
cl2[i]=cl1[i]
cl1[i]=0
else:
cl2[i]=renpy.random.randint(1,6)
for q in range(4):
clp2[i]+=8
renpy.pause(.0000001)
ktmr+=0.1
for i in range(0,9):
if cl1[i]==0:
clp1[i]-=32
cl1[i]=renpy.random.randint(1,6)
for w in range(4):
clp1[i]+=8
renpy.pause(.0000001)
ktmr+=0.1
return
screen krix:
text"[pointk]"style"mcnn"
text str(int(ktmr))style"mcnn"xalign.99
timer 1 repeat True action If(ktmr>0,true=SetVariable('ktmr',ktmr-1),false=Return())
for z in range(1,7):
for i in range(0,9):
imagebutton idle("k"+str(globals()["cl"+str(z)][i])+".w")xpos(i*80+260)ypos(z*80+20)action[SetVariable('krix',i),SetVariable('kriy',z),ui.callsinnewcontext("krich")]
screen krixx:
text"[pointk]"style"mcnn"
text str(int(ktmr)) style"mcnn"xalign.99
timer 1 repeat True action If(ktmr>0,true=SetVariable('ktmr',ktmr-1),false=Return())
for z in range(1,7):
for i in range(0,9):
image("k"+str(globals()["cl"+str(z)][i])+".w")xpos(i*80+260)ypos(z*80+20+globals()["clp"+str(z)][i])
label krich:
show screen krixx
if krix>=0:
if krix in(krix0+1,krix0-1)and kriy==kriy0:
pass
elif kriy in(kriy0+1,kriy0-1)and krix==krix0:
pass
else:
jump krich3
if krix0>=0:
$krixxx=globals()["cl"+str(kriy)][krix]
$globals()["cl"+str(kriy)][krix]=globals()["cl"+str(kriy0)][krix0]
$globals()["cl"+str(kriy0)][krix0]=krixxx
label krich2:
$krib()
if pointka>0:
$pointloop+=1
$pointk+=pointka
$pointka=0
jump krich2
if pointloop==0:
$krixxx=globals()["cl"+str(kriy0)][krix0]
$globals()["cl"+str(kriy0)][krix0]=globals()["cl"+str(kriy)][krix]
$globals()["cl"+str(kriy)][krix]=krixxx
$pointloop=0
$krix=-1
$krix0=-1
else:
label krich3:
$krix0=krix
$kriy0=kriy
return
label krix:
scene kg
python:
cl0,cl1,cl2,cl3,cl4,cl5,cl6,cl7,krix,kriy,kris,krin,kriw,krie,kricol,krix,krix0,kriy,kriy0,pointk,pointloop,ktmr,pointka=[],[],[],[],[],[],[],[],0,0,0,0,0,0,0,-1,-1,-1,-1,0,0,120,0
for z in range(1,7):
for i in range(0,9):
globals()["cl"+str(z)].append(renpy.random.randint(1,6))
clp0,clp1,clp2,clp3,clp4,clp5,clp6,clp7=[],[],[],[],[],[],[],[]
for z in range(1,7):
for i in range(0,9):
globals()["clp"+str(z)].append(0)
call screen krix
return