Bug - Waiting for Info MP Restoration and Equipment Changing (Travoltan Trousers mostly)

Travoltan Trousers and MP restoreing interactions

So if my current pants give me a boost to MP, and then mafia switches on the travoltan trousers to buy magical mystery juice, and I want to restore
up to 100% of my MP, what happens is this:

change pants to TT
buy mmj
drink mmj
change pants back to original

But the problem with this, is that you are capped at lower MP when the pants are the Travoltan Trousers, so you don't get 100% of your MP
back.

Now combine this with running a script such as autobasement.ash for doing Fernswarthy basement runs, and you get an infinite loop of buying
MMJ's and using them in an attempt to get MP up to 100%.

I would suggest that you:

change pants to TT
buy mmj
change pants back to original
drink mmj
 

lostcalpolydude

Developer
Staff member
I feel like this is a duplicate thread, 3 seconds of searching didn't help me find that though...

Your suggestion is not a complete solution. After the "drink mmj" step, if mafia hasn't met its target (due to low returns from MMJ), it will want to go and buy more, which will probably result in the same (though probably not infinite) loop. You might even lose MP from the first step of "change pants to TT".
 

holatuwol

Developer
Alternatively, maybe we just shouldn't buy stuff from NPCs if it requires an outfit the wearing of which will reduce MP below it's current value. It won't happen that often that it is required to spend more meat to recover from stuff that it lost, and maybe that could be left to manual or script exercise ?
Going with this suggestion for r11082 (or at least a variant where we abort if we need to switch to an outfit for sure, and just ignore the Travoltan Trousers if you don't have to change equipment). We'll see what happens.
 

Veracity

Developer
Staff member
When searching for an existing bug report for my "equipment switching reduces my HP", I found this "equipment switching reduces my MP" thread. Since it's still open, I thought I'd bump it so we all can stare at it some more. :)
 
OK, I spent a good hour digging into the code, and I think I've found the cause of all this trouble. Lines 920 through 927 in UseSkillRequest.java, as they stand now:
Code:
                if ( KoLCharacter.getCurrentMP() > predictions[ Modifiers.BUFFED_MP ] )
		{
			return false;
		}
		if ( KoLCharacter.getCurrentHP() > predictions[ Modifiers.BUFFED_HP ] )
		{
			return false;
		}
This comparison is obviously wrong. Modifiers.java suggests that BUFFED_MP and BUFFED_HP are derived from your MAXIMUM, rather than CURRENT values. So let's fix that:
Code:
                if ( KoLCharacter.getMaximumMP() > predictions[ Modifiers.BUFFED_MP ] )
		{
			return false;
		}
		if ( KoLCharacter.getMaximumHP() > predictions[ Modifiers.BUFFED_HP ] )
		{
			return false;
		}
I've attached a patch that does exactly this.
 

Veracity

Developer
Staff member
That looks right. I ran with it and found no problems. I submitted it in revision 14978.
Lets see if anything unexpected happens.
 
Top