Bug - Fixed allow equipment changing while casting buffs- missing equipment

Howdy,

As seen here-
http://kolmafia.us/showthread.php?20398-allow-equipment-changing-while-casting-buffs

currently, mafia uses a hardcoded list to allow equipment changing while buffing. The list is missing a few items (according to Drazil, it only handles: Plexiglass Pocketwatch, Wizard Hat and Brimstone Beret- I'm assuming he ment the bracelet, not the beret?).
Not point in listing the missing items since you can easily find them with "modifies mana cost". I count 14 total (thus 11 items need to be added to the list, plus maybe the Vile Vagrant Vestments outfit?)

Thanks for reading and considering this, and as always- Thanks to the developing-developer community of mafia. It really is an amazing thing.
 

Darzil

Developer
What I would like us to do is to replace the whole thing with something cleverer, perhaps which takes advantage of maximizer.

However, I'm concerned about performance when doing so. In aftercore, my doing "-mana cost, 3 max, hp, 1834 max, mp, 32 max -tie" (my max hp and current mp respectively) worked, but isn't yet considering not dropping songs, and took 250k combinations, which is a few seconds.

The overall logic of the function seems to be :
Doesn't try to reduce mana cost when casting Ode to Booze, Glorious Lunch or Librams (not sure why, maybe this was just expensive skills and cut to reduce changes?)
Doesn't try to reduce mana cost when casting 0 mana skills - Can make this skills costing less than 1 - current mana cost.
Doesn't try to reduce mana cost when casting in aftercore - I assume because mp is relatively cheap.
Doesn't put on an item if it reduces your max hp (this prevents a loop where casting a healing spell can cause you hp to drop, requiring a heal spell to restore hp).
Doesn't put on an item if it reduces your max mp (not entirely sure why this isn't just current mp ? Maybe for buffbots, as BuffBotManager calls it ?)
Doesn't put on an item if it reduces the number of songs you can have active (even if you have less than that active).
Is hardcoded not to remove -mana cost accessories.
Is hardcoded not to remove Juju Mojo mask to avoid losing the buff (are there any other items which lose a buff if removed but without adventuring?)

I fear the best solution will be an expanded hacky function, rather than a streamlined one.
 
Last edited:

Darzil

Developer
Actually, not as bad as I thought.

I will make a few changes, but it actually handled all items bar bass clarinet, shakespeare's sister's accordion and pocket square of loathing. Pocket square is just adding it to the valid accessories, then I'll need to add a section for weapons.

Planned changes unless anyone objects :
Doesn't try to reduce mana cost when cost >= 50, rather than a short hard coded list.
Doesn't try to reduce mana cost if current equipment provides enough to reduce cost to 1 or less.
Use current mp rather than max mp when working out if it is safe to change equipment.
Check if it would force song loss, rather than just reduce max number, to change equipment.
Add weapon section.
Add new items.
 

xKiv

Active member
> Check if it would force song loss, rather than just reduce max number, to change equipment.

Nit: you need 1 free song slot before casting, if you are casting a song that you don't have yet.
 

Darzil

Developer
Having ascended it's working fine for me, and no comments from anyone else, so will close as complete.
 

Theraze

Active member
In aftercore, my doing "-mana cost, 3 max, hp, 1834 max, mp, 32 max -tie" (my max hp and current mp respectively) worked

Quick note about this. If your goal was not to drop your max hp or current mp, you want min, not max, on those. What was posted would say that it can do HP, but no more than 1834 is worthwhile. If it happens to drop your hp down to 13, that's fine. No problems here...

You probably wanted "-mana cost, 3 max, hp, 1834 min, mp, 32 min, -tie" instead.
 
Top