ClanGenOfficial / clangen

Warrior Cats fan game
https://clangen.io
Other
229 stars 398 forks source link

[CODE] Adjust ShortEvents to be capable of handling more than 2 cats in an event #2495

Open scribblecrumb opened 1 week ago

scribblecrumb commented 1 week ago

Description At the moment, ShortEvents cannot handle naming and affecting more than 2 cats at once (with the exception of mass death events). This is rather restrictive.

However, adjusting ShortEvents to be capable of handling more than 3 cats in a single event presents some challenges. Namely, how do we handle the choosing of the extra cats? Currently, the second cat in an event (the random_cat) is chosen before we even filter for possible events. If we try to do something similar with any additional cats, we could start to struggle with heavily constrained events becoming insanely rare (i.e. if an event requires a bloodthirsty leader, compassionate med, and a kit; then we simply have to hope that all three of those cats a randomly chosen at the same time. they might all exists in the clan, but that doesn't mean they'll ever be chosen together and trigger the event.)

And idea could be to check if the cat exists in the clan during filtering and then choose the event and assign accordingly if it does. However, this sounds like it could become pretty resource intensive (especially in large clans). Perhaps a secondary filtering could be used? First filtering using the main_cat and random_cat as usual, then, when the smaller group of possible events has been found, checking to see if any of those events require extra cats and whether or not those cats are available.

With regards to how to reference these cats within the event, I think the o_c{index} tag utilized in patrols should be used.