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!