From 19d5b74290cd9ed8e121eb694799dee40ec450e1 Mon Sep 17 00:00:00 2001 From: J Gynn <48025294+j-gynn@users.noreply.github.com> Date: Sun, 1 Dec 2024 03:00:48 +0000 Subject: [PATCH 1/2] super quick fix! --- scripts/utility.py | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/scripts/utility.py b/scripts/utility.py index a8f208f48c..da6e010141 100644 --- a/scripts/utility.py +++ b/scripts/utility.py @@ -341,14 +341,14 @@ def create_new_cat_block( else: parent2 = event.new_cats[index][0] - adoptive_indexes = [int(index) if index.isdigit() else index for index in adoptive_indexes] + adoptive_indexes = [ + int(index) if index.isdigit() else index for index in adoptive_indexes + ] for index in adoptive_indexes: if in_event_cats[index].ID not in adoptive_parents: adoptive_parents.append(in_event_cats[index].ID) adoptive_parents.extend(in_event_cats[index].mate) - - # gather mates give_mates = [] for tag in attribute_list: @@ -519,7 +519,7 @@ def create_new_cat_block( status = cat_type new_name = False thought = "Is wondering about those new cats" - if age <= 6 and not bs_override: + if age is not None and not bs_override and age <= 6: chosen_backstory = "outsider1" # IS THE CAT DEAD? @@ -603,7 +603,7 @@ def create_new_cat_block( outside=outside, parent1=parent1.ID if parent1 else None, parent2=parent2.ID if parent2 else None, - adoptive_parents=adoptive_parents if adoptive_parents else None + adoptive_parents=adoptive_parents if adoptive_parents else None, ) # NEXT @@ -711,7 +711,7 @@ def create_new_cat( outside: bool = False, parent1: str = None, parent2: str = None, - adoptive_parents: list = None + adoptive_parents: list = None, ) -> list: """ This function creates new cats and then returns a list of those cats @@ -798,7 +798,7 @@ def create_new_cat( backstory=backstory, parent1=parent1, parent2=parent2, - adoptive_parents=adoptive_parents if adoptive_parents else [] + adoptive_parents=adoptive_parents if adoptive_parents else [], ) else: # grab starting names and accs for loners/kittypets @@ -806,8 +806,8 @@ def create_new_cat( name = choice(names.names_dict["loner_names"]) if bool(getrandbits(1)): accessory = choice(Pelt.collars) - elif ( - loner and bool(getrandbits(1)) + elif loner and bool( + getrandbits(1) ): # try to give name from full loner name list name = choice(names.names_dict["loner_names"]) else: @@ -833,7 +833,7 @@ def create_new_cat( backstory=backstory, parent1=parent1, parent2=parent2, - adoptive_parents=adoptive_parents if adoptive_parents else [] + adoptive_parents=adoptive_parents if adoptive_parents else [], ) else: # completely new name new_cat = Cat( @@ -843,7 +843,7 @@ def create_new_cat( backstory=backstory, parent1=parent1, parent2=parent2, - adoptive_parents=adoptive_parents if adoptive_parents else [] + adoptive_parents=adoptive_parents if adoptive_parents else [], ) # these cats keep their old names else: @@ -856,7 +856,7 @@ def create_new_cat( backstory=backstory, parent1=parent1, parent2=parent2, - adoptive_parents=adoptive_parents if adoptive_parents else [] + adoptive_parents=adoptive_parents if adoptive_parents else [], ) # give em a collar if they got one @@ -1359,7 +1359,7 @@ def gather_cat_objects( """ gathers cat objects from list of abbreviations used within an event format block :param Cat Cat: Cat class - :param list[str] abbr_list: The list of abbreviations, supports "m_c", "r_c", "p_l", "s_c", "app1" through "app6", + :param list[str] abbr_list: The list of abbreviations, supports "m_c", "r_c", "p_l", "s_c", "app1" through "app6", "clan", "some_clan", "patrol", "multi", "n_c{index}" :param event: the controlling class of the event (e.g. Patrol, HandleShortEvents), default None :param Cat stat_cat: if passing the Patrol class, must include stat_cat separately @@ -2213,8 +2213,6 @@ def event_text_adjust( # prey lists text = adjust_prey_abbr(text) - - # acc_plural (only works for main_cat's acc) if "acc_plural" in text: text = text.replace( From e426e2da7e372bfa1a6a957dd56e8f8f6f0460cc Mon Sep 17 00:00:00 2001 From: J Gynn <48025294+j-gynn@users.noreply.github.com> Date: Sun, 1 Dec 2024 03:03:40 +0000 Subject: [PATCH 2/2] super quick fix! --- scripts/utility.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/scripts/utility.py b/scripts/utility.py index da6e010141..4b23472768 100644 --- a/scripts/utility.py +++ b/scripts/utility.py @@ -519,7 +519,7 @@ def create_new_cat_block( status = cat_type new_name = False thought = "Is wondering about those new cats" - if age is not None and not bs_override and age <= 6: + if age is not None and age <= 6 and not bs_override: chosen_backstory = "outsider1" # IS THE CAT DEAD? @@ -711,7 +711,7 @@ def create_new_cat( outside: bool = False, parent1: str = None, parent2: str = None, - adoptive_parents: list = None, + adoptive_parents: list = None, ) -> list: """ This function creates new cats and then returns a list of those cats @@ -807,7 +807,7 @@ def create_new_cat( if bool(getrandbits(1)): accessory = choice(Pelt.collars) elif loner and bool( - getrandbits(1) + getrandbits(1) ): # try to give name from full loner name list name = choice(names.names_dict["loner_names"]) else: