WTS/game/scripts/interface/house_points.rpy

38 lines
1.6 KiB
Plaintext
Raw Normal View History

2022-05-16 23:48:22 +00:00
### House-Points ###
init python:
def house_points_daily():
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
bonus_g = states.her.tier
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
house_points = {
"gryffindor": states.env.gryffindor,
"hufflepuff": states.env.hufflepuff,
"ravenclaw": states.env.ravenclaw,
"slytherin": states.env.slytherin
}
2022-05-16 23:48:22 +00:00
leader = max(house_points.values())
2022-05-16 23:48:22 +00:00
factors = {
"gryffindor": (bonus_g, max(house_points["hufflepuff"], house_points["ravenclaw"], house_points["slytherin"])),
"hufflepuff": (bonus_h, max(house_points["gryffindor"], house_points["ravenclaw"], house_points["slytherin"])),
"ravenclaw": (bonus_r, max(house_points["gryffindor"], house_points["hufflepuff"], house_points["slytherin"])),
"slytherin": (bonus_s, max(house_points["gryffindor"], house_points["hufflepuff"], house_points["ravenclaw"]))
}
2022-05-16 23:48:22 +00:00
points = {
house: min(leader, round((progress_factor + bonus) * max_points / house_points[house]))
for house, (bonus, max_points) in factors.items()
}
2022-05-16 23:48:22 +00:00
for house, point in points.items():
points[house] = renpy.random.randint(point // 2, point) + house_points[house]
2022-05-16 23:48:22 +00:00
states.env.set_points(points)