Feature Adventure Modifiers

katyarn

Member
A long-standing game mechanic is now fully exposed by the side panel and looks like this:
image.png

1682968609194.png
image.png


This way KoLmafia won't have to guess whether the next adventure will consume stench jelly, clara's bell, spikolodon spikes, and any subsequent mechanics of this type.
 
My immediate instinct is that the only real thing that needs tracking is whether the very next adventure will be a forced NC.
This in-game tracking also doesn't appear to support stacking stench jellies, for example, so we still don't technically have the ability to know how many forced NCs we have lined up.

We could also just do adventureModifiers as a comma-separated string of our NC forcer sources. So in your second image we'd have clara's bell,spikolodon spikes,stench jelly, and people can determine if an NC is going to be forced by checking if the string is empty. That gives scripts more information, although I'm not sure more is actually better in this case.
 

Veracity

Developer
Staff member
Is it only in the charpane?

While automating, we never go to the charpane; when KoL requests a charpane refresh, we go to api.
 
If this doesn't end up getting added to api.php, we'd only actually need to check charpane.php in two situations: when you start your session, and after resolving a choice adventure when we know that an NC forcer is active. We know all of the things that can activate an NC forcer, so we should never (or rarely) be surprised that one has been activated. It's the un-activating that's the issue.

A setup like that would cause performance issues if someone activates an NC forcer and then repeatedly enters choice adventures that aren't triggered by it (for example, the Boxing Daycare), but that feels like a pretty narrow use case.

I'm still holding out hope that this gets added to api.php, so I'll give it another week before pursuing this further.
 
This feels worth a triple post:
Code:
"noncomforcers":[]
and
Code:
"noncomforcers":["spikolodon","stench jelly","cincho exit","sneakisol"]

The account I checked this on is in hardcore, so I can't check clara's bell, but also we might only care about whether or not the array is empty.

I actually did sneakisol, then cincho, then spikolodon, and then stench jelly, so I'm not sure what (if anything) the order of the array tells me.

This is the same order as it appears in the charpane:
Your spikes are scaring away most monsters.
With the jelly all over you, you are probably not going to encounter anything
You've engaged exit mode on your cincho and will avoid most combats.
You are avoiding fights until something cool happens.

I briefly looked into what we'll need to implement this, under the assumption that we're only tracking the binary state of "is an NC forcer active right now":
- We'll want to update it on eating a stench toast (currently this isn't in the ItemPool; while we're there, we'll want to add tracking for both Hot toast and Spooky toast, whose jelly currently have tracking), chewing a stench jelly, using sneakisol (there isn't currently a PillkeeperRequest, but there is a PillkeeperCommand), using clara's bell (it would be nice to track whether using it was successful, but we can predict success based on the current value of _clarasBellUsed), using spikolodon spikes (in combat) or using fiesta exit (out of combat)
- If we update CharpaneRequest.parseStatus, it will break basically every test we have that uses api.php and examines a JSON. We can probably update all of these to just include "noncomforcers":[]
- When we do update CharpaneRequest.parseStatus, we can just check the length() of the array, and set the pref to noncombatForcers.length() > 0
- I'm not sure off the cuff whether there's any situation in which we'd do an encounter that plausibly eats a noncombat forcer without then hitting api.php afterwards--probably not(?), but maybe(?)
- We'll also want charpane.php tracking here, both for players in pokefam and for players who are playing in the relay browser. If we're just tracking the boolean I described earlier, we can just search for <b>Adventure Modifiers</b>. Conceivably, someone could mess up tracking by naming their familiar "Adventure Modifiers", but I think that's a situation where we can let people shoot themselves in the foot.
- It shouldn't be an underscore pref but should reset on ascension--that being said, because we'll update it when we hit api.php, I'm not sure if that technically matters

We'll want to make tests for making sure that successfully eating stench toast/chewing stench jelly/using clara's bell/popping a sneakisol/casting fiesta exit/casting spikolodon spikes does grant us a charge, that unsuccessfully doesn't, and that we successfully read api.php in both negative and positive cases. For the negative case, we'll want to pre-set the pref to true, so that we can actually be sure it changed.
 
Last edited:
Top