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
316
317
318
319
320
321
322
323init python:
import random
random.seed()
def Snow(image, max_particles=50, speed=150, wind=100, xborder=(0,100), yborder=(50,400), **kwargs):
"""
This creates the snow effect. You should use this function instead of instancing
the SnowFactory directly (we'll, doesn't matter actually, but it saves typing if you're
using the default values =D)
@parm {image} image:
The image used as the snowflakes. This should always be a image file or an im object,
since we'll apply im transformations in it.
@parm {int} max_particles:
The maximum number of particles at once in the screen.
@parm {float} speed:
The base vertical speed of the particles. The higher the value, the faster particles will fall.
Values below 1 will be changed to 1
@parm {float} wind:
The max wind force that'll be applyed to the particles.
@parm {Tuple ({int} min, {int} max)} xborder:
The horizontal border range. A random value between those two will be applyed when creating particles.
@parm {Tuple ({int} min, {int} max)} yborder:
The vertical border range. A random value between those two will be applyed when creating particles.
The higher the values, the fartest from the screen they will be created.
"""
return Particles(SnowFactory(image, max_particles, speed, wind, xborder, yborder, **kwargs))
class SnowFactory(object):
"""
The factory that creates the particles we use in the snow effect.
"""
def __init__(self, image, max_particles, speed, wind, xborder, yborder, **kwargs):
"""
Initialize the factory. Parameters are the same as the Snow function.
"""
self.max_particles = max_particles
self.speed = speed
self.wind = wind
self.xborder = xborder
self.yborder = yborder
self.depth = kwargs.get("depth", 10)
self.image = self.image_init(image)
def create(self, particles, st):
"""
This is internally called every frame by the Particles object to create new particles.
We'll just create new particles if the number of particles on the screen is
lower than the max number of particles we can have.
"""
if particles is None or len(particles) < self.max_particles:
depth = random.randint(1, self.depth)
depth_speed = 1.5-depth/(self.depth+0.0)
return [ SnowParticle(self.image[depth-1],
random.uniform(-self.wind, self.wind)*depth_speed,
self.speed*depth_speed,
random.randint(self.xborder[0], self.xborder[1]),
random.randint(self.yborder[0], self.yborder[1]),
) ]
def image_init(self, image):
"""
This is called internally to initialize the images.
will create a list of images with different sizes, so we
can predict them all and use the cached versions to make it more memory efficient.
"""
rv = [ ]
for depth in range(self.depth):
p = 1.1 - depth/(self.depth+0.0)
if p > 1:
p = 1.0
rv.append( im.FactorScale( im.Alpha(image, p), p ) )
return rv
def predict(self):
"""
This is called internally by the Particles object to predict the images the particles
are using. It's expected to return a list of images to predict.
"""
return self.image
class SnowParticle(object):
"""
Represents every particle in the screen.
"""
def __init__(self, image, wind, speed, xborder, yborder):
"""
Initializes the snow particle. This is called automatically when the object is created.
"""
self.image = image
if speed <= 0:
speed = 1
self.wind = wind
self.speed = speed
self.oldst = None
self.xpos = random.uniform(0-xborder, renpy.config.screen_width+xborder)
self.ypos = -yborder
def update(self, st):
"""
Called internally in every frame to update the particle.
"""
if self.oldst is None:
self.oldst = st
lag = st - self.oldst
self.oldst = st
self.xpos += lag * self.wind
self.ypos += lag * self.speed
if self.ypos > renpy.config.screen_height or\
(self.wind< 0 and self.xpos < 0) or (self.wind > 0 and self.xpos > renpy.config.screen_width):
return None
return int(self.xpos), int(self.ypos), st, self.image
init:
image snow = Snow("images/anim/snow.png")
image heavy_snow = Snow("images/anim/snow.png", max_particles=500)
$ flash = Fade(1, 0, 1, color="#fff")
$ flash2 = Fade(2, 2, 2, color="#fff")
$ flash_red = Fade(1, 0, 1, color="#e11")
$ fade3 = Fade(1.5, 0, 1.5)
$ fade2 = Fade(1, 0, 1)
$ hell_dissolve = Dissolve(50)
$ dissolve2 = Dissolve(2)
$ dissolve_fast = Dissolve(0.5)
$ dissolve_long = Dissolve(100)
$ dspr = Dissolve(.2)
$ backdrop = "prologue"
init python:
import itertools
locations = ["bg ext_aidpost", "bg ext_beach", "bg ext_boathouse", "bg ext_clubs", "bg ext_dining_hall_away", "bg ext_library", "bg ext_house_of_mt", "bg ext_playground", "bg ext_road", "bg ext_square", "bg int_dining_hall"]
variations = ["night", "sunset", "day"]
all_loc = ["%s_%s" % (location, variation) for (location, variation) in itertools.product(locations, variations)]
if persistent.endings == None:
persistent.endings = {
"main_good":False,
"main_bad":False,
"dv_good":False,
"dv_bad":False,
"sl_good":False,
"sl_bad":False,
"un_good":False,
"un_bad":False,
"us_good":False,
"us_bad":False,
"mi":False,
"uv_city":False,
"uv_unknown_fucken_shit":False
}
if persistent.CardsDemo == None:
persistent.CardsDemo = False
if persistent.CardsFail == None:
persistent.CardsFail = False
if persistent.CardsWon1 == None:
persistent.CardsWon1 = False
if persistent.CardsWon2 == None:
persistent.CardsWon2 = False
if persistent.CardsWon3 == None:
persistent.CardsWon3 = False
if persistent.hentai == None:
persistent.hentai = False
if persistent.foobar == None:
persistent.foobar = False
init:
python:
import math
class Shaker(object):
anchors = {
'top' : 0.0,
'center' : 0.5,
'bottom' : 1.0,
'left' : 0.0,
'right' : 1.0,
}
def __init__(self, start, child, dist):
if start is None:
start = child.get_placement()
self.start = [ self.anchors.get(i, i) for i in start ]
self.dist = dist
self.child = child
def __call__(self, t, sizes):
def fti(x, r):
if x is None:
x = 0
if isinstance(x, float):
return int(x * r)
else:
return x
xpos, ypos, xanchor, yanchor = [ fti(a, b) for a, b in zip(self.start, sizes) ]
xpos = xpos - xanchor
ypos = ypos - yanchor
nx = xpos + (1.0-t) * self.dist * (renpy.random.random()*2-1)
ny = ypos + (1.0-t) * self.dist * (renpy.random.random()*2-1)
return (int(nx), int(ny), 0, 0)
def _Shake(start, time, child=None, dist=100.0, **properties):
move = Shaker(start, child, dist=dist)
return renpy.display.layout.Motion(move,
time,
child,
add_sizes=True,
**properties)
Shake = renpy.curry(_Shake)
init:
$ lp_dv = 0
$ lp_sl = 0
$ lp_un = 0
$ lp_us = 0
$ lp_uv = 0
# Decompiled by unrpyc: https://github.com/CensoredUsername/unrpyc