宠物宝藏宠物币上限也需乘以翻倍系数
This commit is contained in:
parent
852eb088fa
commit
519c8a7a68
@ -446,7 +446,7 @@ func ReqGmCommand_(player *Player, Command string) error {
|
||||
db.RedisDelKey(fmt.Sprintf("%s_%s", RANK_COUNTRY_USER, conf.Server.CountryCode))
|
||||
case "addFriendStar":
|
||||
FriendTreasureMod := player.PlayMod.getFriendTreasureMod()
|
||||
FriendTreasureMod.AddStar(200)
|
||||
FriendTreasureMod.AddStar(200, player.GetOrderFactor())
|
||||
case "comfortOrder":
|
||||
BaseMod := player.PlayMod.getBaseMod()
|
||||
BaseMod.LogoutTime = GoUtil.Now() - 7*86400
|
||||
|
||||
@ -56,8 +56,9 @@ func (f *FriendTreasureMod) InitGame(List []*msg.TreasureInfo, List2 []int32) {
|
||||
}
|
||||
|
||||
// 增加星级
|
||||
func (f *FriendTreasureMod) AddStar(Star int) {
|
||||
f.Star = min(200, f.Star+Star)
|
||||
func (f *FriendTreasureMod) AddStar(star, factor int) {
|
||||
limit := GoUtil.FormatStarItemNum(200, factor)
|
||||
f.Star = min(limit, f.Star+star)
|
||||
}
|
||||
|
||||
// 翻牌
|
||||
|
||||
@ -437,7 +437,7 @@ func ReqRewardOrder(player *Player, buf []byte) error {
|
||||
player.HandleInChampshipRank()
|
||||
}
|
||||
FriendTreasureMod := player.PlayMod.getFriendTreasureMod()
|
||||
FriendTreasureMod.AddStar(Star / 20)
|
||||
FriendTreasureMod.AddStar(Star/20, player.GetOrderFactor())
|
||||
player.PushClientRes(FriendTreasureMod.NotifyStar())
|
||||
// 限时事件增加进度
|
||||
LimitedTimeEventMod.AddProgress(player.GetPlayerBaseMod().GetLevel())
|
||||
|
||||
@ -727,9 +727,13 @@ func GetGeoInfo(ip string) (string, string, error) {
|
||||
func FormatStarItem(items []*item.Item, factor int) []*item.Item {
|
||||
for _, v := range items {
|
||||
if v.Id == item.ITEM_STAR_ID {
|
||||
Num := math.Round(float64(v.Num) * float64(factor) / 100)
|
||||
v.Num = int(Num) / 5 * 5
|
||||
v.Num = FormatStarItemNum(v.Num, factor)
|
||||
}
|
||||
}
|
||||
return items
|
||||
}
|
||||
|
||||
func FormatStarItemNum(num, factor int) int {
|
||||
Num := math.Round(float64(num) * float64(factor) / 100)
|
||||
return int(Num) / 5 * 5
|
||||
}
|
||||
|
||||
Loading…
Reference in New Issue
Block a user