Feature - Implemented Restoration details for items

Veracity

Developer
Staff member
Over a run, I accumulate all sorts of restoration items. I see them on the Restores panel, but tend to not use many of them, since I can't remember which items restore what (HP or MP) and how much.

Just as food in the food panel tells you adventure gains, stat gains, side effects and notes, it would be nice if items in the Restores panel told what they cured, the range (and average), side effects and other notes.
 

Bale

Minion
I'd very much like to add to this feature request!

When (if) you implement this, please add a proxy field to items for:

  • .minhp - Minimum HP restored
  • .maxhp - Maximum HP restored
  • .minmp - Minimum MP restored
  • .maxmp - Maximum MP restored
(Actually the values I need are max and ave. I have no need for min except as a way to calculate ave, but that would seem weird...)

Or you could implement it as a spread such as 5-10. Less convenient, but I'd be willing to parse it.
  • .hpRestore
  • .mpRestore

After all, if you're going to add these values to mafia, it would be really helpful if I could make use of them in my recoveryScript.
 

Theraze

Active member
I think min is still useful if you're trying to reduce server hits... if you purchase enough to do the restoration with min restore, then it should hopefully avoid the softcore equipment restoration bug...
 

Bale

Minion
I think min is still useful if you're trying to reduce server hits... if you purchase enough to do the restoration with min restore, then it should hopefully avoid the softcore equipment restoration bug...

You seem to have missed an update. You no longer need to wear the KGE to purchase seltzer.
 

Theraze

Active member
Yep, it was the travoltan trousers I was talking about... since that's likely to drop your hp or mp if you have any sort of decent gear.

Hence me referring to it as a softcore restoration bug, not a restoration bug.
 

rlbond86

Member
HP and MP restoring items do not have any notes or properties indicating so

Not sure if I should call this a bug or a feature.

Items which heal HP or MP as a secondary effect have this noted in their notes. For example,

Code:
Oh, the Humanitini
plural => Oh, the Humanitinis
descid => 839812561
image => martini_f.gif
levelreq => 8
quality => awesome
adventures => 8-9
muscle => 0
mysticality => 0
moxie => 0
fullness => 0
inebriety => 2
spleen => 0
notes => Restores HP
combat => false
reusable => false
usable => false
multi => false
fancy => false
candy => false
bounty => none
bounty_count => 0
seller => none
buyer => none

on the other hand,

Code:
Returned: elven medi-pack
plural => elven medi-packs
descid => 989436501
image => medipack.gif
levelreq => 0
quality =>
adventures =>
muscle =>
mysticality =>
moxie =>
fullness => 0
inebriety => 0
spleen => 0
notes =>
combat => false
reusable => false
usable => false
multi => false
fancy => false
candy => false
bounty => none
bounty_count => 0
seller => none
buyer => none

Shouldn't there be at the very least, a note which says "Restores HP"? Or better yet, a field for HP and MP which hold the ranges of healing, similar to the adventures field? Or a HP / MP numeric modifier? This seems like a large oversight.
 

Rinn

Developer
I'm switching this to a feature request instead of a bug. I would like mafia to track hp and mp restoration, and I'm sure Bale would be a fan of that.
 
Last edited:
I've been working on this for a bit, and it's gotten drastically more complicated as I went, so figured it's time for me to start asking for feedback before I spend a ton of time developing a patch that no-one but me cares about. :)

My approach is to add a "restoratives.txt" new data file that contains all the various restorative items out there (both HP and MP), with min/max values. This means that the list stored in moods/HPRestoreItemList.java gets basically moved into the data file, other than the skill/locations. For the handful of items that don't have a simple random range, I'm leveraging the ModifiersExpression code to allow for the appropriate formula to define the correct values. This will eventually (next phase of my work) allow as per the request to have the ash items have restoreHPMin/restoreHPMax (and MP) properties, so you can get the specific ranges. Questions:

- Should I move the locations/skills into restoratives.txt also, and include a "type" column to encompass them?
- As I'm doing this, there's obviously a ton of duplicate code between what I've done for HPRestoreItemList and what I'll eventually do for MPRestoreItemList. There any value in merging the two to a "RestoreItemList" that of course lets you get just HP or MP items?
- One of the main functions of the restoreItemLists is to populate the HP/MP usage tab for "stuff to use to get HP/MP back". There are various items/skills not included right now, and the ordering seems fairly arbitrary. Should I duplicate the same ordering/list for now, or any preferences on how I should better lay it out if I do go and fill out the additional items/skills? Should I sort the list via the "compareTo" function implemented for HPRestoreItem objects (i.e., "best value" first)?
- There are various items (and skills, cocoon) that restore "all hp". The code handled this by setting those to Integer.maxValue, and right now I'm just using "-1" in the restoratives.txt file. The "most correct" option seems to be extending Expressions to be able to say something like "[stat(MaxHP)]", i.e., an expression returning the value of KoLCharacter.getMaximumHP() - but there's no syntax for that right now, just the existing set of special characters (which MaxHP is not yet one). Does that make sense as an approach, and if so, what's the right format/structure for the Expression extension?

Phew. Lots of work still to do, feedback is much appreciated. Thanks!
 

fronobulax

Developer
Staff member
Will anything make UR easier to maintain? Will your work make mafia's own restoration more competitive with UR? I'd prefer no new data files but if the lists are hard coded in Java then a data file is the lesser of two evils. it is true that new content will be easier to implement with files. I vote for code that handles both MP and HP rather than duplication. Inheritance might be the way to handle something that needs to be different. No useful feedback but at least you know someone was reading.
 
Will anything make UR easier to maintain? Will your work make mafia's own restoration more competitive with UR? I'd prefer no new data files but if the lists are hard coded in Java then a data file is the lesser of two evils. it is true that new content will be easier to implement with files. I vote for code that handles both MP and HP rather than duplication. Inheritance might be the way to handle something that needs to be different. No useful feedback but at least you know someone was reading.

Hahahaha. I do very much appreciate the knowledge that someone was reading. :) Much better than me having to count the number of times someone read the thread in the forum.

Well, Bale can jump in, but the whole point of this was to satisfy a FREQ he put in that I assume is helping UR - if nothing else, it'll allow him to get a lot more precise since he can then query the exact restoration ranges to "tune" better. And if there's other needs for UR on the way, I'll jump on those. Beyond that, check, sounds good. I'll finish up my current drive of dealing with HPRestoreItemList, share the patch for feedback, and if I'm still on the right track convert the MPRestoreItemList to match.
 

Theraze

Active member
Sounds like it would help to have "type" included as well. Not sure if "adventure" goes as a standard... guessing that the clan sofa and resting at campground are the two main sources, unless we're adding a new "location" resting with the knob elite gear.
 

Bale

Minion
I will be very happy to be able to use KoLmafia's datafiles for UR. As for the idea putting skills and restoratives into the datafile, I'm pretty much doing that for 1Up, so it would definitely be of use to me. Take a look at my current datafile for 1Up (the successor to UR):

Code:
#name	type	avehp	maxhp	avemp	maxmp	avail
ancient Magi-Wipes	item	55	60	55	60	
ancient turtle shell powder	item	78	98	0	0	
banana spritzer	item	0	0	70	100	
black cherry soda	item	0	0	10	11	
Blatantly Canadian	item	0	0	22	25	
blue paisley oyster egg	item	0	0	32.5	35	spleen
blue pixel potion	item	0	0	65	80	
blue polka-dot oyster egg	item	0	0	32.5	35	spleen
blue striped oyster egg	item	0	0	32.5	35	spleen
bottle of Monsieur Bubble	item	0	0	55	65	
bottle of Vangoghbitussin	item	100	100	100	100	
Cannelloni Cocoon	skill	maxhp	maxhp	0	0	
carbonated soy milk	item	0	0	75	80	
carbonated water lily	item	0	0	65	70	
cast	item	17.5	20	0	0	
Cherry Cloaca Cola	item	0	0	8	9	
Cloaca-Cola	item	0	0	12*canteen	14*canteen	
cotton candy bale	item	61.5	82	61.5	82	
cotton candy cone	item	39	52	39	52	
cotton candy pillow	item	51	68	51	68	
cotton candy pinch	item	9	9	12	12	
cotton candy plug	item	28.5	38	28.5	38	
cotton candy skoshe	item	22.5	30	22.5	30	
cotton candy smidgen	item	17	23	17	23	
delicious shimmering moth	item	0	0	35	40	
Diet Cloaca Cola	item	0	0	8	9	
Disco Nap	skill	20	20	0	0	
Disco Power Nap	skill	40	40	0	0	
Doc Galaktik's Ailment Ointment	item	9	10	0	0	
Doc Galaktik's Homeopathic Elixir	item	19	20	0	0	
Doc Galaktik's Pungent Unguent	item	4	5	0	0	
Doc Galaktik's Restorative Balm	item	14	15	0	0	
Dyspepsi-Cola	item	0	0	12*canteen	14*canteen	
elven magi-pack	item	0	0	45	50	
elven medi-pack	item	90	100	0	0	
filthy poultice	item	100	120	0	0	
forest tears	item	7.5	10	0	0	
Frat Nuns	nuns	1000	1000	1000	1000	fratnun-nunsVisits
free rest	rest	restmp	restmp	resthp+1	resthp+1	disco-timesrested
galaktik hp	galaktik hp *	1	1	0	0	
gauze garter	item	100	120	0	0	
green pixel potion	item	50	60	35	40	
high-pressure seltzer bottle	item	0	0	175	200	
Hippy Nuns	nuns	1000	1000	0	0	hippynun-nunsVisits
honey-dipped locust	item	35	40	34.5	39	
Knob Goblin seltzer	item	0	0	10	12	
Knob Goblin superseltzer	item	0	0	27	29	
Lasagna Bandages	skill	20	30	0	0	
Laugh It Off	skill	1.5	2	0	0	
magical mystery juice	item	0	0	1.5*L+5	1.5*L+6	mmjavail
Marquis de Poivre soda	item	0	0	35	40	
Medicinal Herb's medicinal herbs	item	maxhp	maxhp	0	0	spleen
Monstar energy beverage	item	0	0	75	80	
Mountain Stream soda	item	0	0	7.5	9	
Nardz energy beverage	item	0	0	65	80	
natural fennel soda	item	0	0	100	120	
New Cloaca-Cola	item	0	0	150	160	
Notes from the Elfpocalypse, Chapter I	item	35	40	35	40	
Notes from the Elfpocalypse, Chapter II	item	35	40	35	40	
Notes from the Elfpocalypse, Chapter III	item	35	40	35	40	
Notes from the Elfpocalypse, Chapter IV	item	35	40	35	40	
Notes from the Elfpocalypse, Chapter V	item	35	40	35	40	
Notes from the Elfpocalypse, Chapter VI	item	35	40	35	40	
palm-frond fan	item	40	45	40	45	
personal massager	item	9	10	0	0	
phonics down	item	48	50	48	50	
pixellated candy heart	item	4.5	5	0	0	
plump juicy grub	item	95	100	0	0	
potion of healing	item	10	16	10	16	
pseudo New Cloaca-Cola	pseudoitem	0	0	150	160	six-pack of New Cloaca-Cola*.167
pseudo palm-frond fan	pseudoitem	40	45	40	45	Palm frond*2
pseudo really thick bandage	pseudoitem	110	120	0	0	mummy wrapping*2
really thick bandage	item	110	120	0	0	
red paisley oyster egg	item	32.5	35	0	0	spleen
red pixel potion	item	110	120	0	0	
red polka-dot oyster egg	item	32.5	35	0	0	spleen
red striped oyster egg	item	32.5	35	0	0	spleen
Regular Cloaca Cola	item	0	0	8	9	
rest	rest	restmp	restmp	resthp+1	resthp+1	adv
scented massage oil	item	maxhp	maxhp	0	0	
scroll of drastic healing	item	maxhp	maxhp	0	0	
soda water	item	0	0	4	5	
sugar shard	item	15	20	7.5	10	
tiny house	item	22	24	22	24	
Tongue of the Otter	skill	12.5	15	0	0	
Tongue of the Walrus	skill	35	40	0	0	
tonic water	item	0	0	40	50	
unrefined Mountain Stream syrup	item	0	0	55	60	
Wint-O-Fresh mint	item	0	0	4	5	
Wolfman Nardz	item	0	0	250	300

(Yeah, it has ave and max instead of min and max. There's a reason for that, but I'm not gonna get into it since there's no reason that should be implemented for KoLmafia.) Note that requires an entry for both "Frat Nuns" and "Hippy Nuns" and similar situations so I added an avail field which is evaluated in the script to tell me if something is available. Another weird case is the Cloaca-cola and Dyspepsi cola which are modified by an accessory. Hence a weird formula. I suppose KoLmafia doesn't need to know that either.
 
I will counter your datafile with one of my own! See attached...

I went through and validated all the HP items, and just added in the locations/skills - I have not yet validated the MP items (or locations, necessarily), so I'm likely missing some there. Any feedback on errors is much appreciated. The goal is to expose all of this via ash, so that should make the 1up script much easier. Bale, your thoughts on how if any I should be exposing cost is also much appreciated. it's an interesting balance around how much logic should be built into kolmafia, vs. how much should be externalized in scripts like UR/what will be 1up. My theory is if we take whatever logic you've got already in 1up and merge that into the HPRestoreItem object's compareTo function, you can end up with 99% of it built-in to kolmafia.
 

Attachments

  • restoratives.txt
    4.1 KB · Views: 114

Darzil

Developer
r13290 adds restores.txt. Mafia DOESN'T use it yet.

If anyone wants to check I've not missed anything, feel free. I used Iron Tetsubo's file above, and added any other non-combat HP or MP restores I could find on the wiki pages for restores. Am pretty sure there are also things not in either list.

Current plan is to read the file into a RestoresDatabase, add a global variable that stores which restores are shown in the HP/MP Usage panel (by default showing only reusable special stuff and tradable common stuff, probably), and convert everything to use them.
 

heeheehee

Developer
Staff member
Cocoon entries should probably read [HP], not HP.
"Lasanga Bandages"
your own black heart, max MP restored has a } at the end.
 
Top