ActEpsAllEpsPushCtrl.cs 1.1 KB

12345678910111213141516171819202122232425262728293031
  1. using FL.Data;
  2. using XGame.Database;
  3. using XGame.Framework.Network;
  4. namespace FL.Network
  5. {
  6. public class ActEpsAllEpsPushCtrl : MsgController<ActEpsAllEpsPush>
  7. {
  8. protected override void OnProcess(ActEpsAllEpsPush message, object context)
  9. {
  10. if (message.power > 0) PlayerData.Instance.Power = message.power;
  11. if (message.allEps != null)
  12. {
  13. var attr = PlayerData.Instance.Attr;
  14. // 全属性
  15. foreach (var item in message.allEps)
  16. {
  17. attr.SetValue((EAttributeType)item.epid, item.val);
  18. //XGame.Log.Warn($"当前角色属性名称:{(EAttributeType)item.epid},属性值:{item.val}");
  19. }
  20. //TODO 先临时复制血量上限值
  21. //attr.Hp = 10000;
  22. //attr.HpLimit = attr.Hp;
  23. attr.MoveSpeed = 5;
  24. //attr.Attack = 15;
  25. EventSingle.Instance.Notify(EventDefine.AttributeChange); // 角色属性变化
  26. }
  27. }
  28. }
  29. }