ArtifactService.cs 5.5 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200
  1. 
  2. using FL.Network;
  3. using XGame.Framework.Data;
  4. using XGame.Framework.Network;
  5. namespace FL
  6. {
  7. /// <summary>
  8. /// 神器消息交互
  9. /// </summary>
  10. public class ArtifactService : DataSingleton<ArtifactService>
  11. {
  12. #region 普通神器
  13. /// <summary>
  14. /// 请求神器相关数据
  15. /// </summary>
  16. public void SendToArtifactData()
  17. {
  18. NetModule.Request(new ArtifactIntoRequest() { });
  19. }
  20. /// <summary>
  21. /// 一键升级神器(一键锤炼按钮事件)
  22. /// </summary>
  23. public void SendToUpgradeArtifactByOneKey()
  24. {
  25. NetModule.Request(new ArtifactTiShengAllRequest() { });
  26. }
  27. /// <summary>
  28. /// 升级神器(锤炼按钮事件)
  29. /// </summary>
  30. public void SendToUpgradeArtifact()
  31. {
  32. NetModule.Request(new ArtifactTishengRequest() { });
  33. }
  34. #endregion
  35. #region 高级(皮肤)神器
  36. /// <summary>
  37. /// 请求升星的高级神器id
  38. /// </summary>
  39. public int UpgradeArtifactId { get; set; }
  40. /// <summary>
  41. /// 升星前神器的星级
  42. /// </summary>
  43. public int ArtifactStarLv { get; set; }
  44. /// <summary>
  45. /// 请求解锁某个高级神器(皮肤)
  46. /// </summary>
  47. /// <param name="mountId"></param>
  48. public void SendToUnlockArtifact(int artifactId)
  49. {
  50. var msg = new ArtifactAddArtifactRequest()
  51. {
  52. artifactId = artifactId
  53. };
  54. NetModule.Request(msg);
  55. }
  56. /// <summary>
  57. /// 启用高级神器技能
  58. /// </summary>
  59. /// <param name="artifactId"></param>
  60. public void SendToUseArtifactSkill(int artifactId)
  61. {
  62. var msg = new ArtifactUseSkillRequest()
  63. {
  64. artifactId = artifactId
  65. };
  66. NetModule.Request(msg);
  67. }
  68. /// <summary>
  69. /// 取消高级神器技能的使用
  70. /// </summary>
  71. public void SendCancelUseArtifactSkill()
  72. {
  73. NetModule.Request(new ArtifactSkillDownRequest() { });
  74. }
  75. /// <summary>
  76. /// 高级神器升级(升星)
  77. /// </summary>
  78. /// <param name="artifactId"></param>
  79. public void SendToUpgradeAdvaceActifact(int artifactId)
  80. {
  81. UpgradeArtifactId = artifactId;
  82. ArtifactStarLv = ArtifactData.Instance.GetAdvancedArtifactLevel(artifactId);
  83. var msg = new ArtifactUpStarRequest()
  84. {
  85. artifactId = artifactId
  86. };
  87. NetModule.Request(msg);
  88. }
  89. #endregion
  90. #region 神器附魔
  91. /// <summary>
  92. /// 附魔(元素上阵)
  93. /// </summary>
  94. /// <param name="elementId"></param>
  95. public void SendToWearElement(int elementId)
  96. {
  97. var msg = new ArtifactUseElementRequest()
  98. {
  99. elementId = elementId
  100. };
  101. NetModule.Request(msg);
  102. }
  103. /// <summary>
  104. /// 取消附魔(元素下阵)
  105. /// </summary>
  106. /// <param name="elementType">元素类型</param>
  107. /// <param name="holePosition">孔位</param>
  108. public void SendToDisbandElement(int elementType, int holePosition)
  109. {
  110. var msg = new ArtifactDownElementRequest()
  111. {
  112. type = elementType,
  113. buwei = holePosition
  114. };
  115. NetModule.Request(msg);
  116. }
  117. /// <summary>
  118. /// 元素升级
  119. /// </summary>
  120. /// <param name="elementId"></param>
  121. public void SendToUpgradeElement(int elementId)
  122. {
  123. var msg = new ArtifactUpElementRequest()
  124. {
  125. elementId = elementId
  126. };
  127. NetModule.Request(msg);
  128. }
  129. /// <summary>
  130. /// 元素一键升级
  131. /// </summary>
  132. /// <param name="elementType"></param>
  133. public void SendToUpgradeElementByOnekey(int elementType)
  134. {
  135. var msg = new ArtifactUpElementAllRequest()
  136. {
  137. type = elementType
  138. };
  139. NetModule.Request(msg);
  140. }
  141. /// <summary>
  142. /// 元素一键附魔(穿戴元素)
  143. /// </summary>
  144. /// <param name="elementType"></param>
  145. public void SendToWearElementByOnekey(int elementType)
  146. {
  147. var msg = new ArtifactUseElementAllRequest()
  148. {
  149. type = elementType
  150. };
  151. NetModule.Request(msg);
  152. }
  153. /// <summary>
  154. /// 激活(解锁)元素
  155. /// </summary>
  156. /// <param name="elementId"></param>
  157. public void SendToUnlockElement(int elementId)
  158. {
  159. var msg = new ArtifactAddElementRequest()
  160. {
  161. elementId = elementId
  162. };
  163. NetModule.Request(msg);
  164. }
  165. #endregion
  166. /// <summary>
  167. /// 穿戴神器
  168. /// </summary>
  169. /// <param name="artifactId"></param>
  170. public void SendToWearArtifact(int artifactId)
  171. {
  172. var msg = new ArtifactShangzhenRequest()
  173. {
  174. artifactId = artifactId
  175. };
  176. NetModule.Request(msg);
  177. }
  178. /// <summary>
  179. /// 穿戴神器
  180. /// </summary>
  181. public void SendToTakeOffArtifact()
  182. {
  183. NetModule.Request(new ArtifactDownRequest() { });
  184. }
  185. }
  186. }