league.go 7.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175
  1. package enum
  2. import (
  3. "slices"
  4. )
  5. // 联盟旗帜类型
  6. const (
  7. League_FlagBg int32 = 1 // 旗帜-背景
  8. League_FlagIcon int32 = 2 // 旗帜-图标
  9. )
  10. // 联盟权限
  11. const (
  12. League_Permission_Member int32 = 1 // 人员管理
  13. League_Permission_Diplomacy int32 = 2 // 外交
  14. League_Permission_Castle int32 = 3 // 城池管理
  15. League_Permission_Construction int32 = 4 // 同盟建设
  16. League_Permission_Decree int32 = 5 // 发送法令邮件
  17. League_Permission_Command int32 = 6 // 发送指挥邮件
  18. )
  19. // 联盟日志
  20. const (
  21. Log_LeagueCreate int32 = 101 // {0}创建了联盟
  22. Log_LeagueJoin int32 = 102 // {0}加入了联盟
  23. Log_LeagueQuit int32 = 103 // {0}退出了联盟
  24. Log_LeagueKick int32 = 104 // {0}.{1}将{2}请离联盟
  25. Log_LeagueJobRegined int32 = 105 // {0}的{1}职位被撤销
  26. Log_LeagueCityAppoint int32 = 106 // {0}的城池{1}城主职位被任命
  27. Log_LeagueCityRevoke int32 = 107 // {0}的城池{1}城主职位被撤销
  28. Log_LeagueJobSet int32 = 108 // 盟主.{0}委任{1}为{2} 服务端:{0}玩家名称 {1}被任命玩家名称 {2}职位ID L-联盟-职位表职位ID
  29. Log_LeagueLeaderTransfer int32 = 109 // 盟主职位{0}已转让给{1} 服务端: {0}原盟主玩家名称 {1}新盟主玩家名称
  30. Log_LeagueLeaderImpeach int32 = 110 // 盟主{0}已被弹劾,新盟主变更为{1} 服务端: {0}原盟主玩家名称 {1}新盟主玩家名称
  31. Log_LeagueDeclareWar int32 = 201 // {0}对{1}的{2}{3}宣战 服务端:{0}玩家名称 {1}城池ID D-地图-城池表城池配置ID
  32. Log_LeagueDeclareCancel int32 = 202 // {0}终止了对{1}的{2}{3}宣战 服务端:{0}玩家名称 {1}城池ID D-地图-城池表城池配置ID
  33. Log_LeagueCaptureCity int32 = 203 // 我方攻占了{0}的{1}{2} 服务端:{0}城池ID D-地图-城池表城池配置ID
  34. Log_LeagueCaptureCity_Enemy int32 = 204 // {0}联盟攻占了我方的{1}{2} 服务端:{0}攻占联盟名称 {1}城池ID D-地图-城池表城池配置ID
  35. Log_LeagueBuildBuilding int32 = 301 // {0}{1}建造了建筑{2} 服务端:{0}职位ID L-联盟-职位表职位ID {1}玩家名称 {2}建筑ID D-建筑-建筑表建筑配置ID
  36. Log_LeagueGiveUpBuilding int32 = 302 // {0}{1}成功放弃了建筑{2} 服务端:{0}职位ID L-联盟-职位表职位ID {1}玩家名称 {2}建筑ID D-建筑-建筑表建筑配置ID
  37. Log_LeagueRelationChange int32 = 401 // 和联盟{0}的关系已成为{1} 服务端:{0}联盟名称 {1}关系类型ID 0联邦 1友盟
  38. Log_LeagueRelationBreak int32 = 402 // 和联盟{0}的{1}关系已解除 服务端:{0}联盟名称 {1}关系类型ID 0联邦 1友盟
  39. Log_LeagueRateUpdate int32 = 501 // {0}调整了{1}税率{2}->{3}
  40. Log_LeagueCollectResource int32 = 502 // {0}采集了{1}x{2},入库:{3}
  41. Log_LeagueTechUpgradeCost int32 = 503 // {0}消耗{1}x{2},学习了科技{3}
  42. Log_LeagueFRatioUpdate int32 = 601 // {0}调整了F币税率{1}->{2}
  43. Log_LeagueFundBonus int32 = 602 // {0}分配了F币x{1} 查看>
  44. Log_LeagueCollectResourceF int32 = 603 // {0}采集了F币x{1},入库:{2}
  45. )
  46. type LeagueMemberWarType int32
  47. // 联盟成员战绩类型
  48. const (
  49. LeagueWarType_Glory LeagueMemberWarType = 1 // 功勋
  50. LeagueWarType_Contribution LeagueMemberWarType = 2 // 贡献
  51. LeagueWarType_AttackCityCount LeagueMemberWarType = 3 // 攻城次数
  52. LeagueWarType_AttackCityValue LeagueMemberWarType = 4 // 攻城值
  53. LeagueWarType_CampaignsCount LeagueMemberWarType = 5 // 讨伐次数
  54. LeagueWarType_CampaignsNum LeagueMemberWarType = 6 // 讨伐数量
  55. LeagueWarType_CaptureResCount LeagueMemberWarType = 7 // 占领敌方资源地数
  56. LeagueWarType_CaptureCityCount LeagueMemberWarType = 8 // 击溃玩家主城数
  57. LeagueWarType_KillEnemyCount LeagueMemberWarType = 9 // 杀敌数
  58. )
  59. // 职位类型
  60. const (
  61. JobType_Leader int32 = 1 // 盟主
  62. )
  63. var (
  64. LeaguePermissionss = []int32{
  65. League_Permission_Member,
  66. League_Permission_Diplomacy,
  67. League_Permission_Castle,
  68. League_Permission_Construction,
  69. League_Permission_Decree,
  70. League_Permission_Command,
  71. }
  72. )
  73. func CheckLeaguePermissionExist(permID int32) bool {
  74. return slices.Contains(LeaguePermissionss, permID)
  75. }
  76. func GetSendLeagueMailPermission(mailType int32) int32 {
  77. switch mailType {
  78. case MailType_Decree, MailType_Union:
  79. return League_Permission_Decree
  80. case MailType_Command:
  81. return League_Permission_Command
  82. default:
  83. return 0
  84. }
  85. }
  86. // 联盟货币类型的id
  87. const (
  88. LeagueItemIDExp int32 = 20001 // 联盟经验
  89. LeagueItemIDSeasonScore int32 = 20101 // 联盟赛季积分
  90. LeagueItemIDWood int32 = 20201 // 木材
  91. LeagueItemIDIron int32 = 20202 // 铁矿
  92. LeagueItemIDStone int32 = 20203 // 石料
  93. LeagueItemIDGrain int32 = 20204 // 粮食
  94. LeagueItemIDF int32 = 20205 // F币
  95. )
  96. var (
  97. LeagueItemMaxNumList = []int32{ // 有上限货币道具ID列表
  98. LeagueItemIDWood,
  99. LeagueItemIDIron,
  100. LeagueItemIDStone,
  101. LeagueItemIDGrain,
  102. }
  103. LeagueCurrencyList = []int32{
  104. LeagueItemIDWood,
  105. LeagueItemIDIron,
  106. LeagueItemIDStone,
  107. LeagueItemIDGrain,
  108. LeagueItemIDF,
  109. LeagueItemIDExp,
  110. }
  111. )
  112. const (
  113. LeagueAttrMemberCountLimit int32 = 101 // 成员人数上限
  114. LeagueAttrCastleCountLimit int32 = 201 // 城池上限
  115. LeagueAttrCampCountLimit int32 = 301 // 联盟大营数量上限
  116. LeagueAttrCampLevelLimit int32 = 302 // 联盟大营等级上限
  117. LeagueAttrFlagCountLimit int32 = 401 // 旗帜数量上限
  118. LeagueAttrBarricadeCountLimit int32 = 501 // 拒马数量上限
  119. LeagueAttrBarricadeLevelLimit int32 = 502 // 拒马等级上限
  120. LeagueAttrArrowTowerCountLimit int32 = 601 // 箭塔数量上限
  121. LeagueAttrArrowTowerLevelLimit int32 = 602 // 箭塔等级上限
  122. LeagueAttrResTownCountLimit int32 = 701 // 联盟资源田数量上限
  123. LeagueAttrResTownLevelLimit int32 = 702 // 联盟资源田等级上限
  124. LeagueAttrResCapacity int32 = 801 // 联盟仓库资源存储上限(木石粮铁)
  125. LeagueAttrResCapacityProtect int32 = 802 // 联盟仓库资源保护上限
  126. LeagueAttrWoodYield int32 = 901 // 联盟木材产量 (每小时)
  127. LeagueAttrStoneYield int32 = 902 // 联盟石料产量 (每小时)
  128. LeagueAttrGrainYield int32 = 903 // 联盟粮食产量 (每小时)
  129. LeagueAttrIronYield int32 = 904 // 联盟铁矿产量 (每小时)
  130. LeagueAttrResidenceCountLimit int32 = 1000 // 可建筑驻地
  131. LeagueAttrResTownHp int32 = 1001 // 驻地耐久
  132. LeagueAttrResTownDefense int32 = 1002 // 驻地城防部队数量
  133. LeagueAttrBossLevelLimit int32 = 1101 // 联盟boss等级上限
  134. LeagueAttrSiegeCampLimit int32 = 1201 // 攻城大营数量上限
  135. )
  136. func IsLeagueCurrency(id int32) bool {
  137. return slices.Contains(LeagueCurrencyList, id)
  138. }
  139. const (
  140. LeagueDiplomacy_Umeng int32 = 1 // 联盟外交-友盟
  141. LeagueDiplomacy_Union int32 = 2 // 联盟外交-加入联邦邀请
  142. LeagueDiplomacy_ApplyAdd int32 = 1 // 联盟外交申请添加
  143. LeagueDiplomacy_ApplyDel int32 = 2 // 联盟外交申请删除
  144. )
  145. func IsNotLeagueDiplomacyType(applyType int32) bool {
  146. if applyType == LeagueDiplomacy_Umeng || applyType == LeagueDiplomacy_Union {
  147. return false
  148. }
  149. return true
  150. }
  151. const (
  152. LeagueMapBuildType_Res = 5 // 资源田类型
  153. )