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

[CLEANUP] Refactoring of python files inside cats, cat_relations, and clan_resoucres folders #3251

Open
wants to merge 58 commits into
base: development
Choose a base branch
from

Conversation

filvas2
Copy link
Contributor

@filvas2 filvas2 commented Dec 24, 2024

About The Pull Request

I have carefully gone though all .py files in the following path and tried to make the code cleaner where i deemed it suitable without changing the intent of the code.

  • scripts\cat,
  • scripts\cat_relations
  • scripts\clan_resources

(This is a repost, something severely wrong happened with my fork yesterday and PR #3221 closed)

Why This Is Good For ClanGen

I hope it will help with code readability and therefore maintainability

Linked Issues

Proof of Testing

image

I've also tested mediate relationships, kill the leader, break up and make mates of cats and other easily triggered events

Changelog/Credits

refactoring and code cleaning in the following folders:

  • scripts\cat,
  • scripts\cat_relations
  • scripts\clan_resources

Filip Västlund and others added 30 commits December 20, 2024 22:20
Copy link
Collaborator

@j-gynn j-gynn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comments :)

scripts/events_module/short/handle_short_events.py Outdated Show resolved Hide resolved
scripts/cat_relations/inheritance.py Outdated Show resolved Hide resolved
scripts/cat/thoughts.py Outdated Show resolved Hide resolved
scripts/cat/thoughts.py Show resolved Hide resolved
scripts/cat/pelts.py Outdated Show resolved Hide resolved
self.thought = final_thought
return ""
elif game.clan.leader_lives <= 0:
if game.clan.leader_lives <= 0:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure this change won't have unanticipated problems elsewhere in the code, even if it makes sense. There was a change in event code, but I don't recall seeing anything for patrols.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

image
I redid my refactoring step by step and I feel confident it is working the same way. I might be wrong though

scripts/cat/cats.py Outdated Show resolved Hide resolved
and i not in life_givers
and self.fetch_cat(i).status not in ["leader", "newborn"]
]
cats_in_starcaln_or_darkforest = game.clan.starclan_cats
Copy link
Collaborator

@j-gynn j-gynn Dec 25, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am not sure that these lists are regularly updated: to confirm, has this branch been game tested generating leader ceremonies?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have tested it by repeatedly killing my leader and promoting a new one, both for Starclan and Dark forest guides and it worked fine. Is there another way?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants