Commit 25e5cbb7b66e6a88d8a58489bb51f28ef12c5510

Authored by jiyue
2 parents d66e5487 c3f5ce22

Merge branch 'cn/develop' into cn/publish/preview

Showing 2 changed files with 52 additions and 18 deletions   Show diff stats
src/models/Diner.lua
@@ -232,7 +232,7 @@ function Diner:calSellReward(sell, delta, dishData, isExpedite) @@ -232,7 +232,7 @@ function Diner:calSellReward(sell, delta, dishData, isExpedite)
232 upValue[-1] = (upValue[-1] or 0) + collectAdd 232 upValue[-1] = (upValue[-1] or 0) + collectAdd
233 233
234 -- 电波塔加成 234 -- 电波塔加成
235 - local goldCount = (self.owner:getBnousDiner(4,addReward[ItemId.Gold])) * delta 235 + local goldCount = (self.owner:getBnousDiner(4,addReward[ItemId.Gold]/delta, true) + self.owner:getBnousByZero(4)) * delta
236 236
237 for id, count in pairs(addReward) do 237 for id, count in pairs(addReward) do
238 addReward[id] = math.floor(count * (1 + (upValue[id] or 0) / 100)) 238 addReward[id] = math.floor(count * (1 + (upValue[id] or 0) / 100))
src/models/RolePlugin.lua
@@ -2873,15 +2873,32 @@ function RolePlugin.bind(Role) @@ -2873,15 +2873,32 @@ function RolePlugin.bind(Role)
2873 return self.towerBnousActive 2873 return self.towerBnousActive
2874 end 2874 end
2875 2875
  2876 + function Role:bonusMerged(bonus1, bonus2)
  2877 + bonus1 = bonus1 or {}
  2878 + bonus2 = bonus2 or {}
  2879 +
  2880 + local bonus = {}
  2881 + bonus[0] = (bonus1[0] or 0) + (bonus2[0] or 0)
  2882 + bonus[1] = (bonus1[1] or 0) + (bonus2[1] or 0)
  2883 + return bonus
  2884 + end
  2885 +
  2886 + --计算公式是 (原价+固有提升数)*(1+赞誉度增幅中的百分比+电波塔中的百分比)
  2887 + --详细做法是 原价 + (原价+固有提升数) * (赞誉度增幅中的百分比+电波塔中的百分比) + 固有提升数
2876 function Role:getDeltaValue(result, value) 2888 function Role:getDeltaValue(result, value)
2877 if not result then return 0 end 2889 if not result then return 0 end
2878 local delta = 0 2890 local delta = 0
2879 - if result[1] and value then  
2880 - delta = math.floor(value * result[1] / 100)  
2881 - end  
2882 if result[0] then 2891 if result[0] then
2883 delta = delta + result[0] 2892 delta = delta + result[0]
2884 end 2893 end
  2894 +
  2895 + if result[1] and value then
  2896 + if delta == 0 then
  2897 + delta = delta * result[1] / 100
  2898 + else
  2899 + delta = (delta + value )* result[1] / 100
  2900 + end
  2901 + end
2885 return delta 2902 return delta
2886 end 2903 end
2887 2904
@@ -2894,32 +2911,49 @@ function RolePlugin.bind(Role) @@ -2894,32 +2911,49 @@ function RolePlugin.bind(Role)
2894 local towerBnous = self:getTowerBnousActive() 2911 local towerBnous = self:getTowerBnousActive()
2895 local levelBnous = self:getLevelBnous() 2912 local levelBnous = self:getLevelBnous()
2896 2913
2897 - local towerValue = self:getDeltaValue(towerBnous[SystemBnousType.CrusadeTask], value)  
2898 - local levelValue = self:getDeltaValue(levelBnous[SystemBnousType.CrusadeTask], value)  
2899 - return levelValue + towerValue 2914 + local bonus = self:bonusMerged(towerBnous[SystemBnousType.CrusadeTask], levelBnous[SystemBnousType.CrusadeTask])
  2915 + return self:getDeltaValue(bonus, value)
2900 end 2916 end
2901 2917
2902 - function Role:getBnousDiner(type, value) 2918 + function Role:getBnousDiner(type, value, flag)
2903 local towerBnous = self:getTowerBnousActive() 2919 local towerBnous = self:getTowerBnousActive()
2904 local levelBnous = self:getLevelBnous() 2920 local levelBnous = self:getLevelBnous()
2905 type = type or 1 2921 type = type or 1
2906 - local result, levelReault 2922 + local bonus
2907 if type == 1 then 2923 if type == 1 then
2908 - result = towerBnous[SystemBnousType.DinerGet]  
2909 - levelReault = levelBnous[SystemBnousType.DinerGet] 2924 + bonus = self:bonusMerged(towerBnous[SystemBnousType.DinerGet], levelBnous[SystemBnousType.DinerGet])
2910 elseif type == 2 then 2925 elseif type == 2 then
2911 - result = towerBnous[SystemBnousType.DinerLimit]  
2912 - levelReault = levelBnous[SystemBnousType.DinerLimit] 2926 + bonus = self:bonusMerged(towerBnous[SystemBnousType.DinerLimit], levelBnous[SystemBnousType.DinerLimit])
2913 elseif type == 3 then 2927 elseif type == 3 then
2914 - result = towerBnous[SystemBnousType.DinerSell]  
2915 - levelReault = levelBnous[SystemBnousType.DinerSell] 2928 + bonus = self:bonusMerged(towerBnous[SystemBnousType.DinerSell], levelBnous[SystemBnousType.DinerSell])
2916 elseif type == 4 then 2929 elseif type == 4 then
2917 - result = towerBnous[SystemBnousType.DinerPrice]  
2918 - levelReault = levelBnous[SystemBnousType.DinerPrice] 2930 + bonus = self:bonusMerged(towerBnous[SystemBnousType.DinerPrice], levelBnous[SystemBnousType.DinerPrice])
  2931 + end
  2932 + dump(bonus)
  2933 + if not flag then
  2934 + return self:getDeltaValue(bonus, value) + (bonus[0] or 0)
  2935 + else
  2936 + return self:getDeltaValue(bonus, value)
2919 end 2937 end
2920 - return self:getDeltaValue(result, value) + self:getDeltaValue(levelReault, value)  
2921 end 2938 end
2922 2939
  2940 + function Role:getBnousByZero(type)
  2941 + local towerBnous = self:getTowerBnousActive()
  2942 + local levelBnous = self:getLevelBnous()
  2943 + type = type or 1
  2944 + local bonus
  2945 + if type == 1 then
  2946 + bonus = self:bonusMerged(towerBnous[SystemBnousType.DinerGet], levelBnous[SystemBnousType.DinerGet])
  2947 + elseif type == 2 then
  2948 + bonus = self:bonusMerged(towerBnous[SystemBnousType.DinerLimit], levelBnous[SystemBnousType.DinerLimit])
  2949 + elseif type == 3 then
  2950 + bonus = self:bonusMerged(towerBnous[SystemBnousType.DinerSell], levelBnous[SystemBnousType.DinerSell])
  2951 + elseif type == 4 then
  2952 + bonus = self:bonusMerged(towerBnous[SystemBnousType.DinerPrice], levelBnous[SystemBnousType.DinerPrice])
  2953 + end
  2954 + return (bonus[0] or 0)
  2955 + end
  2956 +
2923 local function appendAdvBnous(dstBnous, srcBnous) 2957 local function appendAdvBnous(dstBnous, srcBnous)
2924 if not dstBnous and not srcBnous then return {} end 2958 if not dstBnous and not srcBnous then return {} end
2925 local result = clone(dstBnous or {}) 2959 local result = clone(dstBnous or {})