Page 1 of 2 1 2 LastLast
Results 1 to 10 of 15

Thread: Some missing restore information

  1. #1
    Senior Member zarqon's Avatar
    Join Date
    Nov 2007
    Location
    Seoul, Korea
    Posts
    3,750

    Exclamation Some missing restore information

    I've been working on and off on a restore script, and in the process have found some places where my data (which is compiled from mafia, UR, and the Wiki) and mafia's don't match:

    > 1up test

    156 healing options loaded.
    HP mismatch for aspirin: 1up says 101 and mafia says 0
    HP mismatch for personal massager: 1up says 9 and mafia says 0
    HP mismatch for plump juicy grub: 1up says 95 and mafia says 0
    MP mismatch for delicious shimmering moth: 1up says 35 and mafia says 0
    HP mismatch for whimpering willow bark: 1up says 31 and mafia says 539
    HP mismatch for Texas tea: 1up says 30 and mafia says 0
    MP mismatch for Texas tea: 1up says 30 and mafia says 0
    MP mismatch for holy spring water: 1up says 50 and mafia says 45
    Looks like some of them are just missing. The willow bark should be the lesser of 25% of your maxhp (the value shown above) and 50% of your currently possible healing. The holy spring water is a simple discrepancy between the Wiki's and mafia's data.

    I've also found that the pixel orb does not seem to be tracked as a 1/day item. Evidently Darzil added tracking for it in r13738, but I checked several characters and none of them have a _pixelOrbUsed property in their preferences files, and the dailyusesleft proxy field shows -1 rather than 1. Was tracking for this moved somewhere else perhaps?

    That's it, thanks!
    Sig by JakAtk
    My scripts: Prefref Plus | Skillref Plus | One-Click Wossna | Om*****st (??) | Psychose-a-Matic | RandBot
    Combat suite: Best Between Battle | Mercenary Mood | SmartStasis | BatMan | BatMan RE
    For script authors: ASH Wiki | ZLib | BatBrain | CLI Links | Drag-n-Drop Inventories | CanAdv | Script Registry | Map Manager
    If you appreciate my work, help me become BAT KING OF THE WORLD! Thanks to all donators!

  2. #2
    Developer fronobulax's Avatar
    Join Date
    Feb 2009
    Location
    Central Virginia, USA
    Posts
    4,628

    Default

    _pixelOrbUsed does not seem to occur in any of the source files. Looking at the current code, _corruptedStardustUsed is set if either the orb or stardust is used. Between r13738 and now it seems that the preference was changed from a count to a boolean. Given that a trivial update made the orb and stardust one a day items, that makes sense. I will investigate but my hunch is that two separate preferences are needed and something got stepped on in the past six years :-)

  3. #3
    Developer fronobulax's Avatar
    Join Date
    Feb 2009
    Location
    Central Virginia, USA
    Posts
    4,628

    Default

    r19830

    Untested.

    Separate tracking for _corruptedStardustUsed _pixelOrbUsed.

  4. #4
    Senior Member zarqon's Avatar
    Join Date
    Nov 2007
    Location
    Seoul, Korea
    Posts
    3,750

    Default

    Great, thanks frono!
    Sig by JakAtk
    My scripts: Prefref Plus | Skillref Plus | One-Click Wossna | Om*****st (??) | Psychose-a-Matic | RandBot
    Combat suite: Best Between Battle | Mercenary Mood | SmartStasis | BatMan | BatMan RE
    For script authors: ASH Wiki | ZLib | BatBrain | CLI Links | Drag-n-Drop Inventories | CanAdv | Script Registry | Map Manager
    If you appreciate my work, help me become BAT KING OF THE WORLD! Thanks to all donators!

  5. #5
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    12,927

    Default

    Bumping since frono fixed the tracking of the two items, but didn't say he'd added/fixed the missing restores.

  6. #6
    Developer fronobulax's Avatar
    Join Date
    Feb 2009
    Location
    Central Virginia, USA
    Posts
    4,628

    Default

    Bumping since frono fixed the tracking of the two items, but didn't say he'd added/fixed the missing restores.
    Originally Posted by Veracity View Post
    I didn't.
    Well, thank you.
    Originally Posted by Veracity View Post

  7. #7
    Developer fronobulax's Avatar
    Join Date
    Feb 2009
    Location
    Central Virginia, USA
    Posts
    4,628

    Default

    r19849 sort of. Untested.

    I added a couple of items and changed values.

    Unresolved are:
    plump juicy grub item [90*effect(form of...bird!)] [100*effect(form of...bird!)] 0
    delicious shimmering moth item 0 0 [30*effect(form of...bird!)] [40*effect(form of...bird!)] 0
    whimpering willow bark item [floor(HP/4)] [floor(HP/4)] 0 0 0

    The first two, if I understand the syntax, are going to return 0 unless KoLmafia thinks the character is in bird form when the restoration bounds are requested. So mafia may be correct unless 1up can simulate being in bird form.

    I can't figure out whether the evaluation can distinguish between current and maximum HP. The expression could be
    min(.25*maxHP, ,5(maxHP-curHP)) but I don't know the syntax.

    I did not add the personal massager because it only heals if the character is beaten up. I suppose something like
    8*effect(Beaten up) 10*effect(Beaten up) might work but again, I'd rather make a second edit with better knowledge of the syntax.

  8. #8
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    12,927

    Default

    Looking at RestoreExpression:

    Code:
    		if ( this.optional( "HP" ) )
    		{
    			return "\u0085";
    		}
    		if ( this.optional( "MP" ) )
    		{
    			return "\u0091";
    		}
    Looking at Expression:

    Code:
    			case '\u0085':
    				v = KoLCharacter.getMaximumHP();
    				break;
    			// Valid with RestoreExpression:
    			case '\u0091':
    				v = KoLCharacter.getMaximumMP();
    				break;
    If you wanted CURHP (or CURMP) you could add Unicode characters for those in Expression and function names for them in RestoreExpression

  9. #9
    Developer Veracity's Avatar
    Join Date
    Mar 2006
    Location
    The Unseelie Court
    Posts
    12,927

    Default

    Revision 19876 adds CURHP function to RestoreExpression and fixes the expressions for whimpering willow bark.

    I agree with your other comments, so this completes the work for this issue.

    The expression you are looking for is:

    [min(floor((HP-CURHP)/2),floor(HP/4))]

  10. #10
    Senior Member zarqon's Avatar
    Join Date
    Nov 2007
    Location
    Seoul, Korea
    Posts
    3,750

    Default

    I made the grub, moth, and massager healing (was this last one added -- or already present?) contingent on the relevant effect in my data file, and now the only discrepancy is the aspirin, which is not likely to ever be a big deal.

    Thanks!
    Last edited by zarqon; 03-19-2020 at 05:27 AM.
    Sig by JakAtk
    My scripts: Prefref Plus | Skillref Plus | One-Click Wossna | Om*****st (??) | Psychose-a-Matic | RandBot
    Combat suite: Best Between Battle | Mercenary Mood | SmartStasis | BatMan | BatMan RE
    For script authors: ASH Wiki | ZLib | BatBrain | CLI Links | Drag-n-Drop Inventories | CanAdv | Script Registry | Map Manager
    If you appreciate my work, help me become BAT KING OF THE WORLD! Thanks to all donators!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •