2022-05-16 23:48:22 +00:00
|
|
|
### House-Points ###
|
|
|
|
|
|
|
|
label points_changes: # Gets called every day/night.
|
|
|
|
|
2023-11-17 01:47:17 +00:00
|
|
|
python hide:
|
2024-04-25 19:14:25 +00:00
|
|
|
progress_factor = max(1, int(math.log(states.env.day) * 5))
|
2022-05-16 23:48:22 +00:00
|
|
|
|
|
|
|
# Bonuses based on Tonks and Snape friendship stat
|
|
|
|
# Tonks' is lower since you can do events with her directly to increase points.
|
2023-03-31 22:41:48 +00:00
|
|
|
bonus_g = states.her.tier # Passive bonus
|
2023-04-02 23:48:38 +00:00
|
|
|
bonus_h = int((states.ton.level/100.0) * (progress_factor*0.7))
|
|
|
|
bonus_s = int((states.sna.level/100.0) * progress_factor*0.7)
|
|
|
|
bonus_r = states.cho.tier + states.lun.tier # Passive bonus
|
2022-05-16 23:48:22 +00:00
|
|
|
|
|
|
|
leader = max(hufflepuff, ravenclaw, slytherin, gryffindor)
|
|
|
|
|
|
|
|
difference_factor_g = min(leader, round((progress_factor + bonus_g) * max(hufflepuff, ravenclaw, slytherin)/float(gryffindor)))
|
|
|
|
difference_factor_h = min(leader, round((progress_factor + bonus_h) * max(gryffindor, ravenclaw, slytherin)/float(hufflepuff)))
|
|
|
|
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)))
|
|
|
|
|
2023-11-17 01:47:17 +00:00
|
|
|
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),
|
|
|
|
)
|
2022-05-16 23:48:22 +00:00
|
|
|
|
2023-11-17 01:47:17 +00:00
|
|
|
store.gryffindor += points_g
|
|
|
|
store.hufflepuff += points_h
|
|
|
|
store.ravenclaw += points_r
|
|
|
|
store.slytherin += points_s
|
2022-05-16 23:48:22 +00:00
|
|
|
|
|
|
|
hide screen points_changes
|
2024-04-27 00:54:41 +00:00
|
|
|
show screen points_changes(points_g, points_s, points_r, points_h)
|
2022-05-16 23:48:22 +00:00
|
|
|
return
|
|
|
|
|
2024-04-27 00:54:41 +00:00
|
|
|
screen points_changes(gryffindor=None, slytherin=None, ravenclaw=None, hufflepuff=None, prefix="+", direction="up"):
|
2022-05-16 23:48:22 +00:00
|
|
|
tag points_changes
|
|
|
|
zorder 35
|
|
|
|
|
|
|
|
hbox:
|
|
|
|
spacing 15
|
|
|
|
align (0.5, 0.1)
|
2024-04-27 00:54:41 +00:00
|
|
|
if direction == "up":
|
|
|
|
at transform:
|
|
|
|
on start:
|
|
|
|
alpha 0.0
|
|
|
|
on show:
|
|
|
|
alpha 1.0
|
|
|
|
yoffset 0
|
|
|
|
easein 4.0 yoffset -50 alpha 0.0
|
|
|
|
else:
|
|
|
|
at transform:
|
|
|
|
on start:
|
|
|
|
alpha 0.0
|
|
|
|
on show:
|
|
|
|
alpha 1.0
|
|
|
|
yoffset -50
|
|
|
|
easein 4.0 yoffset 0 alpha 0.0
|
|
|
|
|
|
|
|
if gryffindor:
|
|
|
|
text "[prefix][gryffindor]" outlines [(1, "#000000BF", 1, 0)] size 24 color "#A74D2A"
|
|
|
|
if slytherin:
|
|
|
|
text "+[prefix][slytherin]" outlines [(1, "#000000BF", 1, 0)] size 24 color "#3A734B"
|
|
|
|
if ravenclaw:
|
|
|
|
text "[prefix][ravenclaw]" outlines [(1, "#000000BF", 1, 0)] size 24 color "#5974C2"
|
|
|
|
if hufflepuff:
|
|
|
|
text "[prefix][hufflepuff]" outlines [(1, "#000000BF", 1, 0)] size 24 color "#FBC60A"
|
|
|
|
|
|
|
|
timer 4.0 action Hide("points_changes")
|