JSGPlayerCardData.cs 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. using CommonAI.Data;
  2. using CommonAI.Zone;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. using XmdsCommonServer.Plugin;
  9. using XmdsCommonServer.Plugin.Base;
  10. namespace XmdsCommonSkill.Plugin.CardSkill
  11. {
  12. //玩家卡牌技能数据
  13. public class JSGPlayerCardData : JSGCardDataBase
  14. {
  15. public override void RefreshCardInfo(XmdsVirtual player)
  16. {
  17. RefreshCardInfo cardInfo = new RefreshCardInfo();
  18. for(int i = 0; i < (int)CardType.Max; i++)
  19. {
  20. if(i < this.mCards)
  21. {
  22. cardInfo.cardData[i] = (byte)this.mCardData[i];
  23. }
  24. else
  25. {
  26. cardInfo.cardData[i] = (byte)CardType.Max;
  27. }
  28. }
  29. player.SendMsgToPlayer(cardInfo);
  30. }
  31. public override void RefreshCardInfo(XmdsVirtual player, byte[] cardData)
  32. {
  33. RefreshCardInfo cardInfo = new RefreshCardInfo();
  34. for (int i = 0; i < (int)CardType.Max; i++)
  35. {
  36. cardInfo.cardData[i] = cardData[i];
  37. }
  38. player.SendMsgToPlayer(cardInfo);
  39. }
  40. public override void SendTriggerInfo(XmdsVirtual player, CardTriggerResult result, int skillId, byte[] cardData)
  41. {
  42. PlayerLaunchCardSkill launchInfo = new PlayerLaunchCardSkill();
  43. launchInfo.cardSkill = skillId;
  44. launchInfo.type = result.type;
  45. launchInfo.layer = result.sameNums;
  46. launchInfo.cardData = cardData;
  47. player.SendMsgToPlayer(launchInfo);
  48. }
  49. }
  50. }