出售加价计算错误
This commit is contained in:
parent
28dc696beb
commit
a1f28a0ba6
@ -19,15 +19,15 @@
|
||||
"citymainlock": 11001,
|
||||
"cityman": 34006,
|
||||
"cityname": {
|
||||
"key": "asd",
|
||||
"key": "caravan_caravan_city_cityname_1",
|
||||
"text": "死湾"
|
||||
},
|
||||
"cityinformation": {
|
||||
"key": "asd",
|
||||
"key": "caravan_caravan_city_cityinformation_1",
|
||||
"text": "常年游荡在死湾的商人,这一区域或许只有他才敢在这里做生意。"
|
||||
},
|
||||
"citytxt": {
|
||||
"key": "asd",
|
||||
"key": "caravan_caravan_city_citytxt_1",
|
||||
"text": "死湾长年被一股胀气笼罩,这里的人们长年吸入这些气息,不知不觉已经产生了异变,他们自己称之为兽化病,年长的居民,会随着兽化病的加重,变成熊猫的模样,他们的人性会逐渐的被兽性所代替,最后彻底沦为一只只知道吃包子的直立行走的熊猫。"
|
||||
},
|
||||
"citytype": 1,
|
||||
@ -40,12 +40,12 @@
|
||||
],
|
||||
"specialnum": 500,
|
||||
"exspecial": [
|
||||
2,
|
||||
3,
|
||||
5
|
||||
],
|
||||
"exspecialnum": 1500,
|
||||
"Orspecial": 1000,
|
||||
"checktime": 180,
|
||||
"checktime": 1800,
|
||||
"cityeventpro": 50000,
|
||||
"cityevent": [
|
||||
1001
|
||||
@ -71,15 +71,15 @@
|
||||
"citymainlock": 11001,
|
||||
"cityman": 24004,
|
||||
"cityname": {
|
||||
"key": "asd",
|
||||
"key": "caravan_caravan_city_cityname_2",
|
||||
"text": "乱冢"
|
||||
},
|
||||
"cityinformation": {
|
||||
"key": "asd",
|
||||
"key": "caravan_caravan_city_cityinformation_2",
|
||||
"text": "常年游荡在乱冢的商人,这一区域或许只有他才敢在这里做生意。"
|
||||
},
|
||||
"citytxt": {
|
||||
"key": "asd",
|
||||
"key": "caravan_caravan_city_citytxt_2",
|
||||
"text": "乱冢长年被一股胀气笼罩,这里的人们长年吸入这些气息,不知不觉已经产生了异变,他们自己称之为兽化病,年长的居民,会随着兽化病的加重,变成熊猫的模样,他们的人性会逐渐的被兽性所代替,最后彻底沦为一只只知道吃包子的直立行走的熊猫。"
|
||||
},
|
||||
"citytype": 1,
|
||||
@ -97,7 +97,7 @@
|
||||
],
|
||||
"exspecialnum": 1600,
|
||||
"Orspecial": 1000,
|
||||
"checktime": 180,
|
||||
"checktime": 1800,
|
||||
"cityeventpro": 100000,
|
||||
"cityevent": [
|
||||
1001
|
||||
@ -124,15 +124,15 @@
|
||||
"citymainlock": 11001,
|
||||
"cityman": 25001,
|
||||
"cityname": {
|
||||
"key": "asd",
|
||||
"key": "caravan_caravan_city_cityname_3",
|
||||
"text": "陌城"
|
||||
},
|
||||
"cityinformation": {
|
||||
"key": "asd",
|
||||
"key": "caravan_caravan_city_cityinformation_3",
|
||||
"text": "常年游荡在陌城的商人,这一区域或许只有他才敢在这里做生意。"
|
||||
},
|
||||
"citytxt": {
|
||||
"key": "asd",
|
||||
"key": "caravan_caravan_city_citytxt_3",
|
||||
"text": "陌城长年被一股胀气笼罩,这里的人们长年吸入这些气息,不知不觉已经产生了异变,他们自己称之为兽化病,年长的居民,会随着兽化病的加重,变成熊猫的模样,他们的人性会逐渐的被兽性所代替,最后彻底沦为一只只知道吃包子的直立行走的熊猫。"
|
||||
},
|
||||
"citytype": 1,
|
||||
@ -150,7 +150,7 @@
|
||||
],
|
||||
"exspecialnum": 1700,
|
||||
"Orspecial": 1000,
|
||||
"checktime": 180,
|
||||
"checktime": 1800,
|
||||
"cityeventpro": 50000,
|
||||
"cityevent": [
|
||||
1001
|
||||
@ -177,15 +177,15 @@
|
||||
"citymainlock": 11001,
|
||||
"cityman": 45001,
|
||||
"cityname": {
|
||||
"key": "asd",
|
||||
"key": "caravan_caravan_city_cityname_4",
|
||||
"text": "暗窟"
|
||||
},
|
||||
"cityinformation": {
|
||||
"key": "asd",
|
||||
"key": "caravan_caravan_city_cityinformation_4",
|
||||
"text": "常年游荡在暗窟的商人,这一区域或许只有他才敢在这里做生意。"
|
||||
},
|
||||
"citytxt": {
|
||||
"key": "asd",
|
||||
"key": "caravan_caravan_city_citytxt_4",
|
||||
"text": "暗窟长年被一股胀气笼罩,这里的人们长年吸入这些气息,不知不觉已经产生了异变,他们自己称之为兽化病,年长的居民,会随着兽化病的加重,变成熊猫的模样,他们的人性会逐渐的被兽性所代替,最后彻底沦为一只只知道吃包子的直立行走的熊猫。"
|
||||
},
|
||||
"citytype": 1,
|
||||
@ -203,7 +203,7 @@
|
||||
],
|
||||
"exspecialnum": 1800,
|
||||
"Orspecial": 1000,
|
||||
"checktime": 180,
|
||||
"checktime": 1800,
|
||||
"cityeventpro": 100000,
|
||||
"cityevent": [
|
||||
1001
|
||||
@ -229,15 +229,15 @@
|
||||
"citymainlock": 11001,
|
||||
"cityman": 14007,
|
||||
"cityname": {
|
||||
"key": "asd",
|
||||
"key": "caravan_caravan_city_cityname_5",
|
||||
"text": "腐宴"
|
||||
},
|
||||
"cityinformation": {
|
||||
"key": "asd",
|
||||
"key": "caravan_caravan_city_cityinformation_5",
|
||||
"text": "常年游荡在腐宴的商人,这一区域或许只有他才敢在这里做生意。"
|
||||
},
|
||||
"citytxt": {
|
||||
"key": "asd",
|
||||
"key": "caravan_caravan_city_citytxt_5",
|
||||
"text": "腐宴长年被一股胀气笼罩,这里的人们长年吸入这些气息,不知不觉已经产生了异变,他们自己称之为兽化病,年长的居民,会随着兽化病的加重,变成熊猫的模样,他们的人性会逐渐的被兽性所代替,最后彻底沦为一只只知道吃包子的直立行走的熊猫。"
|
||||
},
|
||||
"citytype": 1,
|
||||
@ -255,7 +255,7 @@
|
||||
],
|
||||
"exspecialnum": 1900,
|
||||
"Orspecial": 1000,
|
||||
"checktime": 180,
|
||||
"checktime": 1800,
|
||||
"cityeventpro": 50000,
|
||||
"cityevent": [
|
||||
1001
|
||||
|
@ -2,14 +2,14 @@
|
||||
{
|
||||
"id": 1,
|
||||
"goodsname": {
|
||||
"key": "asdsad",
|
||||
"key": "caravan_caravan_city_goodsname_1",
|
||||
"text": "番茄"
|
||||
},
|
||||
"goodsinfor": {
|
||||
"key": "asdsad",
|
||||
"key": "caravan_caravan_city_goodsinfor_1",
|
||||
"text": "这是一个番茄"
|
||||
},
|
||||
"goodsicon": "fanqie_c",
|
||||
"goodsicon": "clmsg_ll_01",
|
||||
"goodsprice": 1000,
|
||||
"changeperiod": [
|
||||
5,
|
||||
@ -40,14 +40,14 @@
|
||||
{
|
||||
"id": 2,
|
||||
"goodsname": {
|
||||
"key": "asdsad",
|
||||
"key": "caravan_caravan_city_goodsname_2",
|
||||
"text": "苹果"
|
||||
},
|
||||
"goodsinfor": {
|
||||
"key": "asdsad",
|
||||
"key": "caravan_caravan_city_goodsinfor_2",
|
||||
"text": "这是一个苹果"
|
||||
},
|
||||
"goodsicon": "fanqie_c",
|
||||
"goodsicon": "clmsg_ll_02",
|
||||
"goodsprice": 900,
|
||||
"changeperiod": [
|
||||
5,
|
||||
@ -78,14 +78,14 @@
|
||||
{
|
||||
"id": 3,
|
||||
"goodsname": {
|
||||
"key": "asdsad",
|
||||
"key": "caravan_caravan_city_goodsname_3",
|
||||
"text": "手机"
|
||||
},
|
||||
"goodsinfor": {
|
||||
"key": "asdsad",
|
||||
"key": "caravan_caravan_city_goodsinfor_3",
|
||||
"text": "这是一个手机"
|
||||
},
|
||||
"goodsicon": "fanqie_c",
|
||||
"goodsicon": "clmsg_ll_03",
|
||||
"goodsprice": 500,
|
||||
"changeperiod": [
|
||||
5,
|
||||
@ -116,14 +116,14 @@
|
||||
{
|
||||
"id": 4,
|
||||
"goodsname": {
|
||||
"key": "asdsad",
|
||||
"key": "caravan_caravan_city_goodsname_4",
|
||||
"text": "干果"
|
||||
},
|
||||
"goodsinfor": {
|
||||
"key": "asdsad",
|
||||
"key": "caravan_caravan_city_goodsinfor_4",
|
||||
"text": "这是一个干果"
|
||||
},
|
||||
"goodsicon": "fanqie_c",
|
||||
"goodsicon": "clmsg_ll_04",
|
||||
"goodsprice": 1500,
|
||||
"changeperiod": [
|
||||
5,
|
||||
@ -154,14 +154,14 @@
|
||||
{
|
||||
"id": 5,
|
||||
"goodsname": {
|
||||
"key": "asdsad",
|
||||
"text": "干果"
|
||||
"key": "caravan_caravan_city_goodsname_5",
|
||||
"text": "矿石"
|
||||
},
|
||||
"goodsinfor": {
|
||||
"key": "asdsad",
|
||||
"text": "这是一个干果"
|
||||
"key": "caravan_caravan_city_goodsinfor_5",
|
||||
"text": "这是一个矿石"
|
||||
},
|
||||
"goodsicon": "fanqie_c",
|
||||
"goodsicon": "clmsg_ll_05",
|
||||
"goodsprice": 2300,
|
||||
"changeperiod": [
|
||||
5,
|
||||
@ -192,14 +192,14 @@
|
||||
{
|
||||
"id": 6,
|
||||
"goodsname": {
|
||||
"key": "asdsad",
|
||||
"text": "干果"
|
||||
"key": "caravan_caravan_city_goodsname_6",
|
||||
"text": "饼干"
|
||||
},
|
||||
"goodsinfor": {
|
||||
"key": "asdsad",
|
||||
"text": "这是一个干果"
|
||||
"key": "caravan_caravan_city_goodsinfor_6",
|
||||
"text": "这是一个饼干"
|
||||
},
|
||||
"goodsicon": "fanqie_c",
|
||||
"goodsicon": "clmsg_ll_06",
|
||||
"goodsprice": 1130,
|
||||
"changeperiod": [
|
||||
5,
|
||||
|
@ -50,15 +50,15 @@ func (this *apiComp) BuyOrSell(session comm.IUserSession, req *pb.CaravanBuyOrSe
|
||||
items := caravan.Items[k]
|
||||
var price int32
|
||||
price = items.Price
|
||||
// if cityConf := this.module.configure.GetCaravanCity(req.City); cityConf != nil {
|
||||
// for _, v := range cityConf.Exspecial {
|
||||
// if v == k {
|
||||
// price = cityConf.Exspecialnum * items.Price / 1000
|
||||
for _, v := range cityInfo.Special {
|
||||
if v == k {
|
||||
if cityConf := this.module.configure.GetCaravanCity(req.City); cityConf != nil {
|
||||
price = cityConf.Specialnum * price / 1000
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
// break
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
addScore += price * v // 卖出收益
|
||||
}
|
||||
if this.module.ArrayBag(caravan, upperLimit) { // 背包满了
|
||||
@ -98,9 +98,6 @@ func (this *apiComp) BuyOrSell(session comm.IUserSession, req *pb.CaravanBuyOrSe
|
||||
price = caravan.Goods[k].Price
|
||||
for _, v := range cityInfo.Special {
|
||||
if v == k {
|
||||
if cityConf := this.module.configure.GetCaravanCity(req.City); cityConf != nil {
|
||||
price = cityConf.Specialnum * price / 1000
|
||||
}
|
||||
bFound = true
|
||||
break
|
||||
}
|
||||
@ -109,14 +106,6 @@ func (this *apiComp) BuyOrSell(session comm.IUserSession, req *pb.CaravanBuyOrSe
|
||||
code = pb.ErrorCode_TrollCityUnSellItem // 城市不卖这个物品
|
||||
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
|
||||
|
||||
totla += price * v
|
||||
|
Loading…
Reference in New Issue
Block a user