Skip to content

Commit

Permalink
super quick fix!
Browse files Browse the repository at this point in the history
  • Loading branch information
j-gynn committed Dec 1, 2024
1 parent de5844a commit 19d5b74
Showing 1 changed file with 13 additions and 15 deletions.
28 changes: 13 additions & 15 deletions scripts/utility.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down Expand Up @@ -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?
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -798,16 +798,16 @@ 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
if kittypet:
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:
Expand All @@ -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(
Expand All @@ -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:
Expand All @@ -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
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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(
Expand Down

0 comments on commit 19d5b74

Please sign in to comment.