diff --git a/config-dev.yml b/config-dev.yml index c993a01..e13acd3 100644 --- a/config-dev.yml +++ b/config-dev.yml @@ -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 diff --git a/config/zhgww2_config.go b/config/zhgww2_config.go index 49cf327..f00ccc6 100644 --- a/config/zhgww2_config.go +++ b/config/zhgww2_config.go @@ -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 } diff --git a/game/live_logic/ww2_handler.go b/game/live_logic/ww2_handler.go index 0494473..83d4d9a 100644 --- a/game/live_logic/ww2_handler.go +++ b/game/live_logic/ww2_handler.go @@ -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 { // 所有礼物-空投