league.go 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168
  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_LeagueDeclareWar int32 = 201 // {0}对地区的城池宣战
  29. Log_LeagueDeclareCancel int32 = 202 // {0}终止了对地区的城池宣战
  30. Log_LeagueCaptureCity int32 = 203 // 我方攻占了地区的{0}城池
  31. Log_LeagueCaptureCity_Enemy int32 = 204 // {0}联盟攻占了我方的{1}城池
  32. Log_LeagueRobbery_Enemy int32 = 205 // {0}联盟掠夺了我方驻地{1}
  33. Log_LeagueBuildBuilding int32 = 301 // 联盟{0}建造了建筑{1}
  34. Log_LeagueGiveUpBuilding int32 = 302 // 联盟管理{0}成功放弃了建筑{1}
  35. Log_LeagueRelationChange int32 = 401 // 和联盟{0}的关系已成为{1}
  36. Log_LeagueRelationBreak int32 = 402 // 和联盟{0}的{1}关系已解除
  37. Log_LeagueRateUpdate int32 = 501 // {0}调整了{1}税率{2}->{3}
  38. Log_LeagueCollectResource int32 = 502 // {0}采集了{1}x{2},入库:{3}
  39. Log_LeagueTechUpgradeCost int32 = 503 // {0}消耗{1}x{2},学习了科技{3}
  40. Log_LeagueFRatioUpdate int32 = 601 // {0}调整了F币税率{1}->{2}
  41. Log_LeagueFundBonus int32 = 602 // {0}分配了F币x{1} 查看>
  42. Log_LeagueCollectResourceF int32 = 603 // {0}采集了F币x{1},入库:{2}
  43. )
  44. type LeagueMemberWarType int32
  45. // 联盟成员战绩类型
  46. const (
  47. LeagueWarType_Glory LeagueMemberWarType = 1 // 功勋
  48. LeagueWarType_Contribution LeagueMemberWarType = 2 // 贡献
  49. LeagueWarType_AttackCityCount LeagueMemberWarType = 3 // 攻城次数
  50. LeagueWarType_AttackCityValue LeagueMemberWarType = 4 // 攻城值
  51. LeagueWarType_CampaignsCount LeagueMemberWarType = 5 // 讨伐次数
  52. LeagueWarType_CampaignsNum LeagueMemberWarType = 6 // 讨伐数量
  53. LeagueWarType_CaptureResCount LeagueMemberWarType = 7 // 占领敌方资源地数
  54. LeagueWarType_CaptureCityCount LeagueMemberWarType = 8 // 击溃玩家主城数
  55. LeagueWarType_KillEnemyCount LeagueMemberWarType = 9 // 杀敌数
  56. )
  57. // 职位类型
  58. const (
  59. JobType_Leader int32 = 1 // 盟主
  60. )
  61. var (
  62. LeaguePermissionss = []int32{
  63. League_Permission_Member,
  64. League_Permission_Diplomacy,
  65. League_Permission_Castle,
  66. League_Permission_Construction,
  67. League_Permission_Decree,
  68. League_Permission_Command,
  69. }
  70. )
  71. func CheckLeaguePermissionExist(permID int32) bool {
  72. return slices.Contains(LeaguePermissionss, permID)
  73. }
  74. func GetSendLeagueMailPermission(mailType int32) int32 {
  75. switch mailType {
  76. case MailType_Decree, MailType_Union:
  77. return League_Permission_Decree
  78. case MailType_Command:
  79. return League_Permission_Command
  80. default:
  81. return 0
  82. }
  83. }
  84. // 联盟货币类型的id
  85. const (
  86. LeagueItemIDExp int32 = 20001 // 联盟经验
  87. LeagueItemIDSeasonScore int32 = 20101 // 联盟赛季积分
  88. LeagueItemIDWood int32 = 20201 // 木材
  89. LeagueItemIDIron int32 = 20202 // 铁矿
  90. LeagueItemIDStone int32 = 20203 // 石料
  91. LeagueItemIDGrain int32 = 20204 // 粮食
  92. LeagueItemIDF int32 = 20205 // F币
  93. )
  94. var (
  95. LeagueItemMaxNumList = []int32{ // 有上限货币道具ID列表
  96. LeagueItemIDWood,
  97. LeagueItemIDIron,
  98. LeagueItemIDStone,
  99. LeagueItemIDGrain,
  100. }
  101. LeagueCurrencyList = []int32{
  102. LeagueItemIDWood,
  103. LeagueItemIDIron,
  104. LeagueItemIDStone,
  105. LeagueItemIDGrain,
  106. LeagueItemIDF,
  107. LeagueItemIDExp,
  108. }
  109. )
  110. const (
  111. LeagueAttrMemberCountLimit int32 = 101 // 成员人数上限
  112. LeagueAttrCastleCountLimit int32 = 201 // 城池上限
  113. LeagueAttrCampCountLimit int32 = 301 // 联盟大营数量上限
  114. LeagueAttrCampLevelLimit int32 = 302 // 联盟大营等级上限
  115. LeagueAttrFlagCountLimit int32 = 401 // 旗帜数量上限
  116. LeagueAttrRejectMarchCountLimit int32 = 501 // 拒马数量上限
  117. LeagueAttrRejectMarchLevelLimit int32 = 502 // 拒马等级上限
  118. LeagueAttrArrowTowerCountLimit int32 = 601 // 箭塔数量上限
  119. LeagueAttrArrowTowerLevelLimit int32 = 602 // 箭塔等级上限
  120. LeagueAttrResTownCountLimit int32 = 701 // 联盟资源田数量上限
  121. LeagueAttrResTownLevelLimit int32 = 702 // 联盟资源田等级上限
  122. LeagueAttrResCapacity int32 = 801 // 联盟仓库资源存储上限(木石粮铁)
  123. LeagueAttrResCapacityProtect int32 = 802 // 联盟仓库资源保护上限
  124. LeagueAttrWoodYield int32 = 901 // 联盟木材产量 (每小时)
  125. LeagueAttrStoneYield int32 = 902 // 联盟石料产量 (每小时)
  126. LeagueAttrGrainYield int32 = 903 // 联盟粮食产量 (每小时)
  127. LeagueAttrIronYield int32 = 904 // 联盟铁矿产量 (每小时)
  128. LeagueAttrResidenceCountLimit int32 = 1000 // 可建筑驻地
  129. LeagueAttrResTownHp int32 = 1001 // 驻地耐久
  130. LeagueAttrResTownDefense int32 = 1002 // 驻地城防部队数量
  131. LeagueAttrBossLevelLimit int32 = 1101 // 联盟boss等级上限
  132. )
  133. func IsLeagueCurrency(id int32) bool {
  134. return slices.Contains(LeagueCurrencyList, id)
  135. }
  136. const (
  137. LeagueDiplomacy_Umeng int32 = 1 // 联盟外交-友盟
  138. LeagueDiplomacy_Union int32 = 2 // 联盟外交-加入联邦邀请
  139. LeagueDiplomacy_ApplyAdd int32 = 1 // 联盟外交申请添加
  140. LeagueDiplomacy_ApplyDel int32 = 2 // 联盟外交申请删除
  141. )
  142. func IsNotLeagueDiplomacyType(applyType int32) bool {
  143. if applyType == LeagueDiplomacy_Umeng || applyType == LeagueDiplomacy_Union {
  144. return false
  145. }
  146. return true
  147. }