城市购买饱和系数
This commit is contained in:
parent
97b2284820
commit
28dc696beb
@ -50,15 +50,15 @@ func (this *apiComp) BuyOrSell(session comm.IUserSession, req *pb.CaravanBuyOrSe
|
|||||||
items := caravan.Items[k]
|
items := caravan.Items[k]
|
||||||
var price int32
|
var price int32
|
||||||
price = items.Price
|
price = items.Price
|
||||||
if cityConf := this.module.configure.GetCaravanCity(req.City); cityConf != nil {
|
// if cityConf := this.module.configure.GetCaravanCity(req.City); cityConf != nil {
|
||||||
for _, v := range cityConf.Exspecial {
|
// for _, v := range cityConf.Exspecial {
|
||||||
if v == k {
|
// if v == k {
|
||||||
price = cityConf.Exspecialnum * items.Price / 1000
|
// price = cityConf.Exspecialnum * items.Price / 1000
|
||||||
|
|
||||||
break
|
// break
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
}
|
// }
|
||||||
addScore += price * v // 卖出收益
|
addScore += price * v // 卖出收益
|
||||||
}
|
}
|
||||||
if this.module.ArrayBag(caravan, upperLimit) { // 背包满了
|
if this.module.ArrayBag(caravan, upperLimit) { // 背包满了
|
||||||
@ -109,6 +109,14 @@ func (this *apiComp) BuyOrSell(session comm.IUserSession, req *pb.CaravanBuyOrSe
|
|||||||
code = pb.ErrorCode_TrollCityUnSellItem // 城市不卖这个物品
|
code = pb.ErrorCode_TrollCityUnSellItem // 城市不卖这个物品
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if cityConf := this.module.configure.GetCaravanCity(req.City); cityConf != nil {
|
||||||
|
for _, v := range cityConf.Exspecial {
|
||||||
|
if v == k {
|
||||||
|
price = cityConf.Exspecialnum * caravan.Goods[k].Price / 1000
|
||||||
|
break
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
caravan.Items[k].Count += v
|
caravan.Items[k].Count += v
|
||||||
|
|
||||||
totla += price * v
|
totla += price * v
|
||||||
|
Loading…
Reference in New Issue
Block a user