东方夜雀食堂 - Touhou Mystia's Izakaya

东方夜雀食堂 - Touhou Mystia's Izakaya

Sem avaliações suficientes
Food Combination Calculator (SPOILERS FOR THE BASE GAME AND DLC1 - 4)
Por Cookie
I made a Python script to calculate the best (least ingredients) meals that can be cooked for every customer in the game and up to DLC4. It also has a number of options for various spell cards and modes that can affect how the results are calculated.
   
Premiar
Adic. a Favoritos
Nos Favoritos
Desfavoritar
Background Information
[Working on a major rewrite to include data from DLC5, better code, more and better ways to interact with the program (i.e. proper argparsing), easier to edit data, and also fixing the way ratings are calculated since the Fandom wiki had incorrect data on it about how it's done]

I wrote a Python 3.12 program that finds the best meal possible for guests in order to get a perfect rating with as few ingredients as possible. It's generally geared towards end game when you have a bunch of every ingredient, but want the dishes to be as easy to make as possible. It also takes into account any spell cards that would affect ratings along with some different calculation/sorting modes.

Every recipe and rare or special guest that can appear in your Izakaya is included, up through DLC4. There are of course spoilers if you choose to keep reading or look at the code.

All of the data is taken from the in-game journal and should include every guest like and dislike, unless I made a mistake anywhere. I used Keine's ability to make sure I wasn't missing any preferences for special guests.

Also, some of the edge case interactions between things like spell cards that affect likes and dislikes haven't really been tested in-game, so I don't know if the calculator will always work perfectly for all combinations of spell cards. But it will likely be very close if it is incorrect.

Lastly, the way ratings are calculated assume the guest has requested one of the tags that the meal has and that you give them the drink they want. I used the Customers wiki page[touhou-mystias-izakaya.fandom.com] for the calculation.


I plan to update this as new content is released and translated for the game.
Input and Usage
The script can be run by using the following command:
python -OO meals.py [MODIFIERS] [GUEST]

Some examples would be:
python -OO meals.py anp wriggle
python -OO meals.py wriggle
python -OO meals.py RUmIA
python -OO meals.py AKmPsD ruMia

None of the arguments are case sensitive.

The first argument is a combination of letters that enable certain modifications to the search algorithm or order of results. Include every letter that you wish to enable in a single word in any order.
  • a = Aya's Positive Spell Card is Active
  • k = Kagerou's Positive Spell Card is Active
  • m = Medicine's Positive Spell Card is Active
  • p = Patchouli's Positive Spell Card is Active
  • s = Seija's Positive Spell Card is Active
  • d = Find the best meals with as many tags as possible that are not known to be liked or disliked by the guest. The main purpose of this is to quickly discover new preferences for guests.
  • n = Find the best meals without adding any ingredients. The main purpose of this is to create meals ahead of time for boss fights.
The last two letters also change the order of results to prioritize meals with the most tags that are liked by the guest.

The second argument is the name of the guest. This is always the first word in the English translation of the guest's name in the in-game journal. For example, Wriggle Nightbug can be searched for using Wriggle and Rumia can be searched for using Rumia.


It is also possible to take into consideration if a tag is currently popular or unpopular. To do so, find the following line near the bottom of the code:
POPULARITY: dict[Tag, Tag] = {}

If Good with Alcohol is currently popular, replace the line with:
POPULARITY: dict[Tag, Tag] = {Tag.GOOD_WITH_ALCOHOL: Tag.TREND_POPULAR}
If Filling is currently unpopular, replace the line with:
POPULARITY: dict[Tag, Tag] = {Tag.FILLING: Tag.TREND_UNPOPULAR}

I don't believe this is possible, but if Good with Alcohol is currently popular AND Filling is current unpopular, you can replace the line with:
POPULARITY: dict[Tag, Tag] = {Tag.GOOD_WITH_ALCOHOL: Tag.TREND_POPULAR, Tag.FILLING: Tag.TREND_UNPOPULAR}

All tag names are always the English translation of the tag's name in the in-game journal, all caps with underscores instead of spaces.
Output
This is an example result:
6 | 50¥ | Falling Blossoms | Premium Tuna, Bingdi Lotus, Cream | Legendary, Cultural Heritage, Photogenic, Japanese, Small Portion, Western, Sweet

  • The 6 is the rating the customer will give the meal if both their food and drink tag requests are met.
  • The 50¥ is the price of the recipe that the customer will pay if they can afford it.
  • Falling Blossoms is the name of the base recipe that is being modified.
  • Premium Tuna, Bingdi Lotus, Cream is the list of ingredients required to meet the score and tags listed.
  • Legendary, Cultural Heritage, Photogenic, Japanese, Small Portion, Western, Sweet is the list of tags the recipe will have that are liked or disliked by the guest.

Results are filtered first to remove any that won't give at least a rating of 4 (Pink), if possible. Then they are sorted to find the least number of the ingredients, most tags that are liked by the guest, and finally highest price, in that order.
Code
Finally!

The code is unfortunately too long to include here so you will have to go to this pastebin instead:
https://pastebin.com/fDaE9RJC

I also posted the code in the Mystia's Izakaya Discord server:
https://discord.com/channels/750216642616754314/750218099646529536/1205989457728245800

Sorry it is undocumented and ugly. I had not initially intended to upload it anywhere.