GameDefs.go 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127
  1. package wildapeslot
  2. import (
  3. "fmt"
  4. "bet24.com/log"
  5. )
  6. const (
  7. COLUMN_COUNT = 5
  8. ROW_COUNT = 3
  9. FREE_ROW_COUNT = 4
  10. RESULT_COUNT = 15 //免费玩法有20个元素
  11. FREE_RESULT_COUNT = 20 //普通情况
  12. GAMEID = 55
  13. GAME_NAME = "wildapeslot"
  14. GAME_MESSAGE = "wildapeslot"
  15. )
  16. // 中奖连线信息
  17. type Result struct {
  18. SlotID int // 格子ID
  19. SlotCount int // 数量
  20. WinShape int // 连线数值 从左到右,从个位数起 111表示第一行3个 1111第一行4个,333第三行三个
  21. WinRate float64 // 赢的倍数
  22. }
  23. func dumpSlots(slots []int) {
  24. for i := 0; i < ROW_COUNT; i++ {
  25. col := ""
  26. for c := 0; c < COLUMN_COUNT; c++ {
  27. d := slots[i*COLUMN_COUNT+c]
  28. if d >= 10 {
  29. col = fmt.Sprintf("%s %d", col, d)
  30. } else {
  31. col = fmt.Sprintf("%s %d", col, d)
  32. }
  33. }
  34. log.Color(LogColor, col)
  35. }
  36. }
  37. // 消息定义
  38. const (
  39. Msg_Bet = 1 // 下注
  40. Msg_Result = 2 // 发送结果
  41. //Msg_Jackpot = 3 // 获取彩池额度
  42. Msg_BetLevel = 3
  43. Msg_Slots = 4 // 获取目前使用的Slot类型
  44. //Msg_BetLevel = 5 // 下注配置信息
  45. Msg_WinShapes = 5
  46. Msg_GetConfig = 6 // 获取配置信息
  47. Msg_Broadcast = 7 // 奖池广播
  48. Msg_Enter = 8 // 进入游戏
  49. Msg_Exit = 9 // 离开游戏
  50. Msg_FreeAdConfig = 10 // 广告配置及自己的剩余
  51. Msg_UseAd = 11 // 看广告后请求免费次数
  52. )
  53. type DragonSlot_Message struct {
  54. MsgID int
  55. Data string
  56. }
  57. type DragonSlot_Bet struct {
  58. Amount int
  59. ErrorMsg string
  60. }
  61. type TestSlots struct {
  62. Slots []int
  63. }
  64. type DragonSlot_Result struct {
  65. BetAmount int // 下注金额
  66. WinAmount int // 共赢金额
  67. Slots []int // 15个格子ID
  68. Lines []Result // 中奖连线
  69. FreeApe bool // 3*3免费
  70. BonusFree int //bonus的免费次数
  71. WildCount int //wild个数
  72. }
  73. type JackPot_Broadcast struct {
  74. UserID int
  75. JackpotLevel int
  76. Amount int
  77. FaceID int
  78. FaceChangeIndex int
  79. FaceUrl string
  80. NickName string
  81. Vip int
  82. Sex int
  83. }
  84. type DragonSlot_Jackpot struct {
  85. Amount int
  86. }
  87. type DragonSlot_FreeAdBet struct {
  88. AdCount int
  89. BetLevel int
  90. }
  91. type DragonSlot_FreeAdConfig struct {
  92. TotalAdCount int // 每日免费次数
  93. AdCount int // 剩余次数
  94. FreeSpinCount int // 看广告后获取的免费次数
  95. Bet int // 本次看视频获得的底注
  96. AdBets []DragonSlot_FreeAdBet
  97. }
  98. // 下行数据,上行无数据
  99. type DragonSlot_UsedAd struct {
  100. FreeSpinCount int // 获取免费次数,如果为0 表示没有免费
  101. Bet int // 免费次数的底注
  102. AdCount int // 剩余次数
  103. NextAdBetAmount int // 下次广告的底注
  104. DragonId int
  105. }
  106. // 中免费的时候选择龙
  107. type DragonSlot_SelectDragon struct {
  108. DragonId int // 上行
  109. FreeCount int // 下行
  110. }