Commit 6c012309f8a05ac85f5014b49ae6625e3e0aaceb
1 parent
4500c9b8
sp 满了不加
Showing
1 changed file
with
2 additions
and
0 deletions
Show diff stats
src/adv/AdvPlayer.lua
| ... | ... | @@ -631,7 +631,9 @@ function Player:changeSp(value, cType) |
| 631 | 631 | elseif cType == 1 then |
| 632 | 632 | change = self.sp * value / 100 |
| 633 | 633 | end |
| 634 | + local old = self.sp | |
| 634 | 635 | self.sp = math.floor(math.min(self.spMax, math.max(0, self.sp + change))) |
| 636 | + change = self.sp - old | |
| 635 | 637 | if change ~= 0 then |
| 636 | 638 | self.battle.adv:pushBackEvent(AdvBackEventType.SpChange, {change = math.floor(change)}) |
| 637 | 639 | end | ... | ... |