From 2bbc1c1db8807c4a4a9f0f0c82dd7316f5330c95 Mon Sep 17 00:00:00 2001 From: Kaden <kaden701gmail.com> Date: Wed, 27 Jul 2022 11:52:07 -0400 Subject: [PATCH 1/2] expanded shared_functions --- Mods_Kaden/shared_functions.rpy | 74 ++++++++++++++++++++++++++++++--- 1 file changed, 69 insertions(+), 5 deletions(-) diff --git a/Mods_Kaden/shared_functions.rpy b/Mods_Kaden/shared_functions.rpy index 4fdcc96..90a8a38 100644 --- a/Mods_Kaden/shared_functions.rpy +++ b/Mods_Kaden/shared_functions.rpy @@ -5,15 +5,15 @@ init -1 python: return formatted_title def return_underwear(the_item): - list = [] + temp_list = [] for key, list_of_values in mc.stolen_underwear.items(): if the_item in list_of_values: - list = list_of_values - list.remove(the_item) + temp_list = list_of_values + temp_list.remove(the_item) del mc.stolen_underwear[key] - if list: + if temp_list: mc.stolen_underwear[key] = [] - for clothing in list: + for clothing in temp_list: mc.stolen_underwear[key].append(clothing) return @@ -22,3 +22,67 @@ init -1 python: if clothing not in [thong, tiny_g_string]: return True return False + + def home_residents(): + residents = [] + for person in [x for x in all_people_in_the_game() if x.home == mc.location]: + residents.append(person) + return residents + + def get_existing_rivals(self, person): + return_list = [] + for relationship in self.get_relationship_type_list(person, types = ["Nemesis", "Rival"]): + return_list.append(relationship[0]) + return return_list + + def get_existing_rival_count(self, person): + return __builtin__.len(get_existing_rivals(self, person)) + + def get_existing_friends(self, person): + return_list = [] + for relationship in self.get_relationship_type_list(person, types = ["Friend", "Best Friend"]): + return_list.append(relationship[0]) + return return_list + + def get_exisiting_friend_count(self, person): + return __builtin__.len(get_existing_friends(self, person)) + + def get_exisiting_family_count(self, person): + return __builtin__.len(get_family_members(self, person)) + + def pregnant_family(person): + the_mothers = [] + if len(get_family_members(town_relationships, person)) > 0: + for x in get_family_members(town_relationships, person): + if x.event_triggers_dict.get("preg_knows", False): + if x.event_triggers_dict.get("preg_tits_date", 999) < day-5: + the_mothers.append(x) + return the_mothers + + def pregnant_friends(person): + the_mothers = [] + if len(get_existing_friends(town_relationships, person)) > 0: + for x in get_existing_friends(town_relationships, person): + if x.event_triggers_dict.get("preg_knows", False): + if x.event_triggers_dict.get("preg_tits_date", 999) < day-5: + the_mothers.append(x) + return the_mothers + + def pregnant_enemies(person): + the_mothers = [] + if len(get_existing_rivals(town_relationships, person)) > 0: + for x in get_existing_rivals(town_relationships, person): + if x.event_triggers_dict.get("preg_knows", False): + if x.event_triggers_dict.get("preg_tits_date", 999) < day-5: + the_mothers.append(x) + return the_mothers + + def pregnant_people(person): #change to body type check? + the_mothers = [] + if pregnant_family(person): + the_mothers.extend(pregnant_family(person)) + if pregnant_friends(person): + the_mothers.extend(pregnant_friends(person)) + if pregnant_enemies(person): + the_mothers.extend(pregnant_enemies(person)) + return the_mothers -- GitLab From 0fe7574e7a2b37bde6cc68f836c80a590cb8dfa1 Mon Sep 17 00:00:00 2001 From: Kaden <kaden701gmail.com> Date: Wed, 27 Jul 2022 12:02:20 -0400 Subject: [PATCH 2/2] temp_list and shared_functions clean up --- Mods_Kaden/baby_fever.rpy | 55 ++++--------------------------- Mods_Kaden/bedroom_search.rpy | 9 +---- Mods_Kaden/bra_size_crisis.rpy | 15 +++++---- Mods_Kaden/college_girls.rpy | 4 +-- Mods_Kaden/missing_bra.rpy | 8 ++--- Mods_Kaden/missing_panties.rpy | 8 ++--- Mods_Kaden/pajamas.rpy | 15 +++++---- Mods_Kaden/side_effect_crisis.rpy | 10 ------ Mods_Kaden/time_capsule.rpy | 12 +++---- Mods_Kaden/uniform_designer.rpy | 30 +++++++---------- 10 files changed, 51 insertions(+), 115 deletions(-) diff --git a/Mods_Kaden/baby_fever.rpy b/Mods_Kaden/baby_fever.rpy index ec4fee1..493aa85 100644 --- a/Mods_Kaden/baby_fever.rpy +++ b/Mods_Kaden/baby_fever.rpy @@ -1,6 +1,6 @@ init -1 python: def baby_fever_get_people(): - list = [] + temp_list = [] final_list = [] for person in known_people_in_the_game(): if person not in [lily, mom, cousin, aunt]: @@ -9,11 +9,11 @@ init -1 python: if person.event_triggers_dict.get("last_birth", 0) < 1: # no baby if person.event_triggers_dict.get("baby_fever_chat", 0) < day -14: # no recent talk if pregnant_people(person): - list.append(person) - if list: + temp_list.append(person) + if temp_list: while len(final_list) < 1: target = mc.business.event_triggers_dict.get("baby_fever", -4) - for person in list: + for person in temp_list: if person.get_opinion_score("creampies") + person.get_opinion_score("bareback sex") == target: final_list.append(person) if not final_list: @@ -23,49 +23,6 @@ init -1 python: mc.business.event_triggers_dict["baby_fever"] = target + 1 return final_list - def get_existing_friends(self, person): - return_list = [] - for relationship in self.get_relationship_type_list(person, types = ["Friend", "Best Friend"]): - return_list.append(relationship[0]) - return return_list - - def pregnant_family(person): - the_mothers = [] - if len(get_family_members(town_relationships, person)) > 0: - for x in get_family_members(town_relationships, person): - if x.event_triggers_dict.get("preg_knows", False): - if x.event_triggers_dict.get("preg_tits_date", 999) < day-5: - the_mothers.append(x) - return the_mothers - - def pregnant_friends(person): - the_mothers = [] - if len(get_existing_friends(town_relationships, person)) > 0: - for x in get_existing_friends(town_relationships, person): - if x.event_triggers_dict.get("preg_knows", False): - if x.event_triggers_dict.get("preg_tits_date", 999) < day-5: - the_mothers.append(x) - return the_mothers - - def pregnant_enemies(person): - the_mothers = [] - if len(get_existing_rivals(town_relationships, person)) > 0: - for x in get_existing_rivals(town_relationships, person): - if x.event_triggers_dict.get("preg_knows", False): - if x.event_triggers_dict.get("preg_tits_date", 999) < day-5: - the_mothers.append(x) - return the_mothers - - def pregnant_people(person): #change to body type check - the_mothers = [] - if pregnant_family(person): - the_mothers.extend(pregnant_family(person)) - if pregnant_friends(person): - the_mothers.extend(pregnant_friends(person)) - if pregnant_enemies(person): - the_mothers.extend(pregnant_enemies(person)) - return the_mothers - def crisis_baby_fever_requirement(): if mc.business.event_triggers_dict.get("baby_fever_chat", 0) < day - 5: if baby_fever_get_people(): @@ -209,7 +166,7 @@ label crisis_baby_fever_label(): the_person "...[the_person.mc_title]?" $ the_person.tits = tit_size $ the_person.body_type = body_type - if the_person.is_at_work(): + if the_person.is_employee() and the_person.is_at_work(): $ the_person.wear_uniform() else: $ the_person.apply_planned_outfit() @@ -268,7 +225,7 @@ label crisis_baby_fever_label(): $ the_person.draw_person(position = "kissing", special_modifier = "kissing") "You put your arms around her waist and she kisses you immediately. When you break the kiss she's grinning ear to ear." $ the_person.draw_person(emotion = "happy") - $ ex_title = so_title[:4] #Get's only the first 4 characters of any title for some hesitant-sounding speach. + $ ex_title = so_title[:4] the_person "It feels so good to not have to hide anything anymore! I'll break the news to my [ex_title]... My ex-[so_title] later today." else: the_person "You can't be serious. I already have a [so_title]. Do you really think I'd leave him for you just to have a kid?" diff --git a/Mods_Kaden/bedroom_search.rpy b/Mods_Kaden/bedroom_search.rpy index 0e3bb12..a45838e 100644 --- a/Mods_Kaden/bedroom_search.rpy +++ b/Mods_Kaden/bedroom_search.rpy @@ -1,10 +1,4 @@ init -1 python: - def home_residents(): - residents = [] - for person in [x for x in all_people_in_the_game() if x.home == mc.location]: - residents.append(person) - return residents - def aunt_suitcase_search_requirement(): if hall.has_person(aunt): if time_of_day == 3: @@ -16,7 +10,7 @@ init -1 python: def bedroom_search_requirement(): if mc.location.get_person_count() > 0: person = get_random_person_in_location(mc.location) - return "Not with " + person.title + " around." + return "Not with " + (person.title or "someone") + " around." elif mc.energy < 15: return "Not enough {image=gui/extra_images/energy_token.png}" else: @@ -415,7 +409,6 @@ label aunt_suitcase_search_description(): $ the_person.event_triggers_dict["stolen_bras"] += 1 else: $ the_person.event_triggers_dict["stolen_bras"] = 1 - $ mc.change_location(bedroom) $ mc.location.show_background() "Steal a pair of panties" if len(underwear_list(the_person, bra = False, panties = True)) > 0: diff --git a/Mods_Kaden/bra_size_crisis.rpy b/Mods_Kaden/bra_size_crisis.rpy index e5838b2..cbf688a 100644 --- a/Mods_Kaden/bra_size_crisis.rpy +++ b/Mods_Kaden/bra_size_crisis.rpy @@ -26,22 +26,23 @@ init -1 python: return count def crisis_bra_size_get_people(): - list = [] + temp_list = [] for person in mc.business.get_employee_list(): if not pregnant_role in person.special_role: if person.bra_size + 1 < Person.rank_tits(person.tits): #more than 1 size bigger if bra_count(person) > 0: - list.append(person) + temp_list.append(person) elif person.bra_size + 2 < Person.rank_tits(person.tits): - list.append(person) + temp_list.append(person) elif person.bra_size - 1 > Person.rank_tits(person.tits): #more than 1 size smaller if bra_count(person) > 0: - list.append(person) - for person in list: + temp_list.append(person) + for person in temp_list: for serum in person.serum_effects: if serum.has_trait(breast_enhancement) or serum.has_trait(breast_reduction) or serum.has_trait(lactation_hormones): - list.remove(person) - return list + if person in temp_list: + temp_list.remove(person) + return temp_list init 3 python: crisis_bra_size_action = ActionMod("Bra Size", crisis_bra_size_requirement, "crisis_bra_size_label", diff --git a/Mods_Kaden/college_girls.rpy b/Mods_Kaden/college_girls.rpy index 47dafb0..ddd48c1 100644 --- a/Mods_Kaden/college_girls.rpy +++ b/Mods_Kaden/college_girls.rpy @@ -102,7 +102,7 @@ label lily_intro_one(the_sister): #friend $ scene_manager = Scene() $ lily_friend_mod_initialization() $ lily.event_triggers_dict["classmate_1"] = True - $ lily.event_triggers_dict["classmate_2"] = day + 5 + $ lily.event_triggers_dict["classmate_2"] = day + 3 $ the_sister = lily $ the_sister.apply_university_outfit() $ the_person = lily_friend @@ -161,7 +161,7 @@ label lily_intro_two(the_sister): #rival $ scene_manager = Scene() $ lily_rival_mod_initialization() $ lily.event_triggers_dict["classmate_2"] = 999 - $ lily.event_triggers_dict["classmate_3"] = day + 5 + $ lily.event_triggers_dict["classmate_3"] = day + 3 $ the_sister = lily $ the_sister.apply_university_outfit() $ the_person = lily_rival diff --git a/Mods_Kaden/missing_bra.rpy b/Mods_Kaden/missing_bra.rpy index 706e88b..075245f 100644 --- a/Mods_Kaden/missing_bra.rpy +++ b/Mods_Kaden/missing_bra.rpy @@ -5,17 +5,17 @@ init -1 python: return False def home_missing_bra_get_people(): - list = [] + temp_list = [] if mc.is_home(): for person in [x for x in people_in_mc_home()]: if person.event_triggers_dict.get("stolen_bras",0) > 0: count = person.event_triggers_dict.get("stolen_bras",0) if get_person_bra_list(person): while count: - list.append(person) + temp_list.append(person) count -= 1 - if list: - return get_random_from_list(list) + if temp_list: + return get_random_from_list(temp_list) else: return get_random_from_list(people_in_mc_home()) return None diff --git a/Mods_Kaden/missing_panties.rpy b/Mods_Kaden/missing_panties.rpy index 9acc81e..b8baf0e 100644 --- a/Mods_Kaden/missing_panties.rpy +++ b/Mods_Kaden/missing_panties.rpy @@ -5,17 +5,17 @@ init -1 python: return False def home_missing_panties_get_people(): - list = [] + temp_list = [] if mc.is_home(): for person in [x for x in people_in_mc_home()]: if person.event_triggers_dict.get("stolen_panties",0) > 0: count = person.event_triggers_dict.get("stolen_panties",0) if get_person_panties_list(person): while count: - list.append(person) + temp_list.append(person) count -= 1 - if list: - return get_random_from_list(list) + if temp_list: + return get_random_from_list(temp_list) else: return get_random_from_list(people_in_mc_home()) return None diff --git a/Mods_Kaden/pajamas.rpy b/Mods_Kaden/pajamas.rpy index 53e91a4..a652a9a 100644 --- a/Mods_Kaden/pajamas.rpy +++ b/Mods_Kaden/pajamas.rpy @@ -113,13 +113,14 @@ init 0 python: # run original function org_func(person, destination) # run extension code - if person.location == person.home: - wear_pajamas(person) - if not aunt.event_triggers_dict.get("invited_for_drinks", False): - if aunt.location == hall: - wear_pajamas(aunt) - if cousin.location == lily_bedroom: - wear_pajamas(cousin) + if time_of_day > 3: + if person.location == person.home: + wear_pajamas(person) + if not aunt.event_triggers_dict.get("invited_for_drinks", False): + if aunt.location == hall: + wear_pajamas(aunt) + if cousin.location == lily_bedroom: + wear_pajamas(cousin) return return run_move_enhanced_wrapper_2 diff --git a/Mods_Kaden/side_effect_crisis.rpy b/Mods_Kaden/side_effect_crisis.rpy index 1e054d2..c2adfeb 100644 --- a/Mods_Kaden/side_effect_crisis.rpy +++ b/Mods_Kaden/side_effect_crisis.rpy @@ -1,13 +1,4 @@ init -1 python: - def get_existing_rivals(self, person): - return_list = [] - for relationship in self.get_relationship_type_list(person, types = ["Nemesis", "Rival"]): - return_list.append(relationship[0]) - return return_list - - def get_existing_rival_count(self, person): - return __builtin__.len(get_existing_rivals(self, person)) - def serum_test_crisis_requirement(): if mc.business.is_open_for_business() and mc.is_at_work(): if mandatory_paid_serum_testing_policy.is_active(): @@ -224,4 +215,3 @@ label serum_test_crisis_label(): $ clear_scene() $ the_person.apply_serum_study() return - \ No newline at end of file diff --git a/Mods_Kaden/time_capsule.rpy b/Mods_Kaden/time_capsule.rpy index 92edc6a..4c79120 100644 --- a/Mods_Kaden/time_capsule.rpy +++ b/Mods_Kaden/time_capsule.rpy @@ -137,19 +137,19 @@ init 1 python: return time_capsule def get_time_serum(): - list = [] + temp_list = [] list2 = [] list2 = hidden_trait_list() - list = persistent.time_capsule + temp_list = persistent.time_capsule time_serum = SerumDesign() time_serum.name = "Time Serum" - if list: - for y in list: + if temp_list: + for y in temp_list: for x in list_of_traits: if x.name == y: time_serum.add_trait(x) - if list and list2: - for y in list: + if temp_list and list2: + for y in temp_list: for x in list2: if x.name == y: time_serum.add_trait(x) diff --git a/Mods_Kaden/uniform_designer.rpy b/Mods_Kaden/uniform_designer.rpy index 85a771b..39bf2c2 100644 --- a/Mods_Kaden/uniform_designer.rpy +++ b/Mods_Kaden/uniform_designer.rpy @@ -119,38 +119,32 @@ init 2 python: menu_tooltip = "An employee wants to talk about the work uniforms.", category = "Business Crisis", is_crisis = True) def get_uniform_designer(): - list = [] + temp_list = [] opinion = -2 slut = 0 - while not list: + while not temp_list: for person in mc.business.get_employee_list(): person.create_opinion("work uniforms", start_positive = False, start_known = False, add_to_log = False) if person.get_opinion_score("work uniforms") == opinion: - list.append(person) + temp_list.append(person) opinion += 1 - person = get_random_from_list(list) - for x in list: + person = get_random_from_list(temp_list) + for x in temp_list: if x.sluttiness > person.sluttiness: person = x return person - def get_existing_friends(self, person): - return_list = [] - for relationship in self.get_relationship_type_list(person, types = ["Friend", "Best Friend"]): - return_list.append(relationship[0]) - return return_list - def build_forced_uniform_list(the_person): - list = mc.business.get_employee_list() - list.remove(the_person) - for person in list: + temp_list = mc.business.get_employee_list() + temp_list.remove(the_person) + for person in temp_list: if not person.event_triggers_dict.get("forced_uniform", None): - list.remove(person) - return list + temp_list.remove(person) + return temp_list def uniform_followup_prep(): - list = mc.business.get_employee_list() - for person in list: + temp_list = mc.business.get_employee_list() + for person in temp_list: if person.event_triggers_dict.get("forced_uniform", None): person.apply_outfit(person.event_triggers_dict.get("forced_uniform", None).get_copy()) return -- GitLab