Bug - Not A Bug Unarmed modifier always returns false, even during Fistcore

zarqon

Well-known member
In a Fistcore run, I noticed one of my combat scripts kept attacking rather than using the Fist skill which it should have been using. It turns out that the Unarmed modifier was returning false:

> ash boolean_modifier("Unarmed")

Returned: false

> ash equipped_item($slot[weapon])

Returned: none
plural => nones
descid =>
image =>
levelreq => 0
quality =>
adventures =>
muscle =>
mysticality =>
moxie =>
fullness => 0
inebriety => 0
spleen => 0
notes =>
combat => false
reusable => false
usable => false
multi => false
seller => none
buyer => none

> ash equipped_item($slot[offhand])

Returned: none
plural => nones
descid =>
image =>
levelreq => 0
quality =>
adventures =>
muscle =>
mysticality =>
moxie =>
fullness => 0
inebriety => 0
spleen => 0
notes =>
combat => false
reusable => false
usable => false
multi => false
seller => none
buyer => none

> wtf?

deodorant
Bad item value: "deodorant" (zlib.ash, line 383)

Also, I tested with an aftercore character and it returned false regardless of whether there were items in the hands.

Am I misunderstanding something or is this not the way it should work?
 

Veracity

Developer
Staff member
> ash boolean_modifier( $item[ shining halo ], "Unarmed" )

Returned: true
The Unarmed modifier tells you whether the specified item is for "Unarmed characters only".
 

zarqon

Well-known member
Ah -- sorry about that. Not a Bug, then.

I'll go back to checking both hand slots to determine the state of Unarmed-ness then.
 

slyz

Developer
Unarmed is true for a character using an item with the "Unarmed" modifier, false otherwise.
Code:
> ash boolean_modifier( "Unarmed" )

Returned: true

Taking off shining halo...
Equipment changed.

> ash boolean_modifier( "Unarmed" )

Returned: false
A script need to check whether or not the character is using a weapon/offhand to make something of it.

Or we could expose Modifiers.unarmed via a is_unarmed() ASH function. Modifiers.unarmed is defined like this, in KoLCharacter.recalculateAdjustments():
PHP:
Modifiers.unarmed = (weapon == null || weapon == EquipmentRequest.UNEQUIP)
	&& (offhand == null || offhand == EquipmentRequest.UNEQUIP);

It's easy enough to reproduce in a script though.
 
Last edited:

zarqon

Well-known member
Yeah, I'd just misunderstood the purpose of the modifier -- erroneously thought it worked like some of the others, to reference player status. It's fine going back to the slots check.
 

slyz

Developer
Well, it works like other boolean modifiers: it is true if you have something with that "flag" equipped.

You could also say it works the same as numeric modifiers: your total +item% is the sum the +item% of all your items/effects.

Maybe the name "Unarmed" is misleading, it could have been something like "Unarmed Characters Only", but that doesn't roll off the tongue.
 
Last edited:
Top