Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENHANCEMENT] "exclude_involved" added to short events #3430

Open
wants to merge 1 commit into
base: development
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions resources/lang/en/events/death/general.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
"age": ["adolescent", "young adult", "adult", "senior adult"],
"status": [ "any" ]
},
"exclude_involved": ["r_c"],
"history": [{
"cats": ["m_c"],
"reg_death": "m_c was secretly murdered by r_c."
Expand Down
1 change: 1 addition & 0 deletions scripts/events_module/generate_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,6 +145,7 @@ def generate_short_events(event_triggered, biome):
r_c=event["r_c"] if "r_c" in event else {},
new_cat=event["new_cat"] if "new_cat" in event else [],
injury=event["injury"] if "injury" in event else [],
exclude_involved=event["exclude_involved"] if "exclude_involved" in event else [],
history=event["history"] if "history" in event else [],
relationships=event["relationships"]
if "relationships" in event
Expand Down
6 changes: 6 additions & 0 deletions scripts/events_module/short/handle_short_events.py
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,12 @@ def handle_event(
self.handle_mass_death()
if len(self.multi_cat) <= 2:
return

# remove cats from involved_cats if theyre supposed to be
if self.chosen_event.r_c and "r_c" in self.chosen_event.exclude_involved:
self.involved_cats.remove(self.random_cat.ID)
if "m_c" in self.chosen_event.exclude_involved:
self.involved_cats.remove(self.main_cat.ID)

# create new cats (must happen here so that new cats can be included in further changes)
self.handle_new_cats()
Expand Down
2 changes: 2 additions & 0 deletions scripts/events_module/short/short_event.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ def __init__(
r_c=None,
new_cat: List[list] = None,
injury: list = None,
exclude_involved: list = None,
history: list = None,
relationships: list = None,
outsider: dict = None,
Expand Down Expand Up @@ -89,6 +90,7 @@ def __init__(
self.r_c["gender"] = []

self.new_cat = new_cat if new_cat else []
self.exclude_involved = exclude_involved if exclude_involved else []
self.injury = injury if injury else []
self.history = history if history else []
self.relationships = relationships if relationships else []
Expand Down