Bug - Fixed Mood manager using incorrect bang potions

Flanders

New member
Pretty much what it says in the title: I set up my mood to take potions of blessing, ettin strength and acuity, and Mafia uses potions of confusion, sleepiness and teleportitis instead. I tried logging out and back in and uploading the latest build, but no dice. I think I might need to purge the database where that information is stored, but I don't know where that is (I use a mac).

Help?

I just feel lucky inebrity wasn't one of the substituted potions.

EDIT: I thought I should point out that, when I select these potions in the Mafia inventory window, the correct potion gets used. It only messes up when I try and do it from the left sidebar of the relay browser (Safari).

Thanks,
Flanders
 

Bale

Minion
It might be helpful if you told us exactly what it says in your mood manager. Please post which triggers produce which commands. Either do lots of copy/paste or else go to your setting directory and copy/paste your Flanders_moods.txt (or whatever your character's name might be). Then in the CLI type an exclamation point and copy/paste it like this:

Code:
> !

milky:
swirly:
bubbly:
smoky:
cloudy:
effervescent:
fizzy:
dark:
murky:
 
Because mafia stores them as in-game names, not by their effects, and they change each ascension. So you type in "use mental acuity" and mafia converts that to, say, "use bubbly potion". And when you ascend, it keeps using bubbly potions, no matter what it is now.
 

Flanders

New member
Oh, okay. Once you told me it was ascension specific, I knew what the problem was. I went in to the mood manager and deleted/re-entered them from my mood. Worked like a charm, and honestly, I should have thought to do that myself. Thanks for your help!

Dear Mod: please change the category to "Fixed." or "Not a Bug."

Thanks!
 

Veracity

Developer
Staff member
On the other hand, if KoLmafia were to store "use 1 potion of mental acuity" in the mood and translate it at run time when it tries to execute the mood and fail if it doesn't know this ascension's translation, it would always do the right thing.

I don't know if the current behavior is a Bug or is simply crying out for a new Feature. Probably the latter.

Edit: OK, I am confused. I went to the mood manager and selected "Izchak" and KoLmafia offered to add "when I run low on Izchak's blessing use 1 potion of blessing". And that is what it put into the mood file:

lose_effect izchak's blessing => use 1 potion of blessing

That looks correct. And also not what Fred said.
 
Last edited:
Well, my statement was based on observations from long ago, so it's possible that was fixed and this is a different issue. Or it's the same issue and I've just long misunderstood WHY it is an issue.
 

Idran

Member
Bang potions tracked by item in moods, not buff

When there's a mood that contains a bang potion, after a new ascension with new bang potion assignments, the mood will be associated to the same specific potion, not the same buff. For example, if in your ascension effervescent potions were potions of detection, and you have a mood containing "When I run low on Object Detection, use 1 potion of detection", and you ascend and now effervescent potions are now, say, potions of blessing, the mood will become "When I run low on Object Detection, use 1 potion of blessing".
 

Idran

Member
Oh bah, I'm sorry about that. I searched before I posted, but on stupid search terms I can see in hindsight.
 

slyz

Developer
It looks like KoLCharacter.ensureUpdatedPotionEffects() calls ItemDatabase.registerItemAlias() when you have identified a potion (the "lastBangPotionXXX" property isn't empty), but it doesn't remove the item alias from ItemDatabase.itemIdByName for unidentified potions, as it should after reseting the "lastBangPotionXXX" properties, when you ascend.

This means that item aliases for bang potions (and slime vials) stay in ItemDatabase.itemIdByName (and ItemDatabase.canonicalNames) during your session, even if you ascend. Restarting mafia should solve the problem, but I'll try to find a way to remove the item aliases when you ascend.

The simplest way would be to simply call ItemDatabase.reset() when you ascend, but that could break a host of other stuff.
 

slyz

Developer
I'll try adding
PHP:
ItemDatabase.reset();
at the beginning of ValhallaManager.postAscension(), but I want to test this myself before committing.
 

slyz

Developer
It's not happening to me. Do you have any gCLI output to paste here? And what exactly is in your mood?
 

Idran

Member
I don't have gCLI output, unfortunately, since I noticed it a few days ago and only noticed the bug was marked as fixed today. I do have the session log for Mafia firing the mood, though.
Code:
cast 1 Fat Leon's Phat Loot Lyric
You acquire an effect: Fat Leon's Phat Loot Lyric (duration: 15 Adventures)

cast 1 Leash of Linguini
You acquire an effect: Leash of Linguini (duration: 10 Adventures)

buy 5 Knob Goblin pet-buffing spray for 250 each from 1945689 on 20111123
You acquire Knob Goblin pet-buffing spray (5)

use 5 Knob Goblin pet-buffing spray
You acquire an effect: Heavy Petting (duration: 50 Adventures)

use 1 fizzy potion of inebriety
You gain 3 Drunkenness

buy 5 Knob Goblin eyedrops for 200 each from 1945689 on 20111123
You acquire Knob Goblin eyedrops (5)

use 5 Knob Goblin eyedrops
You acquire an effect: Peeled Eyeballs (duration: 50 Adventures)

buy 1 love song of disturbing obsession for 600 each from 1536550 on 20111123
You acquire an item: love song of disturbing obsession

use 1 love song of disturbing obsession
You acquire an effect: Withered Heart (duration: 5 Adventures)

And this is my current mood.
Code:
When I get Wasabi Sinuses, uneffect Wasabi Sinuses
When I run low on Empathy, cast 1 Empathy of the Newt
When I run low on Fat Leon's Phat Loot Lyric, cast 1 Fat Leon's Phat Loot Lyric
When I run low on Heavy Petting, use 5 Knob Goblin pet-buffing spray
When I run low on Leash of Linguini, cast 1 Leash of Linguini
When I run low on Object Detection, use 1 potion of detection
When I run low on On the Trail, olfact monster black knight
When I run low on Peeled Eyeballs, use 5 Knob Goblin eyedrops
When I run low on Withered Heart, use 1 love song of disturbing obsession
However, at the time, it had "When I run low on Object Detection, use 1 potion of inebriety". I aborted the adventure run, fixed the mood, and resumed the run. This was a mood I already had at the time, it originally had "potion of detection" as well. I didn't notice exactly when it changed since I don't use it except in aftercore, but I know it changed at some point after my ascension.
 
Last edited:

Theraze

Active member
Just checking... you're aware that the fix would only change things when you next ascend, right? So if you had it screwed up, and you got a fixed version, it would still be screwed up... Ascend, and it should be fixed.
 

Idran

Member
No, I know. It only effects the moods though, that's all. And I can fix those manually as I notice them. It'd just be better if they didn't need to be fixed in the future at all, especially since I always forget about the bug until the mood starts firing.

(Which is especially annoying when, like in that scenario, what was a potion of detection in one ascension is a potion of inebriety in the next. :p)
 

Theraze

Active member
Yes... that bug is now fixed (one ascension to the next) but it takes a new ascension to see the change. :)
 

Idran

Member
Wait, now I'm getting some really strange behavior that I'm entirely confused by. A mood I created literally two days ago just had its bang potion of detection change to "use 1 potion of healing" without any sort of ascension happening in between. The only thing I can think of that might cause this is the fact that I use Mafia for more than one character; is it possible that that would screw up the mood? Because if not I have no idea what is going on here.

I've checked older moods too, and they changed bang potions as well; every mood I have that uses a bang potion had it change in the same way.

I'd post a log, but I'm honestly not sure what sort of log to post.

Edit: As a followup, I just checked. The potion of detection on the character I noticed the mood change on is milky. The potion of healing on the other character I also play on Mafia is also milky. Also (somewhat coincidentally), the potion of healing on the former character is effervescent, as is the potion of detection on the latter.

Possibly related to this bug, a day or so ago I accidentally logged into one character through Mafia while the other was still in the process of logging out. (A separate bug that I should probably also submit a report for now that I think of it, Mafia doesn't grey out its interface while running logout scripts anymore.) Could that have caused this bang potion confusion somehow?
 
Last edited:
Top