### House-Points ### init python: def house_points_daily(): progress_factor = max(1, int(math.log(states.env.day) * 5)) # 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 } leader = max(house_points.values()) 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"])) } points = { house: min(leader, round((progress_factor + bonus) * max_points / house_points[house])) for house, (bonus, max_points) in factors.items() } for house, point in points.items(): points[house] = renpy.random.randint(point // 2, point) + house_points[house] states.env.set_points(points)