battle.proto 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201
  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. bytes configData = 6;
  49. // 是否生成配置数据
  50. bool generateConfigData = 7;
  51. }
  52. // // 领主信息
  53. // message BattleLordInfo {
  54. // // 领主ID
  55. // int64 lordId = 1;
  56. // // 名称
  57. // string name = 2;
  58. // // 等级
  59. // int32 level = 3;
  60. // // 头像
  61. // int32 iconID = 4;
  62. // // 头像框
  63. // int32 frameID = 5;
  64. // // 联盟名
  65. // string guildName = 6;
  66. // }
  67. // 阵营参数
  68. message BattleCampParam {
  69. // 阵营 BattleCampType
  70. int32 camp = 1;
  71. // 战斗力
  72. int64 power = 2;
  73. // 战斗小队
  74. repeated BattleSquadParam squads = 3;
  75. // 玩家唯一ID,0表示是怪物
  76. int64 playerID = 4;
  77. }
  78. // 战斗小队参数
  79. message BattleSquadParam {
  80. // 阵位索引
  81. int32 tileIndex = 1;
  82. // 战斗对象
  83. Fighter fighter = 2;
  84. // 小兵
  85. repeated BattleSoldierParam soldiers = 3;
  86. // 军团属性列表
  87. Attrs attrs = 4;
  88. // 兵种类型
  89. int32 troopsID = 5;
  90. // 兵种数量
  91. int32 troopsNum = 6;
  92. // 统兵上限数量
  93. int32 heroTroopNum = 7;
  94. // 首战兵种数量(连战)
  95. int32 firstTroopsNum = 8;
  96. }
  97. // 战斗对象
  98. message Fighter {
  99. // 唯一ID
  100. int64 id = 1;
  101. // 战斗对象类型 1:英雄 2:怪物
  102. int32 battleObjType = 2;
  103. // 配置ID
  104. int32 configID = 3;
  105. // 编队位置索引 默认0,前端用
  106. int32 tileIndex = 4;
  107. // 属性列表
  108. Attrs attrs = 5;
  109. // 技能列表
  110. repeated uint32 skills = 6;
  111. // 等级
  112. int32 level = 7;
  113. // 外显等级
  114. int32 displayLevel = 8;
  115. // 英雄星级
  116. int32 star = 9;
  117. // 是否死亡
  118. bool isDead = 10;
  119. }
  120. // 战斗小兵参数
  121. message BattleSoldierParam {
  122. // 配置ID
  123. int32 configID = 1;
  124. // 编队位置索引
  125. int32 tileIndex = 2;
  126. // 属性列表
  127. Attrs attrs = 3;
  128. // 技能列表
  129. repeated uint32 skills = 4;
  130. // 数量
  131. int32 num = 5;
  132. }
  133. // 阵营结果
  134. message BattleCampResult {
  135. // 阵营 BattleCampType
  136. int32 camp = 1;
  137. // 各个小队的结果
  138. repeated BattleSquadResult squadResults = 2;
  139. // 玩家唯一ID,0表示是怪物
  140. int64 playerID = 3;
  141. }
  142. // 小队结果
  143. message BattleSquadResult {
  144. // 战斗对象结果
  145. FighterResult fighterResult = 1;
  146. // 士兵剩余数量
  147. int32 soldierNum = 2;
  148. }
  149. // 战斗对象结果
  150. message FighterResult {
  151. // 唯一ID
  152. int64 id = 1;
  153. // 战斗对象类型 1:英雄 2:怪物
  154. int32 battleObjType = 2;
  155. // 配置ID
  156. int32 configID = 3;
  157. // 是否死亡
  158. bool isDead = 4;
  159. // 剩余血量万分比 (需要除以10000)
  160. int32 hp = 5;
  161. }
  162. // 战斗结果
  163. message BattleResult {
  164. // 胜利的阵营 -1表示平局
  165. int32 victoriousCamp = 1;
  166. // 结果校验码 相等时表示执行结果一致
  167. int64 checksum = 2;
  168. // 阵营结果
  169. repeated BattleCampResult campResult = 3;
  170. // 详细校验结果
  171. repeated BattleVerifyInfo verifyInfos = 4;
  172. // 配置数据
  173. bytes configData = 6;
  174. }
  175. // 校验详细信息
  176. message BattleVerifyInfo {
  177. // 类名
  178. string name = 1;
  179. // 校验码
  180. int64 checksum = 2;
  181. // 成员信息
  182. map<string, string> members = 3;
  183. // 子节点信息
  184. map<string, BattleVerifyInfo> children = 4;
  185. }