LoafyLemon
df724981d2
* Added common style properties for houses * Added unique displayable for gold when in the main room * Unified currency screen to support arbitrary displayables and properties. * Unified transforms * Put interface elements onto interface layer * Hooked house points into the new currency screen * Improved animation and display of values during animation. * Allow independent animation of each supplied displayable * Remove redundant code
38 lines
1.6 KiB
Plaintext
38 lines
1.6 KiB
Plaintext
### 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)
|