Feature Holstered sixguns need more support

(put the sixguns into a new section labeled, for example, "# Sixguns section of modifiers.txt"). They can still be "Item" modifiers.)
 
So, I tried tackling this, since how hard could it be? So, I modified Evaluator.TIEBREAKER, added a few lines to modifiers.txt, and added some stuff to Modifiers to make sure the modifiers were properly parsed. modtrace worked just fine (showing my toy sixgun gave +5 sixgun damage).

But then I ran into a bit of weirdness in the Maximizer frame (and presumably would with the maximize command, as well):
Current score: 5.00 Predicted: 5.00 (+0)
...
unequip holster (toy sixgun, -5) [selected; not sure why the predicted score didn't update]

What did I miss?
 
And one other thing I noticed when testing that out:
cli holstering said:
> equip toy sixgun

You can't equip a toy sixgun

> equip holster toy sixgun

Holstering toy sixgun...
Equipment changed.
 
I would think this is related:
> ash can_equip($item[toy sixgun])

Returned: false

> ash my_class()

Returned: Beanslinger
primestat => Mysticality

> ash item_type($item[toy sixgun])

Returned: sixgun

I can't see any reason for this to return false. I think I'll bust out a debugger and trace what's going on here.

edit: guess not, looks like can_equip checks a hardcoded list of equipment slots before invoking EquipmentManager.canEquip.
 
Last edited:
Okay. It looks like the order in which slots are maximized is hardcoded via a chain of function calls in MaximizerSpeculation, so I added trySixguns in the middle of the chain (maybe it makes sense at the end? Dunno). This should be more or less handled in r16795.
 
Looks good to me.

Have made a tweak in r16796 to take into account "Well-Oiled Guns" skill. Not that it'll ever change the preference, but at least it'll display the real damage value when asked.
 
Last edited:
Minor issue with Holster display in Gear Changer, didn't appear for me when I became a Snake Oiler til I next logged into Mafia.
 
Interesting. I tested logging out of an AWOL class and in to a non-AWOL class and back again (different characters) - without exiting KoLmafia; simply going to the login frame - and the slot disappeared and reappeared as expected. It must have built the frame anew for each character.

I don't see why it wouldn't appear when you change class without logging out, since it is built using the same widget used by the "You are in away mode" in KoLmafia chat, which appears and disappears. Unfortunately it is hard to test. I'll try modifying the isHidden method to look at a preference which I can change while logged in and will try it in a debugger.

Eventually. :)
 
OK, I did that. I changed the method to look like this:

Code:
			@Override
			public boolean isHidden()
			{
				// return !KoLCharacter.isAWoLClass();
				return Preferences.getBoolean( "_boogers" );
			}
1) I opened the Gear Changer frame. The Holstered slot was present.
2) I closed the frame and "set _boogers = true" and opened the frame again. The Holstered slot was absent.
3) I closed the frame and "set _boogers = false" and opened the frame again. The Holstered slot was present.

So, it seems to be working as expected for me. Now, if you had the Gear Changer frame open when you ascended, perhaps it would not change, since I don't know if it has a Listener associated with your Class - but I would expect it to refresh because of your inventory change, at least.

I have no idea why it didn't work for you.
 
Probably has the Gear Changer as a tab in the main mafia window per the defaults, so it wouldn't have redrawn.
 
I don't have the Gear Changer as a tab. I do have Preferences. Looking at the defaults, both are non-standard, although I didn't think I ever changed them from what they were originally. Whatever.

Nothing I've tried has made the widget show or hide that field in a frame that is a tab. For now, I think this will just have to be a inor limitation; as observed, you can log off and log back in and it will work as expected.
 
Yeah, unless there's a way to add a 'Redraw' button that will force a tab to rebuild itself, that's probably as useful as can be easily done.
 
The holster link on the inventory page of the relay browser works but the holster link after buying the reliable sixgun from the gift shop of the L & T Office does not.
 
"holster" link after purchasing reliable sixgun doesn't work

The holster link on the inventory page of the relay browser works but the holster link provided after buying the reliable sixgun from the gift shop of the L & T Office does not.
 
Back
Top