Add data privacy when computing house points
the dynamic variables are needed for the show screen call
(cherry picked from commit aefa88e4d2
)
This commit is contained in:
parent
20c00bbc74
commit
f78c269fc8
@ -2,7 +2,7 @@
|
||||
|
||||
label points_changes: # Gets called every day/night.
|
||||
|
||||
python:
|
||||
python hide:
|
||||
progress_factor = max(1, int(math.log(game.day) * 5))
|
||||
|
||||
# Bonuses based on Tonks and Snape friendship stat
|
||||
@ -19,15 +19,17 @@ label points_changes: # Gets called every day/night.
|
||||
difference_factor_r = min(leader, round((progress_factor + bonus_r) * max(gryffindor, hufflepuff, slytherin)/float(ravenclaw)))
|
||||
difference_factor_s = min(leader, round((progress_factor + bonus_s) * max(hufflepuff, ravenclaw, gryffindor)/float(slytherin)))
|
||||
|
||||
points_g = renpy.random.randint(difference_factor_g//2, difference_factor_g)
|
||||
points_h = renpy.random.randint(difference_factor_h//2, difference_factor_h)
|
||||
points_r = renpy.random.randint(difference_factor_r//2, difference_factor_r)
|
||||
points_s = renpy.random.randint(difference_factor_s//2, difference_factor_s)
|
||||
renpy.dynamic(
|
||||
points_g = renpy.random.randint(difference_factor_g//2, difference_factor_g),
|
||||
points_h = renpy.random.randint(difference_factor_h//2, difference_factor_h),
|
||||
points_r = renpy.random.randint(difference_factor_r//2, difference_factor_r),
|
||||
points_s = renpy.random.randint(difference_factor_s//2, difference_factor_s),
|
||||
)
|
||||
|
||||
gryffindor += points_g
|
||||
hufflepuff += points_h
|
||||
ravenclaw += points_r
|
||||
slytherin += points_s
|
||||
store.gryffindor += points_g
|
||||
store.hufflepuff += points_h
|
||||
store.ravenclaw += points_r
|
||||
store.slytherin += points_s
|
||||
|
||||
hide screen points_changes
|
||||
show screen points_changes(points_s, points_g, points_r, points_h)
|
||||
@ -42,7 +44,7 @@ screen points_changes(points_s, points_g, points_r, points_h):
|
||||
align (0.5, 0.1)
|
||||
at transform:
|
||||
on start:
|
||||
alpha 0.0
|
||||
alpha 0.0
|
||||
on show:
|
||||
yoffset 0
|
||||
alpha 1.0
|
||||
@ -54,5 +56,3 @@ screen points_changes(points_s, points_g, points_r, points_h):
|
||||
text "+[points_h]" outlines [(1, "#000000BF", 1, 0)] size 24 color "#FBC60A"
|
||||
|
||||
timer 3.0 action Hide("points_changes")
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user