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

Update farewells to work similar to greetings #5852

Merged

Conversation

multimokia
Copy link
Member

Farewells used an outdated method for selection. This PR updates them to use a similar selection algorithm to greetings.

In addition to this, I have also created a new rule type, MASProbabilityRule, which is a number between 1 and 10 (since this is designed to work with the function store.mas_utils.weightedChoice()

An analogy for how the function works is as follows:
Priority number essentially corresponds to the amount of times the choice given is repeated in the list for a random.choice to pick from.

So a probability rule with value 10 doesn't mean it's guaranteed to be selected, however it is more likely.

I have also rerandomed bye_leaving_already and added a conditional for it to show for sessions under 20 minutes in length.

Testing:

  • Verify that farewells work properly
  • Verify that farewells still follow time rules
  • Verify that it's possible to get generic farewells during ranges of time rules
  • Verify no crashes

@multimokia multimokia added awaiting testing code needs to be tested awaiting code review someone needs to check for syntax/logic/indentation errors labels May 31, 2020
@multimokia multimokia added this to the 0.11.3 milestone May 31, 2020
Monika After Story/game/definitions.rpy Show resolved Hide resolved
Monika After Story/game/script-farewells.rpy Show resolved Hide resolved
Monika After Story/game/event-rules.rpy Outdated Show resolved Hide resolved
Monika After Story/game/event-rules.rpy Outdated Show resolved Hide resolved
jmwall24
jmwall24 previously approved these changes Jun 4, 2020
ThePotatoGuy
ThePotatoGuy previously approved these changes Jun 4, 2020
@ThePotatoGuy ThePotatoGuy removed the awaiting code review someone needs to check for syntax/logic/indentation errors label Jun 4, 2020
@multimokia multimokia dismissed stale reviews from ThePotatoGuy and jmwall24 via 25ef922 June 4, 2020 03:38
Legendkiller21
Legendkiller21 previously approved these changes Jun 4, 2020
ThePotatoGuy
ThePotatoGuy previously approved these changes Jun 4, 2020
@ThePotatoGuy ThePotatoGuy merged commit 669131a into Monika-After-Story:content Jun 15, 2020
@multimokia multimokia removed the awaiting testing code needs to be tested label Jun 15, 2020
@multimokia multimokia deleted the FarewellsWorkLikeGreetings branch June 15, 2020 04:45
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.

4 participants