Add configuration options for friendly success chance and required successes
Hi! I don't know if you're accepting merge requests on this project, but I'm a big fan of the Hungry Lizards mod and have been enjoying using your tweaked version lately, and decided to make some tweaks of my own. After finishing this first feature I figure I might as well show you the changes and let you decide if you want to include them or not.
For my first tweak, I've added the ability for friendly lizards to use the same success/fail struggle mechanics as enemies, with a separate set of configurable values. I find the random chance mechanics of escaping predators to be quite fun, and wanted to be able to extend that system to friendly predators (since before this you could only instant-escape or get auto-successes for friendly lizards, neither of which quite had the feel I wanted).
This branch adds four new configuration options, with default settings that shouldn't affect the gameplay experience for anyone updating the mod:
-
req_esc_friend_enable
andreq_esc_friend_config
: enable and configure required number of successes required to escape from friendly lizards- Disabled and matches enemy settings by default
-
suc_chn_friend_enable
andsuc_chn_friend_config
: enable and configure success chance for struggles within friendly lizards- Enabled and set to 100% by default (since before this tweak all friendly struggles succeeded)
I did my best to fit the new options into the config screen seamlessly.
These configurations are implemented in gameplay using two new helper functions, StruggleSuccessesRequired
, and StruggleSuccessChance
which take an argument of whether the predator is friendly and return the right number of successes and success chance, respectively, based on the new settings above. The variables _strugglesRequiredToEscape
and _struggleSuccessChance
have been removed from HungryLizards.cs because these new helpers make them both unused and obsolete.
In addition, this makes some minor dev-related changes. It adds a .editorconfig
file that enforces tab indents (because my editor uses space indents by default and so my work didn't match the rest of the project code until I added that), and it also adds a bunch of reference paths to the project configuration file that I needed before the mod would build on my windows VM. Neither of these changes should have any effect on your work or builds.
This is my first time working on a Rain World mod, so I'm not sure the best way to include localization in a merge request like this. However, you can find an updated localization file with the name/description strings for the new configuration fields in my build over here: https://gitgud.io/arcanacheque/hungry-lizards-tweaked-again/-/blob/release/hlta_v0.1/ReleasedVersion/hlta_v0.1/localization/English.json
I've tested this tweak on my own machine, and everything seems to work just fine, but I'd recommend testing for yourself before merging.
Anyway, you're free to choose whether to merge or ignore this! If you like my work and merge it, I can also send future tweaks I make upstream to you. Best of luck with your modding work! :>