diff --git a/src/models/RolePlugin.lua b/src/models/RolePlugin.lua index c1f9bfc..5d6ce52 100644 --- a/src/models/RolePlugin.lua +++ b/src/models/RolePlugin.lua @@ -581,7 +581,7 @@ function RolePlugin.bind(Role) function Role:costJade(param) self:addItem(param) self:checkTaskEnter("CostJade", {count = - param.count}) - self:checkWorldChangePoints({[ItemWorldLine.CostJade]=param.count}) + self:checkWorldChangePoints({[ItemWorldLine.CostJade]= -param.count}) end function Role:increBy(field, val) @@ -3270,18 +3270,19 @@ function RolePlugin.bind(Role) function Role:checkWorldChangePoints(param) local worldChangePoints = self:getProperty("worldChangePoints") or {} if param[ItemWorldLine.CostJade] then - worldChangePoints[ItemWorldLine.CostJade] = (worldChangePoints[ItemWorldLine.CostJade] or 0) + param[ItemWorldLine.CostDiamond] - local cost = math.floor(param[ItemWorldLine.CostJade] / globalCsv.worldline_count_currency) - worldChangePoints[ItemWorldLine.CostJade] = worldChangePoints[ItemWorldLine.CostJade] - cost - worldChangePoints[ItemWorldLine.RouletteCount] = worldChangePoints[ItemWorldLine.RouletteCount] + cost + worldChangePoints[ItemWorldLine.CostJade] = (worldChangePoints[ItemWorldLine.CostJade] or 0) + param[ItemWorldLine.CostJade] + local cost = math.floor(worldChangePoints[ItemWorldLine.CostJade] / globalCsv.worldline_gift) + worldChangePoints[ItemWorldLine.CostJade] = worldChangePoints[ItemWorldLine.CostJade] - cost * globalCsv.worldline_gift + worldChangePoints[ItemWorldLine.RouletteCount] = (worldChangePoints[ItemWorldLine.RouletteCount] or 0) + cost end if param[ItemWorldLine.CostDiamond] then worldChangePoints[ItemWorldLine.CostDiamond] = (worldChangePoints[ItemWorldLine.CostDiamond] or 0) + param[ItemWorldLine.CostDiamond] - local cost = math.floor(param[ItemWorldLine.CostDiamond] / globalCsv.worldline_count_currency) - worldChangePoints[ItemWorldLine.CostDiamond] = worldChangePoints[ItemWorldLine.CostDiamond] - cost - worldChangePoints[ItemWorldLine.Points] = worldChangePoints[ItemWorldLine.Points] + cost + local cost = math.floor(worldChangePoints[ItemWorldLine.CostDiamond] / globalCsv.worldline_count_currency) + worldChangePoints[ItemWorldLine.CostDiamond] = worldChangePoints[ItemWorldLine.CostDiamond] - cost * globalCsv.worldline_count_currency + worldChangePoints[ItemWorldLine.Points] = (worldChangePoints[ItemWorldLine.Points] or 0) + cost end + self:setProperty("worldChangePoints", worldChangePoints) end end -- libgit2 0.21.2