Feature Boolean modifiers for certain types of equipment

Darzil

Developer
It is because by default, at present, ALL items that match a boolean requirement are passed through to the brute force maximization, so would need pruning. Numerics already get pruned.
 

Saklad5

Member
It is because by default, at present, ALL items that match a boolean requirement are passed through to the brute force maximization, so would need pruning. Numerics already get pruned.
Is there anything I might be able to do to help? Seal Clubbers and Accordion Thieves really benefit from using their titular weapons, and I’d like to see this make progress for those classes in particular.
 

Darzil

Developer
A patch that successfully coverts Boolean array from bits to longs as we are running out, and works everywhere they are used would help. I couldn’t get them all working and don’t have time now.
 

Saklad5

Member
A patch that successfully coverts Boolean array from bits to longs as we are running out, and works everywhere they are used would help. I couldn’t get them all working and don’t have time now.
You want a function that can take an array of booleans and turn it into a bitfield? I’m a bit unclear on why we aren’t just using boolean arrays in the first place, honestly.
 

Darzil

Developer
No, I need a rewrite of everything about Boolean modifiers in Mafia. As after adding one more, any further involve a metric shedload of changes. It is the hard part about this change.

Incidentally, two handed accordions work fine, and maybe one handed. It is only clubs where it might only show you clubs for both hands if using two weapons where club is an issue
 

heeheehee

Developer
Staff member
Maybe "club" should only be considered to be valid in the mainhand slot.

I didn't think it worked as an offhand equip. I guess I can test with a multi + batter up, maybe later.
 
According to the maximizer help, all of these weapontype keywords (club, knife, accordion and utensil) are already for mainhand only, but that does seem to interfere with the offhand equipment selection.

Ex: Maximizing for "club, equip thor's pliers" will ignore the pliers and result in a failed maximisation for not meeting that goal.
Similarly, maximizing for "club, weapon damage" causes it to suggest either the ginsu (+100% weapon damage, 2-handed sword, which is good since I have iron palms active), or brimstone bludgeon+slime-covered club if I force it into 1-handed weapons. Both times, it ignores brimstone bludgeon + stick knife, which outweighs either.

As for functionality: accordions can't be equipped in the offhand, but for utensils', knives' and clubs' skill interactions only mainhand counts.

As such, I'm not sure if a boolean modifier approach is the way to go here, since that might result in an outfit with the requested equipment in the offhand (or maybe on the disembodied hand), which would then fail to give you the skill interactions (and seal-clubbing prowess) you were probably looking for.
 
Last edited:

heeheehee

Developer
Staff member
I bet this is testable.

PHP:
	@Test
	public void clubModifierDoesntAffectOffhand()
	{
		KoLCharacter.addAvailableSkill( "Double-Fisted Skull Smashing" );
		// 5 base + buffed mus.
		KoLCharacter.setStatPoints( 5, 25, 0, 0, 0, 0 );
		try
		{
			// 2 seal-clubbing clubs, 1 white sword
			InventoryManager.parseInventory( new JSONObject( "{\"1\": \"2\", \"269\": \"1\"}" ) );
		}
		catch ( JSONException e )
		{
			fail( "Inventory parsing failed." );
		}
		assertTrue( Maximizer.maximize( "mus, club", 0, 0, true ) );
		assertEquals(
			7, Modifiers.getNumericModifier( "Generated", "_spec", "Buffed Muscle" ), 0.01 );
	}
reproduces this failure.

(Regardless, we still need an overhaul of the boolean modifier situation, since we're still running into scaling limitations.)
 
Last edited:

heeheehee

Developer
Staff member
It looks like a problem is in Evaluator.java, namely that we use
PHP:
			int slot = EquipmentManager.itemIdToEquipmentType( id );
...
				case EquipmentManager.WEAPON:
...
					if ( this.requireClub && !EquipmentDatabase.isClub( id ) )
					{
						continue;
					}
etc

which doesn't care about which slot you're trying to put the item into.
 

heeheehee

Developer
Staff member
r19183 ostensibly fixes the issue where +club (and similar keywords) force the offhand to also be a club. This is also tangential to the original discussion. As mentioned by the dictator, changing these to be boolean modifiers might actually be nonideal, since the modifiers only apply to the mainhand slot. We'll still need some sort of hardcoded behavior to understand that.

(Technically, the test only checks that the maximize command can equip a club and a sword, but not which slots they end up in...)
 
Top