Crystal icon indicating copy to clipboard operation
Crystal copied to clipboard

HP + MP % #803 HP/MP potion ranges + % recovery (editor + tooltip + i…

Open daneo1989 opened this issue 1 week ago • 3 comments

…ndicators)

Adds proper potion recovery support for both fixed values and ranges.

  • ItemInfo / DB

    • Added HPRollRaw / MPRollRaw to store HP/MP ranges like 10~100.
    • Implemented RollHP() / RollMP() helpers.
    • Saved ranges using an appended tail marker and load-time “peek + rewind” so older DBs still read cleanly.
  • Item editor (ItemInfoFormNew)

    • StatHP / StatMP now accept either an integer or min~max.
    • Ranges are persisted to HPRollRaw/MPRollRaw, fixed values stay in Stats[HP/MP].
    • Validation added with a clear “enter a number or min~max” message.
  • Server potion logic

    • NormalPotion (shape 0) now supports range/% by rolling into the potion pools.
    • SunPotion (shape 1) supports range/% and shows indicators for both HP and MP when applied.
    • Refactored the repeated math into a single helper on HumanObject to keep player/hero behavior identical.
    • MP regen ticks now emit indicators the same way HP regen already did.
  • Client tooltip + indicators

    • Potion tooltips show “Health/Mana Recovery + …” with ranges, and show percent recovery as “Health/Mana Recovery + X%”.
    • Added HealthRecoveryPlusPercent / ManaRecoveryPlusPercent localization keys (English + Chinese).
    • DamageIndicator display now formats positive values as +X (keeps the old color scheme) and skips 0 spam.

daneo1989 avatar Dec 18 '25 11:12 daneo1989