From 32cf1de3a0eaa901f2ba3df99589b6842d6a550b Mon Sep 17 00:00:00 2001 From: Gouvernathor <44340603+Gouvernathor@users.noreply.github.com> Date: Wed, 15 Nov 2023 23:06:04 +0100 Subject: [PATCH] Auto-cleanup public variables I chose not to add them directly in the screen, to keep it readable but even though they're still global variables, now they are dynamic and cleaned as soon as we exit the menu --- game/scripts/interface/stats.rpy | 84 +++++++++++++++----------------- 1 file changed, 39 insertions(+), 45 deletions(-) diff --git a/game/scripts/interface/stats.rpy b/game/scripts/interface/stats.rpy index e3b9d378..c4dac958 100644 --- a/game/scripts/interface/stats.rpy +++ b/game/scripts/interface/stats.rpy @@ -1,7 +1,3 @@ -init python: - def stats_sortfilter(item, sortby=False): - return item - default stats_show_locked = False define her_whoring_word_list = ("Pure", "Naive", "Curious", "Naughty", "Perverse", "Immoral", "Slutty", "Shameless", "Cumslut", "Total Cumslut", "Shameless Cumslut") @@ -21,61 +17,61 @@ 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"] -label update_stats: +init python: + def __update_stats(): + return dict( + ### Hermione ### - ### Hermione ### + # Whoring + her_whoring_word = her_whoring_word_list[int(min(states.her.level, 24)/2.4)], - # 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)], - # 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)], - # 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)], - # 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)], - ### 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 ### - ### Cho ### + # Whoring + cho_whoring_word = cho_whoring_word_list[int(min(states.cho.level, 24)/2.4)], - # 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)], - # 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)], - # Mood - $ cho_mood_word = cho_mood_word_list[int(min(states.cho.mood, 10)/1.0)] + ### Snape ### - ### Snape ### + # # Support + # sna_support_word = sna_support_word_list[int(min(sna_support, 15)/1.5)], - # # 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)], - # Friendship - $ sna_friendship_word = sna_friendship_word_list[int(min(states.sna.level, 100)/10)] + ### Tonks ### - ### Tonks ### + # Reputation + ton_reputation_word = ton_reputation_word_list[int(min(states.ton.public_level, 24)/2.4)], - # 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)], - # 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)], - # 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)] - - return + #ton_sluttiness_word = ton_sluttiness_word_list[int(ton_clothing_level/10)], + ) label stats: $ gui.in_context("stats_menu") @@ -95,9 +91,7 @@ define stats_dict = { } label stats_menu(xx=150, yy=90): - - call update_stats - + $ renpy.dynamic(**__update_stats()) call screen stats(xx, yy) return