Commit 9f956e883ce4fa2d7a0d679b55c2e9d99ba9d73a

Authored by zhouhaihai
1 parent 9d0976a5

资助对积分的影响

Showing 2 changed files with 15 additions and 1 deletions   Show diff stats
src/adv/Adv.lua
... ... @@ -1250,7 +1250,7 @@ function Adv:scoreChange(scoreType, pms)
1250 1250 return
1251 1251 end
1252 1252 self.score[scoreType] = self.score[scoreType] or 0
1253   - self.score[scoreType] = self.score[scoreType] + score
  1253 + self.score[scoreType] = self.score[scoreType] + self.owner:fixAdvScoreChange(score)
1254 1254 end
1255 1255  
1256 1256 function Adv:getScore()
... ...
src/models/RolePlugin.lua
... ... @@ -890,6 +890,20 @@ function RolePlugin.bind(Role)
890 890 return level
891 891 end
892 892  
  893 + function Role:fixAdvScoreChange(score)
  894 + local change = 0
  895 + for i = 0, self:getProperty("advL")[1] do
  896 + local effects = csvdb["adv_level_fundCsv"][i].effect:toArray()
  897 + for _, one in ipairs(effects) do
  898 + local effect = one:toArray(true, "=")
  899 + if effect[1] == 3 then
  900 + change = change + effect[2]
  901 + end
  902 + end
  903 + end
  904 + return score * (1 + change / 100)
  905 + end
  906 +
893 907 function Role:getAdvLvAddAttrs()
894 908 -- 1=冒险队属性;1=点数/百分比=属性枚举=参数;属性枚举(1=生命上限/2=魔法上限/3=攻击/4=防御);点数/百分比(0=点数/1=百分比)
895 909 local attrs = {}
... ...