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.
I can't even review this PR for fixes. Its so all over the place that it sounds like you're just asking AI to do something and then instantly accepting what it gives you.
Why would you have a stat column allow a string of min and max, when we have specific stats of min and max it could use?
@Suprcode The description was AI produced. I've had it for some time, Its not a fix. I did submit bug report on the HP/MP % which wasn't supported.
The column allows for ~ to be used to separate between Min/Max (HP,MP) thus giving a range recovery. which is how it works on KR. I could add new columns for MinMax but thats just pointless.
HP, MP % which wasn't added to accept Health/Mana recovery.
ToolTips has also been changed to suite both ranged recovery and %
The item editor form is rather lacking in terms of what KR has to offer. Whether its allowing for multiple item effects, to multiple requirements, currencies, recovery types, new stats.
What i mean is we have plenty of stats available to use. If normal recovery only uses the HP/MP stat currently you could just reuse an existing stat which isn't used. Or add a new "MaxHP" stat that it can use if this is going to be a common thing. The orbs for example just use other stats for their own use.
Hacking it in and using custom "HPRollRaw" strings outside of the stat system is just a crazy way to do it.
You really need to check what the AI is providing you