Bug - Fixed Mafia does not distinguish jar use failure from success

zarqon

Well-known member
Today I used a jar of psychoses (The Suspicious-Looking Guy). I also used one yesterday. Using it today caused mafia to decrement the inventory count by 1, set the _psychoJarUsed property to "true", and add the jar to the campground (as revealed by get_campground()). However, KoL displayed the message "You've had enough of running around in that guy's head for one lifetime", the jar was not consumed, and no couch appeared at my campsite. So after failing to use the jar my inventory, properties, and campground items all contained inaccuracies, and mafia prevented me from using further jars in the CLI.

The bug also includes using a second jar in a given day. KoL displays the message "You've already got a jar of somebody's psychoses open at your campsite. You should deal with that before you start messing around in someone else's head.", but mafia adds the second jar to the campground items as well.

I'm not sure about other jars, but I suspect any jar which is limited to once/ascension would have the same error.

Extra credit: visiting the campground (and noting the absence of couch, or presence of a link to a specific jar) would fix the _psychoJarUsed property/campground items accordingly.

Sorry if wording it as "extra credit" struck anyone as patronizing; I'm a teacher, that's just what came to mind.
 
Probably easiest as the failure messages vary, to look at the success message, which is "You open the jar and peer inside. The swirling subconscious-extract makes you dizzy, so you lie on the couch (couch?) as you feel your mind projecting itself into the jar. " for all of them according to the wiki.
 
You have been really active with the patches lately. Good work!

Well, Slyz sort of hinted at it in a post last week, then contacted me in chat to ask if I'd thought about it, probably thinking about my adding to data files mainly.

As I taught myself Java last year and don't want to get rusty, I thought doing some would keep my hand in, so trying to do a bit more than that.
 
That patch looks good, 12556. The only thing I changed was removing the check for the current value of _psychoJarUsed since Preferences.setX() already checks that the new value is different.
 
Thanks Darzil! (and lost!)

Now the only remaining obstacle to my jar script being releaseworthy is learning the URL for getting a Jick jar.
 
Now the only remaining obstacle to my jar script being releaseworthy is learning the URL for getting a Jick jar.

Np. Here's a snippet from my loginScript. I confirm that this did get me a jar once.

Code:
	// Get Jick Jar
	if(item_amount($item[psychoanalytic jar]) > 0 && get_property("_jickJarAvailable") == "unknown") {
		visit_url("showplayer.php?who=1");
		if(get_property("_jickJarAvailable") == "true")
			visit_url("showplayer.php?who=1&action=jung&whichperson=jick");
	}
 
Back
Top