MountService.cs 3.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133
  1. using FL.Network;
  2. using XGame.Framework.Data;
  3. using XGame.Framework.Network;
  4. namespace FL
  5. {
  6. public class MountService : DataSingleton<MountService>
  7. {
  8. public int UpgradeMountId { set; get; } // 请求升星的高级坐骑id
  9. public int MountStarLv { set; get; } // 高级坐骑升星前的星级
  10. /// <summary>
  11. /// 坐骑激活功能时初始化,只需请求一次(解锁坐骑功能时请求)
  12. /// </summary>
  13. public void SendTo()
  14. {
  15. NetModule.Request(new MountMountInitRequest() { });
  16. }
  17. /// <summary>
  18. /// 请求坐骑相关数据
  19. /// </summary>
  20. public void SendToMountData()
  21. {
  22. NetModule.Request(new MountIntoRequest() { });
  23. }
  24. /// <summary>
  25. /// 一键提升通用坐骑(喂养)
  26. /// </summary>
  27. public void SendToOneKeyFeedMount()
  28. {
  29. NetModule.Request(new MountTiShengAllRequest() { });
  30. }
  31. /// <summary>
  32. /// 通用坐骑(喂养)提升
  33. /// </summary>
  34. public void SendToFeedMount()
  35. {
  36. NetModule.Request(new MountTishengRequest() { });
  37. }
  38. /// <summary>
  39. /// 启用高级坐骑技能
  40. /// </summary>
  41. /// <param name="mountId">坐骑id</param>
  42. public void SendToEnableAdvancedSkill(int mountId)
  43. {
  44. var msg = new MountUseSkillRequest()
  45. {
  46. mountId = mountId
  47. };
  48. NetModule.Request(msg);
  49. }
  50. /// <summary>
  51. /// 取消高级坐骑技能
  52. /// </summary>
  53. public void SendToCancelAdvancedSkill()
  54. {
  55. NetModule.Request(new MountSkillDownRequest() { });
  56. }
  57. /// <summary>
  58. /// 坐骑上阵(骑乘)
  59. /// </summary>
  60. /// <param name="mountId"></param>
  61. public void SendToRideMount(int mountId)
  62. {
  63. var msg = new MountShangzhenRequest()
  64. {
  65. mountId = mountId
  66. };
  67. NetModule.Request(msg);
  68. }
  69. /// <summary>
  70. /// 下坐骑
  71. /// </summary>
  72. public void SendToRideDown()
  73. {
  74. NetModule.Request(new MountDownRequest() { });
  75. }
  76. /// <summary>
  77. /// 坐骑部位一键驯养
  78. /// </summary>
  79. public void SendToOneKeyTraining()
  80. {
  81. NetModule.Request(new MountXunyangAllRequest() { });
  82. }
  83. /// <summary>
  84. /// 坐骑部位驯养
  85. /// </summary>
  86. public void SendToTrainingMountPart()
  87. {
  88. NetModule.Request(new MountXunyangRequest() { });
  89. }
  90. /// <summary>
  91. /// 请求解锁某个高级坐骑
  92. /// </summary>
  93. /// <param name="mountId"></param>
  94. public void SendToUnlockAdvancedMount(int mountId)
  95. {
  96. var msg = new MountAddMountRequest()
  97. {
  98. mountId = mountId
  99. };
  100. NetModule.Request(msg);
  101. }
  102. /// <summary>
  103. /// 高级坐骑升星
  104. /// </summary>
  105. /// <param name="mountId"></param>
  106. public void SendToUpgradeStar(int mountId)
  107. {
  108. UpgradeMountId = mountId;
  109. MountStarLv = MountData.Instance.GetAdvancedMountLv(mountId);
  110. var msg = new MountUpStarRequest()
  111. {
  112. mountId = mountId
  113. };
  114. NetModule.Request(msg);
  115. }
  116. }
  117. }