Skip to content

Commit

Permalink
Merge pull request #233 from jaysoleson/LifeGen-dev
Browse files Browse the repository at this point in the history
dev bugs
  • Loading branch information
jaysoleson authored Oct 1, 2024
2 parents 95c7d2d + 171ade6 commit 1b33465
Show file tree
Hide file tree
Showing 7 changed files with 77 additions and 56 deletions.
33 changes: 27 additions & 6 deletions resources/dicts/events/ceremonies/ceremony-master.json
Original file line number Diff line number Diff line change
Expand Up @@ -3206,7 +3206,8 @@
"general_leader",
"general_backstory",
"all_traits",
"forgiven"
"forgiven",
"shunned_as_kit"
],
"m_c is glad to finally begin training after being forgiven by the Clan."
],
Expand All @@ -3218,7 +3219,8 @@
"general_leader",
"general_backstory",
"all_traits",
"forgiven"
"forgiven",
"shunned_as_kit"
],
"m_c is overjoyed at {PRONOUN/m_c/poss} belated apprentice ceremony, vowing to {PRONOUN/m_c/poss} mentor, (mentor), that {PRONOUN/m_c/subject} will be the most loyal warrior the Clan's ever seen."
],
Expand All @@ -3230,7 +3232,8 @@
"general_leader",
"general_backstory",
"all_traits",
"forgiven"
"forgiven",
"shunned_as_kit"
],
"m_c has always been interested in medicine, and now, {PRONOUN/m_c/subject}{VERB/m_c/'re/'s} finally allowed to begin learning it. {PRONOUN/m_c/subject/CAP} {VERB/m_c/touch/touches} noses with {PRONOUN/m_c/poss} new mentor, (mentor), and promise in front of the Clan that {PRONOUN/m_c/subject} will use {PRONOUN/m_c/poss} new skills only to heal, not hurt."
],
Expand All @@ -3242,7 +3245,7 @@
"general_leader",
"general_backstory",
"all_traits",
"forgiven"
"shunned"
],
"Upon being forgiven by the Clan, m_c will begin training as a mediator apprentice. l_n remarks that learning about mediation will help {PRONOUN/m_c/object} recover from what {PRONOUN/m_c/subject}{VERB/m_c/'ve/'s} done."
],
Expand All @@ -3269,7 +3272,8 @@
"general_leader",
"general_backstory",
"all_traits",
"forgiven"
"forgiven",
"shunned_as_kit"
],
"m_c is glad to finally begin training after being forgiven by the Clan."
],
Expand All @@ -3284,8 +3288,25 @@
"general_leader",
"general_backstory",
"all_traits",
"forgiven"
"forgiven",
"shunned_as_kit"
],
"m_c is glad to finally begin training after being forgiven by the Clan."
],
"forgiven_app8": [
[
"apprentice",
"yes_mentor",
"queen's apprentice",
"mediator apprentice",
"medicine cat apprentice",
"general_parents",
"general_leader",
"general_backstory",
"all_traits",
"forgiven",
"shunned_as_apprentice"
],
"m_c is relieved to get back to training after being forgiven by the Clan."
]
}
6 changes: 3 additions & 3 deletions resources/dicts/lifegen_talk/general_no_kit.json
Original file line number Diff line number Diff line change
Expand Up @@ -9579,7 +9579,7 @@
],
[
"[t_c has a little rasp in {PRONOUN/t_c/poss} voice, and you swear {PRONOUN/t_c/subject} {VERB/t_c/sound/sounds} just like y_p, in the way {PRONOUN/t_c/subject} {VERB/t_c/pronounce/pronounces} certain words ...]",
"[You wonder if your {PRONOUN/t_c/parent} is proud of {PRONOUN/y_p/poss} grandkit.]"
"[You wonder if your {PRONOUN/y_p/parent} is proud of {PRONOUN/y_p/poss} grandkit.]"
]
],
"gen_yourkit9": [
Expand Down Expand Up @@ -17908,7 +17908,7 @@
"dead_deaf_J2": [
[
"any",
"you_deaf",
"only_you_deaf",
"you_dead"
],
[
Expand Down Expand Up @@ -21167,7 +21167,7 @@
[
"How am I doing? I'm not really sure.",
"I feel off, but I don't know why. I'm kind of tired, I guess, and just feel like I'm not doing anything right.",
"[t_c sighs into your pelt. You feel {PRONOUN/t_c/object} breath fluttering your fur.]",
"[t_c sighs into your pelt. You feel {PRONOUN/t_c/poss} breath fluttering your fur.]",
"I think I'll feel better tomorrow. How's your day been?"
]
],
Expand Down
3 changes: 1 addition & 2 deletions resources/dicts/thoughts/alive/kitten.json
Original file line number Diff line number Diff line change
Expand Up @@ -623,8 +623,7 @@
"Is convinced that {PRONOUN/m_c/subject} will become an apprentice early",
"Butts into a coversation to correct someone",
"Is going off, in great detail, about the history of c_n",
"Rubbing in r_c's muzzle about a subject {PRONOUN/m_c/subject} greatly excel at",
"Is trying to retell a story {PRONOUN/m_c/subject} know IS the absolute truth"
"Is trying to retell a story {PRONOUN/m_c/subject} {VERB/m_c/know/knows} is the absolute truth"
],
"main_trait_constraint": [
"know-it-all"
Expand Down
35 changes: 15 additions & 20 deletions scripts/events.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
from scripts.event_class import Single_Event
from scripts.game_structure.game_essentials import game
from scripts.cat_relations.relationship import Relationship
from scripts.utility import change_clan_relations, change_clan_reputation, get_cluster, ceremony_text_adjust, get_current_season, adjust_list_text, ongoing_event_text_adjust, event_text_adjust, create_new_cat, pronoun_repl, get_alive_status_cats, get_alive_cats, get_cats_same_age, adjust_txt
from scripts.cat.cats import Cat, cat_class, BACKSTORIES
from scripts.cat.history import History
from scripts.cat.names import Name
Expand Down Expand Up @@ -62,7 +61,11 @@ class BirthType(Enum):
event_text_adjust,
get_other_clan,
history_text_adjust,
unpack_rel_block
unpack_rel_block,
pronoun_repl,
create_new_cat,
adjust_txt,
get_cluster
)


Expand Down Expand Up @@ -2367,7 +2370,6 @@ def one_moon_cat(self, cat):
self.exile_or_forgive(cat)
else:
# Max number of moons a cat can be shunned before the clan makes up their damn mind
# Currently ten, but it was also roll if its set to more than that in a cat's save
if cat.shunned >= game.config["shunned_cat"]["max_shunned_moons"]:
self.exile_or_forgive(cat)

Expand Down Expand Up @@ -3145,12 +3147,20 @@ def ceremony(self, cat, promoted_to, preparedness="prepared", LG_TYPE=""):
text = self.CEREMONY_TXT[ceremony][1]

if LG_TYPE == "shunned":
# a ceremony for a cat WHILE theyre shunned
if "shunned" not in tags:
continue

elif LG_TYPE == "forgiven":
# a ceremony for a cat returning to work after being forgiven
if "forgiven" not in tags:
continue
if (cat.moons - cat.shunned) > 5:
if "shunned_as_apprentice" not in tags:
continue
else:
if "shunned_as_kit" not in tags:
continue

else:
if "forgiven" in tags or "shunned" in tags:
Expand All @@ -3173,6 +3183,7 @@ def ceremony(self, cat, promoted_to, preparedness="prepared", LG_TYPE=""):
except IndexError:
print("WARNING: A ceremony could not be chosen for", cat.name, LG_TYPE)
print(new_ceremonies)
print(cat.moons - cat.shunned)
return
else:
# -------------------
Expand Down Expand Up @@ -3962,28 +3973,12 @@ def exile_or_forgive(self, cat):
"apprentice",
"medicine cat apprentice",
"mediator apprentice",
"queen's apprentice",
"warrior",
"medicine cat",
"mediator",
"queen",
"queen's apprentice"
]:
self.ceremony(cat, cat.status, LG_TYPE="forgiven")

elif cat.status in ["kitten", "newborn"] and cat.moons >= 6:
self.ceremony(cat, "apprentice", LG_TYPE="forgiven")

else:
if cat.moons == 0:
cat.status = 'newborn'
elif cat.moons < 6:
cat.status = "kitten"
elif cat.moons < 12:
cat.status_change('apprentice')
elif cat.moons < 120:
cat.status_change('warrior')
else:
cat.status_change('elder')

elif cat.status == 'leader':
if random.randint(1,4) == 1:
Expand Down
3 changes: 1 addition & 2 deletions scripts/game_structure/windows.py
Original file line number Diff line number Diff line change
Expand Up @@ -1979,8 +1979,6 @@ def __init__(self, last_screen):
self.mediator_button.enable()
self.random_button.enable()



def process_event(self, event):
super().process_event(event)

Expand Down Expand Up @@ -2022,6 +2020,7 @@ def process_event(self, event):
self.kill()
except:
print('Error with PickPath window!')


class DeathScreen(UIWindow):
def __init__(self, last_screen):
Expand Down
20 changes: 10 additions & 10 deletions scripts/patrol/patrol.py
Original file line number Diff line number Diff line change
Expand Up @@ -644,13 +644,21 @@ def _filter_patrols(
other_cat = self.patrol_cats[1]

if not other_cat.joined_df:
if "fellowtrainee" in patrol.tags:
if "fellowtrainee" in patrol.tags:
continue

else:
if "fellowtrainee" not in patrol.tags:
continue
elif game.switches["patrol_category"] == "date":
else:
if "shunned" in patrol.tags:
if game.clan.your_cat.shunned == 0:
continue

if "shunned" not in patrol.tags and "df" not in patrol.tags:
if game.clan.your_cat.shunned > 0:
continue
if game.switches["patrol_category"] == "date":
if "df" in patrol.tags:
if len(self.patrol_cats) > 1:
other_cat = self.patrol_cats[1]
Expand All @@ -662,14 +670,6 @@ def _filter_patrols(
if Cat.all_cats.get(game.clan.your_cat.mentor).personality.trait != "bloodthirsty":
continue

if "shunned" in patrol.tags:
if game.clan.your_cat.shunned == 0:
continue

if "shunned" not in patrol.tags and "df" not in patrol.tags:
if game.clan.your_cat.shunned > 0:
continue

# this is testing every piece of text in the patrol
# to see if there's an abbrev that cant be fulfilled.
# theres probably a better way to do it but.... patrols scare me. and this works
Expand Down
33 changes: 20 additions & 13 deletions scripts/screens/EventsScreen.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,9 +118,19 @@ def handle_event(self, event):
elif event.type == pygame_gui.UI_BUTTON_PRESSED: # everything else on button press to prevent blinking
element = event.ui_element
if element == self.timeskip_button:
self.events_thread = self.loading_screen_start_work(
events_class.one_moon
)
if game.clan.your_cat.dead_for >= 2 and not game.switches['continue_after_death']:
DeathScreen('events screen')
return
elif (game.clan.your_cat.moons == 5
and not game.clan.your_cat.outside
and not game.clan.your_cat.dead
and game.clan.your_cat.status == "kitten"
):
PickPath('events screen')
else:
self.events_thread = self.loading_screen_start_work(
events_class.one_moon
)
elif self.death_button and event.ui_element == self.death_button:
DeathScreen('events screen')
return
Expand Down Expand Up @@ -229,6 +239,13 @@ def handle_event(self, event):
self.handle_tab_select(event.key)
elif event.key == pygame.K_RETURN:
self.handle_tab_switch(self.selected_display)
elif event.key == pygame.K_SPACE:
if game.clan.your_cat.moons == 5 and game.clan.your_cat.status == 'kitten' and not game.clan.your_cat.outside and not game.clan.your_cat.dead:
PickPath('events screen')
elif (game.clan.your_cat.dead_for == 1 or game.clan.your_cat.exiled):
DeathScreen('events screen')
return
self.events_thread = self.loading_screen_start_work(events_class.one_moon)

def save_scroll_position(self):
"""
Expand Down Expand Up @@ -899,16 +916,6 @@ def timeskip_done(self):

if get_living_clan_cat_count(Cat) == 0:
GameOver("events screen")

# lifegen
if game.clan.your_cat.dead_for >= 2 and not game.switches['continue_after_death']:
DeathScreen('events screen')
elif (game.clan.your_cat.moons == 6
and not game.clan.your_cat.outside
and not game.clan.your_cat.dead
):
PickPath('events screen')
# ---

self.update_display_events_lists()

Expand Down

0 comments on commit 1b33465

Please sign in to comment.