| | |
| | | { |
| | | get |
| | | { |
| | | return HpEx * FullHp + Hp; |
| | | return (ulong)HpEx * FullHp + Hp; |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | get |
| | | { |
| | | return MaxHpEx * FullHp + MaxHp; |
| | | return (ulong)MaxHpEx * FullHp + MaxHp; |
| | | } |
| | | } |
| | | |
| | |
| | | { |
| | | ushort _multiple = (ushort)(value / FullHp); |
| | | |
| | | //if (sid != PlayerDatas.Instance.PlayerId) |
| | | //{ |
| | | // Debug.LogFormat("<color=red>伤血量: {0}, 当前hp: {1}, hpEx: {2}</color>", value, Hp, HpEx); |
| | | //} |
| | | // if (sid != PlayerDatas.Instance.PlayerId) |
| | | // { |
| | | // Debug.LogFormat("<color=red>伤血量: {0}, 当前hp: {1}, hpEx: {2}</color>", value, Hp, HpEx); |
| | | // } |
| | | |
| | | if (_multiple > HpEx) |
| | | { |
| | |
| | | Hp -= value; |
| | | } |
| | | |
| | | //if (sid != PlayerDatas.Instance.PlayerId) |
| | | //{ |
| | | // if (HpEx != SyncServerHpEx) |
| | | // { |
| | | // Debug.LogFormat("<color=red>---- 计算后, hp: {0}, hpEx: {1}</color>", Hp, HpEx); |
| | | // } |
| | | //} |
| | | |
| | | if (HpEx * FullHp + Hp < SyncServerHpEx * FullHp + SyncServerHp) |
| | | { |
| | | Hp = SyncServerHp; |
| | | HpEx = SyncServerHpEx; |
| | | } |
| | | |
| | | // if (sid != PlayerDatas.Instance.PlayerId) |
| | | // { |
| | | // if (HpEx != SyncServerHpEx) |
| | | // { |
| | | // Debug.LogFormat("<color=red>---- 计算后, hp: {0}, hpEx: {1}</color>", Hp, HpEx); |
| | | // } |
| | | // } |
| | | |
| | | if (OnHpChange != null) |
| | | { |
| | | OnHpChange(Hp); |