battle.proto 3.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. // message结构的属性名请使用 驼峰小写字母开始
  2. syntax = "proto3";
  3. option go_package = "/pb";
  4. package pb;
  5. import "base_type.proto";
  6. // // 兵种
  7. // enum TroopType {
  8. // // 步兵
  9. // Infantry = 1;
  10. // // 骑兵
  11. // Cavalry = 2;
  12. // // 弓箭手
  13. // Archer = 3;
  14. // }
  15. // // 阵营类型
  16. // enum BattleCampType {
  17. // Camp1 = 0;
  18. // Camp2 = 1;
  19. // }
  20. // enum BattleType {
  21. // // 测试
  22. // Test = 1;
  23. // // 探险
  24. // Exploration = 2;
  25. // //
  26. // PVP = 3;
  27. // //
  28. // SLG = 4,
  29. // }
  30. message BattleReplay {
  31. int32 errorCode = 1;
  32. string errorText = 2;
  33. BattleResult result = 3;
  34. }
  35. // 战斗参数
  36. message BattleParam {
  37. // 随机种子数
  38. uint64 randomSeed = 1;
  39. // 地图ID
  40. uint32 mapID = 2;
  41. // 阵营数据
  42. repeated BattleCampParam camps = 3;
  43. // 是否需要生成详细校验数据
  44. bool isGenerateVerificationInfo = 4;
  45. // 战斗类型 BattleType 1:测试 2:探险 3:PVP 4:SLG
  46. int32 battleType = 5;
  47. }
  48. // // 领主信息
  49. // message BattleLordInfo {
  50. // // 领主ID
  51. // int64 lordId = 1;
  52. // // 名称
  53. // string name = 2;
  54. // // 等级
  55. // int32 level = 3;
  56. // // 头像
  57. // int32 iconID = 4;
  58. // // 头像框
  59. // int32 frameID = 5;
  60. // // 联盟名
  61. // string guildName = 6;
  62. // }
  63. // 阵营参数
  64. message BattleCampParam {
  65. // 阵营 BattleCampType
  66. int32 camp = 1;
  67. // 战斗力
  68. int64 power = 2;
  69. // 战斗小队
  70. repeated BattleSquadParam squads = 3;
  71. // 玩家唯一ID,0表示是怪物
  72. int64 playerID = 4;
  73. }
  74. // 战斗小队参数
  75. message BattleSquadParam {
  76. // 阵位索引
  77. int32 tileIndex = 1;
  78. // 战斗对象
  79. Fighter fighter = 2;
  80. // 小兵
  81. repeated BattleSoldierParam soldiers = 3;
  82. // 军团属性列表
  83. Attrs attrs = 4;
  84. // 兵种类型
  85. int32 troopsID = 5;
  86. // 兵种数量
  87. int32 troopsNum = 6;
  88. // 统兵上限数量
  89. int32 heroTroopNum = 7;
  90. // 首战兵种数量(连战)
  91. int32 firstTroopsNum = 8;
  92. }
  93. // 战斗对象
  94. message Fighter {
  95. // 唯一ID
  96. int64 id = 1;
  97. // 战斗对象类型 1:英雄 2:怪物
  98. int32 battleObjType = 2;
  99. // 配置ID
  100. int32 configID = 3;
  101. // 编队位置索引 默认0,前端用
  102. int32 tileIndex = 4;
  103. // 属性列表
  104. Attrs attrs = 5;
  105. // 技能列表
  106. repeated uint32 skills = 6;
  107. // 等级
  108. int32 level = 7;
  109. // 外显等级
  110. int32 displayLevel = 8;
  111. // 英雄星级
  112. int32 star = 9;
  113. // 是否死亡
  114. bool isDead = 10;
  115. }
  116. // 战斗小兵参数
  117. message BattleSoldierParam {
  118. // 配置ID
  119. int32 configID = 1;
  120. // 编队位置索引
  121. int32 tileIndex = 2;
  122. // 属性列表
  123. Attrs attrs = 3;
  124. // 技能列表
  125. repeated uint32 skills = 4;
  126. // 数量
  127. int32 num = 5;
  128. }
  129. // 阵营结果
  130. message BattleCampResult {
  131. // 阵营 BattleCampType
  132. int32 camp = 1;
  133. // 各个小队的结果
  134. repeated BattleSquadResult squadResults = 2;
  135. // 玩家唯一ID,0表示是怪物
  136. int64 playerID = 3;
  137. }
  138. // 小队结果
  139. message BattleSquadResult {
  140. // 战斗对象结果
  141. FighterResult fighterResult = 1;
  142. // 士兵剩余数量
  143. int32 soldierNum = 2;
  144. }
  145. // 战斗对象结果
  146. message FighterResult {
  147. // 唯一ID
  148. int64 id = 1;
  149. // 战斗对象类型 1:英雄 2:怪物
  150. int32 battleObjType = 2;
  151. // 配置ID
  152. int32 configID = 3;
  153. // 是否死亡
  154. bool isDead = 4;
  155. // 剩余血量万分比 (需要除以10000)
  156. int32 hp = 5;
  157. }
  158. // 战斗结果
  159. message BattleResult {
  160. // 胜利的阵营 -1表示平局
  161. int32 victoriousCamp = 1;
  162. // 结果校验码 相等时表示执行结果一致
  163. int64 checksum = 2;
  164. // 阵营结果
  165. repeated BattleCampResult campResult = 3;
  166. // 详细校验结果
  167. repeated BattleVerifyInfo verifyInfos = 4;
  168. }
  169. // 校验详细信息
  170. message BattleVerifyInfo {
  171. // 类名
  172. string name = 1;
  173. // 校验码
  174. int64 checksum = 2;
  175. // 成员信息
  176. map<string, string> members = 3;
  177. // 子节点信息
  178. map<string, BattleVerifyInfo> children = 4;
  179. }