[Patch] Try to save MP even if skills are expensive or you are in aftercore
I was recently trying to figure out how to equip MP-saving gear when executing my Mood in a way that didnít entail switching back and forth with every individual skill. I ended up looking at the source code to see if there was a hidden setting or something, and it turned out that such a function already exists. However, for reasons that are beyond me, it doesnít trigger in aftercore or for skills more expensive than 50MP. I get that MP is at more of a premium during a run, but that doesnít mean that MP is free in aftercore. And I donít why MP is suddenly less important when you are using more of it.
Iíve attached a patch that removes those checks from the code. If someone wants to add a hidden setting to govern this behavior, thatís fine. Even if this patch doesnít get incorporated into KoLmafia, Iíll probably keep using it myself.
It is done deliberately to avoid server hits. as documented in the code you deleted.
I saw that, but Iíd still rather make that a setting.
On a related note, is it possible to configure moods to equip MP-saving gear, then restore the original gear after finishing execution?
If you can work out how and where to change equipment for mana saving before and after all buffs, that'd be well worth doing.
Upon reflection, I think it’d be impossible. KoLmafia has no way of knowing if unconditional triggers actually need to do something, and that means that it cannot tell if a mood is actually doing anything. And switching equipment back and forth before literally every adventure would hardly be an improvement.
If unconditional triggers could be reworked in such a way that the conditional and the action were distinct, this would be possible. Such a change would make sense, since anything that is actually supposed to run before every adventure probably belongs in the dedicated script for just that. It probably wouldn’t be worth screwing up everyone’s existing moods, though.
It could work if KoLmafia ignored unconditional triggers when deciding whether to swap equipment, but that feels messy.