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

main
NorthLan 2 years ago
parent 061a54289f
commit 38956fbc72

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

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

@ -306,19 +306,20 @@ func (h *WW2GameLogic) handleGift(liveRoom *LiveRoom, user *pbCommon.PbUser, gif
h.reborn(room, user) h.reborn(room, user)
case config.GiftOvertime: case config.GiftOvertime:
h.overtime(room, user, gift.Price*gift.GiftNum) 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: case pbMq.MqGift_PACK:
// 宝箱 // 宝箱
h.chargeTank(room, user, gift.Price*gift.GiftNum) h.chargeTank(room, user, gift.Price*gift.GiftNum)
case pbMq.MqGift_RED_PACK: 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 { } else {
// 所有礼物-空投 // 所有礼物-空投
h.airdrop(room, user, gift.Price*gift.GiftNum) h.airdrop(room, user, gift.Price*gift.GiftNum)

Loading…
Cancel
Save