Bug Cannot choose slot to equip Powerful Glove

ckb

Minion
Staff member
If a Powerful Glove skill is in a mood and the glove is not equipped, Mafia will sometimes fail with:
Cannot choose slot to equip Powerful Glove.
That skill is unavailable.
Mood failed to cast 1 CHEAT CODE: Invisible Avatar: That skill is unavailable.
KoLmafia declares world peace.


This seems to be a problem with whatever magic was done in r19977
 

gausie

D̰͕̝͚̤̥̙̐̇̑͗̒e͍͔͎͈͔ͥ̉̔̅́̈l̠̪̜͓̲ͧ̍̈́͛v̻̾ͤe͗̃ͥ̐̊ͬp̔͒ͪ
Staff member
Next time it happens, post here with a list of the 3 accessories you had equipped
 

ckb

Minion
Staff member
acc1 astral mask, acc2 ghost of a necklace, acc3 hewn moon-rune spoon

acc1: hewn moon-rune spoon, acc2: astral mask, acc3: Beach Comb
 
Last edited:

gausie

D̰͕̝͚̤̥̙̐̇̑͗̒e͍͔͎͈͔ͥ̉̔̅́̈l̠̪̜͓̲ͧ̍̈́͛v̻̾ͤe͗̃ͥ̐̊ͬp̔͒ͪ
Staff member
acc1 astral mask, acc2 ghost of a necklace, acc3 hewn moon-rune spoon

acc1: hewn moon-rune spoon, acc2: astral mask, acc3: Beach Comb
Well these are not what I expected at all, you've got plenty of valid switch targets there. I'll try to catch it happening myself.
 

dark_adonis

New member
TLDR: Looks like this might be an issue where something isn't accounted for when predicting equipment change (for me suspect Iunion Crown enchantments). Since we are comparing the predicted change vs actual state this leads to a misleading comparison (actual has a higher MP than predicted).

Trying to work through a solution the best I could think of would be to instead focus on differences rather than on real value of MP.
(Max MP - Current MP) vs Calculated current max MP - Predicted max MP
then Calculated current max HP - Predicted max HP

I whipped up some code, but already spent the power on my glove so need to check it later.




Adding a bit of detail it looks like there is something odd around speculating.

Testing with
acc1: ghost of a necklace
acc2: hewn moon-rune spoon
acc3: Beach Comb

> ash my_hp()
Returned: 980

> ash my_mp()
Returned: 1610

> whatif equip acc1 Powerful Glove
Buffed HP Maximum 988.00 (+20.00)
Buffed MP Maximum 1,577.00 (+10.00)

Getting into birthday suit gives me something reasonable
> ash my_hp()
Returned: 488

> ash my_mp()
Returned: 1063

> whatif equip acc1 Powerful Glove
Buffed HP Maximum 508.00 (+20.00)
Buffed MP Maximum 1,073.00 (+10.00

When I put on Iunion Crown:
> ash my_maxhp()
Returned: 509

> ash my_maxmp()
Returned: 1118

Buffed HP Maximum 521.00 (+20.00)
Buffed MP Maximum 1,095.00 (+10.00)

Everything else seems to be working properly.

One more note:
KoL Mafia says Iunion Crown (starting unequipped)

whatif equip iunion crown:
Initiative 241.00 (+10.00)
Item Drop 85.00 (+10.00)
Damage Absorption 650.00 (+200.00)
Moxie 66.00 (+10.00)
Muscle 72.00 (+10.00)
Mysticality 72.00 (+10.00)
Buffed Muscle 426.00 (+10.00)
Buffed Mysticality 559.00 (+10.00)
Buffed Moxie 417.00 (+10.00)
Buffed HP Maximum 1,028.00 (+20.00)
Buffed MP Maximum 1,624.00 (+28.00)


Going to my inventory says:

Muscle +16
Mysticality +25
Moxie +19
+12% Item Drops from Monsters
+6% Meat from Monsters
Slight Hot Resistance (+1)
Slight Spooky Resistance (+1)
Slight Stench Resistance (+1)
Stunning Sleaze Resistance (+7)
+10% Combat Initiative
+3 Cold Damage
+6 Spooky Damage
+6 Stench Damage
+18 Sleaze Damage


When I equip it actually reflects the latter/equipment screen version
 
Last edited:

dark_adonis

New member
I think I have a patch for this.
Added a couple lines to speculate on old outfit.
Calculated gap in MP (Max MP - current MP)
Calculated change in max MP (Calculated new max MP - Calculated old max MP)
if( gap + change < 0): Fail

Calculated change in max HP: (Calculated new max MP - Calculated old max MP)
if change is negative: fail

Not calculated: number of songs
 

Attachments

  • debug_powerful_glove_issue.patch
    1.4 KB · Views: 2

gausie

D̰͕̝͚̤̥̙̐̇̑͗̒e͍͔͎͈͔ͥ̉̔̅́̈l̠̪̜͓̲ͧ̍̈́͛v̻̾ͤe͗̃ͥ̐̊ͬp̔͒ͪ
Staff member
I've been running this and it seems to work? I'm going to merge it and we can always revert if necessary. r20662
 

ckb

Minion
Staff member
using r20662 I get the same error.

Equipment is thus: weapon Fourth of May Cosplay Saber, off-hand maple magnet, back vampyric cloake, pants Cargo Cultist Shorts, acc1 Eight Days a Week Pill Keeper, acc2 Lil' Doctor™ bag, acc3 Retrospecs,
 

gausie

D̰͕̝͚̤̥̙̐̇̑͗̒e͍͔͎͈͔ͥ̉̔̅́̈l̠̪̜͓̲ͧ̍̈́͛v̻̾ͤe͗̃ͥ̐̊ͬp̔͒ͪ
Staff member
Never mind, ey
 

dark_adonis

New member
using r20662 I get the same error.

Equipment is thus: weapon Fourth of May Cosplay Saber, off-hand maple magnet, back vampyric cloake, pants Cargo Cultist Shorts, acc1 Eight Days a Week Pill Keeper, acc2 Lil' Doctor™ bag, acc3 Retrospecs,
Thanks for checking it.

I think this is working as intended.

Powerful Glove Max HP: +10
Eight Pill Keeper Max HP: +20 (+10 over Powerful Glove)
Lil' Doctor Bag Max HP: +35 (+25 over Powerful Glove)
Retrospecs Max HP: +25 (+15 over Powerful Glove)

Options:
1) Losing a certain amount of max HP doesn't matter (where is cutoff, should we warn)
2) Put in a warning/accept
3) Working as intended
 
Last edited:

dark_adonis

New member
Yeah. The code for checking if a switch is valid has a max HP check which appears to be for avoiding problems with healing.

I suppose a solution could be a special check for the glove/that there isn't healing. Let me work toward that... Thanks for the help!


I have a patch I just tested with your setup.
Essentially add function to skill database to determine whether a skill is a "remedy" or "combat/non-combat remedy" which is to say a heal skill. Add that as an additional "and":
if heal skill AND max_HP decreases: break

The code has a warning that this might cause loops for healing, but unless this is a skill chain we should be ok I think.
 

Attachments

  • Adding_check_for_healing_skill.patch
    2.2 KB · Views: 3
Last edited:
Top