Bug Mer-kin bladeswitcher "sack" attack weapon unequip not tracked

This is an obscure one. Was fighting in the Mer-kin Colosseum without the special weapons/skills, and was periodically losing weapons - which no longer appeared in mafia inventory or available as equip-able weapons. Eventually it occurred to me to "refresh", and found them in Item Manager -> General.

Not a big issue, except for a few minutes where I thought that they were permanently removed as a "serious loss" by a ball-dodger http://kol.coldfront.net/thekolwiki/index.php/Mer-kin_balldodger . One was a brimstone bludgeon. Yeah, someone would have noticed that sort of behavior earlier.

Anyway, one more for the list.

Edit: r13848.
 
Last edited:

Darzil

Developer
This is an obscure one. Was fighting in the Mer-kin Colosseum without the special weapons/skills, and was periodically losing weapons - which no longer appeared in mafia inventory or available as equip-able weapons. Eventually it occurred to me to "refresh", and found them in Item Manager -> General.

Not a big issue, except for a few minutes where I thought that they were permanently removed as a "serious loss" by a ball-dodger http://kol.coldfront.net/thekolwiki/index.php/Mer-kin_balldodger . One was a brimstone bludgeon. Yeah, someone would have noticed that sort of behavior earlier.

Anyway, one more for the list.

Edit: r13848.

Ok, seems to be the Blade Switcher attack "He flicks his oiled switchblade at you and wrenches your weapon out of your hand. Luckily, it lands in your sack instead of on the grimy sea floor. "

The wiki states "The third special attack (sack) unequips your weapon for the rest of the fight, and prevents you from using any skills that would be granted by that weapon.", is that untrue and it actually just unequips the weapon and puts in into inventory?
 
Right, the bladeswitcher. Ah - so it was thought that the weapon was restored after battle? Nope, it remained unequipped after the fight.

I wonder what happens with multiple wielding - are all weapons removed?
 
Finally got back to the sea. So, same issue, mainhand weapon only is actually unequipped, checked by looking at KOL inventory / equipment. The offhand weapon is still there, but not the main.

Immediately after the fight, Mafia incorrectly shows both slots as empty. Refreshing status does not change this.

Need to refresh inventory from item manager for unequipped mainhand weapon to reappear. Selecting a mainhand weapon (in this case the formerly removed one) and then using "change gear" equips the mainhand. I still had the offhand slot showing as empty, which resulted in unequipping the offhand that it didn't know about.

I lost track of the offhand handling a bit, but I think an inventory refresh isn't needed to find it, as was the case for the mainhand.

A bit more detail on this, anyway. Not sure if that's enough to go on.

Edit: r14080
 
Last edited:

Darzil

Developer
r14164 has a partial fix. Basically moved the existing code into an area where it'd be reached other than in the final round, and checked for the removal text, rather than the preparing to remove text.

I haven't yet worked out a simple way to remove just a mainhand weapon within Mafia's code. setEquipment ( EquipmentManager.WEAPON, EquipmentRequest.UNEQUIP ) actually removes items of type WEAPON, not from slot WEAPON. So at present this code will work other than erroneously thinking a weapon in your offhand has been removed if dual wielding. If this is the only issue, I'm not sure I want to re-write EquipmentManager to distinguish between equipment type and slot type at present.
 

Veracity

Developer
Staff member
I haven't yet worked out a simple way to remove just a mainhand weapon within Mafia's code. setEquipment ( EquipmentManager.WEAPON, EquipmentRequest.UNEQUIP ) actually removes items of type WEAPON, not from slot WEAPON.
I'm not seeing it. EquipmentManager.WEAPON is a slot, not a use type (which would be KoLConstants.EQUIP_WEAPON) and EquipmentRequest.UNEQUIP is an AdventureResult: "new AdventureResult( "(none)", 1, false )"

Code:
	public static final void setEquipment( final int slot, AdventureResult item )
...
		EquipmentManager.equipment.set( slot, item );
		EquipmentManager.equipmentLists[ slot ].setSelectedItem( item );
		EquipmentManager.historyLists[ slot ].remove( item );
		EquipmentManager.historyLists[ slot ].add( item );
...
		case EquipmentManager.WEAPON:
		case EquipmentManager.OFFHAND:
			EquipmentManager.checkFamiliar( slot );
			GearChangeFrame.updateWeapons();
			break;
Perhaps you are seeing what happens when we call GearChangeFrame.updateWeapons(), which, in turn calls GearChangeFrame.ensureValidSelections(), which will unequip an offhand weapon if you have no weapon in your main hand because, well, that's what KoL itself does: if you are dual-wielding and unequip your mainhand weapon, KoL itself automatically unequips your off-hand weapon. So, when you say:

So at present this code will work other than erroneously thinking a weapon in your offhand has been removed if dual wielding. If this is the only issue, I'm not sure I want to re-write EquipmentManager to distinguish between equipment type and slot type at present.
Why is that "erroneous"?
 

Darzil

Developer
Ok, my mistake. It probably will be the GearChangeFrame.updateWeapons() thing.

I guess we could not worry about it, if every other time your mainhand is removed your offhand is too.

Edit - Hmm, actually, would a check and return in GearChangeFrame.ensureValidSelections() for KoLmafia.isAdventuring() as there is for KoLmafia.isRefreshing() work? It's not something I've really looked at before, but I guess it's only true whilst in encounters, which it seems is also where KoL doesn't check for valid combinations?
 
Last edited:

Veracity

Developer
Staff member
Are you SURE that KoL doesn't check for valid combinations mid-battle? That would surprise me. If true, I would report a KoL bug, since it could leave you with an invalid set of equipment after the battle.

It would be easy enough to check, given a dual-wielding character, by using an antique spear in the main hand and some other melee weapon in offhand.
 

Darzil

Developer
Well, I do know you have only offhand weapon equipped if mainhand is removed in that fight, leaving mafia out of sync. If you log out with only offhand weapon equipped, it is in equipped in mainhand on login. A bit messy really. If you don't log out with only offhand equipped, and start another fight, you are considered attacking unarmed.

Edit - Am putting in a KoL bug suggesting that they remove both weapons in this case for consistency. In which case the existing fix would be right.
 
Last edited:

Veracity

Developer
Staff member
Fascinating. I would report a KoL bug.

api.php has the equipment array. If you refresh, we will do EquipmentManager.setEquipment( equipment ) with the whole array of items which will then update the Gear Changer with the new equipment. The Gear Changer will validate in order to remove invalid combos. The point of that is to prevent you from making invalid selections in the GUI, but if KoL itself gives you an invalid configuration, that is unexpected.

It sounds like right now there is no warning if you happen to lose your main weapon. As I said, I'd report a KoL bug, but I wouldn't hold my breath for them to make a change. You lose your main item and "since you have no weapon in your main hand, you put your X back in your bag" or, if they really want you to keep the offhand item equipped but attack unarmed "you stare at the X in your offhand, but with no weapon equipped in your main hand, you decide to ignore it and attack with your bare fist".

Edit: or even "since you no longer have a weapon in your main hand, you take your X from your offhand", in order to mirror what happens if you log out. That seems the most reasonable behavior to me.
 
Last edited:

Darzil

Developer
Same behaviour from an antique spear break in mainhand when using two weapons, though took me 200 adventures for it to happen!
 
Top