From f78c269fc841500401109a46cd9cfa93c20881ab Mon Sep 17 00:00:00 2001 From: Gouvernathor <44340603+Gouvernathor@users.noreply.github.com> Date: Fri, 17 Nov 2023 02:47:17 +0100 Subject: [PATCH] Add data privacy when computing house points the dynamic variables are needed for the show screen call (cherry picked from commit aefa88e4d24483f5c1be51206d1ef5fe5044672e) --- game/scripts/interface/house_points.rpy | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/game/scripts/interface/house_points.rpy b/game/scripts/interface/house_points.rpy index 4c6ab676..2b31d114 100644 --- a/game/scripts/interface/house_points.rpy +++ b/game/scripts/interface/house_points.rpy @@ -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") - -