Bug - Fixed r10938 - Inconsistent skill reporting

Fluxxdog

Active member
It's not a major issue, but I came across this curiosity while experimenting. Given the following code:
Code:
boolean[skill]my_skills(){ boolean[skill]m_s;
	foreach tech in $skills[] if(have_skill(tech)) m_s[tech]=true;
	return m_s;}
boolean[skill]combat_skills(){ boolean[skill]c_s;
	foreach tech in my_skills() if(tech.combat) c_s[tech]=true;
	return c_s;}
... combat_skills() should return those skills you have that can be used in combat. When tested though, I got this (The ones in red are dependent on having certain items equipped):
Code:
> ashtest combat_skills()

Returned: aggregate boolean [skill]
Cannelloni Cannon => true
CLEESH => true
Entangling Noodles => true
[COLOR="#FF0000"]Feed => true
Fire black bottle-rocket => true
Fire blue bottle-rocket => true
Fire orange bottle-rocket => true
Fire purple bottle-rocket => true
Fire red bottle-rocket => true
Give Your Opponent the Stinkeye => true[/COLOR]
Ravioli Shurikens => true
Spaghetti Spear => true
Stuffed Mortar Shell => true
Transcendent Olfaction => true
Volcanometeor Showeruption => true
Weapon of the Pastalord => true

> ash set_location($location[town square])

Returned: void

> ashtest combat_skills()

Returned: aggregate boolean [skill]
Cannelloni Cannon => true
CLEESH => true
Entangling Noodles => true
[COLOR="#FF0000"]Feed => true
Fire black bottle-rocket => true
Fire blue bottle-rocket => true
Fire orange bottle-rocket => true
Fire purple bottle-rocket => true
Fire red bottle-rocket => true
Give Your Opponent the Stinkeye => true[/COLOR]
Ravioli Shurikens => true
Spaghetti Spear => true
Stuffed Mortar Shell => true
Transcendent Olfaction => true
Volcanometeor Showeruption => true
Weapon of the Pastalord => true
Putting on outfit: Vile Vagrant Vestments
Equipment changed.

> ashtest combat_skills()

Returned: aggregate boolean [skill]
Cannelloni Cannon => true
CLEESH => true
Entangling Noodles => true
[COLOR="#FF0000"]Feed => true
Fire black bottle-rocket => true
Fire blue bottle-rocket => true
Fire orange bottle-rocket => true
Fire purple bottle-rocket => true
Fire red bottle-rocket => true
Give Your Opponent the Stinkeye => true[/COLOR]
Ravioli Shurikens => true
Spaghetti Spear => true
Stuffed Mortar Shell => true
Transcendent Olfaction => true
Volcanometeor Showeruption => true
Weapon of the Pastalord => true

> ash have_skill($skill[Fire black bottle-rocket])

Returned: true
As you can see, a number of skills are being reported as owned even though I don't have their appropriate gear equipped. However, Trashquake isn't being reported. I have the outfit required (and the stats to wear it) and I'm a pastamancer AND I set the location to Town Square, but it's not being reported. I also have each piece of the Arrrbor Day Aparrrel, each piece of which has their own unique skill.

Edit: tested during combat and I don't see "Release the Boots" showing up when the boots are ready. Wasn't expecting it so much, but all these skills are conditional, aren't they?
 
Last edited:

slyz

Developer
The way the code currently works, item based skills are added to availableSkillsMap when you equip the item, but are never removed.
 

fxer

Member
have_skill() returns true for skills tied to items not currently equipped

I don't think this used to be the case, but mafia reports I have the Creepy Grin skill available (both via have_skill and the 'skills' cli command) when I am not wearing the V for Vivala mask, it is just in my inventory. Clicking the Skills button in the relay browser shows indeed, I do not have that skill available
 

Darzil

Developer
Have you had it equipped? From memory I recall us setting the skill available when equipped, but not unavailable when unequipped.
 

Crowther

Active member
It seems when you take the mask off, the skill stays.
Code:
> ash have_skill($skill[Creepy Grin ])

Returned: false

> equip v for

Putting on V for Vivala mask...
Equipment changed.

> ash have_skill($skill[Creepy Grin ])

Returned: true

> outfit birthday suit

Taking off everything...
Everything removed.

> ash have_skill($skill[Creepy Grin ])

Returned: true
 

fxer

Member
Have you had it equipped? From memory I recall us setting the skill available when equipped, but not unavailable when unequipped.

What Crowther said, it was equipped at some point during the day for a couple advs
 

fxer

Member
Wow, didn't realize this bug went back 2.5 years and is still open. Does that mean it is insanely hard to fix?
 

lostcalpolydude

Developer
Staff member
It would mean completely changing how those skills are handled, and it doesn't seem to be enough of a bad thing to put in that effort.
 

fxer

Member
Yeah now knowing what's up I can at least code around it, do an item equip check as well as a have_skill check for these cases I guess would be the best bet.

So from sylz post above, it isn't as simple as removing the skill from availableSkillsMap on unequip?
 

Darzil

Developer
So from sylz post above, it isn't as simple as removing the skill from availableSkillsMap on unequip?
Probably, or maybe clearing all those temporary skills and rebuilding each time equipment changes, so we recover correctly if the equipment gets out of sync. Maybe we'd want to look at adding skills from effects too, as there are several we don't handle.
 
Top