From 49bd65a05c9adf4e63dd5b261a7b3ff096e9809c Mon Sep 17 00:00:00 2001 From: sk <123456@qq.com> Date: Thu, 4 Jul 2024 15:00:57 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B5=9B=E5=AD=A3=E9=80=9A=E8=A1=8C=E8=AF=81?= =?UTF-8?q?=E5=8A=A0=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/constant.go | 2 ++ worldsrv/action_task.go | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/common/constant.go b/common/constant.go index 730ae3d..6a5e340 100644 --- a/common/constant.go +++ b/common/constant.go @@ -793,3 +793,5 @@ const ( ) const PermitStartTsKey = "permit_start_ts" + +const PermitAdd = 0.2 // 典藏通行证赛季积分多加,百分比 diff --git a/worldsrv/action_task.go b/worldsrv/action_task.go index 30fa879..b62c7c2 100644 --- a/worldsrv/action_task.go +++ b/worldsrv/action_task.go @@ -77,7 +77,7 @@ func SendReward(p *Player, m map[int64]int64, tp int32) { var items []*Item for k, v := range m { if k == common.ItemIDPermit && isPermit { - v += v / 2 // 增加50% + v += int64(float64(v) * common.PermitAdd) } items = append(items, &Item{ ItemId: int32(k), @@ -186,7 +186,7 @@ func CSTaskReward(s *netlib.Session, packetId int, data interface{}, sid int64) SendReward(p, data.Award, msg.Tp) for k, vv := range data.GetAward() { if k == common.ItemIDPermit && isPermit { - vv += vv / 2 // 增加50% + vv += int64(float64(vv) * common.PermitAdd) } ret.Reward[k] = ret.Reward[k] + vv }