好感度调整

This commit is contained in:
meixiongfeng 2023-05-04 14:37:35 +08:00
parent 495d7172b4
commit a11dfcbaba

View File

@ -56,13 +56,13 @@ func (this *apiComp) UseGift(session comm.IUserSession, req *pb.LibraryUseGiftRe
code = pb.ErrorCode_LibraryGiveMaxCount code = pb.ErrorCode_LibraryGiveMaxCount
return return
} }
last := 1 var last int32 = 1
for iPos, v := range c { for _, v := range c {
for ; last <= iPos; last++ { for ; last <= v.K; last++ {
attenuation[int32(last)] = v.V // 3,1000|6,500|9,250 attenuation[int32(last)] = v.V // 3,1000|6,500|9,250
} }
} }
for i := _heroObj.Givecount; i <= _heroObj.Givecount+req.Counts; i++ { for i := _heroObj.Givecount + 1; i <= _heroObj.Givecount+req.Counts; i++ {
addExp += attenuation[i] addExp += attenuation[i]
} }
@ -106,9 +106,8 @@ func (this *apiComp) UseGift(session comm.IUserSession, req *pb.LibraryUseGiftRe
code = pb.ErrorCode_ConfigNoFound code = pb.ErrorCode_ConfigNoFound
return return
} }
// 100*1 + 100*0.5 + 100*0.25 addExp *= itemConf.SpecialType
addExp *= itemConf.SpecialType / 1000 _heroObj.Favorexp += addExp / 1000
_heroObj.Favorexp += addExp
// 折算出等级 // 折算出等级
for { for {
@ -116,8 +115,8 @@ func (this *apiComp) UseGift(session comm.IUserSession, req *pb.LibraryUseGiftRe
_heroObj.Favorexp = 0 _heroObj.Favorexp = 0
break break
} }
if _exp[_heroObj.Favorlv] <= _heroObj.Favorexp { if _exp[_heroObj.Favorlv-1] <= _heroObj.Favorexp {
_heroObj.Favorexp -= _exp[_heroObj.Favorlv] _heroObj.Favorexp -= _exp[_heroObj.Favorlv-1]
_heroObj.Favorlv += 1 _heroObj.Favorlv += 1
upLv++ upLv++
} else { } else {