From 7e3a078dce8ef516e9c486c0608b2d6fb1f42d31 Mon Sep 17 00:00:00 2001 From: Gouvernathor <44340603+Gouvernathor@users.noreply.github.com> Date: Fri, 17 Nov 2023 03:05:12 +0100 Subject: [PATCH] Avoid single-use function (cherry picked from commit 313849696cc6416bdc17f595a3ec94703c354e5d) --- game/scripts/interface/stats.rpy | 111 +++++++++++++++---------------- 1 file changed, 54 insertions(+), 57 deletions(-) diff --git a/game/scripts/interface/stats.rpy b/game/scripts/interface/stats.rpy index 79489418..1d608d70 100644 --- a/game/scripts/interface/stats.rpy +++ b/game/scripts/interface/stats.rpy @@ -17,62 +17,6 @@ define ton_reputation_word_list = ("Teacher", "Bore", "Weirdo", "A Bit Nutty", " define ton_friendship_word_list = ("Unknown", "inferior", "employee", "advisor", "trusted advisor", "Acquaintance", "friend", "Girlfriend", "Partner in crime", "Bonnie & Clyde", "Master & Slave") #$ ton_sluttiness_word_list = ["Masochist", "Disgrace", "Street Whore", "Harlot", "Tart", "Sexually open", "Naughty Teacher", "Easy Going", "Professor", "Bore", "Nun"] -init python: - def __update_stats(): - return dict( - ### Hermione ### - - # Whoring - her_whoring_word = her_whoring_word_list[int(min(states.her.level, 24)/2.4)], - - # Reputation - her_reputation_word = her_reputation_word_list[int(min(states.her.public_level, 24)/2.4)], - - # Tutoring - her_tutoring_word = her_tutoring_word_list[int(states.her.ev.tutoring.stage/1.5)], - - # Mood - her_mood_word = her_mood_word_list[int(min(states.her.mood, 10)/1.0)], - - ### Astoria ### - #call astoria_clothing_level - #ast_cuteness_word = ast_cuteness_word_list[int(ast_clothing_level/10)], - # Mood - ast_mood_word = ast_mood_word_list[int(min(states.ast.mood, 10)/1.0)], - - ### Cho ### - - # Whoring - cho_whoring_word = cho_whoring_word_list[int(min(states.cho.level, 24)/2.4)], - - # Reputation - cho_reputation_word= cho_reputation_word_list[int(min(states.cho.public_level, 24)/2.4)], - - # Mood - cho_mood_word = cho_mood_word_list[int(min(states.cho.mood, 10)/1.0)], - - ### Snape ### - - # # Support - # sna_support_word = sna_support_word_list[int(min(sna_support, 15)/1.5)], - - # Friendship - sna_friendship_word = sna_friendship_word_list[int(min(states.sna.level, 100)/10)], - - ### Tonks ### - - # Reputation - ton_reputation_word = ton_reputation_word_list[int(min(states.ton.public_level, 24)/2.4)], - - # Support - # ton_support_word = ton_support_word_list[int(min(ton_support, 12)/1.2)], - - # Friendship - ton_friendship_word = ton_friendship_word_list[int(min(states.ton.level, 100)/10)], - - #ton_sluttiness_word = ton_sluttiness_word_list[int(ton_clothing_level/10)], - ) - label stats: $ gui.in_context("stats_menu") jump main_room_menu @@ -91,7 +35,60 @@ define stats_dict = { } label stats_menu(xx=150, yy=90): - $ renpy.dynamic(**__update_stats()) + $ renpy.dynamic( + ### Hermione ### + + # Whoring + her_whoring_word = her_whoring_word_list[int(min(states.her.level, 24)/2.4)], + + # Reputation + her_reputation_word = her_reputation_word_list[int(min(states.her.public_level, 24)/2.4)], + + # Tutoring + her_tutoring_word = her_tutoring_word_list[int(states.her.ev.tutoring.stage/1.5)], + + # Mood + her_mood_word = her_mood_word_list[int(min(states.her.mood, 10)/1.0)], + + ### Astoria ### + #call astoria_clothing_level + #ast_cuteness_word = ast_cuteness_word_list[int(ast_clothing_level/10)], + # Mood + ast_mood_word = ast_mood_word_list[int(min(states.ast.mood, 10)/1.0)], + + ### Cho ### + + # Whoring + cho_whoring_word = cho_whoring_word_list[int(min(states.cho.level, 24)/2.4)], + + # Reputation + cho_reputation_word= cho_reputation_word_list[int(min(states.cho.public_level, 24)/2.4)], + + # Mood + cho_mood_word = cho_mood_word_list[int(min(states.cho.mood, 10)/1.0)], + + ### Snape ### + + # # Support + # sna_support_word = sna_support_word_list[int(min(sna_support, 15)/1.5)], + + # Friendship + sna_friendship_word = sna_friendship_word_list[int(min(states.sna.level, 100)/10)], + + ### Tonks ### + + # Reputation + ton_reputation_word = ton_reputation_word_list[int(min(states.ton.public_level, 24)/2.4)], + + # Support + # ton_support_word = ton_support_word_list[int(min(ton_support, 12)/1.2)], + + # Friendship + ton_friendship_word = ton_friendship_word_list[int(min(states.ton.level, 100)/10)], + + #ton_sluttiness_word = ton_sluttiness_word_list[int(ton_clothing_level/10)], + ) + call screen stats(xx, yy) return