From 38956fbc729ae694a6f46f0cb9a99ee069134e8b Mon Sep 17 00:00:00 2001 From: NorthLan <6995syu@163.com> Date: Sun, 2 Oct 2022 22:44:02 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E6=B7=BB=E5=8A=A0=E6=8C=87=E6=8C=A5?= =?UTF-8?q?=E5=AE=98=E7=A4=BC=E7=89=A9=E5=92=8C=E5=9D=A6=E5=85=8B=E7=A4=BC?= =?UTF-8?q?=E7=89=A9=E6=B5=8B=E8=AF=95=E6=8C=87=E4=BB=A4=E4=BB=A5=E5=8F=8A?= =?UTF-8?q?=E7=A4=BC=E7=89=A9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config-dev.yml | 12 ++++++++---- config/zhgww2_config.go | 7 +++++++ game/live_logic/ww2_handler.go | 13 +++++++------ 3 files changed, 22 insertions(+), 10 deletions(-) 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 { // 所有礼物-空投