From db61958a445c6c6fde4b4b38af40a55414bc616d Mon Sep 17 00:00:00 2001 From: wkwk <12408-wkwk@users.norepy.gitgud.io> Date: Sat, 5 Aug 2023 04:26:38 -0600 Subject: [PATCH 01/12] Update all deprecated typing declarations --- game/bugfix_additions/ActionMod_ren.py | 11 ++- game/bugfix_additions/SerumTraitMod_ren.py | 3 +- .../recruitment_policies_ren.py | 3 +- .../regular_crises/crises_definition_ren.py | 3 +- .../relationship_crises_definition_ren.py | 4 +- game/fetish/fetish_serum_quests_ren.py | 2 +- .../relationship_role_definition_ren.py | 5 +- .../_stripclub_role_definitions_ren.py | 8 +- .../chat_actions_definition_ren.py | 3 +- .../command_descriptions_definition_ren.py | 5 +- .../striptease_definitions_ren.py | 3 +- game/helper_functions/heart_image_ren.py | 3 +- game/helper_functions/list_functions_ren.py | 39 +++++---- .../helper_functions/wardrobe_from_xml_ren.py | 4 +- .../wardrobe_management_functions_ren.py | 3 +- game/main_character/MainCharacter_ren.py | 9 +- game/main_character/goals_ren.py | 7 +- game/main_character/mc_serum_trait_ren.py | 5 +- game/main_character/perks/Perks_ren.py | 8 +- .../business_related/Business_ren.py | 51 ++++++------ .../character_related/Job_ren.py | 7 +- .../character_related/Person_ren.py | 83 ++++++++++--------- .../character_related/Personality_ren.py | 9 +- .../Progression_Scene_ren.py | 9 +- .../character_related/Progression_ren.py | 3 +- .../character_related/Relationship_ren.py | 5 +- .../character_related/Schedule_ren.py | 5 +- .../character_related/scene_manager_ren.py | 11 ++- .../clothing_related/Clothing_ren.py | 29 ++++--- .../clothing_related/Expression_ren.py | 3 +- .../LimitedWardrobeCollection_ren.py | 2 +- .../clothing_related/LimitedWardrobe_ren.py | 4 +- .../clothing_related/Outfit_ren.py | 45 +++++----- .../clothing_related/Wardrobe_ren.py | 10 +-- .../clothing_related/wardrobe_builder_ren.py | 78 ++++++++--------- .../clothing_related/zip_manager_ren.py | 3 +- .../game_logic/ActionList_ren.py | 9 +- .../major_game_classes/game_logic/Duty_ren.py | 3 +- .../game_logic/Position_ren.py | 13 ++- .../major_game_classes/game_logic/Room_ren.py | 13 ++- .../game_logic/TextMessageManager_ren.py | 3 +- .../serum_related/SerumDesign_ren.py | 7 +- .../serum_related/SerumInventory_ren.py | 9 +- .../serum_related/SerumTrait_ren.py | 10 +-- .../serum_related/serums/fetish_serums_ren.py | 3 +- game/map/HomeHub_ren.py | 7 +- game/map/MapHub_ren.py | 5 +- game/map/map_code_ren.py | 5 +- game/people/Candace/candace_definition_ren.py | 7 +- game/people/Ellie/IT_Business_Projects_ren.py | 7 +- game/people/Ellie/IT_Nanobot_Projects_ren.py | 3 +- .../people/Gabrielle/cousin_definition_ren.py | 7 +- game/people/Ophelia/ophelia_definition_ren.py | 5 +- .../_personality_definitions_ren.py | 45 +++++----- game/random_lists_ren.py | 7 +- .../threesome_position_definitions_ren.py | 3 +- game/text_tags/generic_replacer_ren.py | 7 +- game/trainables/_trainables_ren.py | 9 +- 58 files changed, 311 insertions(+), 361 deletions(-) diff --git a/game/bugfix_additions/ActionMod_ren.py b/game/bugfix_additions/ActionMod_ren.py index ec6952c39..e16e850c0 100644 --- a/game/bugfix_additions/ActionMod_ren.py +++ b/game/bugfix_additions/ActionMod_ren.py @@ -1,12 +1,11 @@ import renpy -from typing import List, Set from game.major_game_classes.game_logic.Action_ren import Action, Limited_Time_Action from game.main_character.MainCharacter_ren import mc -action_mod_list: List['ActionMod'] = [] -crisis_list : List[Action] = [] -morning_crisis_list : List[Action] = [] -limited_time_event_pool : List[Limited_Time_Action] = [] +action_mod_list: list['ActionMod'] = [] +crisis_list : list[Action] = [] +morning_crisis_list : list[Action] = [] +limited_time_event_pool : list[Limited_Time_Action] = [] # proxy methods for type system def init_action_mod_disabled(action_mod: 'ActionMod'): #pylint: disable=unused-argument @@ -18,7 +17,7 @@ init -1 python: """ class ActionMod(Action): - _instances : Set['ActionMod'] = set() + _instances : set['ActionMod'] = set() # store instances of mod def __init__(self, name, requirement, effect, args = None, requirement_args = None, menu_tooltip = None, priority = 10, event_duration = 99999, is_fast = True, diff --git a/game/bugfix_additions/SerumTraitMod_ren.py b/game/bugfix_additions/SerumTraitMod_ren.py index 37ae9fc5f..6b22b2e39 100644 --- a/game/bugfix_additions/SerumTraitMod_ren.py +++ b/game/bugfix_additions/SerumTraitMod_ren.py @@ -1,11 +1,10 @@ -from typing import Set from game.major_game_classes.serum_related.SerumTrait_ren import SerumTrait, list_of_traits """renpy init -1 python: """ class SerumTraitMod(SerumTrait): # store instances of mod - _instances : Set[SerumTrait] = set() + _instances : set[SerumTrait] = set() def __init__(self,name,desc, positive_slug = "", negative_slug = "", research_added = 0, slots_added = 0, production_added = 0, duration_added = 0, base_side_effect_chance = 0, clarity_added = 0, diff --git a/game/business_policies/recruitment_policies_ren.py b/game/business_policies/recruitment_policies_ren.py index 7ce602b07..2412b4666 100644 --- a/game/business_policies/recruitment_policies_ren.py +++ b/game/business_policies/recruitment_policies_ren.py @@ -1,5 +1,4 @@ #Define all helper functions first -from typing import List from game.main_character.MainCharacter_ren import mc from game.major_game_classes.business_related.Policy_ren import Policy from game.major_game_classes.character_related.Person_ren import Person @@ -14,7 +13,7 @@ def increase_interview_cost(amount): def decrease_interview_cost(amount): mc.business.recruitment_cost -= amount -recruitment_policies_list : List[Policy] = [] +recruitment_policies_list : list[Policy] = [] #### RECRUITMENT IMPROVEMENT POLICIES #### diff --git a/game/crises/regular_crises/crises_definition_ren.py b/game/crises/regular_crises/crises_definition_ren.py index 05c65a91f..7e06f19e4 100644 --- a/game/crises/regular_crises/crises_definition_ren.py +++ b/game/crises/regular_crises/crises_definition_ren.py @@ -1,6 +1,5 @@ import builtins from operator import attrgetter -from typing import List import renpy from game.helper_functions.list_functions_ren import get_random_from_list from game.major_game_classes.serum_related.SerumDesign_ren import SerumDesign @@ -373,7 +372,7 @@ def horny_at_work_get_follower(): potential_follower.append(person) return get_random_from_list(potential_follower) -def horny_at_work_get_licker(helpful_people: List[Person]): +def horny_at_work_get_licker(helpful_people: list[Person]): licker = None for person in helpful_people: person.change_obedience(3) diff --git a/game/crises/regular_crises/relationship_crises_definition_ren.py b/game/crises/regular_crises/relationship_crises_definition_ren.py index 6bf0e1a8d..72f7f96bb 100644 --- a/game/crises/regular_crises/relationship_crises_definition_ren.py +++ b/game/crises/regular_crises/relationship_crises_definition_ren.py @@ -1,5 +1,3 @@ - -from typing import List import renpy from game.helper_functions.list_functions_ren import get_random_from_list from game.bugfix_additions.ActionMod_ren import crisis_list, limited_time_event_pool @@ -120,7 +118,7 @@ def get_girlfriend_nudes_person(): and x.days_since_event("girlfriend nudes", True) > TIER_2_TIME_DELAY and x not in mc.location.people]) -def camera_strip_tits_description(person: Person, strip_list: List[Clothing]): +def camera_strip_tits_description(person: Person, strip_list: list[Clothing]): for item in strip_list: person.draw_animated_removal(item, position = "stand5", the_animation = blowjob_bob, animation_effect_strength = 0.8) if person.tits_visible: diff --git a/game/fetish/fetish_serum_quests_ren.py b/game/fetish/fetish_serum_quests_ren.py index 97b0ca8bd..fd8b57d45 100644 --- a/game/fetish/fetish_serum_quests_ren.py +++ b/game/fetish/fetish_serum_quests_ren.py @@ -188,7 +188,7 @@ def fetish_serum_coding_work_required(): return 0 def fetish_serum_update_coding_progress(progress): - mc.business.event_triggers_dict["fetish_serum_code_progress"] = builtins.int((fetish_serum_get_coding_progress() + progress)) + mc.business.event_triggers_dict["fetish_serum_code_progress"] = builtins.int(fetish_serum_get_coding_progress() + progress) def fetish_add_collar(person: Person, collar: Clothing): new_collar = collar.get_copy() diff --git a/game/game_roles/relationship_role_definition_ren.py b/game/game_roles/relationship_role_definition_ren.py index 7add699e8..91ca3ba6f 100644 --- a/game/game_roles/relationship_role_definition_ren.py +++ b/game/game_roles/relationship_role_definition_ren.py @@ -21,7 +21,6 @@ import renpy -from typing import List from game.clothing_lists_ren import pube_styles from game.game_roles._role_definitions_ren import sister_role, mother_role, dikdok_role from game.helper_functions.list_functions_ren import get_random_from_list @@ -37,8 +36,8 @@ time_of_day = 0 init -2 python: """ # special list for girlfriend morning actions -girlfriend_morning_action_list : List[Action] = [] -girlfriend_sleepover_interruption_list : List[Action] = [] #Ideas, daughter/mother walk in, phone call, +girlfriend_morning_action_list : list[Action] = [] +girlfriend_sleepover_interruption_list : list[Action] = [] #Ideas, daughter/mother walk in, phone call, #girlfriend_roleplay_list : List[Action] = [] #When a roleplay is created, add it here as an option. list of ACTIONS diff --git a/game/game_roles/stripclub/_stripclub_role_definitions_ren.py b/game/game_roles/stripclub/_stripclub_role_definitions_ren.py index 076e5cfb4..4782374a6 100644 --- a/game/game_roles/stripclub/_stripclub_role_definitions_ren.py +++ b/game/game_roles/stripclub/_stripclub_role_definitions_ren.py @@ -1,5 +1,3 @@ -import builtins -from typing import List from game.game_roles._role_definitions_ren import offer_to_hire_requirement from game.helper_functions.list_functions_ren import people_in_role from game.major_game_classes.character_related.Person_ren import Person, mc, mom, lily, aunt, nora @@ -118,7 +116,7 @@ def strip_club_review_requirement(person: Person): return True return False -def get_stripclub_base_actions() -> List[Action]: +def get_stripclub_base_actions() -> list[Action]: promote_to_manager_action = Action("Appoint as Manager", allow_promote_to_manager_requirement, "promote_to_manager_label", menu_tooltip = "Appoint [the_person.title] as strip club manager.") strip_club_stripper_move_action = Action("Move to new role", is_strip_club_stripper_requirement, "strip_club_move_employee_label", menu_tooltip = "Move [the_person.title] to a different role within the strip club.") strip_club_stripper_fire_action = Action("Fire her", is_strip_club_stripper_requirement, "strip_club_fire_employee_label", menu_tooltip = "Fire [the_person.title] from her stripper job in your strip club.") @@ -139,7 +137,7 @@ def strip_club_bdsm_dildochair_Mistress_requirements(the_person: Person) -> bool return True return False -def get_stripclub_bdsm_performer_role_actions() -> List[Action]: +def get_stripclub_bdsm_performer_role_actions() -> list[Action]: strip_club_dildochair_MC_action = Action("Use the dildo chair {image=gui/heart/Time_Advance.png}", strip_club_bdsm_dildochair_MC_requirements, "strip_club_bdsm_dildochair_MC_label", menu_tooltip = "Use the dildo chair with your BDSM performer.") strip_club_dildochair_Mistress_action = Action("Mistress use the chair {image=gui/heart/Time_Advance.png}", strip_club_bdsm_dildochair_Mistress_requirements, "strip_club_bdsm_dildochair_Mistress_label", menu_tooltip = "Have the Mistress use the dildo chair with your BDSM performer.") @@ -194,7 +192,7 @@ def mistress_hunt_for_me_requirement(person: Person) -> bool|str: return "Requires: " + str(minimum_sluttiness) + " Sluttiness" return True -def get_stripclub_mistress_role_actions() -> List[Action]: +def get_stripclub_mistress_role_actions() -> list[Action]: mistress_role_remove_action = Action("Remove as Mistress", has_mistress_role_requirement, "mistress_role_remove_label", menu_tooltip = "Remove [the_person.title] as strip club mistress.") mistress_hunt_for_me_action = Action("Hunt for me", mistress_hunt_for_me_requirement, "mistress_hunt_for_me_label", menu_tooltip = "Ask [the_person.title] to find you a girl for a threesome.") diff --git a/game/general_actions/interaction_actions/chat_actions_definition_ren.py b/game/general_actions/interaction_actions/chat_actions_definition_ren.py index 53e39b810..0b527a6e7 100644 --- a/game/general_actions/interaction_actions/chat_actions_definition_ren.py +++ b/game/general_actions/interaction_actions/chat_actions_definition_ren.py @@ -1,5 +1,4 @@ import builtins -from typing import List from game.general_actions.interaction_actions.command_descriptions_definition_ren import demand_strip_naked_requirement, demand_strip_tits_requirement, demand_strip_underwear_requirement from game.helper_functions.heart_formatting_functions_ren import get_gold_heart from game.helper_functions.list_functions_ren import get_random_from_list @@ -264,7 +263,7 @@ def demand_bc_requirement(person: Person): #Chat actions shown with all girls. Add to these lists to have options displayed when talking to someone. -chat_actions: List[Action] = [] #Default actions that are displayed when you are talking to a girl. Remember to set is_fast = False if an event can advance time. +chat_actions: list[Action] = [] #Default actions that are displayed when you are talking to a girl. Remember to set is_fast = False if an event can advance time. small_talk_action = Action("Make small talk {energy=-15}", requirement = small_talk_requirement, effect = "small_talk_person", menu_tooltip = "A pleasant chat about your likes and dislikes. A good way to get to know someone and the first step to building a lasting relationship. Provides a chance to study the effects of active serum traits and raise their mastery level.") diff --git a/game/general_actions/interaction_actions/command_descriptions_definition_ren.py b/game/general_actions/interaction_actions/command_descriptions_definition_ren.py index 23a34aa66..b47a36765 100644 --- a/game/general_actions/interaction_actions/command_descriptions_definition_ren.py +++ b/game/general_actions/interaction_actions/command_descriptions_definition_ren.py @@ -1,5 +1,4 @@ import builtins -from typing import List import renpy from game.helper_functions.list_functions_ren import is_iterable from game.helper_functions.convert_to_string_ren import remove_display_tags @@ -109,7 +108,7 @@ def build_demand_strip_menu(person: Person): return ["Strip Command", demand_panties_action, demand_strip_underwear_action, demand_strip_tits_action, demand_strip_naked_action, ["Never mind", "Return"]] -def top_strip_description(person: Person, strip_list: List[Clothing]): +def top_strip_description(person: Person, strip_list: list[Clothing]): for item_to_strip in strip_list: person.draw_animated_removal(item_to_strip) if item_to_strip == strip_list[-1]: #Special line for the last item. @@ -163,7 +162,7 @@ def naked_strip_description(person: Person): cloth = person.outfit.remove_random_upper(top_layer_first = True, do_not_remove = True) -def generalised_strip_description(person: Person, strip_list: List[Clothing], half_off_instead = False, position = None): +def generalised_strip_description(person: Person, strip_list: list[Clothing], half_off_instead = False, position = None): # This acts as a generic strip function that can be used in any scene. Hand over a list of clothing items to strip and this narrates it. # Note: half_off_instead assumes you are handing over a valid half_off list. Not sure what happens if you don't do that. diff --git a/game/general_actions/striptease_descriptions/striptease_definitions_ren.py b/game/general_actions/striptease_descriptions/striptease_definitions_ren.py index 729e27824..16fd81730 100644 --- a/game/general_actions/striptease_descriptions/striptease_definitions_ren.py +++ b/game/general_actions/striptease_descriptions/striptease_definitions_ren.py @@ -1,8 +1,7 @@ -from typing import List from game.major_game_classes.game_logic.StripteasePosition_ren import StripteasePosition -list_of_strip_positions: List[StripteasePosition] = [] +list_of_strip_positions: list[StripteasePosition] = [] """renpy init 1 python: """ diff --git a/game/helper_functions/heart_image_ren.py b/game/helper_functions/heart_image_ren.py index 04af5d7b9..016ffee34 100644 --- a/game/helper_functions/heart_image_ren.py +++ b/game/helper_functions/heart_image_ren.py @@ -1,6 +1,5 @@ # this class can generate a heart image based on their respective base images import renpy -from typing import Dict from renpy.display.im import Image from renpy.rollback import NoRollback from game._image_definitions_ren import get_file_handle @@ -9,7 +8,7 @@ from game._image_definitions_ren import get_file_handle init -10 python: """ class HeartImage(NoRollback, renpy.display.im.ImageBase): - images : Dict[str, Image] = {} + images : dict[str, Image] = {} def __init__(self, name, background, foreground, value = 0, secondary_foreground = None, secondary_value = 0, max_value = 20.0, **properties): super().__init__(name, **properties) diff --git a/game/helper_functions/list_functions_ren.py b/game/helper_functions/list_functions_ren.py index 6cdd22e1c..d1276b68c 100644 --- a/game/helper_functions/list_functions_ren.py +++ b/game/helper_functions/list_functions_ren.py @@ -1,4 +1,3 @@ -from typing import List import builtins import renpy from renpy import basestring @@ -23,36 +22,36 @@ init -20 python: """ from _collections_abc import Iterable -def all_people_in_the_game(excluded_people : List[Person]|None = None, excluded_locations : List[Room]|None = None) -> List[Person]: +def all_people_in_the_game(excluded_people : list[Person]|None = None, excluded_locations : list[Room]|None = None) -> list[Person]: if excluded_people is None: excluded_people = [] if excluded_locations is None: excluded_locations = [] return [x for x in list_of_people if x not in excluded_people and not x.location in excluded_locations] -def all_locations_in_the_game(excluded_locations : List[Room]|None = None) -> List[Room]: +def all_locations_in_the_game(excluded_locations : list[Room]|None = None) -> list[Room]: if excluded_locations is None: excluded_locations = [] return [x for x in list_of_places if not x in excluded_locations] -def all_policies_in_the_game(excluded_policies : List[Policy]|None = None) -> List[Policy]: +def all_policies_in_the_game(excluded_policies : list[Policy]|None = None) -> list[Policy]: if excluded_policies is None: excluded_policies = [] return [x for x in uniform_policies_list + recruitment_policies_list + serum_policies_list + organisation_policies_list + unmapped_policies_list if x not in excluded_policies] -def all_IT_projects() -> List[IT_Project]: +def all_IT_projects() -> list[IT_Project]: return list(business_IT_project_list + nanobot_IT_project_list + nanobot_unlock_project_list) -def all_jobs(excluded_jobs = None) -> List[Job]: +def all_jobs(excluded_jobs = None) -> list[Job]: if excluded_jobs is None: excluded_jobs = [] return [x for x in list_of_jobs if x not in excluded_jobs] -def all_hubs() -> List[MapHub]: +def all_hubs() -> list[MapHub]: return [x for x in list_of_hubs] @ttl_cache(ttl=1) -def unique_characters_not_known() -> List[Person]: # TODO The check should be standardized, but some people are vanilla, some are different modders or different 'style'. +def unique_characters_not_known() -> list[Person]: # TODO The check should be standardized, but some people are vanilla, some are different modders or different 'style'. not_met_yet_list = [] if not alexia.has_event_day("day_met"): # She'll be scheduled otherwise when met. not_met_yet_list.append(alexia) @@ -93,26 +92,26 @@ def unique_characters_not_known() -> List[Person]: # TODO The check should be st return not_met_yet_list #@ttl_cache(ttl=1) -def known_people_in_the_game(excluded_people : List[Person]|None = None, excluded_locations : List[Room]|None = None) -> List[Person]: +def known_people_in_the_game(excluded_people : list[Person]|None = None, excluded_locations : list[Room]|None = None) -> list[Person]: if excluded_people is None: excluded_people = [] if excluded_locations is None: excluded_locations = [] return [x for x in list_of_people if x not in excluded_people and not x.location in excluded_locations and x not in unique_characters_not_known() and not x.is_stranger] -def people_at_location(location: Room, excluded_people : List[Person]|None = None) -> List[Person]: +def people_at_location(location: Room, excluded_people : list[Person]|None = None) -> list[Person]: if excluded_people is None: excluded_people = [] return [x for x in list_of_people if x not in excluded_people and x.location == location] #@ttl_cache(ttl=1) -def known_people_at_location(location: Room, excluded_people : List[Person]|None = None) -> List[Person]: +def known_people_at_location(location: Room, excluded_people : list[Person]|None = None) -> list[Person]: if excluded_people is None: excluded_people = [] return [x for x in location.people if x.is_available and not x in excluded_people + unique_characters_not_known() and not x.is_stranger] #@ttl_cache(ttl=1) -def unknown_people_in_the_game(excluded_people : List[Person]|None = None, excluded_locations : List[Room]|None = None) -> List[Person]: +def unknown_people_in_the_game(excluded_people : list[Person]|None = None, excluded_locations : list[Room]|None = None) -> list[Person]: if excluded_people is None: excluded_people = [] if excluded_locations is None: @@ -120,20 +119,20 @@ def unknown_people_in_the_game(excluded_people : List[Person]|None = None, exclu return [x for x in list_of_people if x not in excluded_people and not x.location in excluded_locations and (x in unique_characters_not_known() or x.is_stranger)] #@ttl_cache(ttl=1) -def unknown_people_at_location(location: Room, excluded_people : List[Person]|None = None) -> List[Person]: +def unknown_people_at_location(location: Room, excluded_people : list[Person]|None = None) -> list[Person]: if excluded_people is None: excluded_people = [] return [x for x in location.people if x.is_available and not x in excluded_people and (x in unique_characters_not_known() or x.is_stranger)] -def people_in_mc_home(excluded_people : List[Person]|None = None) -> List[Person]: +def people_in_mc_home(excluded_people : list[Person]|None = None) -> list[Person]: if excluded_people is None: excluded_people = [] return [x for x in list_of_people if x.is_available and not x in excluded_people and x.location in home_hub] -def people_in_role(role: str|Role|List[Role]) -> List[Person]: +def people_in_role(role: str|Role|list[Role]) -> list[Person]: return [x for x in list_of_people if x.has_role(role)] -def people_with_job(job: Job) -> List[Person]: +def people_with_job(job: Job) -> list[Person]: return [x for x in list_of_people if x.job == job] def exists_in_mandatory_crisis_list(effect_name: str) -> bool: @@ -159,7 +158,7 @@ def exists_in_location_action_list(location: Room, effect_name: str) -> bool: # returns a single employee when number of employees == 1 # returns a tuple of employees when number of employees > 1 # only returns employees available for events -def get_random_employees(number_of_employees: int, exclude_list : List[Person]|None = None, **employee_args) -> List[Person]|Person: +def get_random_employees(number_of_employees: int, exclude_list : list[Person]|None = None, **employee_args) -> list[Person]|Person: if exclude_list is None: exclude_list = [] @@ -179,7 +178,7 @@ def get_random_employees(number_of_employees: int, exclude_list : List[Person]|N return tuple(result) -def get_random_interns(number_of_interns, exclude_list : List[Person]|None = None, **intern_args) -> List[Person]|Person: +def get_random_interns(number_of_interns, exclude_list : list[Person]|None = None, **intern_args) -> list[Person]|Person: if exclude_list is None: exclude_list = [] @@ -200,7 +199,7 @@ def get_random_interns(number_of_interns, exclude_list : List[Person]|None = Non return tuple(result) #Return a list of people in the same room as MC. If MC is home, return everyone at MC's home. -def get_nearby_people() -> List[Person]: +def get_nearby_people() -> list[Person]: if mc.is_home: return [x for x in list_of_people if x.location in home_hub] if mc.is_at_work: @@ -253,7 +252,7 @@ def flatten_list(lst): # get a sorted list of people to use with main_choice_display @renpy.pure -def get_sorted_people_list(people: List[Person], title: str, back_extension: None|str = None, reverse = False) -> List[Person]: +def get_sorted_people_list(people: list[Person], title: str, back_extension: None|str = None, reverse = False) -> list[Person]: people.sort(key = lambda x: x.name, reverse = reverse) people.insert(0, title) if not back_extension is None: diff --git a/game/helper_functions/wardrobe_from_xml_ren.py b/game/helper_functions/wardrobe_from_xml_ren.py index d471dbe6e..7421e49f8 100644 --- a/game/helper_functions/wardrobe_from_xml_ren.py +++ b/game/helper_functions/wardrobe_from_xml_ren.py @@ -1,5 +1,5 @@ import os -from typing import Callable, List +from typing import Callable import xml.etree.ElementTree as ET import renpy from game.major_game_classes.clothing_related.Clothing_ren import Clothing @@ -51,7 +51,7 @@ def outfit_from_xml(outfit_element: ET.Element): return_outfit = Outfit(outfit_element.attrib["name"]) clothing_mapping = {"UpperBody":Outfit.add_upper, "LowerBody":Outfit.add_lower, "Feet":Outfit.add_feet, "Accessories":Outfit.add_accessory} - add_function: Callable[[Outfit, Clothing, List[float], str, List[float]], None] + add_function: Callable[[Outfit, Clothing, list[float], str, list[float]], None] for location, add_function in clothing_mapping.items(): for item_element in outfit_element.find(location): clothing_copy = proper_name_to_clothing_copy(item_element.attrib["name"]) diff --git a/game/helper_functions/wardrobe_management_functions_ren.py b/game/helper_functions/wardrobe_management_functions_ren.py index ff71a265d..ae91b5f4b 100644 --- a/game/helper_functions/wardrobe_management_functions_ren.py +++ b/game/helper_functions/wardrobe_management_functions_ren.py @@ -1,6 +1,5 @@ import os import re -from typing import List from game.major_game_classes.clothing_related.Outfit_ren import Outfit, Clothing from renpy import config """renpy @@ -11,7 +10,7 @@ from xml.dom import minidom def log_outfit(outfit: Outfit, outfit_class = "FullSets", wardrobe_name = "Exported_Wardrobe") -> None: def build_item_dict(cloth: Clothing): - def add_colors(item_dict, colour: List[float], prefix = ""): + def add_colors(item_dict, colour: list[float], prefix = ""): for idx, col_name in enumerate(["red", "green", "blue", "alpha"]): item_dict[prefix + col_name] = "{:0.5f}".format(colour[idx]) diff --git a/game/main_character/MainCharacter_ren.py b/game/main_character/MainCharacter_ren.py index b2d1c9c89..b2c9890e8 100644 --- a/game/main_character/MainCharacter_ren.py +++ b/game/main_character/MainCharacter_ren.py @@ -1,5 +1,4 @@ import builtins -from typing import Dict, List, Tuple from game.bugfix_additions.mapped_list_ren import MappedList from game.helper_functions.list_functions_ren import all_locations_in_the_game from game.main_character.goals_ren import create_initial_sex_goal, create_initial_stat_goal, create_initial_work_goal, create_new_sex_goal, create_new_stat_goal, create_new_work_goal @@ -24,7 +23,7 @@ init -2 python: import time class MainCharacter(): - def __init__(self, location, name, last_name, stat_array: List[int], skill_array: List[int], sex_array: List[int]): + def __init__(self, location, name, last_name, stat_array: list[int], skill_array: list[int], sex_array: list[int]): self.location = location self.name = name self.last_name = last_name @@ -58,7 +57,7 @@ class MainCharacter(): ##Sex Skills## # These skill represent your knowledge and experience with different types of intimacy. Useful for raising a girls arousal faster than your own. - self.sex_skills: Dict[str, int] = {} + self.sex_skills: dict[str, int] = {} self.sex_skills["Foreplay"] = sex_array[0] # A catch all for everything that goes on before blowjobs, sex, etc. Includes things like kissing, massages, etc. self.sex_skills["Oral"] = sex_array[1] # Your skill at eating a girl out. self.sex_skills["Vaginal"] = sex_array[2] # Your skill at different positions that involve vaginal sex. @@ -70,7 +69,7 @@ class MainCharacter(): self.max_energy = 100 #Your physical energy. Mainly consumed by having sex, slowly comes back during the day (with some actions speeding this up), and a lot of it returns at the end of the day self.energy = self.max_energy - self.main_character_actions: List[Action] = [] # A list of actions enabled for the main character when they talk to people. Kind of like a "role" for the MC. + self.main_character_actions: list[Action] = [] # A list of actions enabled for the main character when they talk to people. Kind of like a "role" for the MC. self.condom = False #True if you currently have a condom on. (maintained by sex scenes). TODO: Allow a third "broken" state and add dialogue and descriptions for that. self.recently_orgasmed = False #If True you recently orgasmed and aren't hard until your arousal rises to 10 or the encounter ends. @@ -458,7 +457,7 @@ class MainCharacter(): self.stolen_underwear[the_person.identifier].append(the_item) - def get_underwear_list(self) -> Tuple(str, Clothing): + def get_underwear_list(self) -> tuple(str, Clothing): return_list = [] for person_identifier, clothing_items in self.stolen_underwear.items(): person = Person.get_person_by_identifier(person_identifier) diff --git a/game/main_character/goals_ren.py b/game/main_character/goals_ren.py index a6410a1f5..e087d5896 100644 --- a/game/main_character/goals_ren.py +++ b/game/main_character/goals_ren.py @@ -38,7 +38,6 @@ # Reach research tier X. import builtins import copy -from typing import List import renpy from renpy import persistent @@ -56,9 +55,9 @@ from game.sex_positions._position_definitions_ren import kissing day = 0 time_of_day = 0 -stat_goals : List[Goal] = [] -work_goals : List[Goal] = [] -sex_goals : List[Goal] = [] +stat_goals : list[Goal] = [] +work_goals : list[Goal] = [] +sex_goals : list[Goal] = [] """renpy init 1 python: """ diff --git a/game/main_character/mc_serum_trait_ren.py b/game/main_character/mc_serum_trait_ren.py index ac235aec1..a78d810d8 100644 --- a/game/main_character/mc_serum_trait_ren.py +++ b/game/main_character/mc_serum_trait_ren.py @@ -2,15 +2,14 @@ #Each MC serum should be linked to an existing regular serum trait for research purposes. #Each MC serum trait also has atleast three different levels of effectives, based on their mastery and the category master level. #MC Serum Traits can be declared in init python statements because their data is all calculated on the fly, so the list can be changed and fucked with as needed without destroying save games. -from typing import List from game.main_character.perks.Perks_ren import perk_system from game.major_game_classes.serum_related.SerumTrait_ren import SerumTrait, list_of_traits from game.major_game_classes.character_related.Person_ren import mc, ashley from game.people.Ashley.ashley_definition_ren import ashley_get_mc_obedience, ashley_mc_submission_story_complete import renpy -list_of_mc_traits: List["MC_Serum_Trait"] = [] -list_of_upgraded_mc_serums: List[str] = [] +list_of_mc_traits: list["MC_Serum_Trait"] = [] +list_of_upgraded_mc_serums: list[str] = [] """renpy init -2 python: """ diff --git a/game/main_character/perks/Perks_ren.py b/game/main_character/perks/Perks_ren.py index 59fbc7d6c..211e60a97 100644 --- a/game/main_character/perks/Perks_ren.py +++ b/game/main_character/perks/Perks_ren.py @@ -1,4 +1,4 @@ -from typing import Callable, List +from typing import Callable from game.main_character.MainCharacter_ren import MainCharacter, mc from game.major_game_classes.character_related.Person_ren import Person @@ -148,13 +148,13 @@ class Perks(): if self.has_ability_perk(perk_name): self.ability_perks[perk_name].click_perk() - def get_stat_perk_list(self) -> List['Stat_Perk']: #This function returns a list of all three perk lists. + def get_stat_perk_list(self) -> list['Stat_Perk']: #This function returns a list of all three perk lists. return self.stat_perks - def get_item_perk_list(self) -> List['Item_Perk']: + def get_item_perk_list(self) -> list['Item_Perk']: return self.item_perks - def get_ability_perk_list(self) -> List['Ability_Perk']: + def get_ability_perk_list(self) -> list['Ability_Perk']: return self.ability_perks def get_ability_perk_text_desc(self, perk_name: str) -> str: diff --git a/game/major_game_classes/business_related/Business_ren.py b/game/major_game_classes/business_related/Business_ren.py index cafe7becb..0ac45f95d 100644 --- a/game/major_game_classes/business_related/Business_ren.py +++ b/game/major_game_classes/business_related/Business_ren.py @@ -1,5 +1,4 @@ import builtins -from typing import Dict, List, Tuple import renpy from renpy import basestring from game.bugfix_additions.mapped_list_ren import MappedList @@ -68,7 +67,7 @@ class Business(): self.s_uniform = Wardrobe(self.name + " Supply Wardrobe") self.h_uniform = Wardrobe(self.name + " HR Wardrobe") - self.business_uniforms : List[UniformOutfit] = [] #A list of UniformOutfits + self.business_uniforms : list[UniformOutfit] = [] #A list of UniformOutfits self.stripper_wardrobe = Wardrobe("Stripper Wardrobe") self.waitress_wardrobe = Wardrobe("Waitress Wardrobe") @@ -76,7 +75,7 @@ class Business(): self.manager_wardrobe = Wardrobe("Manager Wardrobe") self.mistress_wardrobe = Wardrobe("Mistress Wardrobe") - self.stripclub_uniforms : List[StripClubOutfit] = [] #A list of StripClubOutfits + self.stripclub_uniforms : list[StripClubOutfit] = [] #A list of StripClubOutfits #These are the serums given to the different departments if the daily serum dosage policy is researched. self.m_serum = None @@ -109,7 +108,7 @@ class Business(): self.blueprinted_traits = [] #List of traits that we have built from trait blueprints. - self.serum_designs : List[SerumDesign] = [] #Holds serum designs that you have researched. + self.serum_designs : list[SerumDesign] = [] #Holds serum designs that you have researched. self.active_research_design = None #The current research (serum design or serum trait) the business is working on self.batch_size = 5 #How many serums are produced in each production batch @@ -118,15 +117,15 @@ class Business(): self.inventory = SerumInventory() # Production lines now have their own class. - self.production_lines : List[ProductionLine] = [] #Holds instances of Production Line. Default is 2, buying more production lines lets you produce serum designs in parallel (but no more than your default amount). + self.production_lines : list[ProductionLine] = [] #Holds instances of Production Line. Default is 2, buying more production lines lets you produce serum designs in parallel (but no more than your default amount). self.production_lines.append(ProductionLine(self.inventory)) self.production_lines.append(ProductionLine(self.inventory)) self.max_active_contracts = 2 - self.active_contracts : List[Contract] = [] + self.active_contracts : list[Contract] = [] self.max_offered_contracts = 2 - self.offered_contracts : List[Contract] = [] + self.offered_contracts : list[Contract] = [] # self.policy_list = [] #This is a list of Policy objects. # self.active_policy_list = [] #This is a list of currently active policies (vs just owned ones) @@ -187,7 +186,7 @@ class Business(): self._policy_list = MappedList(Policy, all_policies_in_the_game) self._active_IT_project_map = MappedList(IT_Project, all_IT_projects) self._IT_project_map = MappedList(IT_Project, all_IT_projects) - self._partial_IT_projects : Dict[int, int] = {} + self._partial_IT_projects : dict[int, int] = {} self._current_IT_project: int = None self.current_IT_project_progress = 0 self._head_researcher = None @@ -232,23 +231,23 @@ class Business(): return True @property - def active_policy_list(self) -> List[Policy]: + def active_policy_list(self) -> list[Policy]: return self._active_policy_list @property - def policy_list(self) -> List[Policy]: + def policy_list(self) -> list[Policy]: return self._policy_list @property - def active_IT_projects(self) -> List[IT_Project]: + def active_IT_projects(self) -> list[IT_Project]: return self._active_IT_project_map @property - def IT_projects(self) -> List[IT_Project]: + def IT_projects(self) -> list[IT_Project]: return self._IT_project_map @property - def IT_partial_projects(self) -> Tuple(int, int): + def IT_partial_projects(self) -> tuple(int, int): return self._partial_IT_projects @property @@ -358,23 +357,23 @@ class Business(): self._company_model = None @property - def research_team(self) -> List[Person]: + def research_team(self) -> list[Person]: return self._research_team @property - def market_team(self) -> List[Person]: + def market_team(self) -> list[Person]: return self._market_team @property - def supply_team(self) -> List[Person]: + def supply_team(self) -> list[Person]: return self._supply_team @property - def production_team(self) -> List[Person]: + def production_team(self) -> list[Person]: return self._production_team @property - def hr_team(self) -> List[Person]: + def hr_team(self) -> list[Person]: return self._hr_team @property @@ -1052,14 +1051,14 @@ class Business(): person.event_triggers_dict["stripping"] = True #Used to flag the blackmail event @property - def employee_list(self) -> List[Person]: + def employee_list(self) -> list[Person]: return [x for x in self.research_team + self.production_team + self.supply_team + self.market_team + self.hr_team if x.is_available] @property def employee_count(self) -> int: return len(self.employee_list) - def get_requirement_employee_list(self, exclude_list = None, **kargs) -> List[Person]: #Get a list of employees who pass the validrequirements. Pass the same arguments as person_meets_requirements expects as named args. + def get_requirement_employee_list(self, exclude_list = None, **kargs) -> list[Person]: #Get a list of employees who pass the validrequirements. Pass the same arguments as person_meets_requirements expects as named args. if exclude_list is None: exclude_list = [] return [x for x in self.employee_list if x not in exclude_list and x.person_meets_requirements(**kargs)] @@ -1266,10 +1265,10 @@ class Business(): def mc_offspring_count(self) -> int: return sum(x.number_of_children_with_mc for x in self.employee_list) - def employees_with_children_with_mc(self) -> List[Person]: + def employees_with_children_with_mc(self) -> list[Person]: return [x for x in self.employee_list if x.has_child_with_mc] - def employees_knocked_up_by_mc(self) -> List[Person]: + def employees_knocked_up_by_mc(self) -> list[Person]: return [x for x in self.employee_list if (x.is_pregnant and x.is_mc_father)] def date_scheduled_today(self) -> bool: @@ -1323,7 +1322,7 @@ class Business(): # College intern related functions @property - def interns_list(self) -> List[Person]: + def interns_list(self) -> list[Person]: return [x for x in self.college_interns_research + self.college_interns_production + self.college_interns_supply + self.college_interns_market + self.college_interns_HR if x.is_available] @@ -1390,7 +1389,7 @@ class Business(): person.set_override_schedule(None, the_days = [5,6], the_times = [1,2]) person.remove_role(college_intern_role) - def get_intern_depts_with_openings(self) -> List[str]: + def get_intern_depts_with_openings(self) -> list[str]: dept_list = [] if len(self.college_interns_research) < self.max_interns_by_division: dept_list.append("Research") @@ -1405,7 +1404,7 @@ class Business(): return dept_list @property - def intern_list(self) -> List[Person]: + def intern_list(self) -> list[Person]: return [x for x in self.college_interns_research + self.college_interns_production + self.college_interns_supply + self.college_interns_market + self.college_interns_HR if x.is_available] @property @@ -1418,7 +1417,7 @@ class Business(): return self.intern_count > 0 return False - def get_requirement_intern_list(self, exclude_list : List[Person]|None = None, **kargs): #Get a list of interns who pass the validrequirements. Pass the same arguments as person_meets_requirements expects as named args. + def get_requirement_intern_list(self, exclude_list : list[Person]|None = None, **kargs): #Get a list of interns who pass the validrequirements. Pass the same arguments as person_meets_requirements expects as named args. if exclude_list is None: exclude_list = [] return [x for x in self.intern_list if x not in exclude_list and x.person_meets_requirements(**kargs)] diff --git a/game/major_game_classes/character_related/Job_ren.py b/game/major_game_classes/character_related/Job_ren.py index edd413af8..ae3ac174e 100644 --- a/game/major_game_classes/character_related/Job_ren.py +++ b/game/major_game_classes/character_related/Job_ren.py @@ -1,4 +1,3 @@ -from typing import List from renpy.rollback import NoRollback from game.bugfix_additions.mapped_list_ren import generate_identifier from game.game_roles._role_definitions_ren import unimportant_job_role @@ -7,7 +6,7 @@ from game.major_game_classes.game_logic.Duty_ren import Duty from game.major_game_classes.game_logic.Role_ren import Role from game.major_game_classes.game_logic.Room_ren import Room, list_of_places -list_of_jobs : List['Job'] +list_of_jobs : list['Job'] mom_associate_job: 'Job' mom_secretary_job: 'Job' aunt_unemployed_job: 'Job' @@ -46,9 +45,9 @@ yoga_teacher_job: 'Job' init -2 python: """ class Job(NoRollback): # A job is just a title displayed on the screen and a name that is displayed. A person can only have one job at a time (if it's not a full time job it's just a Role). - def __init__(self, job_title : str, job_roles : List[Role]|Role|None = None, job_location: Room|None = None, hire_function = None, quit_function = None, work_days = None, work_times = None, + def __init__(self, job_title : str, job_roles : list[Role]|Role|None = None, job_location: Room|None = None, hire_function = None, quit_function = None, work_days = None, work_times = None, seniority_level = 1, wage_adjustment = 1.0, productivity_adjustment = 1.0, promotion_function = None, - mandatory_duties: List[Duty]|None = None, available_duties: List[Duty]|None = None): + mandatory_duties: list[Duty]|None = None, available_duties: list[Duty]|None = None): self.job_title = job_title # The string that is displayed on the hud if job_roles is None: self.job_roles = [unimportant_job_role] diff --git a/game/major_game_classes/character_related/Person_ren.py b/game/major_game_classes/character_related/Person_ren.py index d6cc75ed5..a3eb98235 100644 --- a/game/major_game_classes/character_related/Person_ren.py +++ b/game/major_game_classes/character_related/Person_ren.py @@ -1,7 +1,7 @@ import builtins import copy import renpy -from typing import Callable, List, Type, DefaultDict +from typing import Callable, Type from renpy import persistent from renpy import basestring from renpy.character import Character @@ -60,6 +60,7 @@ from game.major_game_classes.clothing_related.wardrobe_builder_ren import Wardro from game.major_game_classes.clothing_related.wardrobe_preferences_ren import WardrobePreference from game.major_game_classes.clothing_related.LimitedWardrobeCollection_ren import limited_wardrobes from game.people.Sarah.sarah_definition_ren import sarah_threesomes_unlocked +from collections import defaultdict GAME_SPEED = 1 TIER_0_TIME_DELAY = 1 @@ -67,11 +68,11 @@ TIER_1_TIME_DELAY = 5 TIER_2_TIME_DELAY = 12 TIER_3_TIME_DELAY = 20 -report_log: DefaultDict[int] -unique_character_list : List['Person'] = [] -list_of_people: List['Person'] = [] -list_of_patreon_characters : List['Person'] = [] -list_of_instantiation_functions: List[Callable[[]], None] +report_log: defaultdict[int] +unique_character_list : list['Person'] = [] +list_of_people: list['Person'] = [] +list_of_patreon_characters : list['Person'] = [] +list_of_instantiation_functions: list[Callable[[]], None] stripclub_strippers = MappedList() stripclub_bdsm_performers = MappedList() @@ -400,7 +401,7 @@ class Person(): #Everything that needs to be known about a person. return return_list @classmethod - def generate_hair_colour(cls, base_colour = None, create_variation = True) -> List[float]: + def generate_hair_colour(cls, base_colour = None, create_variation = True) -> list[float]: return_hair = None if base_colour: @@ -487,7 +488,7 @@ class Person(): #Everything that needs to be known about a person. return get_random_from_list(cls._list_of_male_names) @classmethod - def get_random_glasses_frame_colour(cls) -> List[int]: + def get_random_glasses_frame_colour(cls) -> list[int]: # Picks one of several mostly-neutral colours that should go well with most items return get_random_from_list(cls._list_of_clothing_colours) @@ -496,11 +497,11 @@ class Person(): #Everything that needs to be known about a person. return get_random_from_weighted_list(build_generic_weighted_list("Body Type")) @classmethod - def get_normal_opinions_list(cls) -> List[str]: + def get_normal_opinions_list(cls) -> list[str]: return cls._opinions_list[:] @classmethod - def get_sexy_opinions_list(cls) -> List[str]: + def get_sexy_opinions_list(cls) -> list[str]: return cls._sexy_opinions_list[:] @@ -517,11 +518,11 @@ class Person(): #Everything that needs to be known about a person. return get_random_from_list(cls._coffee_list) @classmethod - def get_list_of_hairs(cls) -> List[str|List[int]]: + def get_list_of_hairs(cls) -> list[str|list[int]]: return copy.deepcopy(cls._list_of_hairs) #Return a deepcopy so that original list and it's content is immutable @classmethod - def get_list_of_eyes(cls) -> List[str|List[int]]: + def get_list_of_eyes(cls) -> list[str|list[int]]: return copy.deepcopy(cls._list_of_eyes) #Return a deepcopy so that original list and it's content is immutable @classmethod @@ -730,12 +731,12 @@ class Person(): #Everything that needs to be known about a person. def __init__(self, name : str, last_name : str, age : int, body_type : str, tits : str, height: float, body_images : Clothing, - hair_colour : str|List[str|List[int]], hair_style : Clothing, pubes_style : Clothing, skin : str, eyes, job : Job, wardrobe: Wardrobe, personality: Personality, - stat_list : List[int], skill_list : List[int], - sluttiness=0,obedience=100,suggest=0,sex_skill_list : List[int]|None = None, love = 0, happiness = 100, home : Room = None, + hair_colour : str|list[str|list[int]], hair_style : Clothing, pubes_style : Clothing, skin : str, eyes, job : Job, wardrobe: Wardrobe, personality: Personality, + stat_list : list[int], skill_list : list[int], + sluttiness=0,obedience=100,suggest=0,sex_skill_list : list[int]|None = None, love = 0, happiness = 100, home : Room = None, font = "fonts/Avara.tff", name_color = "#ffffff", dialogue_color = "#ffffff", face_style = "Face_1", tan_style : Clothing|None = None, - special_role : List[Role]|Role|None = None, + special_role : list[Role]|Role|None = None, title : str|None = None, possessive_title : str|None = None, mc_title : str|None = None, relationship : str|None = None, SO_name: str|None = None, kids : int|None = None, base_outfit : Outfit|None = None, generate_insta = False, generate_dikdok = False, generate_onlyfans = False, coffee_style : str|None = None, @@ -828,7 +829,7 @@ class Person(): #Everything that needs to be known about a person. if possessive_title: self.set_possessive_title(possessive_title) - self.text_modifiers : List[Callable[[Person, str], str]] = [] #A list of functions, each of which take Person, String and return a modified String. Used to modify text to dynamically highlight words, or reflect a speech difference. + self.text_modifiers : list[Callable[[Person, str], str]] = [] #A list of functions, each of which take Person, String and return a modified String. Used to modify text to dynamically highlight words, or reflect a speech difference. self.pubes_colour = None @@ -846,9 +847,9 @@ class Person(): #Everything that needs to be known about a person. self.set_eye_colour(Color(rgb=(eyes[1][0], eyes[1][1], eyes[1][2]))) self.serum_tolerance = 2 #How many active serums this person can tolerate before they start to suffer negative effects. - self.serum_effects : List[SerumDesign] = [] #A list of all of the serums we are under the effect of. + self.serum_effects : list[SerumDesign] = [] #A list of all of the serums we are under the effect of. - self.special_role : List[Role] = [] + self.special_role : list[Role] = [] if isinstance(special_role, Role): self.special_role = [special_role] #Support handing a non-list special role, in case we forget to wrap it in a list one day. elif isinstance(special_role, list): @@ -883,7 +884,7 @@ class Person(): #Everything that needs to be known about a person. self.work_experience = work_experience # How experienced with work in general this girl is. The higher it is the more money a girl will want, but the more duties she can handle. self.job : Job | None = None - self.duties : List[Duty] = [] + self.duties : list[Duty] = [] self.change_job(job) @@ -957,7 +958,7 @@ class Person(): #Everything that needs to be known about a person. elif isinstance(base_outfit, Outfit): self.base_outfit = base_outfit - self.infractions : List[Infraction] = [] #List of infractions this character has committed. + self.infractions : list[Infraction] = [] #List of infractions this character has committed. self.outfit = None # what outfit is she currently wearing self.planned_outfit = None #planned_outfit is the outfit the girl plans to wear today while not at work. She will change back into it after work or if she gets stripped. Cop0y it in case the outfit is changed during the day. @@ -1780,7 +1781,7 @@ class Person(): #Everything that needs to be known about a person. def run_turn(self): self.change_energy(20, add_to_log = False) - remove_list : List[SerumDesign] = [] + remove_list : list[SerumDesign] = [] for serum in self.serum_effects: #Compute the effects of all of the serum that the girl is under. serum.run_on_turn(self) #Run the serum's on_turn funcion if it has one. if serum.is_expired: #Returns true if the serum effect is suppose to expire in this time, otherwise returns false. Always updates duration counter when called. @@ -2126,7 +2127,7 @@ class Person(): #Everything that needs to be known about a person. renpy.hide(str(self.identifier), draw_layer) renpy.hide(str(self.identifier) + "_old", draw_layer) - def draw_animated_removal(self, clothing : Clothing, position: str = None, emotion: str = None, show_person_info = True, special_modifier: str = None, lighting: List[float] = None, the_animation = None, animation_effect_strength = 1.0, half_off_instead = False, + def draw_animated_removal(self, clothing : Clothing, position: str = None, emotion: str = None, show_person_info = True, special_modifier: str = None, lighting: list[float] = None, the_animation = None, animation_effect_strength = 1.0, half_off_instead = False, draw_layer = "solo", display_transform = None, extra_at_arguments = None, display_zorder = None, wipe_scene = True, scene_manager : Scene|None = None): if clothing is None: #we need something to take off renpy.say("WARNING", "Draw animated removal called without passing a clothing item.") @@ -3676,7 +3677,7 @@ class Person(): #Everything that needs to be known about a person. return True return False - def effective_sluttiness(self, taboos: str|List[str]|None = None) -> int: #Used in sex scenes where the girl will be more aroused, making it easier for her to be seduced. + def effective_sluttiness(self, taboos: str|list[str]|None = None) -> int: #Used in sex scenes where the girl will be more aroused, making it easier for her to be seduced. if taboos is None: taboos = [] elif not isinstance(taboos, list): #Handles handing over a single item without pre-wrapping it for "iteration". @@ -4144,7 +4145,7 @@ class Person(): #Everything that needs to be known about a person. return (profit_base + tit_modifier + ass_modifier + self.charisma) * shifts - def set_schedule(self, the_location: Room, the_days: List[int]|None = None, the_times: List[int]|None = None): + def set_schedule(self, the_location: Room, the_days: list[int]|None = None, the_times: list[int]|None = None): ''' Sets the scheduled location When the_days is None, all days of the week are scheduled @@ -4228,7 +4229,7 @@ class Person(): #Everything that needs to be known about a person. return what - def has_job(self, job : str|Job|List[Job]) -> bool: + def has_job(self, job : str|Job|list[Job]) -> bool: if not self.job: return False @@ -4238,7 +4239,7 @@ class Person(): #Everything that needs to be known about a person. return self.job in job return self.job == job - def has_job_role(self, job_role : str|List[Role]) -> bool: + def has_job_role(self, job_role : str|list[Role]) -> bool: if not self.job: return False @@ -4319,14 +4320,14 @@ class Person(): #Everything that needs to be known about a person. if over_count == 0: break - def get_duty_actions(self) -> List[Action]: + def get_duty_actions(self) -> list[Action]: actions = set() for duty in self.duties: if self.is_at_work or not duty.only_at_work: actions.update(duty.actions) return list(actions) - def get_duty_internet_actions(self) -> List[Action]: + def get_duty_internet_actions(self) -> list[Action]: actions = set() for duty in self.duties: if self.is_at_work or not duty.only_at_work: @@ -4370,7 +4371,7 @@ class Person(): #Everything that needs to be known about a person. return True return False - def has_role(self, role : str|Role|List[Role]) -> bool: + def has_role(self, role : str|Role|list[Role]) -> bool: ''' Returns True: When one of the passed roles is found ''' @@ -4467,7 +4468,7 @@ class Person(): #Everything that needs to be known about a person. return "friend" # fallback - def get_titles(self) -> List[str]: #Returns a list of character titles this person can have. A title is what you call a person, often but not always their name or based on their name. + def get_titles(self) -> list[str]: #Returns a list of character titles this person can have. A title is what you call a person, often but not always their name or based on their name. list_of_titles = self.personality.get_personality_titles(self) if isinstance(list_of_titles, basestring): # lock personality to one title return [list_of_titles] @@ -4550,7 +4551,7 @@ class Person(): #Everything that needs to be known about a person. def get_random_title(self) -> str: return get_random_from_list(self.get_titles()) - def get_possessive_titles(self) -> List[str]: + def get_possessive_titles(self) -> list[str]: list_of_titles = self.personality.get_personality_possessive_titles(self) if isinstance(list_of_titles, basestring): # lock personality to one title return [list_of_titles] @@ -4631,10 +4632,10 @@ class Person(): #Everything that needs to be known about a person. return list(set(list_of_titles)) - def get_random_possessive_title(self) -> List[str]: + def get_random_possessive_title(self) -> list[str]: return get_random_from_list(self.get_possessive_titles()) - def get_player_titles(self) -> List[str]: + def get_player_titles(self) -> list[str]: list_of_titles = self.personality.get_personality_player_titles(self) if isinstance(list_of_titles, basestring): # lock personality to one title return [list_of_titles] @@ -4773,7 +4774,7 @@ class Person(): #Everything that needs to be known about a person. # now let the Garbage Collector do the rest (we are no longer referenced in any objects). - def __strip_outfit_strip_list(self, strip_list: List[Clothing], position: str = None, emotion: str = None, display_transform = None, lighting: List[float] = None, scene_manager: Scene = None, wipe_scene = False, half_off_instead = False, delay = 1): + def __strip_outfit_strip_list(self, strip_list: list[Clothing], position: str = None, emotion: str = None, display_transform = None, lighting: list[float] = None, scene_manager: Scene = None, wipe_scene = False, half_off_instead = False, delay = 1): if position is None: self.position = self.idle_pose @@ -4896,28 +4897,28 @@ class Person(): #Everything that needs to be known about a person. def restore_all_clothing(self): return self.outfit.restore_all_clothing() - def get_full_strip_list(self, strip_feet = True, strip_accessories = False) -> List[Clothing]: + def get_full_strip_list(self, strip_feet = True, strip_accessories = False) -> list[Clothing]: return self.outfit.get_full_strip_list(strip_feet, strip_accessories) - def get_underwear_strip_list(self, visible_enough = True, avoid_nudity = False) -> List[Clothing]: + def get_underwear_strip_list(self, visible_enough = True, avoid_nudity = False) -> list[Clothing]: return self.outfit.get_underwear_strip_list(visible_enough, avoid_nudity) def can_half_off_to_tits(self, visible_enough = True) -> bool: return self.outfit.can_half_off_to_tits(visible_enough) - def get_half_off_to_tits_list(self, visible_enough = True) -> List[Clothing]: + def get_half_off_to_tits_list(self, visible_enough = True) -> list[Clothing]: return self.outfit.get_half_off_to_tits_list(visible_enough) - def get_tit_strip_list(self, visible_enough = True) -> List[Clothing]: + def get_tit_strip_list(self, visible_enough = True) -> list[Clothing]: return self.outfit.get_tit_strip_list(visible_enough) def can_half_off_to_vagina(self, visible_enough = True) -> bool: return self.outfit.can_half_off_to_vagina(visible_enough) - def get_half_off_to_vagina_list(self, visible_enough = True) -> List[Clothing]: + def get_half_off_to_vagina_list(self, visible_enough = True) -> list[Clothing]: return self.outfit.get_half_off_to_vagina_list(visible_enough) - def get_vagina_strip_list(self, visible_enough = True) -> List[Clothing]: + def get_vagina_strip_list(self, visible_enough = True) -> list[Clothing]: return self.outfit.get_vagina_strip_list(visible_enough) # wrapper for girl in charge diff --git a/game/major_game_classes/character_related/Personality_ren.py b/game/major_game_classes/character_related/Personality_ren.py index f458561c9..2ac307732 100644 --- a/game/major_game_classes/character_related/Personality_ren.py +++ b/game/major_game_classes/character_related/Personality_ren.py @@ -1,11 +1,10 @@ -from typing import List import renpy from game.bugfix_additions.mapped_list_ren import generate_identifier from game.helper_functions.play_sounds_ren import play_female_orgasm from game.helper_functions.list_functions_ren import get_random_from_list from game.major_game_classes.character_related.Person_ren import Person, mc -list_of_personalities : List['Personality'] +list_of_personalities : list['Personality'] """renpy init -1 python: """ @@ -146,17 +145,17 @@ class Personality(): the_key = get_random_from_list(self.common_sexy_dislikes) return (the_key,[degree,False]) - def get_personality_titles(self, person: Person) -> List[str]: #This should be a function defined for each + def get_personality_titles(self, person: Person) -> list[str]: #This should be a function defined for each if callable(self.titles_function): return self.titles_function(person) return [person.name] - def get_personality_possessive_titles(self, person: Person)-> List[str]: + def get_personality_possessive_titles(self, person: Person)-> list[str]: if callable(self.possessive_titles_function): return self.possessive_titles_function(person) return [person.name] - def get_personality_player_titles(self, person: Person) -> List[str]: + def get_personality_player_titles(self, person: Person) -> list[str]: if callable(self.player_titles_function): return self.player_titles_function(person) return [mc.name] diff --git a/game/major_game_classes/character_related/Progression_Scene_ren.py b/game/major_game_classes/character_related/Progression_Scene_ren.py index ce183ed8e..d763cc688 100644 --- a/game/major_game_classes/character_related/Progression_Scene_ren.py +++ b/game/major_game_classes/character_related/Progression_Scene_ren.py @@ -5,18 +5,18 @@ #Class may have to reference another class in the event of a branching storyline #Use a character's init file to call their progression scene recompiles. -from typing import Callable, List +from typing import Callable import renpy from game.major_game_classes.game_logic.Action_ren import Action """renpy init -2 python: """ -list_of_progression_scenes : List['Progression_Scene'] = [] +list_of_progression_scenes : list['Progression_Scene'] = [] class Progression_Scene(): - def __init__(self, compile_scenes: Callable[['Progression_Scene'], None], start_scene_list: List[str], req_list: List[Callable], trans_list: List[str], final_scene_list: List[str], + def __init__(self, compile_scenes: Callable[['Progression_Scene'], None], start_scene_list: list[str], req_list: list[Callable], trans_list: list[str], final_scene_list: list[str], intro_scene : str, exit_scene: str, progression_scene_action: Action, choice_scene, stage = -1, advance_time = True, business_action = False, person_action = False, is_random = False, role_action = False, unit_test_func = None, @@ -29,7 +29,7 @@ class Progression_Scene(): self.choice_scene = choice_scene #Use this to determine if MC wants to stay or leave the event. self.progression_scene_action = progression_scene_action #Use this as a generic action that can be added to any girl to proc the event. self.name = self.progression_scene_action.name - self.start_scene_list: List[str] = start_scene_list #Scene to play at the beginning of the progression_scene. Mostly to build lust and set the stage. + self.start_scene_list: list[str] = start_scene_list #Scene to play at the beginning of the progression_scene. Mostly to build lust and set the stage. self.req_list = req_list #Requirements used to determine if we are advancing corruption levels self.trans_list = trans_list #A transition between corruption levels. self.final_scene_list = final_scene_list #The act of the progression_scene itself @@ -142,4 +142,3 @@ def progression_scene_test_func_default(the_group = None): for person in the_group: person.change_slut(10, 100) person.change_energy(200) - time_of_day = 1 diff --git a/game/major_game_classes/character_related/Progression_ren.py b/game/major_game_classes/character_related/Progression_ren.py index d4bd5eb1e..bdc297070 100644 --- a/game/major_game_classes/character_related/Progression_ren.py +++ b/game/major_game_classes/character_related/Progression_ren.py @@ -1,7 +1,6 @@ -from typing import List from game.major_game_classes.character_related.Person_ren import Person -progress_list : List['Progression'] = [] +progress_list : list['Progression'] = [] """renpy init -1 python: """ diff --git a/game/major_game_classes/character_related/Relationship_ren.py b/game/major_game_classes/character_related/Relationship_ren.py index 4dc4de682..e41a730d1 100644 --- a/game/major_game_classes/character_related/Relationship_ren.py +++ b/game/major_game_classes/character_related/Relationship_ren.py @@ -1,5 +1,4 @@ import builtins -from typing import List from renpy import basestring from game.random_lists_ren import get_random_from_weighted_list from game.major_game_classes.character_related.Person_ren import Person, mc @@ -129,7 +128,7 @@ class RelationshipArray(): # pylint: disable=protected-access return None #Otherwise these people have no relationship. - def get_relationship_list(self, the_person: Person, types : List[str]|str = None, visible = None): + def get_relationship_list(self, the_person: Person, types : list[str]|str = None, visible = None): return_list = [] if isinstance(types, basestring): types = [types] @@ -151,7 +150,7 @@ class RelationshipArray(): # pylint: disable=protected-access return_list.append([other_person, self.get_relationship_type(the_person, other_person)]) #Creates a tuple of [Person, Type] for every entry in the list. return return_list - def get_business_relationships(self, types: List[str]|str = None): #Returns a list containing all relationships between people in your company. + def get_business_relationships(self, types: list[str]|str = None): #Returns a list containing all relationships between people in your company. return_list = [] if isinstance(types, basestring): types = [types] diff --git a/game/major_game_classes/character_related/Schedule_ren.py b/game/major_game_classes/character_related/Schedule_ren.py index b8e9494dc..80d4d8269 100644 --- a/game/major_game_classes/character_related/Schedule_ren.py +++ b/game/major_game_classes/character_related/Schedule_ren.py @@ -1,7 +1,6 @@ -from typing import List from game.major_game_classes.game_logic.Room_ren import Room, list_of_places -list_of_places : List[Room] +list_of_places : list[Room] day = 0 time_of_day = 0 """renpy @@ -113,7 +112,7 @@ class Schedule(): return new_schedule - def set_schedule(self, the_place : Room|None, the_days : List[int]|None = None, the_times : List[int]|None = None): + def set_schedule(self, the_place : Room|None, the_days : list[int]|None = None, the_times : list[int]|None = None): ''' Sets the scheduled location When the_days is None, all days of the week are scheduled diff --git a/game/major_game_classes/character_related/scene_manager_ren.py b/game/major_game_classes/character_related/scene_manager_ren.py index f9d33384e..5fd902bff 100644 --- a/game/major_game_classes/character_related/scene_manager_ren.py +++ b/game/major_game_classes/character_related/scene_manager_ren.py @@ -1,5 +1,4 @@ import builtins -from typing import List import renpy from game.bugfix_additions.debug_info_ren import write_log from game.helper_functions.list_functions_ren import is_iterable @@ -93,9 +92,9 @@ class Actor(): class Scene(): def __init__(self): - self.actors : List[Actor] = [] + self.actors : list[Actor] = [] - def add_group(self, people: List[Person], position: str = None, emotion: str = None, special_modifier: str = None, lighting = None, z_order = None): + def add_group(self, people: list[Person], position: str = None, emotion: str = None, special_modifier: str = None, lighting = None, z_order = None): xoffset = 0.1 for person in people: self.add_actor(person, position, emotion, special_modifier, lighting, character_center(xoffset), z_order) @@ -246,7 +245,7 @@ class Scene(): keep_stripping = True renpy.pause(delay) - def strip_actor_strip_list(self, person: Person, strip_list: List[Clothing], lighting = None, half_off_instead = False): + def strip_actor_strip_list(self, person: Person, strip_list: list[Clothing], lighting = None, half_off_instead = False): actor = next((x for x in self.actors if x.person == person), None) if actor: for item in strip_list: @@ -285,7 +284,7 @@ class Scene(): actor.person.hide_person() self.draw_scene() - def hide_actors(self, people: List[Person]): + def hide_actors(self, people: list[Person]): if is_iterable(people): for person in people: self.hide_actor(person) @@ -317,7 +316,7 @@ class Scene(): elif builtins.len(visible_actors) == 1: renpy.show_screen("person_info_ui", visible_actors[0].person) - def draw_scene(self, exclude_list: List[Person] = None): + def draw_scene(self, exclude_list: list[Person] = None): self.draw_info_ui() if exclude_list is None: exclude_list = [] diff --git a/game/major_game_classes/clothing_related/Clothing_ren.py b/game/major_game_classes/clothing_related/Clothing_ren.py index 5bf0daccb..4bf23a955 100644 --- a/game/major_game_classes/clothing_related/Clothing_ren.py +++ b/game/major_game_classes/clothing_related/Clothing_ren.py @@ -1,5 +1,4 @@ import copy -from typing import Dict, List, Tuple from renpy.display import im from renpy.defaultstore import AlphaBlend, Composite, Solid from game.bugfix_additions.mapped_list_ren import generate_identifier @@ -7,9 +6,9 @@ from game.clothing_lists_ren import pumps, high_heels, leggings, pinafore, two_p from game.major_game_classes.clothing_related.Clothing_Images_ren import Clothing_Images from game.major_game_classes.clothing_related.wardrobe_builder_ren import WardrobeBuilder -master_clothing_offset_dict : Dict[str, Dict[str, Tuple[int, int]]] = {} -position_size_dict: Dict[str, Tuple(int, int)] = {} -supported_positions: List[str] = [] +master_clothing_offset_dict : dict[str, dict[str, tuple[int, int]]] = {} +position_size_dict: dict[str, tuple(int, int)] = {} +supported_positions: list[str] = [] """renpy init -15 python: @@ -23,7 +22,7 @@ class Clothing(): def set_pattern_sets(self, value): Clothing._pattern_sets[self.proper_name] = value - pattern_sets : Dict[str, Clothing_Images] = property(get_pattern_sets, set_pattern_sets, None, "Clothing pattern sets") + pattern_sets : dict[str, Clothing_Images] = property(get_pattern_sets, set_pattern_sets, None, "Clothing pattern sets") _position_sets = {} def get_position_sets(self): @@ -33,12 +32,12 @@ class Clothing(): def set_position_sets(self, value): Clothing._position_sets[self.proper_name] = value - position_sets : Dict[str, Clothing_Images] = property(get_position_sets, set_position_sets, None, "Clothing position sets") + position_sets : dict[str, Clothing_Images] = property(get_position_sets, set_position_sets, None, "Clothing position sets") def get_crop_offset_dict(self): return master_clothing_offset_dict.get(self.proper_name, {}) - crop_offset_dict : Dict[str, Tuple[int, int]] = property(get_crop_offset_dict, None, None, "Offset dictionary") + crop_offset_dict : dict[str, tuple[int, int]] = property(get_crop_offset_dict, None, None, "Offset dictionary") _half_off_regions = {} def get_half_off_regions(self): @@ -49,7 +48,7 @@ class Clothing(): if self.proper_name and value: Clothing._half_off_regions[self.proper_name] = value - half_off_regions : List['Clothing'] = property(get_half_off_regions, set_half_off_regions, None, "Clothing half off regions") + half_off_regions : list['Clothing'] = property(get_half_off_regions, set_half_off_regions, None, "Clothing half off regions") _half_off_ignore_regions = {} def get_half_off_ignore_regions(self): @@ -60,7 +59,7 @@ class Clothing(): if self.proper_name and value: Clothing._half_off_ignore_regions[self.proper_name] = value - half_off_ignore_regions: List['Clothing'] = property(get_half_off_ignore_regions, set_half_off_ignore_regions, None, "Clothing half off regions") + half_off_ignore_regions: list['Clothing'] = property(get_half_off_ignore_regions, set_half_off_ignore_regions, None, "Clothing half off regions") _constrain_regions = {} def get_constrain_regions(self): @@ -71,7 +70,7 @@ class Clothing(): if self.proper_name and value: Clothing._constrain_regions[self.proper_name] = value - constrain_regions : List['Clothing'] = property(get_constrain_regions, set_constrain_regions, None, "Clothing half off regions") + constrain_regions : list['Clothing'] = property(get_constrain_regions, set_constrain_regions, None, "Clothing half off regions") #Slots are @@ -95,9 +94,9 @@ class Clothing(): #Layer 3: Over shirts #Layer 4: Over everything - def __init__(self, name: str, layer: int, hide_below: bool, anchor_below: bool, proper_name: str, draws_breasts: bool, underwear: bool, slut_value: int, has_extension: 'Clothing' = None, is_extension = False, colour: List[float] = None, tucked = False, body_dependant = True, - opacity_adjustment = 1, whiteness_adjustment = 0.0, contrast_adjustment = 1.0, supported_patterns = None, pattern = None, colour_pattern: List[float] = None, ordering_variable = 0, display_name = None, - can_be_half_off = False, half_off_regions: List['Clothing'] = None, half_off_ignore_regions: List['Clothing'] = None, half_off_gives_access = None, half_off_reveals = None, constrain_regions : List['Clothing'] = None): + def __init__(self, name: str, layer: int, hide_below: bool, anchor_below: bool, proper_name: str, draws_breasts: bool, underwear: bool, slut_value: int, has_extension: 'Clothing' = None, is_extension = False, colour: list[float] = None, tucked = False, body_dependant = True, + opacity_adjustment = 1, whiteness_adjustment = 0.0, contrast_adjustment = 1.0, supported_patterns = None, pattern = None, colour_pattern: list[float] = None, ordering_variable = 0, display_name = None, + can_be_half_off = False, half_off_regions: list['Clothing'] = None, half_off_ignore_regions: list['Clothing'] = None, half_off_gives_access = None, half_off_reveals = None, constrain_regions : list['Clothing'] = None): self.name = name self.proper_name = proper_name #The true name used in the file system if display_name is None: @@ -190,11 +189,11 @@ class Clothing(): return self.__hash__() < other.__hash__() def __hash__(self) -> int: - return generate_identifier(( + return generate_identifier( tuple([self.name, self.is_extension, self.pattern, self.half_off]) + tuple(self.colour_pattern) + tuple(self.colour) - )) + ) def __eq__(self, other): if isinstance(self, other.__class__): diff --git a/game/major_game_classes/clothing_related/Expression_ren.py b/game/major_game_classes/clothing_related/Expression_ren.py index 092f4ea36..7f8791d32 100644 --- a/game/major_game_classes/clothing_related/Expression_ren.py +++ b/game/major_game_classes/clothing_related/Expression_ren.py @@ -1,11 +1,10 @@ -from typing import Type from renpy.defaultstore import AlphaMask, Composite from renpy.display import im from renpy.rollback import NoRollback from game._image_definitions_ren import empty_image from game.major_game_classes.clothing_related.zip_manager_ren import ZipContainer -supported_positions : Type[str] = [] +supported_positions : type[str] = [] """renpy init -2 python: """ diff --git a/game/major_game_classes/clothing_related/LimitedWardrobeCollection_ren.py b/game/major_game_classes/clothing_related/LimitedWardrobeCollection_ren.py index bfbeb7bc4..5e3179223 100644 --- a/game/major_game_classes/clothing_related/LimitedWardrobeCollection_ren.py +++ b/game/major_game_classes/clothing_related/LimitedWardrobeCollection_ren.py @@ -1,4 +1,4 @@ -from typing import Iterator +from collections.abc import Iterator from game.major_game_classes.clothing_related.LimitedWardrobe_ren import LimitedWardrobe limited_wardrobes : 'LimitedWardrobeCollection' diff --git a/game/major_game_classes/clothing_related/LimitedWardrobe_ren.py b/game/major_game_classes/clothing_related/LimitedWardrobe_ren.py index 74b0c24de..b8fd42065 100644 --- a/game/major_game_classes/clothing_related/LimitedWardrobe_ren.py +++ b/game/major_game_classes/clothing_related/LimitedWardrobe_ren.py @@ -1,4 +1,4 @@ -from typing import Callable, Dict +from typing import Callable from game.bugfix_additions.mapped_list_ren import generate_identifier from game.helper_functions.wardrobe_from_xml_ren import wardrobe_from_xml from game.major_game_classes.character_related.Person_ren import Person @@ -20,7 +20,7 @@ class LimitedWardrobe(): self.priority = priority self.validation_func = func # cache for chosen outfit for person for this day - self.daily_outfits: Dict([int, Outfit]) = {} + self.daily_outfits: dict([int, Outfit]) = {} self.identifier = generate_identifier( (name, priority, func) diff --git a/game/major_game_classes/clothing_related/Outfit_ren.py b/game/major_game_classes/clothing_related/Outfit_ren.py index ad275c3bc..f85ae1c89 100644 --- a/game/major_game_classes/clothing_related/Outfit_ren.py +++ b/game/major_game_classes/clothing_related/Outfit_ren.py @@ -1,4 +1,3 @@ -from typing import List import builtins import math import renpy @@ -42,10 +41,10 @@ class Outfit(): #A bunch of clothing added together, without slot conflicts. def __init__(self, name : str): self.name = name - self.upper_body : List[Clothing] = [] - self.lower_body : List[Clothing] = [] - self.feet : List[Clothing] = [] - self.accessories : List[Facial_Accessory] = [] #Extra stuff that doesn't fit anywhere else. Hats, glasses, ect. + self.upper_body : list[Clothing] = [] + self.lower_body : list[Clothing] = [] + self.feet : list[Clothing] = [] + self.accessories : list[Facial_Accessory] = [] #Extra stuff that doesn't fit anywhere else. Hats, glasses, ect. def __lt__(self, other): if other is None: @@ -208,7 +207,7 @@ class Outfit(): #A bunch of clothing added together, without slot conflicts. def can_add_dress(self, new_clothing : Clothing) -> bool: return self.can_add_upper(new_clothing) - def add_dress(self, new_clothing : Clothing, re_colour : List[float]|None = None, pattern : str|None = None, colour_pattern : List[float]|None = None): + def add_dress(self, new_clothing : Clothing, re_colour : list[float]|None = None, pattern : str|None = None, colour_pattern : list[float]|None = None): self.add_upper(new_clothing, re_colour = re_colour, pattern = pattern, colour_pattern = colour_pattern) def can_add_upper(self, new_clothing : Clothing) -> bool: @@ -218,7 +217,7 @@ class Outfit(): #A bunch of clothing added together, without slot conflicts. and not any(x for x in self.upper_body if x.has_extension and x.layer == new_clothing.has_extension.layer and x.has_extension.layer == new_clothing.layer) return allowed - def add_upper(self, new_clothing : Clothing, re_colour : List[float]|None = None, pattern : str|None = None, colour_pattern : List[float]|None = None): + def add_upper(self, new_clothing : Clothing, re_colour : list[float]|None = None, pattern : str|None = None, colour_pattern : list[float]|None = None): if re_colour is not None: new_clothing.colour = re_colour @@ -237,7 +236,7 @@ class Outfit(): #A bunch of clothing added together, without slot conflicts. def can_add_lower(self,new_clothing : Clothing) -> bool: return not any(x for x in self.lower_body if x.layer == new_clothing.layer) - def add_lower(self, new_clothing, re_colour : List[float]|None = None, pattern : str|None = None, colour_pattern : List[float]|None = None): + def add_lower(self, new_clothing, re_colour : list[float]|None = None, pattern : str|None = None, colour_pattern : list[float]|None = None): if re_colour is not None: new_clothing.colour = re_colour if pattern is not None: @@ -253,7 +252,7 @@ class Outfit(): #A bunch of clothing added together, without slot conflicts. def can_add_feet(self, new_clothing : Clothing) -> bool: return not any(x for x in self.feet if x.layer == new_clothing.layer) - def add_feet(self, new_clothing : Clothing, re_colour : List[float]|None = None, pattern : str|None = None, colour_pattern : List[float]|None = None): + def add_feet(self, new_clothing : Clothing, re_colour : list[float]|None = None, pattern : str|None = None, colour_pattern : list[float]|None = None): if re_colour is not None: new_clothing.colour = re_colour @@ -274,7 +273,7 @@ class Outfit(): #A bunch of clothing added together, without slot conflicts. allowed = False return allowed - def add_accessory(self, new_clothing : Clothing, re_colour : List[float]|None = None, pattern : str|None = None, colour_pattern : List[float]|None = None): + def add_accessory(self, new_clothing : Clothing, re_colour : list[float]|None = None, pattern : str|None = None, colour_pattern : list[float]|None = None): if re_colour is not None: new_clothing.colour = re_colour if pattern is not None: @@ -308,7 +307,7 @@ class Outfit(): #A bunch of clothing added together, without slot conflicts. if found: found.half_off = True - def remove_clothing_list(self, clothing_list : List[Clothing], half_off_instead = False): + def remove_clothing_list(self, clothing_list : list[Clothing], half_off_instead = False): if not isinstance(clothing_list, list): return @@ -432,7 +431,7 @@ class Outfit(): #A bunch of clothing added together, without slot conflicts. self.remove_clothing(to_remove) return to_remove - def get_unanchored(self, half_off_instead = False) -> List[Clothing]: #Returns a list of the pieces of clothing that can be removed. + def get_unanchored(self, half_off_instead = False) -> list[Clothing]: #Returns a list of the pieces of clothing that can be removed. #Question: should be be able to remove accessories like this? We would need a way to flag some things like makeup as unremovable. # Note: half_off_instead returns a list of clothing items that can be half-offed, which means either they are completely unanchored, or they are anchored but all upper layers are half-off and half-off gives access return_list = [] @@ -618,7 +617,7 @@ class Outfit(): #A bunch of clothing added together, without slot conflicts. new_score += 15 return new_score if new_score < 100 else 100 - def get_full_strip_list(self, strip_feet = True, strip_accessories = False) -> List[Clothing]: + def get_full_strip_list(self, strip_feet = True, strip_accessories = False) -> list[Clothing]: items_to_strip = self.lower_body + [x for x in self.upper_body if x.layer > 0] if strip_feet: items_to_strip.extend(self.feet) @@ -636,7 +635,7 @@ class Outfit(): #A bunch of clothing added together, without slot conflicts. items_to_strip.remove(item) #Don't try and strip extension directly. return items_to_strip[::-1] #Put it in reverse order so when stripped it will be done from outside in. - def get_underwear_strip_list(self, visible_enough = True, avoid_nudity = False, strip_shoes = False) -> List[Clothing]: + def get_underwear_strip_list(self, visible_enough = True, avoid_nudity = False, strip_shoes = False) -> list[Clothing]: #If a girl isn't wearing underwear this ends up being a full strip. If she is wearing only a bra/panties she'll strip until they are visible, and the other slot is naked. test_outfit = self.get_copy() #We'll use a copy of the outfit. Slightly less efficient, but makes it easier to ensure we are generating valid strip orders. items_to_strip = [] @@ -680,7 +679,7 @@ class Outfit(): #A bunch of clothing added together, without slot conflicts. for item in items_to_strip: self.remove_clothing(item) - def get_tit_strip_list(self, visible_enough = True) -> List[Clothing]: #Generates a list of clothing that, when removed from this outfit, result in tits being visible. Useful for animated clothing removal. + def get_tit_strip_list(self, visible_enough = True) -> list[Clothing]: #Generates a list of clothing that, when removed from this outfit, result in tits being visible. Useful for animated clothing removal. test_outfit = self.get_copy() items_to_strip = [] while not ((test_outfit.tits_visible and visible_enough) or (test_outfit.tits_available and not visible_enough)): @@ -704,7 +703,7 @@ class Outfit(): #A bunch of clothing added together, without slot conflicts. if not the_item: break - def get_vagina_strip_list(self, visible_enough = False) -> List[Clothing]: + def get_vagina_strip_list(self, visible_enough = False) -> list[Clothing]: test_outfit = self.get_copy() items_to_strip = [] while not ((test_outfit.vagina_visible and visible_enough) or (test_outfit.vagina_available and not visible_enough)): @@ -725,7 +724,7 @@ class Outfit(): #A bunch of clothing added together, without slot conflicts. or (not visible_enough and self.tits_available) \ or len(self.get_half_off_to_tits_list(visible_enough = visible_enough)) > 0 - def get_half_off_to_tits_list(self, visible_enough = True) -> List[Clothing]: + def get_half_off_to_tits_list(self, visible_enough = True) -> list[Clothing]: # If possible returns the list of clothing items, from outer to inner, that must be half-offed to gain view/access to her tits # If not possible returns an empty list. return_list = [] @@ -770,7 +769,7 @@ class Outfit(): #A bunch of clothing added together, without slot conflicts. or (not visible_enough and self.vagina_available)) \ or len(self.get_half_off_to_vagina_list(visible_enough = visible_enough)) > 0 - def get_half_off_to_vagina_list(self, visible_enough = True) -> List[Clothing]: + def get_half_off_to_vagina_list(self, visible_enough = True) -> list[Clothing]: # If possible returns the list of clothing items, from outer to inner, that must be half-offed to gain view/access to her vagina # If not possible returns an empty list. return_list = [] @@ -957,7 +956,7 @@ class Outfit(): #A bunch of clothing added together, without slot conflicts. if builtins.len(outfitname) == 0: return "Naked" - self.name = "{} {}".format(Outfit.classification(self.outfit_slut_score), outfitname) + self.name = f"{Outfit.classification(self.outfit_slut_score)} {outfitname}" return self.name @@ -974,7 +973,7 @@ class Outfit(): #A bunch of clothing added together, without slot conflicts. return True return False - def __get_upper_unanchored(self, half_off_instead = False) -> List[Clothing]: + def __get_upper_unanchored(self, half_off_instead = False) -> list[Clothing]: return_list = [] for top in reversed(self.get_upper_ordered()): if top.has_extension is None or self.is_item_unanchored(top.has_extension, half_off_instead): #Clothing items that cover two slots (dresses) are unanchored if both halves are unanchored. @@ -985,7 +984,7 @@ class Outfit(): #A bunch of clothing added together, without slot conflicts. break #Search the list, starting at the outermost item, until you find something that anchors the stuff below it. return return_list - def __get_lower_unanchored(self, half_off_instead = False) -> List[Clothing]: + def __get_lower_unanchored(self, half_off_instead = False) -> list[Clothing]: return_list = [] for bottom in reversed(self.get_lower_ordered()): if bottom.has_extension is None or self.is_item_unanchored(bottom.has_extension, half_off_instead): @@ -996,7 +995,7 @@ class Outfit(): #A bunch of clothing added together, without slot conflicts. break return return_list - def __get_foot_unanchored(self, half_off_instead = False) -> List[Clothing]: + def __get_foot_unanchored(self, half_off_instead = False) -> list[Clothing]: return_list = [] for foot in reversed(self.get_feet_ordered()): if foot.has_extension is None or self.is_item_unanchored(foot.has_extension, half_off_instead): @@ -1007,7 +1006,7 @@ class Outfit(): #A bunch of clothing added together, without slot conflicts. break return return_list - def __generate_clothing_list(self) -> List[Clothing]: + def __generate_clothing_list(self) -> list[Clothing]: return sorted(self, key = Outfit.__cloth_sort_key) def __get_body_parts_slut_score(self, outfit_type = "full") -> int: diff --git a/game/major_game_classes/clothing_related/Wardrobe_ren.py b/game/major_game_classes/clothing_related/Wardrobe_ren.py index d8d77bda4..948e61b57 100644 --- a/game/major_game_classes/clothing_related/Wardrobe_ren.py +++ b/game/major_game_classes/clothing_related/Wardrobe_ren.py @@ -1,4 +1,4 @@ -from typing import Iterator, List +from collections.abc import Iterator import builtins import copy import renpy @@ -56,7 +56,7 @@ class Wardrobe(): #A bunch of outfits! outfit = wardrobe_builder.build_outfit(outfit_type, max_slut, min_slut) return wardrobe_builder.personalize_outfit(outfit, opinion_color = opinion_color, coloured_underwear = coloured_underwear, swap_bottoms = swap_bottoms, allow_skimpy = allow_skimpy) - def __init__(self, name : str, outfits : List[Outfit] = None, underwear_sets : List[Outfit] = None, overwear_sets : List[Outfit] = None): #Outfits is a list of Outfit objects, or empty if the wardrobe starts empty + def __init__(self, name : str, outfits : list[Outfit] = None, underwear_sets : list[Outfit] = None, overwear_sets : list[Outfit] = None): #Outfits is a list of Outfit objects, or empty if the wardrobe starts empty self.name = name self.outfit_sets = outfits #Outfits is now used to hold full outfits. self.underwear_sets = underwear_sets #Limited to layer 1 clothing items. @@ -403,13 +403,13 @@ class Wardrobe(): #A bunch of outfits! return None def __build_uniform_wardrobe(self, slut_limit = 999, underwear_limit = 999, limited_to_top = False) -> "Wardrobe": - def _filter_outfit_sets(outfit_sets : List[Outfit], slut_limit = 999) -> List[Outfit]: + def _filter_outfit_sets(outfit_sets : list[Outfit], slut_limit = 999) -> list[Outfit]: return [x for x in outfit_sets if x.outfit_slut_score <= slut_limit] - def _filter_underwear_sets(underwear_sets : List[Outfit], underwear_limit = 999) -> List[Outfit]: + def _filter_underwear_sets(underwear_sets : list[Outfit], underwear_limit = 999) -> list[Outfit]: return [x for x in underwear_sets if x.underwear_slut_score <= underwear_limit] - def _filter_overwear_sets(overwear_sets : List[Outfit], slut_limit = 999) -> List[Outfit]: + def _filter_overwear_sets(overwear_sets : list[Outfit], slut_limit = 999) -> list[Outfit]: return [x for x in overwear_sets if x.overwear_slut_score <= slut_limit] outfit_sets = [] diff --git a/game/major_game_classes/clothing_related/wardrobe_builder_ren.py b/game/major_game_classes/clothing_related/wardrobe_builder_ren.py index 75f261563..3901823db 100644 --- a/game/major_game_classes/clothing_related/wardrobe_builder_ren.py +++ b/game/major_game_classes/clothing_related/wardrobe_builder_ren.py @@ -1,5 +1,5 @@ import builtins -from typing import Dict, List, Literal, Tuple +from typing import Literal import renpy from renpy.color import Color from renpy.rollback import NoRollback @@ -19,7 +19,7 @@ init -2 python: """ from collections import OrderedDict -color_clothing_map: Dict[str, List[str]] = { +color_clothing_map: dict[str, list[str]] = { "Jean_Hotpants": ["the colour black", "the colour blue", "the colour brown", "the colour white"], "Daisy_Dukes" : ["the colour black", "the colour blue", "the colour brown", "the colour white"], "Jeans" : ["the colour black", "the colour blue", "the colour brown", "the colour white"], @@ -46,7 +46,7 @@ color_clothing_map: Dict[str, List[str]] = { } #Use this to define a set of neutral colors, useful for colors that match most anything else. -neutral_colors: Dict[str, List[float]] = { +neutral_colors: dict[str, list[float]] = { "khaki": [.765, .69, .569, .95], "swiss coffee": [.859, .331, .321, .95], #wut? this is salmon colored lol "light grey": [.827, .827, .827, .95], @@ -55,7 +55,7 @@ neutral_colors: Dict[str, List[float]] = { "midnight black": [.15, .15, .15, .95] } -neutral_palette: Dict[str, List[float]] = { +neutral_palette: dict[str, list[float]] = { "dark denim": [0, .278, .671, .95], "denim": [.082, .376, .741, .95], "light denim": [.365, .678, .925, .95], @@ -80,7 +80,7 @@ neutral_palette: Dict[str, List[float]] = { "berry": [.478, .09, .071, .95], } -neutral_color_map: Dict[str, List[str]] = { +neutral_color_map: dict[str, list[str]] = { "Jeans": ["dark denim", "denim", "light denim", "midnight black", "dark grey"], "Suit_Pants": ["midnight black", "leather", "khaki", "grey", "berry"], "Capris": ["dark denim", "denim", "dark grey"], @@ -184,7 +184,7 @@ neutral_color_map: Dict[str, List[str]] = { "Underwear": ["charcoal", "white smoke", "dark grey", "pale pink"] } -swap_bottoms_map: Dict[str, List[Clothing]] = { +swap_bottoms_map: dict[str, list[Clothing]] = { "Jeans": [long_skirt], "Suit_Pants": [pencil_skirt, long_skirt], "Capris": [pencil_skirt, skirt], @@ -202,12 +202,12 @@ swap_bottoms_map: Dict[str, List[Clothing]] = { "Micro_Skirt": [daisy_dukes] } -coverup_upper_list: List[Clothing] = [lab_coat, suit_jacket, vest] -coverup_lower_list: List[Clothing] = [] +coverup_upper_list: list[Clothing] = [lab_coat, suit_jacket, vest] +coverup_lower_list: list[Clothing] = [] # exclude list is a list of girl color preference (red, blue, green etc.) she hates -def neutralize_item_colour(item: Clothing, exclude_list: List[str] = None): - def random_preference_color(color_list: list[str], exclude_list) -> List[float]: +def neutralize_item_colour(item: Clothing, exclude_list: list[str] = None): + def random_preference_color(color_list: list[str], exclude_list) -> list[float]: colors = [neutral_palette[x] for x in color_list] if not exclude_list: return get_random_from_list(colors) @@ -289,20 +289,20 @@ def add_make_up_to_outfit(person: Person, outfit: Outfit, make_up_score_boost = if make_up_score > 3: outfit.add_accessory(blush.get_copy(), renpy.random.choice(blush_colours)) -real_bra_list : List[Clothing] = [x for x in bra_list if x not in [cincher, heart_pasties]] -real_pants_list : List[Clothing] = [x for x in pants_list if not x in [cop_pants]] -real_shirt_list : List[Clothing] = [x for x in shirts_list if not x in [cop_blouse, lab_coat]] -real_dress_list : List[Clothing] = [x for x in dress_list if x not in [bath_robe, lacy_one_piece_underwear, lingerie_one_piece, bodysuit_underwear, apron, nightgown_dress, sweater_dress]] -only_socks_list : List[Clothing] = [x for x in socks_list if x not in [thigh_highs, fishnets, garter_with_fishnets]] -real_pantyhose_list : List[Clothing] = [x for x in socks_list if x not in only_socks_list] -earings_only_list : List[Clothing] = [chandelier_earings, gold_earings, modern_glasses] -neckwear_without_collars : List[Clothing] = [x for x in neckwear_list if x.proper_name not in ["Collar_Breed", "Collar_Cum_Slut", "Collar_Fuck_Doll", "Wool_Scarf", "Spiked Choker"]] -makeup_list : List[Facial_Accessory] = [lipstick, light_eye_shadow, heavy_eye_shadow, blush] +real_bra_list : list[Clothing] = [x for x in bra_list if x not in [cincher, heart_pasties]] +real_pants_list : list[Clothing] = [x for x in pants_list if not x in [cop_pants]] +real_shirt_list : list[Clothing] = [x for x in shirts_list if not x in [cop_blouse, lab_coat]] +real_dress_list : list[Clothing] = [x for x in dress_list if x not in [bath_robe, lacy_one_piece_underwear, lingerie_one_piece, bodysuit_underwear, apron, nightgown_dress, sweater_dress]] +only_socks_list : list[Clothing] = [x for x in socks_list if x not in [thigh_highs, fishnets, garter_with_fishnets]] +real_pantyhose_list : list[Clothing] = [x for x in socks_list if x not in only_socks_list] +earings_only_list : list[Clothing] = [chandelier_earings, gold_earings, modern_glasses] +neckwear_without_collars : list[Clothing] = [x for x in neckwear_list if x.proper_name not in ["Collar_Breed", "Collar_Cum_Slut", "Collar_Fuck_Doll", "Wool_Scarf", "Spiked Choker"]] +makeup_list : list[Facial_Accessory] = [lipstick, light_eye_shadow, heavy_eye_shadow, blush] class WardrobeBuilder(NoRollback): default_person = None - preferences : Dict[str, Dict[str, List[Clothing]]]= {} + preferences : dict[str, dict[str, list[Clothing]]]= {} preferences["skimpy outfits"] = {} preferences["skimpy outfits"]["upper_body"] = [two_part_dress, thin_dress, leotard, lace_sweater, belted_top, lace_crop_top, frilly_longsleeve_shirt, tanktop, tube_top, business_vest, kitty_babydoll] preferences["skimpy outfits"]["lower_body"] = [booty_shorts, jean_hotpants, daisy_dukes, belted_skirt, mini_skirt, micro_skirt] @@ -336,7 +336,7 @@ class WardrobeBuilder(NoRollback): preferences['lingerie']["feet"] = [thigh_highs, fishnets, garter_with_fishnets] preferences['lingerie']['accessories'] = [lace_choker, wide_choker] - matching_underwear: Dict[str, List[Clothing]] = {} + matching_underwear: dict[str, list[Clothing]] = {} matching_underwear["Bralette"] = [boy_shorts, cute_lace_panties, tiny_lace_panties, thong, tiny_g_string] matching_underwear["Sports_Bra"] = [cotton_panties, panties, lace_panties] matching_underwear["Lace_Bra"] = [cute_lace_panties, lace_panties, tiny_lace_panties, thong, tiny_g_string, crotchless_panties] @@ -345,7 +345,7 @@ class WardrobeBuilder(NoRollback): matching_underwear["Kitty_Babydoll"] = [kitty_panties, thong, kitty_panties, strappy_panties, kitty_panties] matching_underwear["Cincher"] = [panties, thin_panties, thong, tiny_lace_panties, tiny_g_string, string_panties, crotchless_panties] - color_prefs: Dict[str, OrderedDict[str, list[float]]] = {} + color_prefs: dict[str, OrderedDict[str, list[float]]] = {} color_prefs["the colour blue"] = OrderedDict([ ("dark slate blue", [.282, .239, .545, .95]), ("dark denim", [0, .278, .671, .95]), @@ -435,7 +435,7 @@ class WardrobeBuilder(NoRollback): return get_random_from_list([WardrobeBuilder.color_prefs[opinion_color][x][:] for x in WardrobeBuilder.color_prefs[opinion_color]]) @staticmethod - def get_item_color(item: Clothing, colour: List[float], exclude_list = None, multiplier = 1.0): + def get_item_color(item: Clothing, colour: list[float], exclude_list = None, multiplier = 1.0): if exclude_list is None: exclude_list = [] if item.proper_name in color_clothing_map: @@ -454,7 +454,7 @@ class WardrobeBuilder(NoRollback): return [colour[0] * multiplier, colour[1] * multiplier, colour[2] * multiplier, colour[3]] @staticmethod - def get_color_opinion(colour: List[float]) -> str: + def get_color_opinion(colour: list[float]) -> str: if isinstance(colour, list) and len(colour) >= 3: color_name = closest_preference_color(Color(rgb=(colour[0], colour[1], colour[2]))) @@ -465,8 +465,8 @@ class WardrobeBuilder(NoRollback): return "the colour black" # default fallback @staticmethod - def get_color(person: Person, base_color : List[float] = None) -> List[float]: - def get_excluded(base_color: List[float]) -> List[str]: + def get_color(person: Person, base_color : list[float] = None) -> list[float]: + def get_excluded(base_color: list[float]) -> list[str]: if base_color: # prevents clashing colours opinion_color = WardrobeBuilder.get_color_opinion(base_color) @@ -528,7 +528,7 @@ class WardrobeBuilder(NoRollback): return (color_upper, color_lower, color_feet) @staticmethod - def build_filter_list(item_list: List[Clothing], points: int, min_points = 0, filter_list = None, layers : List[int] = None): + def build_filter_list(item_list: list[Clothing], points: int, min_points = 0, filter_list = None, layers : list[int] = None): if filter_list is None: filter_list = [] if layers is None: @@ -542,7 +542,7 @@ class WardrobeBuilder(NoRollback): return [x for x in item_list if x.slut_value >= min_points and x.slut_value <= points and x.layer in layers and x not in filter_list] @staticmethod - def build_weighted_list(person: Person, item_group: str, filtered_list: List[Clothing]): + def build_weighted_list(person: Person, item_group: str, filtered_list: list[Clothing]): item_list = [[x, 1, True] for x in filtered_list] for topic, prefs in WardrobeBuilder.preferences.items(): score = person.get_opinion_score(topic) @@ -560,7 +560,7 @@ class WardrobeBuilder(NoRollback): or [x for x in item_list if x[1] > 0] @staticmethod - def add_accessory_from_list(outfit: Outfit, filtered_list: List[Clothing], chance: int, item_color : List[float] = None): + def add_accessory_from_list(outfit: Outfit, filtered_list: list[Clothing], chance: int, item_color : list[float] = None): if item_color is None: item_color = [.8, .1, .1, .95] if renpy.random.randint(0, chance) == 0: @@ -569,7 +569,7 @@ class WardrobeBuilder(NoRollback): outfit.add_accessory(item.get_copy(), WardrobeBuilder.get_item_color(item, item_color)) @staticmethod - def get_item_from_list(person: Person, item_group: str, filtered_list : List[Clothing], empty_item_opinions : List[str] = None, no_pattern = False) -> Clothing | None: + def get_item_from_list(person: Person, item_group: str, filtered_list : list[Clothing], empty_item_opinions : list[str] = None, no_pattern = False) -> Clothing | None: if empty_item_opinions is None: empty_item_opinions = [] weighted_list = WardrobeBuilder.build_weighted_list(person, item_group, filtered_list) @@ -591,13 +591,13 @@ class WardrobeBuilder(NoRollback): return item @staticmethod - def get_clothing_min_max_slut_value(sluttiness: int) -> Tuple(int, int): + def get_clothing_min_max_slut_value(sluttiness: int) -> tuple(int, int): base_sluttiness = builtins.max(sluttiness - 15, 0) # first 15 points of sluttiness don't impact outfit builder min_sluttiness = builtins.min(base_sluttiness // 18, 5) if sluttiness > 50 else 0 # prevent override of person preferences until she's slutty enough not to care return (min_sluttiness, builtins.min(base_sluttiness // 7, 12)) @staticmethod - def apply_bottom_preference(person: Person, outfit: Outfit) -> Tuple(Outfit, bool): + def apply_bottom_preference(person: Person, outfit: Outfit) -> tuple(Outfit, bool): swapped = False if outfit.has_pants and person.opinion_skirts > person.opinion_pants: #Outfit has pants and girl prefers skirts outfit = swap_outfit_bottoms(outfit) @@ -640,7 +640,7 @@ class WardrobeBuilder(NoRollback): @staticmethod #pylint: disable=redefined-outer-name - def set_sexier_bra(person: Person, outfit: Outfit, the_color: List[float] = None, allow_remove_bra = True) -> bool: + def set_sexier_bra(person: Person, outfit: Outfit, the_color: list[float] = None, allow_remove_bra = True) -> bool: bra = outfit.get_bra() if not bra is None and bra.has_extension: # one-piece return False @@ -732,13 +732,13 @@ class WardrobeBuilder(NoRollback): return True def build_overwear(self, points = 0, min_points = 0) -> Outfit: - def make_upper_item_transparent(item: Clothing, points: int, colour: List[float]) -> Tuple[Clothing, List[float]]: + def make_upper_item_transparent(item: Clothing, points: int, colour: list[float]) -> tuple[Clothing, list[float]]: colour[3] = .85 + (renpy.random.randint(0, 10) / 100.0) if item.layer == 3 and item.slut_value > 0 and points > 6 and item in real_shirt_list + real_dress_list: colour[3] = .75 + (renpy.random.randint(0, 15) / 100.0) return item.get_copy(), colour - def make_lower_item_transparent(item: Clothing, points: int, colour: List[float]) -> Tuple[Clothing, List[float]]: + def make_lower_item_transparent(item: Clothing, points: int, colour: list[float]) -> tuple[Clothing, list[float]]: colour[3] = .85 + (renpy.random.randint(0, 10) / 100.0) if item.layer == 3 and item.slut_value > 0 and points > 6 and item in skirts_list + [suitpants, leggings, booty_shorts]: colour[3] = .75 + (renpy.random.randint(0, 15) / 100.0) @@ -788,13 +788,13 @@ class WardrobeBuilder(NoRollback): return outfit def build_underwear(self, points = 0, min_points = 0) -> Outfit: - def make_upper_item_transparent(item: Clothing, points: int, colour: List[float]) -> Tuple[Clothing, List[float]]: + def make_upper_item_transparent(item: Clothing, points: int, colour: list[float]) -> tuple[Clothing, list[float]]: colour[3] = .90 + (renpy.random.randint(0, 5) / 100.0) if points >= 8 and item.slut_value > 0 and item in [lacy_one_piece_underwear, lingerie_one_piece, bodysuit_underwear] + real_bra_list: colour[3] = .7 + (renpy.random.randint(0, 20) / 100.0) return item.get_copy(), colour - def make_lower_item_transparent(item: Clothing, points: int, colour: List[float]) -> Tuple[Clothing, List[float]]: + def make_lower_item_transparent(item: Clothing, points: int, colour: list[float]) -> tuple[Clothing, list[float]]: colour[3] = .90 + (renpy.random.randint(0, 5) / 100.0) if points >= 8 and item.slut_value > 0 and item in panties_list: colour[3] = .7 + (renpy.random.randint(0, 20) / 100.0) @@ -857,8 +857,8 @@ class WardrobeBuilder(NoRollback): outfit.update_name() return outfit - def personalize_outfit(self, outfit: Outfit, opinion_color: List[float] = None, coloured_underwear = False, main_colour: List[float] = None, swap_bottoms = False, allow_skimpy = True) -> Outfit: - def preserve_colour_alpha(new_colour: List[float], old_colour: List[float]) -> float: + def personalize_outfit(self, outfit: Outfit, opinion_color: list[float] = None, coloured_underwear = False, main_colour: list[float] = None, swap_bottoms = False, allow_skimpy = True) -> Outfit: + def preserve_colour_alpha(new_colour: list[float], old_colour: list[float]) -> float: alpha_blended = new_colour[:] alpha_blended[3] = old_colour[3] return alpha_blended diff --git a/game/major_game_classes/clothing_related/zip_manager_ren.py b/game/major_game_classes/clothing_related/zip_manager_ren.py index 817280132..383dde5a9 100644 --- a/game/major_game_classes/clothing_related/zip_manager_ren.py +++ b/game/major_game_classes/clothing_related/zip_manager_ren.py @@ -1,7 +1,6 @@ ############################################################ # MOD Implementation of ZIP file loading and image caching # ############################################################ -from typing import Dict import renpy from renpy import persistent from renpy.rollback import NoRollback @@ -11,7 +10,7 @@ from game.major_game_classes.clothing_related.Expression_ren import Expression from game.major_game_classes.clothing_related.Clothing_Images_ren import Clothing_Images from game._image_definitions_ren import get_file_handle -emotion_images_dict: Dict = {} +emotion_images_dict: dict = {} """renpy init -99 python: """ diff --git a/game/major_game_classes/game_logic/ActionList_ren.py b/game/major_game_classes/game_logic/ActionList_ren.py index dc79cb310..bbb087f1b 100644 --- a/game/major_game_classes/game_logic/ActionList_ren.py +++ b/game/major_game_classes/game_logic/ActionList_ren.py @@ -1,5 +1,4 @@ # internal class to handle list of actions -from typing import List from renpy import basestring from game.bugfix_additions.debug_info_ren import write_log from game.major_game_classes.game_logic.Action_ren import Action @@ -7,8 +6,8 @@ from game.major_game_classes.game_logic.Action_ren import Action init -5 python: """ class ActionList(): - def __init__(self, actions : List[Action]|'ActionList'|Action|None = None): - self._actions: List[Action] = [] + def __init__(self, actions : list[Action]|'ActionList'|Action|None = None): + self._actions: list[Action] = [] if isinstance(actions, ActionList): self._actions = actions._actions[:] if isinstance(actions, list): @@ -35,7 +34,7 @@ class ActionList(): def __call__(self): return self._actions - def __iter__(self) -> List[Action]: + def __iter__(self) -> list[Action]: return iter(self._actions) def __len__(self) -> int: @@ -92,7 +91,7 @@ class ActionList(): def copy(self): return self.__class__(self) - def extend(self, other: Action|'ActionList'|List[Action]): + def extend(self, other: Action|'ActionList'|list[Action]): if isinstance(other, ActionList): self._actions.extend(other._actions) #pylint: disable=protected-access elif isinstance(other, list): diff --git a/game/major_game_classes/game_logic/Duty_ren.py b/game/major_game_classes/game_logic/Duty_ren.py index 272de3b64..37a201a85 100644 --- a/game/major_game_classes/game_logic/Duty_ren.py +++ b/game/major_game_classes/game_logic/Duty_ren.py @@ -2,7 +2,6 @@ # -> Duties are given to employees of the MC's business, capped at that employees seniority level. # -> Seniority levels are 1(intern, green employee), 2 (standard employee), 3(senior employee, department head). # -> Duties are checked to add role actions/dates/interactions in the same way as roles. -from typing import List from game.bugfix_additions.mapped_list_ren import generate_identifier from game.major_game_classes.character_related.Person_ren import Person from game.major_game_classes.game_logic.ActionList_ren import ActionList @@ -13,7 +12,7 @@ init -5 python: """ class Duty(): def __init__(self, duty_name : str, duty_description : str, requirement_function = None, - actions : List[Action]|None = None, internet_actions : List[Action]|None = None, + actions : list[Action]|None = None, internet_actions : list[Action]|None = None, on_turn_function = None, on_move_function = None, on_day_function = None, on_apply_function = None, on_remove_function = None, duty_trainables = None, only_at_work = True): diff --git a/game/major_game_classes/game_logic/Position_ren.py b/game/major_game_classes/game_logic/Position_ren.py index f1104c007..b36bd0635 100644 --- a/game/major_game_classes/game_logic/Position_ren.py +++ b/game/major_game_classes/game_logic/Position_ren.py @@ -1,6 +1,5 @@ import builtins -from typing import Dict, List, Tuple import renpy from game.bugfix_additions.mapped_list_ren import generate_identifier from game.helper_functions.list_functions_ren import get_random_from_list @@ -10,8 +9,8 @@ from game.major_game_classes.game_logic.Room_ren import Room, RoomObject from game.major_game_classes.character_related.Person_ren import Person, Clothing, mc from game.major_game_classes.clothing_related.VrenAnimation_ren import VrenAnimation -list_of_positions: List['Position'] -list_of_girl_positions: List['Position'] +list_of_positions: list['Position'] +list_of_girl_positions: list['Position'] idle_wiggle_animation: VrenAnimation = VrenAnimation(None, None, None) blowjob_bob: VrenAnimation missionary_bob: VrenAnimation @@ -29,7 +28,7 @@ class Position(): taboo_break_description, verb = "fuck", verbing = None, opinion_tags = None, record_class = None, default_animation:VrenAnimation|None = None, - modifier_animations: Dict[str, VrenAnimation]|None = None, + modifier_animations: dict[str, VrenAnimation]|None = None, associated_taboo = None, girl_outro = None, double_orgasm = None): @@ -52,13 +51,13 @@ class Position(): self.requires_clothing = requires_clothing # A tag that notes what (lack of) clothing requirements the position has. Vaginal requires access to her vagina, tits her tits. self.skill_tag = skill_tag #The skill that will provide a bonus to this position. self.opinion_tags = opinion_tags #The opinion that will be checked each round. - self.connections : List['Position'] = connections + self.connections : list[Position] = connections self.intro = intro self.taboo_break_description = taboo_break_description #Called instead of the intro/transition when you break a taboo with someone. Should include call to personality taboo specific dialogue. self.scenes = scenes self.outro = outro self.transition_default = transition_default - self.transitions: List[Tuple[Position, str]] = [] + self.transitions: list[tuple[Position, str]] = [] self.strip_description = strip_description self.strip_ask_description = strip_ask_description self.orgasm_description = orgasm_description @@ -234,7 +233,7 @@ class Position(): return the_animation_speed - def calculate_position_requirements(self, person: Person, ignore_taboo = False, only_known_opinions = False) -> Tuple(int, int): + def calculate_position_requirements(self, person: Person, ignore_taboo = False, only_known_opinions = False) -> tuple(int, int): ''' Return (final_slut_requirement, final_slut_cap) ''' diff --git a/game/major_game_classes/game_logic/Room_ren.py b/game/major_game_classes/game_logic/Room_ren.py index 7bf57756b..7aea0d696 100644 --- a/game/major_game_classes/game_logic/Room_ren.py +++ b/game/major_game_classes/game_logic/Room_ren.py @@ -1,5 +1,4 @@ import builtins -from typing import List import renpy from renpy import basestring from renpy.display import im @@ -9,7 +8,7 @@ from game.major_game_classes.character_related.Person_ren import Person, list_of from game.major_game_classes.game_logic.ActionList_ren import ActionList, Action from game.major_game_classes.game_logic.RoomObject_ren import RoomObject -list_of_places: List['Room'] +list_of_places: list['Room'] time_of_day = 0 bedroom: 'Room' lily_bedroom:'Room' @@ -63,7 +62,7 @@ dark_lighting = [[0.4,0.4,0.55],[0.4,0.4,0.55],[0.4,0.4,0.55],[0.4,0.4,0.55],[0. class Room(): #Contains objects. - def __init__(self, name: str = None, formal_name: str = None, background_image= None, objects: List[RoomObject] = None, actions: List[Action] = None, public = False, map_pos = None, + def __init__(self, name: str = None, formal_name: str = None, background_image= None, objects: list[RoomObject] = None, actions: list[Action] = None, public = False, map_pos = None, tutorial_label = None, visible = True, hide_in_known_house_map = True, lighting_conditions = None, privacy_level = 0, darken = True, accessible_func = None): if name is None: @@ -81,7 +80,7 @@ class Room(): #Contains objects. self.background_image = background_image #If a string this is used at all points in the day. If it is a list each entry corrisponds to the background for a different part of the day - self.objects: List[RoomObject] = [] + self.objects: list[RoomObject] = [] if isinstance(objects, list): for x in objects: self.add_object(x) @@ -165,14 +164,14 @@ class Room(): #Contains objects. person.location = self @property - def people(self) -> List[Person]: + def people(self) -> list[Person]: return people_at_location(self) @property def person_count(self) -> int: return len(self.people) - def objects_with_trait(self,the_trait:str) -> List[RoomObject]: + def objects_with_trait(self,the_trait:str) -> list[RoomObject]: return_list = [] for obj in self.objects: if obj.has_trait(the_trait): @@ -219,7 +218,7 @@ class Room(): #Contains objects. del self.accessable @property - def valid_actions(self) -> List[Action]: + def valid_actions(self) -> list[Action]: actions = [x for x in self.actions if x.is_action_enabled() or x.is_disabled_slug_shown()] actions.sort(key = lambda x: x.priority if x.is_action_enabled() else -1000, reverse = True) return actions diff --git a/game/major_game_classes/game_logic/TextMessageManager_ren.py b/game/major_game_classes/game_logic/TextMessageManager_ren.py index a00ba8f6a..08193c524 100644 --- a/game/major_game_classes/game_logic/TextMessageManager_ren.py +++ b/game/major_game_classes/game_logic/TextMessageManager_ren.py @@ -1,4 +1,3 @@ -from typing import Dict, List import renpy from renpy import config from renpy.character import HistoryEntry @@ -20,7 +19,7 @@ config.history_callbacks.append(text_message_history_callback) #Ensures conversa class TextMessageManager(): #Manages text conversations you've had with other girls. Also stores information for other phone related stuff def __init__(self): - self.message_history : Dict[int, List[HistoryEntry]] = {} # A dict that stores entries of Person:[HistoryEntry,HistoryEntry...] representing your recorded conversation with this girl. + self.message_history : dict[int, list[HistoryEntry]] = {} # A dict that stores entries of Person:[HistoryEntry,HistoryEntry...] representing your recorded conversation with this girl. def register_number(self, person: Person): #Now just used to keep track of whose number we know if not self.has_number(person): diff --git a/game/major_game_classes/serum_related/SerumDesign_ren.py b/game/major_game_classes/serum_related/SerumDesign_ren.py index 9ef8248a6..bd69b8e6d 100644 --- a/game/major_game_classes/serum_related/SerumDesign_ren.py +++ b/game/major_game_classes/serum_related/SerumDesign_ren.py @@ -1,4 +1,3 @@ -from typing import List import builtins import renpy from game.bugfix_additions.mapped_list_ren import generate_identifier @@ -31,8 +30,8 @@ class SerumDesign(): #A class that represents a design for a serum built up from def __init__(self, name = ""): self.name = name - self.traits: List[SerumTrait] = [] - self.side_effects : List[SerumTrait] = [] + self.traits: list[SerumTrait] = [] + self.side_effects : list[SerumTrait] = [] self.researched = False self.unlocked = False @@ -194,7 +193,7 @@ class SerumDesign(): #A class that represents a design for a serum built up from def has_trait(self, trait: SerumTrait) -> bool: return any(x for x in self.traits + self.side_effects if x == trait) - def has_tag(self, the_tag : List[str]|str) -> bool: #Returns true if at least one of the traits has the tag "the_tag". Used to confirm a production trait is included. + def has_tag(self, the_tag : list[str]|str) -> bool: #Returns true if at least one of the traits has the tag "the_tag". Used to confirm a production trait is included. return any(x for x in self.traits if x.has_tag(the_tag)) def change_attention(self, amount : int): # can be used to increase or decrease attention of design diff --git a/game/major_game_classes/serum_related/SerumInventory_ren.py b/game/major_game_classes/serum_related/SerumInventory_ren.py index fee4ef905..f111dc004 100644 --- a/game/major_game_classes/serum_related/SerumInventory_ren.py +++ b/game/major_game_classes/serum_related/SerumInventory_ren.py @@ -1,16 +1,15 @@ import builtins -from typing import List, Tuple from game.major_game_classes.serum_related.SerumDesign_ren import SerumDesign, SerumTrait from game.business_policies.organisation_policies_ren import attention_floor_increase_1_policy, attention_floor_increase_2_policy """renpy init -2 python: """ class SerumInventory(): #A bag class that lets businesses and people hold onto different types of serums, and move them around. - def __init__(self, starting_list: List[Tuple(SerumDesign, int)]|None = None): + def __init__(self, starting_list: list[tuple(SerumDesign, int)]|None = None): if starting_list is None: - self.serums_held: List[Tuple(SerumDesign, int)] = [] + self.serums_held: list[tuple(SerumDesign, int)] = [] else: - self.serums_held: List[Tuple(SerumDesign, int)] = starting_list ##Starting list is a list of tuples, going [SerumDesign,count]. Count should be possitive. + self.serums_held: list[tuple(SerumDesign, int)] = starting_list ##Starting list is a list of tuples, going [SerumDesign,count]. Count should be possitive. @property def total_serum_count(self) -> int: @@ -23,7 +22,7 @@ class SerumInventory(): #A bag class that lets businesses and people hold onto d return sum(self.get_serum_count(x) for x in self.get_serum_types if check_function(x)) @property - def get_serum_types(self) -> List[SerumDesign]: ## returns a list of all the serum types that are in the inventory, without their counts. + def get_serum_types(self) -> list[SerumDesign]: ## returns a list of all the serum types that are in the inventory, without their counts. return list({x[0] for x in self.serums_held}) @property diff --git a/game/major_game_classes/serum_related/SerumTrait_ren.py b/game/major_game_classes/serum_related/SerumTrait_ren.py index 0f5352ff4..df3ca6368 100644 --- a/game/major_game_classes/serum_related/SerumTrait_ren.py +++ b/game/major_game_classes/serum_related/SerumTrait_ren.py @@ -1,13 +1,13 @@ import builtins -from typing import Callable, List +from typing import Callable from renpy import basestring from game.bugfix_additions.mapped_list_ren import generate_identifier from game.main_character.MainCharacter_ren import mc, Person from game.major_game_classes.serum_related.SerumDesign_ren import SerumDesign -list_of_traits : List['SerumTrait'] -list_of_side_effects : List['SerumTrait'] -list_of_nora_traits : List['SerumTrait'] +list_of_traits : list['SerumTrait'] +list_of_side_effects : list['SerumTrait'] +list_of_nora_traits : list['SerumTrait'] """renpy init -2 python: """ @@ -208,7 +208,7 @@ class SerumTrait(): has_prereqs = False return has_prereqs - def has_tag(self, tags: List[str]|str) -> bool: + def has_tag(self, tags: list[str]|str) -> bool: if isinstance(tags, basestring): return tags in self.exclude_tags if isinstance(tags, list): diff --git a/game/major_game_classes/serum_related/serums/fetish_serums_ren.py b/game/major_game_classes/serum_related/serums/fetish_serums_ren.py index 751991110..b36f0ef38 100644 --- a/game/major_game_classes/serum_related/serums/fetish_serums_ren.py +++ b/game/major_game_classes/serum_related/serums/fetish_serums_ren.py @@ -1,5 +1,4 @@ import builtins -from typing import List import renpy from renpy import persistent from game.helper_functions.list_functions_ren import find_in_list, get_random_from_list @@ -15,7 +14,7 @@ from game.people.Myrabelle.myra_role_definition_ren import myra_lewd_game_fuck_a from game.people.Sarah.sarah_definition_ren import sarah_threesomes_unlocked from game.people.Starbuck.starbuck_role_definition_ren import get_shop_investment_rate, sex_shop_stage -list_of_traits : List[SerumTrait] = [] +list_of_traits : list[SerumTrait] = [] day = 0 time_of_day = 0 """renpy diff --git a/game/map/HomeHub_ren.py b/game/map/HomeHub_ren.py index 8bf0dda47..86c83ff3a 100644 --- a/game/map/HomeHub_ren.py +++ b/game/map/HomeHub_ren.py @@ -1,4 +1,3 @@ -from typing import List from game.bugfix_additions.mapped_list_ren import MappedList from game.helper_functions.list_functions_ren import all_jobs, all_people_in_the_game from game.major_game_classes.character_related.Job_ren import Job, Room @@ -14,8 +13,8 @@ university_home_hub: 'HomeHub' init -5 python: """ class HomeHub(MapHub): - def __init__(self, name, formal_name, locations: List[Room]|None = None, position: Point|None = None, icon = None, accessible_func = None, - people: List[Person]|None = None, jobs: List[Job]|None = None): + def __init__(self, name, formal_name, locations: list[Room]|None = None, position: Point|None = None, icon = None, accessible_func = None, + people: list[Person]|None = None, jobs: list[Job]|None = None): super().__init__(name, formal_name, locations, position, icon, accessible_func) self.people = MappedList(Person, all_people_in_the_game) @@ -44,5 +43,5 @@ class HomeHub(MapHub): return [x for x in list_of_people if x.home in self] @property - def visible_locations(self) -> List[Room]: + def visible_locations(self) -> list[Room]: return [x for x in self if not x.hide_in_known_house_map and x in mc.known_home_locations] diff --git a/game/map/MapHub_ren.py b/game/map/MapHub_ren.py index 4cd06715a..403bc7f70 100644 --- a/game/map/MapHub_ren.py +++ b/game/map/MapHub_ren.py @@ -1,4 +1,3 @@ -from typing import List from game.bugfix_additions.mapped_list_ren import MappedList, generate_identifier from game.helper_functions.list_functions_ren import all_locations_in_the_game from game.major_game_classes.game_logic.Room_ren import Room @@ -12,7 +11,7 @@ init -10 python: import math class MapHub(): - def __init__(self, name: str, formal_name: str, locations : List[Room]|None = None, position: 'Point'|None = None, icon = None, accessible_func = None): + def __init__(self, name: str, formal_name: str, locations : list[Room]|None = None, position: 'Point'|None = None, icon = None, accessible_func = None): self.name = name self.formal_name = formal_name # internal property don't use in code -> user iterator of hub to get its locations @@ -75,7 +74,7 @@ class MapHub(): return len(self.visible_locations) @property - def visible_locations(self) -> List[Room]: + def visible_locations(self) -> list[Room]: return [x for x in self if x.visible] diff --git a/game/map/map_code_ren.py b/game/map/map_code_ren.py index e1582b935..44ce7befb 100644 --- a/game/map/map_code_ren.py +++ b/game/map/map_code_ren.py @@ -1,6 +1,5 @@ import builtins -from typing import List from renpy.text.text import Text from game.major_game_classes.character_related.Person_ren import Person from game.major_game_classes.game_logic.Room_ren import Room @@ -14,7 +13,7 @@ from game.major_game_classes.character_related.Progression_Scene_ren import list from game.map.HomeHub_ren import HomeHub from game.map.MapHub_ren import MapHub -list_of_hubs : List[MapHub] = [] +list_of_hubs : list[MapHub] = [] day = 0 time_of_day = 0 """renpy @@ -158,7 +157,7 @@ def get_hub_tile_text(hub): return build_tile_information(known_people, total_people, hub.formal_name, has_event, has_progress) -def build_tile_information(known_people: List[Person], total_people, location_name, has_event, has_progress): +def build_tile_information(known_people: list[Person], total_people, location_name, has_event, has_progress): #setting the catches extra_info = [] if any(x for x in known_people if x.is_favourite): diff --git a/game/people/Candace/candace_definition_ren.py b/game/people/Candace/candace_definition_ren.py index 74df2055d..d295a8b70 100644 --- a/game/people/Candace/candace_definition_ren.py +++ b/game/people/Candace/candace_definition_ren.py @@ -1,4 +1,3 @@ -from typing import List from game.helper_functions.random_generation_functions_ren import make_person from game.personality_types._personality_definitions_ren import bimbo_personality, relaxed_personality from game.clothing_lists_ren import heavy_eye_shadow, light_eye_shadow, strappy_bra, lace_crop_top, strappy_panties, leggings,thigh_highs, high_heels, lipstick, curly_bun @@ -30,15 +29,15 @@ def candace_player_titles(person: Person): #pylint: disable=unused-argument return valid_mc_titles -def genius_titles(person: Person) -> List[str]: +def genius_titles(person: Person) -> list[str]: if person.love < 20: return ["Dr." + person.last_name] #If she doesn't like you she's much more formal. return [person.name] -def genius_possessive_titles(person: Person) -> List[str]: +def genius_possessive_titles(person: Person) -> list[str]: return genius_titles(person) #If we don't have a special possessive just use their normal title. -def genius_player_titles(person: Person) -> List[str]: #pylint: disable=unused-argument +def genius_player_titles(person: Person) -> list[str]: #pylint: disable=unused-argument return [mc.name] genius_personality = Personality("genius", default_prefix = relaxed_personality.default_prefix, diff --git a/game/people/Ellie/IT_Business_Projects_ren.py b/game/people/Ellie/IT_Business_Projects_ren.py index 0e560a83f..a415d1fe2 100644 --- a/game/people/Ellie/IT_Business_Projects_ren.py +++ b/game/people/Ellie/IT_Business_Projects_ren.py @@ -1,5 +1,4 @@ import builtins -from typing import List import renpy from game.business_policies.clothing_policies_ren import male_focused_marketing_policy from game.major_game_classes.game_logic.Action_ren import Action @@ -96,9 +95,9 @@ def market_targeted_advertising_project_on_turn(): extra_amount = 0 for person in [x for x in mc.business.market_team if x in mc.business.m_div.people]: if person.should_wear_uniform and male_focused_marketing_policy.is_active: - amount_increased = builtins.int((3*person.charisma) + (person.focus) + (2*person.market_skill)) * ((mc.business.team_effectiveness*0.01)) * (1.0 + (person.outfit.outfit_slut_score / 100.0)) * 5.0 + amount_increased = builtins.int((3*person.charisma) + (person.focus) + (2*person.market_skill)) * (mc.business.team_effectiveness*0.01) * (1.0 + (person.outfit.outfit_slut_score / 100.0)) * 5.0 else: - amount_increased = builtins.int((3*person.charisma) + (person.focus) + (2*person.market_skill)) * ((mc.business.team_effectiveness*0.01)) * 5.0 + amount_increased = builtins.int((3*person.charisma) + (person.focus) + (2*person.market_skill)) * (mc.business.team_effectiveness*0.01) * 5.0 extra_amount += (amount_increased * .1) mc.business.market_reach += extra_amount @@ -166,7 +165,7 @@ def IT_proj_test_req_text(): ## Business IT Projects -business_IT_project_list: List[IT_Project] = [] +business_IT_project_list: list[IT_Project] = [] hr_organized_chaos_project = IT_Project(name = "Organized Chaos", desc = "Increases the maximum efficiency of the company by 5%.", diff --git a/game/people/Ellie/IT_Nanobot_Projects_ren.py b/game/people/Ellie/IT_Nanobot_Projects_ren.py index e45f79363..c5081d735 100644 --- a/game/people/Ellie/IT_Nanobot_Projects_ren.py +++ b/game/people/Ellie/IT_Nanobot_Projects_ren.py @@ -1,4 +1,3 @@ -from typing import List from game.major_game_classes.serum_related.serums.fetish_serums_ren import FETISH_ANAL_OPINION_LIST, FETISH_BREEDING_OPINION_LIST, FETISH_CUM_OPINION_LIST, FETISH_EXHIBITION_OPINION_LIST, FETISH_RESEARCH_ADDED, FETISH_SERUM_ATTENTION, fetish_unlock_anal_serum, fetish_unlock_breeding_serum, fetish_unlock_cum_serum, fetish_unlock_exhibition_serum, get_fetish_anal_serum, get_fetish_basic_serum, get_fetish_breeding_serum, get_fetish_cum_serum, get_fetish_exhibition_serum from game.major_game_classes.character_related.Person_ren import ellie from game.people.Ellie.IT_Project_class_ren import IT_Project @@ -9,7 +8,7 @@ init -5 python: ## Nano IT Projects -nanobot_IT_project_list: List[IT_Project] = [] +nanobot_IT_project_list: list[IT_Project] = [] ### Project related functions ### diff --git a/game/people/Gabrielle/cousin_definition_ren.py b/game/people/Gabrielle/cousin_definition_ren.py index 88dfd1007..18436e6a1 100644 --- a/game/people/Gabrielle/cousin_definition_ren.py +++ b/game/people/Gabrielle/cousin_definition_ren.py @@ -1,4 +1,3 @@ -from typing import List from game.helper_functions.random_generation_functions_ren import make_person from game.helper_functions.wardrobe_from_xml_ren import wardrobe_from_xml from game.personality_types._personality_definitions_ren import introvert_personality @@ -15,7 +14,7 @@ init 5 python: list_of_instantiation_functions.append("create_gabrielle_character") -def cousin_titles(person: Person) -> List[str]: +def cousin_titles(person: Person) -> list[str]: valid_titles = [] valid_titles.append(person.name) if person.love > 20: @@ -25,7 +24,7 @@ def cousin_titles(person: Person) -> List[str]: valid_titles.append("Hellspawn") return valid_titles -def cousin_possessive_titles(person: Person) -> List[str]: +def cousin_possessive_titles(person: Person) -> list[str]: valid_titles = [] valid_titles.append(person.name) valid_titles.append("Your cousin") @@ -40,7 +39,7 @@ def cousin_possessive_titles(person: Person) -> List[str]: return valid_titles -def cousin_player_titles(person: Person) -> List[str]: +def cousin_player_titles(person: Person) -> list[str]: valid_titles = [mc.name] if person.love < -20: valid_titles.append("Asshat") diff --git a/game/people/Ophelia/ophelia_definition_ren.py b/game/people/Ophelia/ophelia_definition_ren.py index 03b77dda0..6b065b1bc 100644 --- a/game/people/Ophelia/ophelia_definition_ren.py +++ b/game/people/Ophelia/ophelia_definition_ren.py @@ -1,5 +1,4 @@ import builtins -from typing import List import renpy from game.helper_functions.random_generation_functions_ren import make_person from game.helper_functions.wardrobe_from_xml_ren import wardrobe_from_xml @@ -30,10 +29,10 @@ salon_total_cost = salon_style_cost + salon_dye_cost def salon_introduction_action_requirement(person: Person): return person.is_at_work -def salon_manager_titles(person: Person) -> List[str]: +def salon_manager_titles(person: Person) -> list[str]: return wild_titles(person) -def salon_manager_possessive_titles(person: Person) -> List[str]: +def salon_manager_possessive_titles(person: Person) -> list[str]: valid_possessive_titles = [] valid_possessive_titles.append(person.name) valid_possessive_titles.append("Your stylist") diff --git a/game/personality_types/_personality_definitions_ren.py b/game/personality_types/_personality_definitions_ren.py index ed4e983c6..4ce15282f 100644 --- a/game/personality_types/_personality_definitions_ren.py +++ b/game/personality_types/_personality_definitions_ren.py @@ -1,4 +1,3 @@ -from typing import List from game.major_game_classes.character_related.Person_ren import Person, Personality, mc """renpy init -1 python: @@ -7,9 +6,9 @@ init -1 python: # Generic Personalities # ######################### -list_of_personalities: List[Personality] = [] +list_of_personalities: list[Personality] = [] -def relaxed_titles(person: Person) -> List[str]: +def relaxed_titles(person: Person) -> list[str]: valid_titles = [] valid_titles.append(person.formal_address + " " + person.last_name) if person.love > 20: @@ -21,10 +20,10 @@ def relaxed_titles(person: Person) -> List[str]: return valid_titles -def relaxed_possessive_titles(person: Person) -> List[str]: +def relaxed_possessive_titles(person: Person) -> list[str]: return relaxed_titles(person) #If we don't have a special possessive just use their normal title. -def relaxed_player_titles(person: Person) -> List[str]: +def relaxed_player_titles(person: Person) -> list[str]: valid_titles = [] valid_titles.append("Mr. " + mc.last_name) if person.love > 10: @@ -44,7 +43,7 @@ relaxed_personality = Personality("relaxed", #Lily style personality list_of_personalities.append(relaxed_personality) -def introvert_titles(person: Person) -> List[str]: +def introvert_titles(person: Person) -> list[str]: valid_titles = [] valid_titles.append(person.formal_address + " " + person.last_name) if person.love > 20: @@ -55,10 +54,10 @@ def introvert_titles(person: Person) -> List[str]: valid_titles.append("Lollipop") return valid_titles -def introvert_possessive_titles(person: Person) -> List[str]: +def introvert_possessive_titles(person: Person) -> list[str]: return introvert_titles(person) -def introvert_player_titles(person: Person) -> List[str]: +def introvert_player_titles(person: Person) -> list[str]: valid_titles = [] valid_titles.append("Mr. " + mc.last_name) if person.has_breeding_fetish: @@ -75,7 +74,7 @@ introvert_personality = Personality("introvert", #Stephanie style personality list_of_personalities.append(introvert_personality) -def reserved_titles(person: Person) -> List[str]: +def reserved_titles(person: Person) -> list[str]: valid_titles = [] valid_titles.append(person.formal_address + " " + person.last_name) if person.love > 20: @@ -86,10 +85,10 @@ def reserved_titles(person: Person) -> List[str]: valid_titles.append("Minx") return valid_titles -def reserved_possessive_titles(person: Person) -> List[str]: +def reserved_possessive_titles(person: Person) -> list[str]: return reserved_titles(person) -def reserved_player_titles(person: Person) -> List[str]: +def reserved_player_titles(person: Person) -> list[str]: valid_titles = [] valid_titles.append("Mr. " + mc.last_name) if person.love > 30: @@ -108,7 +107,7 @@ reserved_personality = Personality("reserved", list_of_personalities.append(reserved_personality) -def wild_titles(person: Person) -> List[str]: +def wild_titles(person: Person) -> list[str]: valid_titles = [] valid_titles.append(person.formal_address + " " + person.last_name) valid_titles.append(person.name) @@ -119,10 +118,10 @@ def wild_titles(person: Person) -> List[str]: return valid_titles -def wild_possessive_titles(person: Person) -> List[str]: +def wild_possessive_titles(person: Person) -> list[str]: return wild_titles(person) -def wild_player_titles(person: Person) -> List[str]: +def wild_player_titles(person: Person) -> list[str]: valid_titles = [] valid_titles.append("Mr. " + mc.last_name) valid_titles.append(mc.name) @@ -144,13 +143,13 @@ list_of_personalities.append(wild_personality) # Special Personalities # ######################### -def bimbo_titles(person: Person) -> List[str]: +def bimbo_titles(person: Person) -> list[str]: return [person.name] -def bimbo_possessive_titles(person: Person) -> List[str]: +def bimbo_possessive_titles(person: Person) -> list[str]: return bimbo_titles(person) -def bimbo_player_titles(person: Person) -> List[str]: #pylint: disable=unused-argument +def bimbo_player_titles(person: Person) -> list[str]: #pylint: disable=unused-argument valid_titles = [mc.name] valid_titles.append("Cutie") return valid_titles @@ -163,7 +162,7 @@ bimbo_personality = Personality("bimbo", #Currently used in the head researcher titles_function = bimbo_titles, possessive_titles_function = bimbo_possessive_titles, player_titles_function = bimbo_player_titles, insta_chance = 75, dikdok_chance = 25) -def alpha_titles(person: Person) -> List[str]: +def alpha_titles(person: Person) -> list[str]: valid_titles = [] valid_titles.append(person.formal_address + " " + person.last_name) if person.love > 20: @@ -172,7 +171,7 @@ def alpha_titles(person: Person) -> List[str]: valid_titles.append("Anal Queen") return valid_titles -def alpha_possessive_titles(person: Person) -> List[str]: +def alpha_possessive_titles(person: Person) -> list[str]: valid_possessive_titles = [] valid_possessive_titles.append(person.formal_address + " " + person.last_name) if person.sluttiness > 80 and person.opinion_threesomes > 0: @@ -181,7 +180,7 @@ def alpha_possessive_titles(person: Person) -> List[str]: valid_possessive_titles.append("Your anal queen") return valid_possessive_titles -def alpha_player_titles(person: Person) -> List[str]: +def alpha_player_titles(person: Person) -> list[str]: valid_player_titles = [] valid_player_titles.append("Mr. " + mc.last_name) if person.happiness < 70: @@ -200,7 +199,7 @@ alpha_personality = Personality("alpha", default_prefix = reserved_personality.d titles_function = alpha_titles, possessive_titles_function = alpha_possessive_titles, player_titles_function = alpha_player_titles) -def cougar_titles(person: Person) -> List[str]: +def cougar_titles(person: Person) -> list[str]: valid_titles = [] valid_titles.append(person.formal_address + " " + person.last_name) if person.love > 20: @@ -213,7 +212,7 @@ def cougar_titles(person: Person) -> List[str]: valid_titles.append("Anal Harlot") return valid_titles -def cougar_possessive_titles(person: Person) -> List[str]: +def cougar_possessive_titles(person: Person) -> list[str]: valid_possessive_titles = [] valid_possessive_titles.append(person.formal_address + " " + person.last_name) if person.love > 20: @@ -226,7 +225,7 @@ def cougar_possessive_titles(person: Person) -> List[str]: valid_possessive_titles.append("Your anal minx") return valid_possessive_titles -def cougar_player_titles(person: Person) -> List[str]: +def cougar_player_titles(person: Person) -> list[str]: valid_player_titles = [] valid_player_titles.append("Mr. " + mc.last_name) if person.happiness < 70: diff --git a/game/random_lists_ren.py b/game/random_lists_ren.py index b93e8649d..1680441dc 100644 --- a/game/random_lists_ren.py +++ b/game/random_lists_ren.py @@ -1,6 +1,5 @@ import builtins from collections import OrderedDict -from typing import List import renpy from renpy import persistent from game.helper_functions.list_functions_ren import get_random_from_list @@ -63,7 +62,7 @@ for pref in generic_preference.values(): if not (getattr(persistent, setting[0]) or isinstance(getattr(persistent, setting[0]), int)): setattr(persistent, setting[0], setting[1]) -def get_random_from_weighted_list(weighted_list: List, return_everything = False): #Passed a list of parameters which are ["Thing", weighted value, anything_else,...] +def get_random_from_weighted_list(weighted_list: list, return_everything = False): #Passed a list of parameters which are ["Thing", weighted value, anything_else,...] #If return_everything is True, returns the entire tuple instead of just an action if builtins.len(weighted_list) == 0: return None @@ -201,7 +200,7 @@ colour_pink = [1.0, 0.8, 0.85, 0.95] def get_random_readable_color(): return get_random_from_list(readable_color_list) -def format_group_of_people(list_of_people: List[Person]): # Returns a string made up of people titles like "PersonA, PersonB, and PersonC." or just "PersonA and PersonB" if there are two people. (or PersonA if it's just one person) +def format_group_of_people(list_of_people: list[Person]): # Returns a string made up of people titles like "PersonA, PersonB, and PersonC." or just "PersonA and PersonB" if there are two people. (or PersonA if it's just one person) #Note: the list is formatted in the order it is handed over. renpy.random.scramble() it beforehand if you want it in a random order. return_string = "" if builtins.len(list_of_people) == 1: @@ -217,7 +216,7 @@ def format_group_of_people(list_of_people: List[Person]): # Returns a string mad return return_string -def format_list_of_clothing(clothing_list: List[Clothing]): # Takes a list of strings and formats them to the form "ThingA, thingB, and ThingC" +def format_list_of_clothing(clothing_list: list[Clothing]): # Takes a list of strings and formats them to the form "ThingA, thingB, and ThingC" return_string = "" if builtins.len(clothing_list) == 1: return_string = clothing_list[0].display_name diff --git a/game/sex_positions/threesome/threesome_position_definitions_ren.py b/game/sex_positions/threesome/threesome_position_definitions_ren.py index 3ff635e11..2a906d6fc 100644 --- a/game/sex_positions/threesome/threesome_position_definitions_ren.py +++ b/game/sex_positions/threesome/threesome_position_definitions_ren.py @@ -1,12 +1,11 @@ -from typing import List from game.main_character.perks.Perks_ren import perk_system from game.major_game_classes.character_related.Person_ren import Person, mc from game.sex_positions.threesome.Threesome_MC_position_ren import Threesome_MC_position from game.sex_positions.threesome.Threesome_Position_ren import Threesome_Position -list_of_threesomes : List[Threesome_Position] = [] +list_of_threesomes : list[Threesome_Position] = [] Threesome_doggy_deluxe_girl_one_transform = None Threesome_doggy_deluxe_girl_two_transform = None diff --git a/game/text_tags/generic_replacer_ren.py b/game/text_tags/generic_replacer_ren.py index b400a59cf..313ab1487 100644 --- a/game/text_tags/generic_replacer_ren.py +++ b/game/text_tags/generic_replacer_ren.py @@ -1,4 +1,3 @@ -from typing import Dict """renpy init -20 python: """ @@ -6,7 +5,7 @@ import re rc_word_finder = re.compile(r"\b[A-Za-z_]\w*\b(?!(\w*\.)?\w*\])") # replace each word in text with word from replace_dict -def word_replace(text: str, replace_dict: Dict[str, str]): +def word_replace(text: str, replace_dict: dict[str, str]): def translate(match): word = match.group(0) found = replace_dict.get(word.lower(), word) @@ -31,7 +30,7 @@ def letter_dropper(text: str, last_letters = ""): return rc_word_finder.sub(translate, text) # replace letter combination in dictionary with replacement letters -def letter_replacer(text: str, letter_replace_dict: Dict[str, str]): +def letter_replacer(text: str, letter_replace_dict: dict[str, str]): def translate(match): word = match.group(0) for f, r in letter_replace_dict.items(): @@ -41,7 +40,7 @@ def letter_replacer(text: str, letter_replace_dict: Dict[str, str]): return rc_word_finder.sub(translate, text) # replace word combinations in dictionary -def word_group_replacer(text: str, word_replace_dict: Dict[str, str]): +def word_group_replacer(text: str, word_replace_dict: dict[str, str]): def replace_keep_case(word, replacement, text): def func(match): g = match.group() diff --git a/game/trainables/_trainables_ren.py b/game/trainables/_trainables_ren.py index d71a02369..3e00b2e62 100644 --- a/game/trainables/_trainables_ren.py +++ b/game/trainables/_trainables_ren.py @@ -1,4 +1,3 @@ -from typing import List from renpy import persistent from game.game_roles._role_definitions_ren import hypno_orgasm_role, anal_fetish_role, cum_fetish_role from game.major_game_classes.serum_related.serums.fetish_serums_ren import is_anal_fetish_unlocked, is_cum_fetish_unlocked @@ -9,10 +8,10 @@ from game.major_game_classes.character_related.Person_ren import Person, mc init -1 python: """ -stat_trainables: List[Trainable] = [] -skill_trainables: List[Trainable] = [] -opinion_trainables: List[Trainable] = [] -special_trainables: List[Trainable] = [] #Trainables put in this list are universal, and also displayed in the same list as Role specific trainables. +stat_trainables: list[Trainable] = [] +skill_trainables: list[Trainable] = [] +opinion_trainables: list[Trainable] = [] +special_trainables: list[Trainable] = [] #Trainables put in this list are universal, and also displayed in the same list as Role specific trainables. # Trainable definitions are defined here, the labels and requirements are separated off into their own file. # STAT TRAINABLES # -- GitLab From 9e98e8ae8befb58ff97b35e15e59b5d13aa3336b Mon Sep 17 00:00:00 2001 From: wkwk <12408-wkwk@users.norepy.gitgud.io> Date: Sat, 5 Aug 2023 04:40:00 -0600 Subject: [PATCH 02/12] Add some return types for special methods --- game/bugfix_additions/mapped_list_ren.py | 6 +++--- .../character_related/Schedule_ren.py | 2 +- .../game_logic/ActionList_ren.py | 4 ++-- game/map/MapHub_ren.py | 2 +- game/pylru.py | 14 +++++++------- 5 files changed, 14 insertions(+), 14 deletions(-) diff --git a/game/bugfix_additions/mapped_list_ren.py b/game/bugfix_additions/mapped_list_ren.py index f2df54c32..2f1d7e6d9 100644 --- a/game/bugfix_additions/mapped_list_ren.py +++ b/game/bugfix_additions/mapped_list_ren.py @@ -72,7 +72,7 @@ class MappedList(): raise TypeError del self.mapped_list[key] - def __repr__(self): + def __repr__(self) -> str: return repr(self()) def __call__(self): @@ -87,10 +87,10 @@ class MappedList(): else: # item is no longer in main list (remove it from mapping) self.mapped_list.remove(item) - def __len__(self): + def __len__(self) -> int: return builtins.len(self.mapped_list) - def __contains__(self, item): + def __contains__(self, item) -> bool: if isinstance(item, self.list_type): return any(x for x in self.mapped_list if x == item.identifier) return False diff --git a/game/major_game_classes/character_related/Schedule_ren.py b/game/major_game_classes/character_related/Schedule_ren.py index 80d4d8269..73bc6e6e6 100644 --- a/game/major_game_classes/character_related/Schedule_ren.py +++ b/game/major_game_classes/character_related/Schedule_ren.py @@ -67,7 +67,7 @@ class Schedule(): def __call__(self, specified_day : int|None = None, specified_time : int|None = None) -> Room|None: return self.get_destination(specified_day, specified_time) - def __str__(self): + def __str__(self) -> str: day_message = "" for day_number in range(7): day_message = str(day_number) + " || " diff --git a/game/major_game_classes/game_logic/ActionList_ren.py b/game/major_game_classes/game_logic/ActionList_ren.py index bbb087f1b..2f2e04d2e 100644 --- a/game/major_game_classes/game_logic/ActionList_ren.py +++ b/game/major_game_classes/game_logic/ActionList_ren.py @@ -28,7 +28,7 @@ class ActionList(): return self._actions[key] raise TypeError - def __repr__(self): + def __repr__(self) -> str: return repr(self._actions) def __call__(self): @@ -40,7 +40,7 @@ class ActionList(): def __len__(self) -> int: return len(self._actions) - def __contains__(self, action: Action): + def __contains__(self, action: Action) -> bool: found = self.find(action) return not found is None diff --git a/game/map/MapHub_ren.py b/game/map/MapHub_ren.py index 403bc7f70..82e7a609a 100644 --- a/game/map/MapHub_ren.py +++ b/game/map/MapHub_ren.py @@ -84,7 +84,7 @@ class Point(): self.X = x self.Y = y - def __str__(self): + def __str__(self) -> str: return "Point({},{})".format(self.X, self.Y) def distance(self, other): diff --git a/game/pylru.py b/game/pylru.py index 277cf451a..bb272e3e6 100644 --- a/game/pylru.py +++ b/game/pylru.py @@ -40,7 +40,7 @@ from collections.abc import Mapping, Iterable class _dlnode(): __slots__ = ('empty', 'next', 'prev', 'key', 'value') - def __init__(self): + def __init__(self) -> None: self.empty = True self.next = None self.prev = None @@ -49,7 +49,7 @@ class _dlnode(): class LRUCache(): - def __init__(self, size, callback=None): + def __init__(self, size, callback=None) -> None: self.callback = callback # Create an empty hash table. @@ -70,7 +70,7 @@ class LRUCache(): # Now adjust the list to the desired size. self.size(size) - def __len__(self): + def __len__(self) -> int: return len(self.table) def clear(self): @@ -81,7 +81,7 @@ class LRUCache(): self.table.clear() - def __contains__(self, key): + def __contains__(self, key) -> bool: return key in self.table # Looks up a value in the cache without affecting the cache's order. @@ -106,7 +106,7 @@ class LRUCache(): return self[key] - def __setitem__(self, key, value): + def __setitem__(self, key, value) -> None: # If any value is stored under 'key' in the cache already, then replace # that value with the new one. if key in self.table: @@ -156,7 +156,7 @@ class LRUCache(): # need to adjust the 'head' variable. self.head = node - def __delitem__(self, key): + def __delitem__(self, key) -> None: # Lookup the node, remove it from the hash table, and mark it as empty. node = self.table[key] del self.table[key] @@ -396,7 +396,7 @@ class LRUCache(): self[key] = value class LRUDecorator(): - def __init__(self, size, callback=None): + def __init__(self, size, callback=None) -> None: self.cache = LRUCache(size, callback) def __call__(self, func): -- GitLab From c0392607c8d6bc1bfe79ee8ea4c9f1443f423fe4 Mon Sep 17 00:00:00 2001 From: wkwk <12408-wkwk@users.norepy.gitgud.io> Date: Sat, 5 Aug 2023 04:52:32 -0600 Subject: [PATCH 03/12] Replace more map lambdas --- game/helper_functions/webcolors_ren.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/game/helper_functions/webcolors_ren.py b/game/helper_functions/webcolors_ren.py index 4d551ed9f..1f7443ed7 100644 --- a/game/helper_functions/webcolors_ren.py +++ b/game/helper_functions/webcolors_ren.py @@ -454,7 +454,7 @@ def normalize_hex(hex_value): except AttributeError as ex: raise ValueError("'%s' is not a valid hexadecimal color value." % hex_value) from ex if len(hex_digits) == 3: - hex_digits = ''.join(map(lambda s: 2 * s, hex_digits)) + hex_digits = ''.join((2 * s for s in hex_digits)) return '#%s' % hex_digits.lower() @@ -743,7 +743,7 @@ def rgb_to_rgb_percent(rgb_triplet): # 256 / 2**n is special-cased for values of n # from 0 through 4, as well as 0 itself. specials = { 255: '100%', 128: '50%', 64: '25%', 32: '12.5%', 16: '6.25%', 0: '0%' } - return tuple(map(lambda d: specials.get(d, '%.02f%%' % ((d / 255.0) * 100)), rgb_triplet)) + return tuple((specials.get(d, '%.02f%%' % ((d / 255.0) * 100)) for d in rgb_triplet)) ###################################################################### -- GitLab From 544eaff953716610fc558f34f619f0b5a064722a Mon Sep 17 00:00:00 2001 From: wkwk <12408-wkwk@users.norepy.gitgud.io> Date: Sat, 5 Aug 2023 05:03:46 -0600 Subject: [PATCH 04/12] Remove some unnecessary list comprehensions --- game/helper_functions/list_functions_ren.py | 2 +- game/text_tags/kinetic_text_tags_ren.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/game/helper_functions/list_functions_ren.py b/game/helper_functions/list_functions_ren.py index d1276b68c..213ac3921 100644 --- a/game/helper_functions/list_functions_ren.py +++ b/game/helper_functions/list_functions_ren.py @@ -48,7 +48,7 @@ def all_jobs(excluded_jobs = None) -> list[Job]: return [x for x in list_of_jobs if x not in excluded_jobs] def all_hubs() -> list[MapHub]: - return [x for x in list_of_hubs] + return list(list_of_hubs) @ttl_cache(ttl=1) def unique_characters_not_known() -> list[Person]: # TODO The check should be standardized, but some people are vanilla, some are different modders or different 'style'. diff --git a/game/text_tags/kinetic_text_tags_ren.py b/game/text_tags/kinetic_text_tags_ren.py index 265dcd035..0a412f07e 100644 --- a/game/text_tags/kinetic_text_tags_ren.py +++ b/game/text_tags/kinetic_text_tags_ren.py @@ -123,7 +123,7 @@ class DispTextStyle(): new_string = "" # The only tags we are required to end are any custom text tags. # And should also end them in the reverse order they were applied. - reversed_cancels = [tag for tag in self.custom_cancel_tags] + reversed_cancels = list(self.custom_cancel_tags) reversed_cancels.reverse() for tag in reversed_cancels: temp = tag.replace("/", "") -- GitLab From 728773c73ee894d784f4424ba31654cf2db8d8a4 Mon Sep 17 00:00:00 2001 From: wkwk <12408-wkwk@users.norepy.gitgud.io> Date: Sat, 5 Aug 2023 05:09:12 -0600 Subject: [PATCH 05/12] Remove some unnecessary tuples --- game/major_game_classes/character_related/Person_ren.py | 6 +++--- game/major_game_classes/clothing_related/Clothing_ren.py | 2 +- game/major_game_classes/game_logic/Duty_ren.py | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/game/major_game_classes/character_related/Person_ren.py b/game/major_game_classes/character_related/Person_ren.py index a3eb98235..4145e0c91 100644 --- a/game/major_game_classes/character_related/Person_ren.py +++ b/game/major_game_classes/character_related/Person_ren.py @@ -1963,7 +1963,7 @@ class Person(): #Everything that needs to be known about a person. disp_key = "P:{}_C:{}".format(self.identifier, hash( - tuple([self.face_style, self.hair_style.name, self.skin, special_modifier]) + + (self.face_style, self.hair_style.name, self.skin, special_modifier) + tuple(self.hair_style.colour) + tuple(self.eyes[1]) )) @@ -2005,8 +2005,8 @@ class Person(): #Everything that needs to be known about a person. disp_key = "ID:{}_C:{}_O:{}".format(self.identifier, hash( - tuple([position, emotion, special_modifier]) + - tuple([self.skin, self.face_style, self.tits, self.body_type, self.tan_style]) + + (position, emotion, special_modifier) + + (self.skin, self.face_style, self.tits, self.body_type, self.tan_style) + tuple(flatten_list(lighting)) ), outfit.identifier) diff --git a/game/major_game_classes/clothing_related/Clothing_ren.py b/game/major_game_classes/clothing_related/Clothing_ren.py index 4bf23a955..568311853 100644 --- a/game/major_game_classes/clothing_related/Clothing_ren.py +++ b/game/major_game_classes/clothing_related/Clothing_ren.py @@ -190,7 +190,7 @@ class Clothing(): def __hash__(self) -> int: return generate_identifier( - tuple([self.name, self.is_extension, self.pattern, self.half_off]) + + (self.name, self.is_extension, self.pattern, self.half_off) + tuple(self.colour_pattern) + tuple(self.colour) ) diff --git a/game/major_game_classes/game_logic/Duty_ren.py b/game/major_game_classes/game_logic/Duty_ren.py index 37a201a85..2f21677d5 100644 --- a/game/major_game_classes/game_logic/Duty_ren.py +++ b/game/major_game_classes/game_logic/Duty_ren.py @@ -43,7 +43,7 @@ class Duty(): else: self.duty_trainables = [duty_trainables] self.identifier = generate_identifier( - tuple([self.duty_name, + (self.duty_name, self.requirement_function, self.on_turn_function, self.on_move_function, @@ -51,7 +51,7 @@ class Duty(): self.on_apply_function, self.on_remove_function, self.only_at_work - ]) + ) ) def __lt__(self,other): ##This and __hash__ are defined so that I can use "if Action in List" and have it find identical actions that are different instances. -- GitLab From 44b4276c32eb3ab2102d81a7e255597e1bc10ceb Mon Sep 17 00:00:00 2001 From: wkwk <12408-wkwk@users.norepy.gitgud.io> Date: Sat, 5 Aug 2023 05:13:17 -0600 Subject: [PATCH 06/12] Fix more raises --- game/helper_functions/renpy_overrides_ren.py | 9 ++++++--- .../clothing_related/LimitedWardrobeCollection_ren.py | 6 ++++-- game/random_lists_ren.py | 3 ++- 3 files changed, 12 insertions(+), 6 deletions(-) diff --git a/game/helper_functions/renpy_overrides_ren.py b/game/helper_functions/renpy_overrides_ren.py index e5dedc664..08b87ebe4 100644 --- a/game/helper_functions/renpy_overrides_ren.py +++ b/game/helper_functions/renpy_overrides_ren.py @@ -15,10 +15,12 @@ def convert_field_override(self, value, conversion): return value if not conversion: - raise ValueError("Conversion specifier can't be empty.") + msg = "Conversion specifier can't be empty." + raise ValueError(msg) if set(conversion) - set("rstqulci!"): - raise ValueError("Unknown symbols in conversion specifier, this must use only the \"rstqulci\".") + msg = 'Unknown symbols in conversion specifier, this must use only the "rstqulci".' + raise ValueError(msg) if "r" in conversion: value = repr(value) @@ -41,7 +43,8 @@ def convert_field_override(self, value, conversion): try: value = self.vformat(value, (), kwargs) except RuntimeError as exc: # PY3 RecursionError - raise ValueError("Substitution {!r} refers to itself in a loop.".format(value)) from exc + msg = "Substitution {!r} refers to itself in a loop.".format(value) + raise ValueError(msg) from exc if "q" in conversion: value = value.replace("{", "{{") diff --git a/game/major_game_classes/clothing_related/LimitedWardrobeCollection_ren.py b/game/major_game_classes/clothing_related/LimitedWardrobeCollection_ren.py index 5e3179223..4c6a7122a 100644 --- a/game/major_game_classes/clothing_related/LimitedWardrobeCollection_ren.py +++ b/game/major_game_classes/clothing_related/LimitedWardrobeCollection_ren.py @@ -18,13 +18,15 @@ class LimitedWardrobeCollection(UserList): if type(item) in [LimitedWardrobe]: self.data[index] = item else: - raise TypeError('Item must be a limited wardrobe.') + msg = 'Item must be a limited wardrobe.' + raise TypeError(msg) def append(self, item: LimitedWardrobe): if type(item) in [LimitedWardrobe]: self.data.append(item) else: - raise TypeError('Item must be a limited wardrobe.') + msg = 'Item must be a limited wardrobe.' + raise TypeError(msg) def __iter__(self) -> Iterator[LimitedWardrobe]: return iter(sorted(self.data, key=lambda x: x.priority, reverse=True)) diff --git a/game/random_lists_ren.py b/game/random_lists_ren.py index 1680441dc..30dba8a4a 100644 --- a/game/random_lists_ren.py +++ b/game/random_lists_ren.py @@ -110,7 +110,8 @@ def index_in_weighted_list(test_item, weighted_list): for item in weighted_list: if test_item == item[0]: return weighted_list.index(item) - raise ValueError("{!r} is not in weighted list".format(test_item)) + msg = "{!r} is not in weighted list".format(test_item) + raise ValueError(msg) def get_random_job(): return get_random_from_weighted_list([x for x in list_of_jobs if x[1] > 2]) -- GitLab From 3c103940832b172120f8228df81177bd2d123d5a Mon Sep 17 00:00:00 2001 From: wkwk <12408-wkwk@users.norepy.gitgud.io> Date: Sat, 5 Aug 2023 06:32:39 -0600 Subject: [PATCH 07/12] Simplify more ifs --- game/bugfix_additions/mapped_list_ren.py | 10 +++----- .../family_crises_definition_ren.py | 5 ++-- .../business_roles/_duty_definitions_ren.py | 12 ++++----- .../_stripclub_role_definitions_ren.py | 12 ++++----- .../random_generation_functions_ren.py | 10 +++----- game/main_character/goals_ren.py | 9 +++---- game/main_character/perks/Perks_ren.py | 5 ++-- .../character_related/Person_ren.py | 25 ++++++++----------- .../Progression_Scene_ren.py | 5 ++-- .../clothing_related/Clothing_ren.py | 11 ++++---- .../Facial_Accessories_ren.py | 11 ++++---- .../clothing_related/Outfit_ren.py | 20 ++++++--------- .../major_game_classes/game_logic/Room_ren.py | 5 ++-- .../serum_related/SerumInventory_ren.py | 5 ++-- .../serum_related/serums/fetish_serums_ren.py | 22 ++++++---------- .../Candace/candace_role_definition_ren.py | 9 +++---- .../people/Ellie/ellie_role_definition_ren.py | 5 ++-- .../people/Erica/erica_role_definition_ren.py | 5 ++-- game/people/Myrabelle/myra_events_ren.py | 9 +++---- .../Myrabelle/myra_role_definition_ren.py | 5 ++-- .../Ophelia/ophelia_role_definition_ren.py | 6 ++--- .../people/Sarah/sarah_role_definition_ren.py | 7 +++--- .../ellie_stephanie_teamup_definition_ren.py | 5 ++-- 23 files changed, 89 insertions(+), 129 deletions(-) diff --git a/game/bugfix_additions/mapped_list_ren.py b/game/bugfix_additions/mapped_list_ren.py index 2f1d7e6d9..627bb60cb 100644 --- a/game/bugfix_additions/mapped_list_ren.py +++ b/game/bugfix_additions/mapped_list_ren.py @@ -124,14 +124,12 @@ class MappedList(): return self def append(self, item): - if isinstance(item, self.list_type): - if not item.identifier in self.mapped_list: - self.mapped_list.append(item.identifier) + if isinstance(item, self.list_type) and not item.identifier in self.mapped_list: + self.mapped_list.append(item.identifier) def remove(self, item): - if isinstance(item, self.list_type): - if item.identifier in self.mapped_list: - self.mapped_list.remove(item.identifier) + if isinstance(item, self.list_type) and item.identifier in self.mapped_list: + self.mapped_list.remove(item.identifier) def clear(self): self.mapped_list.clear() diff --git a/game/crises/regular_crises/family_crises_definition_ren.py b/game/crises/regular_crises/family_crises_definition_ren.py index f81a2d63d..216123cc8 100644 --- a/game/crises/regular_crises/family_crises_definition_ren.py +++ b/game/crises/regular_crises/family_crises_definition_ren.py @@ -39,9 +39,8 @@ crisis_list.append([ def mom_lingerie_surprise_requirement(): - if time_of_day == 4 and mc.location == bedroom: - if mom.arousal_perc > 50 and mom.energy > 50 and mom.love > 40: - return mom.effective_sluttiness("underwear_nudity") > 40 + if time_of_day == 4 and mc.location == bedroom and mom.arousal_perc > 50 and mom.energy > 50 and mom.love > 40: + return mom.effective_sluttiness("underwear_nudity") > 40 return False crisis_list.append([ diff --git a/game/game_roles/business_roles/_duty_definitions_ren.py b/game/game_roles/business_roles/_duty_definitions_ren.py index f9f9ecb50..819dac55d 100644 --- a/game/game_roles/business_roles/_duty_definitions_ren.py +++ b/game/game_roles/business_roles/_duty_definitions_ren.py @@ -70,10 +70,9 @@ def research_clarity_production_check(person: Person, research_amount): #Helper if person.has_duty(research_journal_subscription_duty): clarity_produced += research_amount * 0.2 - if person.has_duty(practical_experimentation_duty): - if mc.business.supply_count >= 5: - mc.business.supply_count -= 5 - clarity_produced += research_amount * 0.2 + if person.has_duty(practical_experimentation_duty) and mc.business.supply_count >= 5: + mc.business.supply_count -= 5 + clarity_produced += research_amount * 0.2 mc.business.partial_clarity += clarity_produced if mc.business.partial_clarity >= 1.0: @@ -358,9 +357,8 @@ def practical_experimentation_duty_requirement(person: Person): #pylint: disable return practical_experimentation.is_active def IT_work_duty_requirement(person: Person): - if mc.business.it_director: - if person != mc.business.it_director: #Don't let the IT director double dip - return True + if mc.business.it_director and person != mc.business.it_director: #Don't let the IT director double dip + return True return False def IT_work_duty_on_turn(person: Person): diff --git a/game/game_roles/stripclub/_stripclub_role_definitions_ren.py b/game/game_roles/stripclub/_stripclub_role_definitions_ren.py index 4782374a6..4903ce7c7 100644 --- a/game/game_roles/stripclub/_stripclub_role_definitions_ren.py +++ b/game/game_roles/stripclub/_stripclub_role_definitions_ren.py @@ -125,16 +125,14 @@ def get_stripclub_base_actions() -> list[Action]: return [promote_to_manager_action, strip_club_stripper_move_action, strip_club_stripper_fire_action, strip_club_stripper_performance_review_action] def strip_club_bdsm_dildochair_MC_requirements(the_person: Person) -> bool: - if the_person.has_role(stripclub_bdsm_performer_role): - if mc.location is bdsm_room: - return True + if the_person.has_role(stripclub_bdsm_performer_role) and mc.location is bdsm_room: + return True return False def strip_club_bdsm_dildochair_Mistress_requirements(the_person: Person) -> bool: - if the_person.has_role(stripclub_bdsm_performer_role): - if mc.location is bdsm_room: - if strip_club_get_mistress() in mc.location.people: - return True + if the_person.has_role(stripclub_bdsm_performer_role) and mc.location is bdsm_room: + if strip_club_get_mistress() in mc.location.people: + return True return False def get_stripclub_bdsm_performer_role_actions() -> list[Action]: diff --git a/game/helper_functions/random_generation_functions_ren.py b/game/helper_functions/random_generation_functions_ren.py index 7de3ef661..81293ed0b 100644 --- a/game/helper_functions/random_generation_functions_ren.py +++ b/game/helper_functions/random_generation_functions_ren.py @@ -193,9 +193,8 @@ def create_random_person(name = None, name_list = None, last_name = None, last_n else get_random_from_list(face_style_list) ) - if tan_style is None: - if renpy.random.randint(0, 1) == 1: # 50% chance on random tan (could be no_tan) - tan_style = get_random_from_list(tan_list) + if tan_style is None and renpy.random.randint(0, 1) == 1: # 50% chance on random tan (could be no_tan) + tan_style = get_random_from_list(tan_list) if suggestibility is None: if suggestibility_range is None: @@ -305,9 +304,8 @@ def create_random_person(name = None, name_list = None, last_name = None, last_n relationship_list = Person.finalize_relationships_weight(relationship_list,age) relationship = get_random_from_weighted_list(relationship_list) - if starting_wardrobe is None: - if not starting_wardrobe_list is None: - starting_wardrobe = get_random_from_list(starting_wardrobe_list) + if starting_wardrobe is None and not starting_wardrobe_list is None: + starting_wardrobe = get_random_from_list(starting_wardrobe_list) if base_outfit is None: if base_outfit_list is None: diff --git a/game/main_character/goals_ren.py b/game/main_character/goals_ren.py index e087d5896..51f4c974a 100644 --- a/game/main_character/goals_ren.py +++ b/game/main_character/goals_ren.py @@ -265,11 +265,10 @@ def flirt_count_difficulty_function(the_goal, the_difficulty): the_goal.arg_dict["required"] += the_difficulty def makeout_count_function(the_goal, the_person, the_position, **kwargs) -> bool: #pylint: disable=unused-argument - if the_position == kissing: - if not the_person.identifier in the_goal.arg_dict["people"]: - the_goal.arg_dict["people"].append(the_person.identifier) - the_goal.arg_dict["count"] += 1 - return the_goal.arg_dict["count"] >= the_goal.arg_dict["required"] + if the_position == kissing and not the_person.identifier in the_goal.arg_dict["people"]: + the_goal.arg_dict["people"].append(the_person.identifier) + the_goal.arg_dict["count"] += 1 + return the_goal.arg_dict["count"] >= the_goal.arg_dict["required"] return False def makeout_count_difficulty_function(the_goal, the_difficulty): diff --git a/game/main_character/perks/Perks_ren.py b/game/main_character/perks/Perks_ren.py index 211e60a97..e99a8954b 100644 --- a/game/main_character/perks/Perks_ren.py +++ b/game/main_character/perks/Perks_ren.py @@ -165,9 +165,8 @@ class Perks(): ret_text += " (active)" else: ret_text += " (inactive)" - if self.ability_perks[perk_name].usable: - if self.ability_perks[perk_name].usable_day > day: - ret_text += " (On Cooldown)" + if self.ability_perks[perk_name].usable and self.ability_perks[perk_name].usable_day > day: + ret_text += " (On Cooldown)" return ret_text def perk_on_cum(self, person: Person, opinion: str, add_to_log = True): diff --git a/game/major_game_classes/character_related/Person_ren.py b/game/major_game_classes/character_related/Person_ren.py index 4145e0c91..6e876c238 100644 --- a/game/major_game_classes/character_related/Person_ren.py +++ b/game/major_game_classes/character_related/Person_ren.py @@ -1931,9 +1931,8 @@ class Person(): #Everything that needs to be known about a person. self.situational_obedience.clear() # dominant person slowly bleeds obedience on run_day (lowest point offset by love) - if self.is_dominant: - if self.obedience - self.love > 100 - (self.opinion_taking_control * 5): - self.change_obedience(-1, add_to_log = False) + if self.is_dominant and self.obedience - self.love > 100 - (self.opinion_taking_control * 5): + self.change_obedience(-1, add_to_log = False) if day%7 == 0: #If the new day is Monday self.change_happiness(self.get_opinion_score("Mondays")*5, add_to_log = False) @@ -2868,15 +2867,12 @@ class Person(): #Everything that needs to be known about a person. def update_outfit_taboos(self) -> bool: return_value = False - if self.tits_visible: - if self.break_taboo("bare_tits"): - return_value = True - if self.vagina_visible: - if self.break_taboo("bare_pussy"): - return_value = True - if self.outfit.are_panties_visible or self.outfit.is_bra_visible: - if self.break_taboo("underwear_nudity"): - return_value = True + if self.tits_visible and self.break_taboo("bare_tits"): + return_value = True + if self.vagina_visible and self.break_taboo("bare_pussy"): + return_value = True + if (self.outfit.are_panties_visible or self.outfit.is_bra_visible) and self.break_taboo("underwear_nudity"): + return_value = True return return_value def give_serum(self, serum: SerumDesign, add_to_log = True): @@ -4473,9 +4469,8 @@ class Person(): #Everything that needs to be known about a person. if isinstance(list_of_titles, basestring): # lock personality to one title return [list_of_titles] - if self.sluttiness > 20: - if self.obedience > 150: - list_of_titles.append("Slave") + if self.sluttiness > 20 and self.obedience > 150: + list_of_titles.append("Slave") if self.sluttiness > 60: list_of_titles.append("Slut") diff --git a/game/major_game_classes/character_related/Progression_Scene_ren.py b/game/major_game_classes/character_related/Progression_Scene_ren.py index d763cc688..5533809c4 100644 --- a/game/major_game_classes/character_related/Progression_Scene_ren.py +++ b/game/major_game_classes/character_related/Progression_Scene_ren.py @@ -116,9 +116,8 @@ class Progression_Scene(): if self.is_multiple_choice: counter = 0 while counter < len(self.trans_list): - if counter not in self.scene_unlock_list: - if self.req_list[counter](): - return True + if counter not in self.scene_unlock_list and self.req_list[counter](): + return True counter += 1 return False #Check all choices for possible progression. diff --git a/game/major_game_classes/clothing_related/Clothing_ren.py b/game/major_game_classes/clothing_related/Clothing_ren.py index 568311853..ddbb7ecaa 100644 --- a/game/major_game_classes/clothing_related/Clothing_ren.py +++ b/game/major_game_classes/clothing_related/Clothing_ren.py @@ -206,13 +206,12 @@ class Clothing(): return True def is_similar(self, other) -> bool: #Checks that two pieces of clothing are similar. ie. their base clothing item is the same, even if pattern or colour differs. - if type(self) is type(other): - if (self.name == other.name - and self.hide_below == other.hide_below - and self.layer == other.layer - and self.is_extension == other.is_extension): + if type(self) is type(other) and (self.name == other.name + and self.hide_below == other.hide_below + and self.layer == other.layer + and self.is_extension == other.is_extension): - return True + return True return False def get_copy(self) -> 'Clothing': #Returns a copy of the piece of clothing with the correct underlying references. diff --git a/game/major_game_classes/clothing_related/Facial_Accessories_ren.py b/game/major_game_classes/clothing_related/Facial_Accessories_ren.py index 1c92ef593..eaf83d89f 100644 --- a/game/major_game_classes/clothing_related/Facial_Accessories_ren.py +++ b/game/major_game_classes/clothing_related/Facial_Accessories_ren.py @@ -63,12 +63,11 @@ class Facial_Accessory(Clothing): #This class inherits from Clothing and is used return True def is_similar(self, other): - if isinstance(self, other.__class__): - if (self.name == other.name - and self.hide_below == other.hide_below - and self.layer == other.layer - and self.is_extension == other.is_extension): - return True + if isinstance(self, other.__class__) and (self.name == other.name + and self.hide_below == other.hide_below + and self.layer == other.layer + and self.is_extension == other.is_extension): + return True return False def generate_item_displayable(self, position, face_type, emotion, special_modifiers = None, lighting = None): diff --git a/game/major_game_classes/clothing_related/Outfit_ren.py b/game/major_game_classes/clothing_related/Outfit_ren.py index f85ae1c89..f1c37107f 100644 --- a/game/major_game_classes/clothing_related/Outfit_ren.py +++ b/game/major_game_classes/clothing_related/Outfit_ren.py @@ -755,9 +755,8 @@ class Outfit(): #A bunch of clothing added together, without slot conflicts. possible = False break - if item.anchor_below: - if item not in return_list: - return_list.append(item) + if item.anchor_below and item not in return_list: + return_list.append(item) if not possible: return [] @@ -801,9 +800,8 @@ class Outfit(): #A bunch of clothing added together, without slot conflicts. possible = False break - if item.anchor_below or item.can_be_half_off: - if item not in return_list: - return_list.append(item) + if (item.anchor_below or item.can_be_half_off) and item not in return_list: + return_list.append(item) if not possible: return [] @@ -1036,9 +1034,8 @@ class Outfit(): #A bunch of clothing added together, without slot conflicts. tits_score += 10 elif self.wearing_bra and self.is_bra_visible: tits_score += 5 - elif outfit_type == "over": - if self.tits_visible: - tits_score += 10 + elif outfit_type == "over" and self.tits_visible: + tits_score += 10 vagina_score = 0 if self.vagina_visible: @@ -1056,9 +1053,8 @@ class Outfit(): #A bunch of clothing added together, without slot conflicts. vagina_score += 10 elif self.wearing_panties and self.are_panties_visible: vagina_score += 5 - elif outfit_type == "over": - if self.vagina_visible: - vagina_score += 10 + elif outfit_type == "over" and self.vagina_visible: + vagina_score += 10 return builtins.int(tits_score + vagina_score) diff --git a/game/major_game_classes/game_logic/Room_ren.py b/game/major_game_classes/game_logic/Room_ren.py index 7aea0d696..fb44e26f4 100644 --- a/game/major_game_classes/game_logic/Room_ren.py +++ b/game/major_game_classes/game_logic/Room_ren.py @@ -144,9 +144,8 @@ class Room(): #Contains objects. renpy.show(name = self.name, what = the_background_image, layer = "master") def add_object(self,the_object: RoomObject): - if isinstance(the_object, RoomObject): - if not the_object in self.objects: - self.objects.append(the_object) + if isinstance(the_object, RoomObject) and not the_object in self.objects: + self.objects.append(the_object) def remove_object(self, object_or_name : RoomObject|str): found = next((x for x in self.objects if x == object_or_name), None) diff --git a/game/major_game_classes/serum_related/SerumInventory_ren.py b/game/major_game_classes/serum_related/SerumInventory_ren.py index f111dc004..47a1277c3 100644 --- a/game/major_game_classes/serum_related/SerumInventory_ren.py +++ b/game/major_game_classes/serum_related/SerumInventory_ren.py @@ -55,9 +55,8 @@ class SerumInventory(): #A bag class that lets businesses and people hold onto d for design in remove_list: self.serums_held.remove(design) - if not found: - if change_amount > 0: - self.serums_held.append([serum_design, builtins.int(change_amount)]) + if not found and change_amount > 0: + self.serums_held.append([serum_design, builtins.int(change_amount)]) def has_serum_with_trait(self, trait: SerumTrait) -> bool: return any(x for x in self.get_serum_types if x.has_trait(trait)) diff --git a/game/major_game_classes/serum_related/serums/fetish_serums_ren.py b/game/major_game_classes/serum_related/serums/fetish_serums_ren.py index b36f0ef38..68b21e680 100644 --- a/game/major_game_classes/serum_related/serums/fetish_serums_ren.py +++ b/game/major_game_classes/serum_related/serums/fetish_serums_ren.py @@ -68,9 +68,8 @@ def anal_fetish_gabrielle_intro_requirement(): return False def anal_fetish_stephanie_intro_requirement(): - if mc.business.is_open_for_business and mc.is_at_work: - if renpy.random.randint(0,100) < 20 : - return stephanie.is_available + if mc.business.is_open_for_business and mc.is_at_work and renpy.random.randint(0,100) < 20: + return stephanie.is_available return False def anal_fetish_alex_intro_requirement(): @@ -212,10 +211,8 @@ def start_anal_fetish_quest(person: Person): return True def breeding_fetish_employee_intro_requirement(): - if time_of_day == 3: - if mc.business.is_open_for_business: - if mc.is_at_work: - return True + if time_of_day == 3 and mc.business.is_open_for_business and mc.is_at_work: + return True return False def breeding_fetish_generic_intro_requirement(person: Person): @@ -224,9 +221,8 @@ def breeding_fetish_generic_intro_requirement(person: Person): return False def breeding_fetish_family_intro_requirement(person: Person): - if person.is_home: - if person.location.person_count == 1: #She is alone in her bedroom - return True + if person.is_home and person.location.person_count == 1: #She is alone in her bedroom + return True return False def breeding_fetish_mom_intro_requirement(): #TODO this should be a morning mandatory crisis event. @@ -242,10 +238,8 @@ def breeding_fetish_gabrielle_intro_requirement(): return False def breeding_fetish_stephanie_intro_requirement(): - if mc.business.is_open_for_business: - if stephanie.is_at_work: - if renpy.random.randint(0,100) < 25: - return True + if mc.business.is_open_for_business and stephanie.is_at_work and renpy.random.randint(0,100) < 25: + return True return False def breeding_fetish_emily_intro_requirement(): diff --git a/game/people/Candace/candace_role_definition_ren.py b/game/people/Candace/candace_role_definition_ren.py index ad530539c..538c30f95 100644 --- a/game/people/Candace/candace_role_definition_ren.py +++ b/game/people/Candace/candace_role_definition_ren.py @@ -24,11 +24,10 @@ def candace_convince_to_quit_requirement(person: Person): #pylint: disable=unuse def candace_get_to_know_requirement(person: Person): - if person.location == office_store: - if not candace_get_has_quit_job(): - if not candace_can_talk(): - return "Already talked today" - return True + if person.location == office_store and not candace_get_has_quit_job(): + if not candace_can_talk(): + return "Already talked today" + return True return False def get_candace_role_actions(): diff --git a/game/people/Ellie/ellie_role_definition_ren.py b/game/people/Ellie/ellie_role_definition_ren.py index 6d7399071..d9f1817be 100644 --- a/game/people/Ellie/ellie_role_definition_ren.py +++ b/game/people/Ellie/ellie_role_definition_ren.py @@ -13,9 +13,8 @@ def ellie_on_day(person: Person): #pylint: disable=unused-argument return def ellie_on_turn(person: Person): - if person.is_employee and person.is_at_work: - if person.arousal_perc < 30: - person.change_arousal(3, add_to_log = False) + if person.is_employee and person.is_at_work and person.arousal_perc < 30: + person.change_arousal(3, add_to_log = False) ellie_role = Role("Ellie", [], on_day = ellie_on_day, on_turn = ellie_on_turn) diff --git a/game/people/Erica/erica_role_definition_ren.py b/game/people/Erica/erica_role_definition_ren.py index 2f29f31a9..a171f1986 100644 --- a/game/people/Erica/erica_role_definition_ren.py +++ b/game/people/Erica/erica_role_definition_ren.py @@ -157,9 +157,8 @@ def add_erica_breeding_nora_news_part_one_action(): ) def erica_breeding_nora_news_part_two_requirement(): - if time_of_day == 2: - if renpy.random.randint(0,100) < 15: #Just to make F95 people QQ - return True + if time_of_day == 2 and renpy.random.randint(0,100) < 15: #Just to make F95 people QQ + return True return False def add_erica_breeding_nora_news_part_two_action(): diff --git a/game/people/Myrabelle/myra_events_ren.py b/game/people/Myrabelle/myra_events_ren.py index e6c56c385..2280466ee 100644 --- a/game/people/Myrabelle/myra_events_ren.py +++ b/game/people/Myrabelle/myra_events_ren.py @@ -249,11 +249,10 @@ def myra_bigger_tits_intro_requirement(person: Person): return False def myra_bigger_tits_serum_requirement(person: Person): - if myra_wants_bigger_tits() and not person.has_large_tits: - if myra_at_cafe(): - if mc.inventory.has_serum_with_trait(breast_enhancement): - return True - return "Requires serum with Breast Enhancement Trait" + if myra_wants_bigger_tits() and not person.has_large_tits and myra_at_cafe(): + if mc.inventory.has_serum_with_trait(breast_enhancement): + return True + return "Requires serum with Breast Enhancement Trait" return False def myra_bigger_tits_final_requirement(person: Person): diff --git a/game/people/Myrabelle/myra_role_definition_ren.py b/game/people/Myrabelle/myra_role_definition_ren.py index 4f2471f54..bd0f24d52 100644 --- a/game/people/Myrabelle/myra_role_definition_ren.py +++ b/game/people/Myrabelle/myra_role_definition_ren.py @@ -192,6 +192,5 @@ def myra_unlock_energy_drink_serum(): def gaming_cafe_dose_customers(): serum = copy.copy(myra_get_exclusive_energy_drink()) for person in gaming_cafe.people: - if serum not in person.serum_effects: - if len(person.serum_effects) < person.serum_tolerance: - person.give_serum(copy.copy(serum), add_to_log = False) + if serum not in person.serum_effects and len(person.serum_effects) < person.serum_tolerance: + person.give_serum(copy.copy(serum), add_to_log = False) diff --git a/game/people/Ophelia/ophelia_role_definition_ren.py b/game/people/Ophelia/ophelia_role_definition_ren.py index 2919c00c3..c6e83e8d2 100644 --- a/game/people/Ophelia/ophelia_role_definition_ren.py +++ b/game/people/Ophelia/ophelia_role_definition_ren.py @@ -25,10 +25,8 @@ def ophelia_ex_bf_plan_pics_requirement(person: Person): # prevent conflict with planned dates if mc.business.date_scheduled_today(): return False - if person.is_at_work: - if ophelia_get_ex_pics_planned() < 2: - if ophelia_get_phone_convo_heard() > 0: - return True + if person.is_at_work and ophelia_get_ex_pics_planned() < 2 and ophelia_get_phone_convo_heard() > 0: + return True return False def ophelia_talk_about_candace_requirement(person: Person): #pylint: disable=unused-argument diff --git a/game/people/Sarah/sarah_role_definition_ren.py b/game/people/Sarah/sarah_role_definition_ren.py index e977d62ee..925f1ad43 100644 --- a/game/people/Sarah/sarah_role_definition_ren.py +++ b/game/people/Sarah/sarah_role_definition_ren.py @@ -181,10 +181,9 @@ def get_Sarah_willing_threesome_list(): return target_list def Sarah_threesome_request_requirement(): - if time_of_day > 2 and day%7 == 5 and sarah.sluttiness >= 80: - if sarah.is_available and mc.is_at_work: - # at least three choices for who to hook up with - return builtins.len(get_Sarah_willing_threesome_list()) >= 3 + if time_of_day > 2 and day%7 == 5 and sarah.sluttiness >= 80 and sarah.is_available and mc.is_at_work: + # at least three choices for who to hook up with + return builtins.len(get_Sarah_willing_threesome_list()) >= 3 return False def add_sarah_threesome_request_action(): diff --git a/game/people/Teamups/ellie_stephanie_teamup_definition_ren.py b/game/people/Teamups/ellie_stephanie_teamup_definition_ren.py index f679b895d..280477916 100644 --- a/game/people/Teamups/ellie_stephanie_teamup_definition_ren.py +++ b/game/people/Teamups/ellie_stephanie_teamup_definition_ren.py @@ -17,9 +17,8 @@ def ellie_stephanie_teamup_progression_scene_1_req(): #Requirements for the s return def ellie_stephanie_teamup_progression_scene_action_req(person: Person): #pylint: disable=unused-argument - if time_of_day == 1 and day%7 == 2: - if mc.business.head_researcher is not None: - return mc.business.head_researcher.is_available and person.is_available + if time_of_day == 1 and day%7 == 2 and mc.business.head_researcher is not None: + return mc.business.head_researcher.is_available and person.is_available return False def ellie_stephanie_teamup_unit_test_func(the_group): -- GitLab From df034ea7a5f80a647827b5abfdcf36ddb9baf595 Mon Sep 17 00:00:00 2001 From: wkwk <12408-wkwk@users.norepy.gitgud.io> Date: Sat, 5 Aug 2023 06:35:53 -0600 Subject: [PATCH 08/12] Remove some key getters --- game/bugfix_additions/debug_info_ren.py | 4 ++-- game/major_game_classes/character_related/Person_ren.py | 4 ++-- .../clothing_related/wardrobe_builder_ren.py | 2 +- .../serum_related/serums/_serum_traits_ren.py | 2 +- game/pylru.py | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/game/bugfix_additions/debug_info_ren.py b/game/bugfix_additions/debug_info_ren.py index b71f56335..abc5bb72b 100644 --- a/game/bugfix_additions/debug_info_ren.py +++ b/game/bugfix_additions/debug_info_ren.py @@ -112,9 +112,9 @@ def bytesizeof(obj, seen=None): try: if isinstance(obj, collections.abc.Mapping): size += sum(bytesizeof(v, seen) for v in obj.values()) - size += sum(bytesizeof(k, seen) for k in obj.keys()) + size += sum(bytesizeof(k, seen) for k in obj) elif hasattr(obj, '__dict__'): # sum all object attributes - size += sum(bytesizeof(getattr(obj, name), seen) for name in obj.__dict__.keys()) + size += sum(bytesizeof(getattr(obj, name), seen) for name in obj.__dict__) elif hasattr(obj, '__iter__') and not isinstance(obj, (str, bytes, bytearray)): size += sum(bytesizeof(i, seen) for i in obj) elif isinstance(obj, (str, bytes, bytearray)): diff --git a/game/major_game_classes/character_related/Person_ren.py b/game/major_game_classes/character_related/Person_ren.py index 6e876c238..eb257b3b9 100644 --- a/game/major_game_classes/character_related/Person_ren.py +++ b/game/major_game_classes/character_related/Person_ren.py @@ -5082,7 +5082,7 @@ class Person(): #Everything that needs to be known about a person. favourite_colour = self.event_triggers_dict.get("favourite_colour", None) #check if current favourite is still in list_of favourites - list_of_favourites = [x for x in WardrobeBuilder.color_prefs.keys() if self.get_opinion_score(x) == 2] + list_of_favourites = [x for x in WardrobeBuilder.color_prefs if self.get_opinion_score(x) == 2] if favourite_colour in list_of_favourites: return favourite_colour @@ -5288,7 +5288,7 @@ class Person(): #Everything that needs to be known about a person. def clean_cache(self): partial = "ID:{}".format(self.identifier) - obsolete = [x for x in character_cache.keys() if partial in x] + obsolete = [x for x in character_cache if partial in x] for x in obsolete: del character_cache[x] diff --git a/game/major_game_classes/clothing_related/wardrobe_builder_ren.py b/game/major_game_classes/clothing_related/wardrobe_builder_ren.py index 3901823db..e6b4e41cd 100644 --- a/game/major_game_classes/clothing_related/wardrobe_builder_ren.py +++ b/game/major_game_classes/clothing_related/wardrobe_builder_ren.py @@ -428,7 +428,7 @@ class WardrobeBuilder(NoRollback): @staticmethod def clothing_in_preferences(topic: str, clothing: Clothing): - return any(clothing in WardrobeBuilder.preferences[topic][x] for x in WardrobeBuilder.preferences[topic].keys()) + return any(clothing in WardrobeBuilder.preferences[topic][x] for x in WardrobeBuilder.preferences[topic]) @staticmethod def get_color_from_opinion_color(opinion_color: str): diff --git a/game/major_game_classes/serum_related/serums/_serum_traits_ren.py b/game/major_game_classes/serum_related/serums/_serum_traits_ren.py index c30492594..a0a8eab8e 100644 --- a/game/major_game_classes/serum_related/serums/_serum_traits_ren.py +++ b/game/major_game_classes/serum_related/serums/_serum_traits_ren.py @@ -601,7 +601,7 @@ def breast_milk_serum_production_on_apply(target_design, person: Person, serum: person.add_role(lactating_serum_role) person.event_triggers_dict["serum_in_breasts"] = 0 - if "lactating_serum_types" in person.event_triggers_dict.keys(): + if "lactating_serum_types" in person.event_triggers_dict: person.event_triggers_dict["lactating_serum_types"].append(target_design) else: person.event_triggers_dict["lactating_serum_types"] = [target_design] diff --git a/game/pylru.py b/game/pylru.py index bb272e3e6..975205527 100644 --- a/game/pylru.py +++ b/game/pylru.py @@ -182,7 +182,7 @@ class LRUCache(): for key in other: self[key] = other[key] elif hasattr(other, "keys"): - for key in other.keys(): + for key in other: self[key] = other[key] else: for key, value in other: -- GitLab From f367bee20c850576e8feb7ae20630b216d24af6e Mon Sep 17 00:00:00 2001 From: wkwk <12408-wkwk@users.norepy.gitgud.io> Date: Sat, 5 Aug 2023 06:45:40 -0600 Subject: [PATCH 09/12] Replace some for-if by any --- game/major_game_classes/game_logic/RoomObject_ren.py | 5 +---- game/major_game_classes/game_logic/Room_ren.py | 5 +---- 2 files changed, 2 insertions(+), 8 deletions(-) diff --git a/game/major_game_classes/game_logic/RoomObject_ren.py b/game/major_game_classes/game_logic/RoomObject_ren.py index 7ca1ecbe5..9270a2f63 100644 --- a/game/major_game_classes/game_logic/RoomObject_ren.py +++ b/game/major_game_classes/game_logic/RoomObject_ren.py @@ -32,10 +32,7 @@ class RoomObject(): return True def has_trait(self,the_trait:str) -> bool: - for trait in self.traits: - if trait == the_trait: - return True - return False + return any(trait == the_trait for trait in self.traits) @property def formatted_name(self) -> str: diff --git a/game/major_game_classes/game_logic/Room_ren.py b/game/major_game_classes/game_logic/Room_ren.py index fb44e26f4..9178f3207 100644 --- a/game/major_game_classes/game_logic/Room_ren.py +++ b/game/major_game_classes/game_logic/Room_ren.py @@ -180,10 +180,7 @@ class Room(): #Contains objects. def has_object_with_trait(self,the_trait: str) -> bool: if the_trait == "None": return True - for obj in self.objects: - if obj.has_trait(the_trait): - return True - return False + return any(obj.has_trait(the_trait) for obj in self.objects) def get_object_with_trait(self, the_trait : str) -> RoomObject: if self.has_object_with_trait(the_trait): -- GitLab From 6e56ddfcef27d924e94a0e23c7bf56c531d64622 Mon Sep 17 00:00:00 2001 From: wkwk <12408-wkwk@users.norepy.gitgud.io> Date: Sat, 5 Aug 2023 06:45:56 -0600 Subject: [PATCH 10/12] Add missing new line --- game/people/Starbuck/starbuck_events_ren.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/game/people/Starbuck/starbuck_events_ren.py b/game/people/Starbuck/starbuck_events_ren.py index 6adb3cafc..fe5c7bfac 100644 --- a/game/people/Starbuck/starbuck_events_ren.py +++ b/game/people/Starbuck/starbuck_events_ren.py @@ -23,4 +23,4 @@ def add_starbuck_coffee_time_action(): mc.business.add_mandatory_crisis( Action("Starbuck meets for Coffee", starbuck_coffee_time_requirement, "starbuck_coffee_time_label") ) - starbuck.progress.love_step = 2 \ No newline at end of file + starbuck.progress.love_step = 2 -- GitLab From 93b1faa0f946fbd90e1017721dd386bb17f6f7c2 Mon Sep 17 00:00:00 2001 From: wkwk <12408-wkwk@users.norepy.gitgud.io> Date: Sat, 5 Aug 2023 06:51:37 -0600 Subject: [PATCH 11/12] Remove some useless returns --- game/business_policies/organisation_policies_ren.py | 1 - game/crises/limited_time_crises/family_LTE_definition_ren.py | 1 - game/crises/regular_crises/crises_definition_ren.py | 1 - game/fetish/anal_fetish_definition_ren.py | 1 - .../business_roles/_business_role_definitions_ren.py | 1 - .../interaction_actions/chat_actions_definition_ren.py | 2 -- game/helper_functions/heart_formatting_functions_ren.py | 1 - game/main_character/mc_serum_trait_ren.py | 1 - game/major_game_classes/business_related/Business_ren.py | 1 - game/major_game_classes/character_related/Person_ren.py | 3 --- game/major_game_classes/game_logic/MenuItem_ren.py | 1 - .../serum_related/serums/fetish_serums_ren.py | 1 - game/people/Alexia/alexia_events_ren.py | 1 - game/people/Candace/candace_definition_ren.py | 1 - game/people/Erica/erica_role_definition_ren.py | 1 - game/people/Gabrielle/cousin_role_definition_ren.py | 2 -- game/people/Myrabelle/myra_focus_training_definition_ren.py | 1 - game/people/Ophelia/hair_salon_action_mod_ren.py | 1 - game/people/Starbuck/starbuck_definition_ren.py | 1 - game/people/Teamups/alexia_myra_teamup_definition_ren.py | 2 -- 20 files changed, 25 deletions(-) diff --git a/game/business_policies/organisation_policies_ren.py b/game/business_policies/organisation_policies_ren.py index 76496ac79..46c400f68 100644 --- a/game/business_policies/organisation_policies_ren.py +++ b/game/business_policies/organisation_policies_ren.py @@ -136,7 +136,6 @@ organisation_policies_list.append(strict_enforcement) def draconian_enforcement_on_day(): for employee in mc.business.employee_list: employee.change_happiness(-5) - return draconian_enforcement = Policy(name = "Draconian Enforcement", desc = "Each policy infraction is to be punished to the utmost tolerable.\nAll infraction severities are increased by one, but the restrictive office environment affects company morale, lowering all employee happiness by -5 per day.", diff --git a/game/crises/limited_time_crises/family_LTE_definition_ren.py b/game/crises/limited_time_crises/family_LTE_definition_ren.py index 7c578c27c..8c50369ee 100644 --- a/game/crises/limited_time_crises/family_LTE_definition_ren.py +++ b/game/crises/limited_time_crises/family_LTE_definition_ren.py @@ -98,7 +98,6 @@ def add_mom_outfit_coloured_apron(person: Person): coloured_apron.pattern = "Pattern_1" coloured_apron.colour_pattern = [1.0,0.83,0.90,1.0] person.outfit.add_dress(coloured_apron) - return def sister_go_shopping_requirement(person: Person): if time_of_day != 3: diff --git a/game/crises/regular_crises/crises_definition_ren.py b/game/crises/regular_crises/crises_definition_ren.py index 7e06f19e4..ad1f6c702 100644 --- a/game/crises/regular_crises/crises_definition_ren.py +++ b/game/crises/regular_crises/crises_definition_ren.py @@ -390,7 +390,6 @@ def horny_at_work_strip_down(person: Person): renpy.say(None,"You pull her " + clothing.display_name + " out of the way so you can get to her pussy.") else: renpy.say(None,"You pull her " + clothing.display_name + " out of the way.") - return def horny_at_work_get_people_sets(): clarity_change = 0 diff --git a/game/fetish/anal_fetish_definition_ren.py b/game/fetish/anal_fetish_definition_ren.py index 3cb34261a..4c5e3c3ce 100644 --- a/game/fetish/anal_fetish_definition_ren.py +++ b/game/fetish/anal_fetish_definition_ren.py @@ -79,7 +79,6 @@ def debug_set_stats_for_anal_fetish_mins(person: Person): person.obedience = 0 person.happiness = 100 person.love = 0 - return def abort_anal_fetish_intro(person: Person): #Use this function to exit a anal fetish scene for whatever reason (something fails, MC choice, etc.) person.event_triggers_dict["anal_fetish_start"] = False diff --git a/game/game_roles/business_roles/_business_role_definitions_ren.py b/game/game_roles/business_roles/_business_role_definitions_ren.py index adc579b8c..22e7f4b91 100644 --- a/game/game_roles/business_roles/_business_role_definitions_ren.py +++ b/game/game_roles/business_roles/_business_role_definitions_ren.py @@ -398,7 +398,6 @@ def update_IT_projects_requirement(person: Person): def IT_director_on_turn(person: Person): if person.location == mc.business.r_div: mc.business.IT_increase_project_progress(amount = (person.int * 2) + (person.focus)) - return def IT_director_on_move(person: Person): #pylint: disable=unused-argument # if mc.business.is_open_for_business and mc.business.current_IT_project: diff --git a/game/general_actions/interaction_actions/chat_actions_definition_ren.py b/game/general_actions/interaction_actions/chat_actions_definition_ren.py index 0b527a6e7..31ad6a972 100644 --- a/game/general_actions/interaction_actions/chat_actions_definition_ren.py +++ b/game/general_actions/interaction_actions/chat_actions_definition_ren.py @@ -329,14 +329,12 @@ def create_movie_date_action(person: Person): Action("Movie date", evening_date_trigger, "movie_date_label", args=person, requirement_args=1) ) mc.business.event_triggers_dict["movie_date_scheduled"] = True - return def create_dinner_date_action(person: Person): mc.business.add_mandatory_crisis( Action("Dinner date", evening_date_trigger, "dinner_date_label", args=person, requirement_args=4) ) mc.business.event_triggers_dict["dinner_date_scheduled"] = True - return def new_title_menu(person: Person): title_tuple = [] diff --git a/game/helper_functions/heart_formatting_functions_ren.py b/game/helper_functions/heart_formatting_functions_ren.py index 0ca7deaa9..d53102bdb 100644 --- a/game/helper_functions/heart_formatting_functions_ren.py +++ b/game/helper_functions/heart_formatting_functions_ren.py @@ -25,7 +25,6 @@ def build_hearts(): name = "gold_heart{}_grey_heart{}".format(i, j) heart_progress = HeartImage(name, "empty_heart.png", "gold_heart.png", i, "grey_heart.png", j) renpy.image(name, heart_progress) - return build_hearts() diff --git a/game/main_character/mc_serum_trait_ren.py b/game/main_character/mc_serum_trait_ren.py index a78d810d8..d623272c3 100644 --- a/game/main_character/mc_serum_trait_ren.py +++ b/game/main_character/mc_serum_trait_ren.py @@ -29,7 +29,6 @@ class MC_Serum_Trait(): self.upg_string = upg_string self.on_apply = on_apply self.on_remove = on_remove - return def __lt__(self, other): if other is None: diff --git a/game/major_game_classes/business_related/Business_ren.py b/game/major_game_classes/business_related/Business_ren.py index 0ac45f95d..46791f3d6 100644 --- a/game/major_game_classes/business_related/Business_ren.py +++ b/game/major_game_classes/business_related/Business_ren.py @@ -446,7 +446,6 @@ class Business(): if day%7 == 6: #ie is Monday self.renew_contracts() - return @property def is_open_for_business(self) -> bool: #Checks to see if employees are currently working diff --git a/game/major_game_classes/character_related/Person_ren.py b/game/major_game_classes/character_related/Person_ren.py index eb257b3b9..39f258bd1 100644 --- a/game/major_game_classes/character_related/Person_ren.py +++ b/game/major_game_classes/character_related/Person_ren.py @@ -2819,7 +2819,6 @@ class Person(): #Everything that needs to be known about a person. self.draw_person() if dialogue: self.call_dialogue("clothing_review") # must be last call in function - return def judge_outfit(self, outfit: Outfit, temp_sluttiness_boost: int = 0, use_taboos = True, as_underwear = False, as_overwear = False) -> bool: #Judge an outfit and determine if it's too slutty or not. Can be used to judge other people's outfits to determine if she thinks they look like a slut. # temp_sluttiness can be used in situations (mainly crises) where an outfit is allowed to be temporarily more slutty than a girl is comfortable wearing all the time. @@ -3156,7 +3155,6 @@ class Person(): #Everything that needs to be known about a person. self.update_work_skill("production_skill", min(max_value, self.production_skill + 1), add_to_log = add_to_log) elif skill == 4 or skill == "supply_skill": self.update_work_skill("supply_skill", min(max_value, self.supply_skill + 1), add_to_log = add_to_log) - return def decrease_work_skill(self, skill: int|str, add_to_log = True): if skill in (0, "hr_skill"): @@ -3169,7 +3167,6 @@ class Person(): #Everything that needs to be known about a person. self.update_work_skill("production_skill", max(0, self.production_skill - 1), add_to_log = add_to_log) elif skill in (4, "supply_skill"): self.update_work_skill("supply_skill", max(0, self.supply_skill - 1), add_to_log = add_to_log) - return def update_work_skill(self, skill: int|str, score: int, add_to_log = True): skill_name = None diff --git a/game/major_game_classes/game_logic/MenuItem_ren.py b/game/major_game_classes/game_logic/MenuItem_ren.py index 0d5ca370e..976abf183 100644 --- a/game/major_game_classes/game_logic/MenuItem_ren.py +++ b/game/major_game_classes/game_logic/MenuItem_ren.py @@ -179,7 +179,6 @@ class MenuItem(): def __del__(self): self.return_value = None self.display_func = None - return def show_person(self): if not self.display_func: diff --git a/game/major_game_classes/serum_related/serums/fetish_serums_ren.py b/game/major_game_classes/serum_related/serums/fetish_serums_ren.py index 68b21e680..abc5ac192 100644 --- a/game/major_game_classes/serum_related/serums/fetish_serums_ren.py +++ b/game/major_game_classes/serum_related/serums/fetish_serums_ren.py @@ -966,7 +966,6 @@ def add_fetish_serum_traits(): mental_aspect = 5, physical_aspect = 5, sexual_aspect = 5, medical_aspect = 0, flaws_aspect = 0, attention = FETISH_SERUM_ATTENTION, allow_toggle = False ) - return def fetish_anal_serum_is_unlocked(): if not get_fetish_anal_serum(): diff --git a/game/people/Alexia/alexia_events_ren.py b/game/people/Alexia/alexia_events_ren.py index 865f31933..53329bc10 100644 --- a/game/people/Alexia/alexia_events_ren.py +++ b/game/people/Alexia/alexia_events_ren.py @@ -22,7 +22,6 @@ def add_alexia_first_stream_action(): alexia.add_unique_on_room_enter_event( Action("Alexia wants to stream", alexia_first_stream_requirement, "alexia_first_stream_label") ) - return diff --git a/game/people/Candace/candace_definition_ren.py b/game/people/Candace/candace_definition_ren.py index d295a8b70..a93a876f6 100644 --- a/game/people/Candace/candace_definition_ren.py +++ b/game/people/Candace/candace_definition_ren.py @@ -190,7 +190,6 @@ def create_debug_genius_candace(): #Use this function to make a version of geni candace.home.add_person(candace) make_candace_free_roam_and_set_intro_event() mc.business.add_employee_supply(candace, False) - return ############## diff --git a/game/people/Erica/erica_role_definition_ren.py b/game/people/Erica/erica_role_definition_ren.py index a171f1986..deb665c0d 100644 --- a/game/people/Erica/erica_role_definition_ren.py +++ b/game/people/Erica/erica_role_definition_ren.py @@ -96,7 +96,6 @@ def add_erica_wakeup_option(option): erica.event_triggers_dict["wake_up_options"] = erica_get_wakeup_options() if not option in erica_get_wakeup_options(): erica.event_triggers_dict["wake_up_options"].append(option) - return def erica_wakeup_choose_position(): tuple_list = [] diff --git a/game/people/Gabrielle/cousin_role_definition_ren.py b/game/people/Gabrielle/cousin_role_definition_ren.py index 7b48269b8..8353401be 100644 --- a/game/people/Gabrielle/cousin_role_definition_ren.py +++ b/game/people/Gabrielle/cousin_role_definition_ren.py @@ -45,7 +45,6 @@ def add_cousin_blackmail_hint_action(person: Person): mc.business.add_mandatory_crisis( Action("Blackmail hint", blackmail_hint_requirement, "aunt_cousin_hint_label", args = [aunt, person], requirement_args = [person, day + renpy.random.randint(2,4)]) ) - return def cousin_serum_boobjob_check_requirement(the_day): @@ -75,7 +74,6 @@ def add_cousin_tits_payback_action(the_person, amount): mc.business.add_mandatory_crisis( Action("cousin tits payback", cousin_tits_payback_requirement, "cousin_tits_payback_label", args = [the_person, amount], requirement_args = day + 7) ) #An event where she sends you some cash in a week, which if it has not finished then re-adds itself with the new amount - return def blackmail_2_confront_requirement(person: Person): diff --git a/game/people/Myrabelle/myra_focus_training_definition_ren.py b/game/people/Myrabelle/myra_focus_training_definition_ren.py index 1360e6245..6e2df82cc 100644 --- a/game/people/Myrabelle/myra_focus_training_definition_ren.py +++ b/game/people/Myrabelle/myra_focus_training_definition_ren.py @@ -54,7 +54,6 @@ def myra_focus_progression_scene_compile_scenes(the_progression_scene): the_progression_scene.trans_list = ["myra_focus_trans_scene_0", "myra_focus_trans_scene_1", "myra_focus_trans_scene_2", "myra_focus_trans_scene_3", "myra_focus_trans_scene_4"] the_progression_scene.final_scene_list = ["myra_focus_progression_scene_0", "myra_focus_progression_scene_1", "myra_focus_progression_scene_2", "myra_focus_progression_scene_3", "myra_focus_progression_scene_4"] # the_progression_scene.regress_scene_list = [] #Add labels for regression here if desired. - return myra_focus_progression_scene_action = Action("Train her Focus", myra_focus_progression_scene_action_req, "myra_focus_progression_scene_action_label") myra_train_focus = Action("Help Myra Train Focus", myra_train_focus_requirement, "myra_train_focus_label") diff --git a/game/people/Ophelia/hair_salon_action_mod_ren.py b/game/people/Ophelia/hair_salon_action_mod_ren.py index 3286460bc..42396b4b0 100644 --- a/game/people/Ophelia/hair_salon_action_mod_ren.py +++ b/game/people/Ophelia/hair_salon_action_mod_ren.py @@ -10,7 +10,6 @@ def hair_salon_mod_initialization(self): salon_manager.event_triggers_dict["ex_name"] = Person.get_random_male_name() # add haircut action to mall salon mall_salon.add_action(self) - return # Note that the class Room have a bunch of useful variables already for restricting access, adding objects etc. def salon_requirement(): diff --git a/game/people/Starbuck/starbuck_definition_ren.py b/game/people/Starbuck/starbuck_definition_ren.py index e997bb8bd..f7fbb6ec1 100644 --- a/game/people/Starbuck/starbuck_definition_ren.py +++ b/game/people/Starbuck/starbuck_definition_ren.py @@ -95,7 +95,6 @@ def create_starbuck_character(): starbuck.generate_home() starbuck.home.add_person(starbuck) make_sex_shop_owner(starbuck) - return ############## diff --git a/game/people/Teamups/alexia_myra_teamup_definition_ren.py b/game/people/Teamups/alexia_myra_teamup_definition_ren.py index 23931cb93..64157c77a 100644 --- a/game/people/Teamups/alexia_myra_teamup_definition_ren.py +++ b/game/people/Teamups/alexia_myra_teamup_definition_ren.py @@ -46,7 +46,6 @@ def myra_alexia_teamup_unit_test_func(the_group): person.change_slut(20) person.change_energy(200) mc.change_energy(200) - return def myra_alexia_teamup_scene_compile_scenes(the_progression_scene): #WARNING: The order of the following lists is critical! They are referenced based on their indexes!!! @@ -55,7 +54,6 @@ def myra_alexia_teamup_scene_compile_scenes(the_progression_scene): the_progression_scene.trans_list = ["myra_alexia_teamup_trans_scene_0", "myra_alexia_teamup_trans_scene_1", "myra_alexia_teamup_trans_scene_2", "myra_alexia_teamup_trans_scene_3", "myra_alexia_teamup_trans_scene_4"] the_progression_scene.final_scene_list = ["myra_alexia_teamup_scene_scene_0", "myra_alexia_teamup_scene_scene_1", "myra_alexia_teamup_scene_scene_2", "myra_alexia_teamup_scene_scene_3", "myra_alexia_teamup_scene_scene_4"] the_progression_scene.regress_scene_list = [] #Add labels for regression here if desired. - return myra_alexia_teamup_scene_action = Action("Myra and Alexia's Game Night", myra_alexia_teamup_scene_action_req, "myra_alexia_teamup_scene_action_label") -- GitLab From 47835cd07017884f1f48dcc0d74147a95667880b Mon Sep 17 00:00:00 2001 From: wkwk <12408-wkwk@users.norepy.gitgud.io> Date: Sat, 5 Aug 2023 04:46:40 -0600 Subject: [PATCH 12/12] Some for improvements --- game/crises/regular_crises/crises_definition_ren.py | 2 +- game/helper_functions/webcolors_usage_ren.py | 2 +- game/main_character/perks/Perks_ren.py | 6 +++--- .../clothing_related/wardrobe_builder_ren.py | 2 +- game/people/Sarah/HR_supervisor_role_definition_ren.py | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/game/crises/regular_crises/crises_definition_ren.py b/game/crises/regular_crises/crises_definition_ren.py index ad1f6c702..2afe21e38 100644 --- a/game/crises/regular_crises/crises_definition_ren.py +++ b/game/crises/regular_crises/crises_definition_ren.py @@ -316,7 +316,7 @@ dict_work_skills = { def build_seminar_improvement_menu(person: Person): work_seminar = [] # NOTE: We can allow seminars for both main and sex skills, e.g through introducing a company hosted seminar type. - for _, skill in dict_work_skills.items(): + for skill in dict_work_skills.values(): work_seminar.append([skill[0] + "\nCurrent: " + str(getattr(person, skill[1])), skill[1]]) work_seminar.insert(0, "Work Skills") return [work_seminar] diff --git a/game/helper_functions/webcolors_usage_ren.py b/game/helper_functions/webcolors_usage_ren.py index 232b44808..ebdf64c88 100644 --- a/game/helper_functions/webcolors_usage_ren.py +++ b/game/helper_functions/webcolors_usage_ren.py @@ -26,7 +26,7 @@ def closest_eye_color(requested_colour: Color) -> str: return closest_color_name(requested_colour, eye_color_hex_to_names) opinion_color_names_to_hex = {} -for g_topic, g_prefs in WardrobeBuilder.color_prefs.items(): +for g_prefs in WardrobeBuilder.color_prefs.values(): for g_name, g_color in g_prefs.items(): opinion_color_names_to_hex[g_name] = normalize_hex(rgb_to_hex(rgb_fraction_to_rgb((g_color[0], g_color[1], g_color[2])))) opinion_color_names_to_hex = _reversedict(opinion_color_names_to_hex) diff --git a/game/main_character/perks/Perks_ren.py b/game/main_character/perks/Perks_ren.py index e99a8954b..53fc3aeb9 100644 --- a/game/main_character/perks/Perks_ren.py +++ b/game/main_character/perks/Perks_ren.py @@ -31,7 +31,7 @@ class Perks(): for perk_name in expired_perks(self.ability_perks): self.remove_perk(perk_name) - for _, perk in self.ability_perks.items(): + for perk in self.ability_perks.values(): perk.update() def remove_perk(self, perk_name): @@ -47,7 +47,7 @@ class Perks(): def save_load(self): def save_load_stat_dictionary(perks): - for _, perk in perks.items(): + for perk in perks.values(): if callable(perk.save_load): perk.save_load() @@ -170,7 +170,7 @@ class Perks(): return ret_text def perk_on_cum(self, person: Person, opinion: str, add_to_log = True): - for _, perk in self.ability_perks.items(): + for perk in self.ability_perks.values(): if callable(perk.on_cum): perk.on_cum(person, opinion, add_to_log) diff --git a/game/major_game_classes/clothing_related/wardrobe_builder_ren.py b/game/major_game_classes/clothing_related/wardrobe_builder_ren.py index e6b4e41cd..46707888e 100644 --- a/game/major_game_classes/clothing_related/wardrobe_builder_ren.py +++ b/game/major_game_classes/clothing_related/wardrobe_builder_ren.py @@ -495,7 +495,7 @@ class WardrobeBuilder(NoRollback): color_list.extend([[WardrobeBuilder.color_prefs[cp][x][:], (score + 2) ** 2] for x in WardrobeBuilder.color_prefs[cp]]) if not color_list: # if she hates all colours - for _, colors in WardrobeBuilder.color_prefs.items(): + for colors in WardrobeBuilder.color_prefs.values(): color_list.extend([[colors[x][:], 5] for x in colors]) return get_random_from_weighted_list(color_list) diff --git a/game/people/Sarah/HR_supervisor_role_definition_ren.py b/game/people/Sarah/HR_supervisor_role_definition_ren.py index 24122d7b8..0e800f8d7 100644 --- a/game/people/Sarah/HR_supervisor_role_definition_ren.py +++ b/game/people/Sarah/HR_supervisor_role_definition_ren.py @@ -321,7 +321,7 @@ def generate_HR_recruit(): recruit.opinions["production work"] = [2, True] # discover some opinions - for x in builtins.range(0, 6): + for _x in builtins.range(0, 6): recruit.discover_opinion(recruit.get_random_opinion(include_known = False, include_sexy = True),add_to_log = False) return recruit -- GitLab