Crystal
Crystal copied to clipboard
HP + MP % #803 HP/MP potion ranges + % recovery (editor + tooltip + i…
…ndicators)
Adds proper potion recovery support for both fixed values and ranges.
-
ItemInfo / DB
- Added
HPRollRaw/MPRollRawto store HP/MP ranges like10~100. - Implemented
RollHP()/RollMP()helpers. - Saved ranges using an appended tail marker and load-time “peek + rewind” so older DBs still read cleanly.
- Added
-
Item editor (ItemInfoFormNew)
StatHP/StatMPnow accept either an integer ormin~max.- Ranges are persisted to
HPRollRaw/MPRollRaw, fixed values stay inStats[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
HumanObjectto 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/ManaRecoveryPlusPercentlocalization keys (English + Chinese). - DamageIndicator display now formats positive values as
+X(keeps the old color scheme) and skips0spam.