feat: 添加指挥官礼物和坦克礼物测试指令以及礼物

main
NorthLan 2 years ago
parent 061a54289f
commit 38956fbc72

@ -114,15 +114,19 @@ Game:
GiftEffect:
# 辣条
Free: [ 1 ]
# 小花花
RestoreHealth: [ 31036, 31476 ]
# 牛哇牛哇
RestoreHealth: [ 31039, 31477, 31225, 31214, 31202 ]
SupportSkill: [ ]
# 告白气球,这个好诶
Paratroops: [ 31702, 31639, 30758, 30971, 31213, 31478 ]
# 打call
Reborn: [ 31485, 31641, 31212, 31037, 31278 ]
# 牛哇牛哇
Overtime: [31039, 31477, 31225, 31214, 31202]
# 小花花
Overtime: [ 31036, 31476 ]
# 粉丝团灯牌
Commander: [ 31164,31738 ]
# 盛典门票
Tank: [ 30727 ]
TankRatio: 0.1
TankMulThreshold: 40000
TankMulRatio: 0.2

@ -10,6 +10,8 @@ type (
Paratroops []int64 // 空降小队
Reborn []int64 // 复活
Overtime []int64 // 加时道具
Commander []int64 // 指挥官道具
Tank []int64 // 坦克礼物
}
TankMulThreshold int64 // 坦克血量比例阈值
TankMulRatio float32 // 坦克血量阈值内对于金瓜子比例
@ -28,6 +30,7 @@ const (
GiftTank
GiftSpecial
GiftOvertime
GiftCommander
)
func (z Zhgww2) ParseGiftType(id int64) GiftType {
@ -43,6 +46,10 @@ func (z Zhgww2) ParseGiftType(id int64) GiftType {
return GiftSpecial
} else if z.isContains(id, z.GiftEffect.Overtime) {
return GiftOvertime
} else if z.isContains(id, z.GiftEffect.Commander) {
return GiftCommander
} else if z.isContains(id, z.GiftEffect.Tank) {
return GiftTank
}
return GiftTypeUnknown
}

@ -306,18 +306,19 @@ func (h *WW2GameLogic) handleGift(liveRoom *LiveRoom, user *pbCommon.PbUser, gif
h.reborn(room, user)
case config.GiftOvertime:
h.overtime(room, user, gift.Price*gift.GiftNum)
case config.GiftCommander:
for i := 0; i < int(gift.GiftNum); i++ {
h.becomeCommander(room, user)
}
case config.GiftTank:
h.chargeTank(room, user, gift.Price*gift.GiftNum)
}
case pbMq.MqGift_PACK:
// 宝箱
h.chargeTank(room, user, gift.Price*gift.GiftNum)
case pbMq.MqGift_RED_PACK:
// 红包
if gift.Price == 100*100 {
// 100电池
h.becomeCommander(room, user)
} else {
h.supportSpecialBomber(room, user, gift.Price*gift.GiftNum)
}
h.supportSpecialBomber(room, user, gift.Price*gift.GiftNum)
}
} else {
// 所有礼物-空投

Loading…
Cancel
Save