JSGMonsterCardData.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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 JSGMonsterCardData : JSGCardDataBase
  14. {
  15. public override void RefreshCardInfo(XmdsVirtual unit)
  16. {
  17. RefreshBossCardInfo cardInfo = new RefreshBossCardInfo(unit.mUnit.ID);
  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. unit.mUnit.queueEvent(cardInfo);
  30. }
  31. public override void RefreshCardInfo(XmdsVirtual unit, byte[] cardData)
  32. {
  33. RefreshBossCardInfo cardInfo = new RefreshBossCardInfo(unit.mUnit.ID);
  34. for (int i = 0; i < (int)CardType.Max; i++)
  35. {
  36. cardInfo.cardData[i] = cardData[i];
  37. }
  38. unit.SendMsgToPlayer(cardInfo);
  39. }
  40. public override void SendTriggerInfo(XmdsVirtual unit, CardTriggerResult result, int skillId, byte[] cardData)
  41. {
  42. BossTriggerCardSkill launchInfo = new BossTriggerCardSkill(unit.mUnit.ID);
  43. launchInfo.cardSkill = skillId;
  44. launchInfo.type = result.type;
  45. launchInfo.layer = result.sameNums;
  46. launchInfo.cardData = cardData;
  47. unit.mUnit.queueEvent(launchInfo);
  48. }
  49. }
  50. }