Commit 98761edcf49836f9eda17d8185e02ad3fa64d623

Authored by zhouhaihai
1 parent ccbafe67

buff 补充

src/actions/GmAction.lua
@@ -292,13 +292,17 @@ end @@ -292,13 +292,17 @@ end
292 292
293 table.insert(helpDes, {"获取冒险内道具", "advit"}) 293 table.insert(helpDes, {"获取冒险内道具", "advit"})
294 function _M.advit(role, pms) 294 function _M.advit(role, pms)
295 - local advItems = role:getProperty("advItems") 295 + local reward = {}
296 for k, v in pairs(csvdb["adv_itemCsv"]) do 296 for k, v in pairs(csvdb["adv_itemCsv"]) do
297 if csvdb["itemCsv"][k] and v.effect ~= 0 then 297 if csvdb["itemCsv"][k] and v.effect ~= 0 then
298 - advItems = advItems:incrv(k, 1) 298 + reward[k] = 1
299 end 299 end
300 end 300 end
301 - role:updateProperty({field = "advItems", value = advItems}) 301 + for k , v in pairs(csvdb["adv_artifactCsv"]) do
  302 + reward[k] = 1
  303 + end
  304 + local adv = role:getAdvData()
  305 + adv:award(reward)
302 return "成功" 306 return "成功"
303 end 307 end
304 308
src/adv/AdvBattle.lua
@@ -62,7 +62,7 @@ function Battle:initPlayer() @@ -62,7 +62,7 @@ function Battle:initPlayer()
62 for _, hero in pairs(attrs) do 62 for _, hero in pairs(attrs) do
63 player[attrName] = (player[attrName] or 0) + hero[attrName] 63 player[attrName] = (player[attrName] or 0) + hero[attrName]
64 end 64 end
65 - palyer.growth[attrName] = player[attrName] * 0.025 65 + player.growth[attrName] = player[attrName] * 0.025
66 end 66 end
67 67
68 player.hpMax = player.hp or 0 68 player.hpMax = player.hp or 0
src/adv/AdvBuff.lua
@@ -27,9 +27,9 @@ Buff.EXP_UP = 24 -- 杀敌经验提高 @@ -27,9 +27,9 @@ Buff.EXP_UP = 24 -- 杀敌经验提高
27 Buff.DISABLE_BUFF = 25 -- 禁用固有技 27 Buff.DISABLE_BUFF = 25 -- 禁用固有技
28 Buff.ATTR_CHANGE_COND = 26 --属性变化(状态)有条件 28 Buff.ATTR_CHANGE_COND = 26 --属性变化(状态)有条件
29 Buff.CHANGE_DROP_TO_CLICK = 27 --掉落转换为click 29 Buff.CHANGE_DROP_TO_CLICK = 27 --掉落转换为click
30 -Buff.SP_MAX_CHANGE = 28, -- 魔法上限  
31 -Buff.ITEM_GET_UP = 29, -- 获得道具数量增加  
32 -Buff.Buff_EFFECT_CHANGE = 30, -- 改变 buff 效果 30 +Buff.SP_MAX_CHANGE = 28 -- 魔法上限
  31 +Buff.ITEM_GET_UP = 29 -- 获得道具数量增加
  32 +Buff.Buff_EFFECT_CHANGE = 30 -- 改变 buff 效果
33 33
34 --角色一些属性的变化 34 --角色一些属性的变化
35 local function commonAttr(_Buff, attrName) 35 local function commonAttr(_Buff, attrName)
@@ -55,16 +55,41 @@ end @@ -55,16 +55,41 @@ end
55 local function commonAttCond(_Buff, attrName) 55 local function commonAttCond(_Buff, attrName)
56 _Buff._init = function(self, data) --初始化变化值 56 _Buff._init = function(self, data) --初始化变化值
57 self._changeV = self:_calculate() 57 self._changeV = self:_calculate()
58 - self.owner:reSetAttr(attrName) 58 + self:_reSetAttr(true)
59 end 59 end
60 _Buff._overlay = function(self) 60 _Buff._overlay = function(self)
61 self._changeV = (self._changeV or 0) + self:_calculate() 61 self._changeV = (self._changeV or 0) + self:_calculate()
62 - self.owner:reSetAttr(attrName) 62 + self:_reSetAttr(true)
63 end 63 end
64 _Buff._uncover = function(self) 64 _Buff._uncover = function(self)
65 self._changeV = self._changeV - self._changeV / (self.layer + 1) 65 self._changeV = self._changeV - self._changeV / (self.layer + 1)
66 - self.owner:reSetAttr(attrName) 66 + self:_reSetAttr()
  67 + end
  68 +
  69 + _Buff._hpChange = function(self)
  70 + local oldHpMax = self.owner.hpMax
  71 + self.owner:reSetHpMax()
  72 +
  73 + local curValue = self.owner.hpMax - oldHpMax
  74 + if curValue > 0 then
  75 + self.owner:recover(curValue, self.release) -- 防止release不存在,地图点buff
  76 + elseif curValue < 0 then
  77 + self.owner:hurt(self.release and self.release:getHurtValue(-curValue) or -curValue, self.release, {hurtType = 2, buffId = self.id})
  78 + end
  79 + end
  80 +
  81 + _Buff._reSetAttr = function(self, isInit)
  82 + if attrName == "hp" then
  83 + if isInit then
  84 + self:_hpChange()
  85 + else
  86 + self.owner:reSetHpMax()
  87 + end
  88 + else
  89 + self.owner:reSetAttr(attrName)
  90 + end
67 end 91 end
  92 +
68 _Buff._calculate = function(self) 93 _Buff._calculate = function(self)
69 local effectCount = 0 94 local effectCount = 0
70 if self.buffData.effectValue4 == 0 then 95 if self.buffData.effectValue4 == 0 then
@@ -79,7 +104,7 @@ local function commonAttCond(_Buff, attrName) @@ -79,7 +104,7 @@ local function commonAttCond(_Buff, attrName)
79 return self.buffData.effectValue1, self._changeV, attrName 104 return self.buffData.effectValue1, self._changeV, attrName
80 end 105 end
81 _Buff._endBuff = function(self, data) 106 _Buff._endBuff = function(self, data)
82 - self.owner:reSetAttr(attrName) 107 + self:_reSetAttr()
83 end 108 end
84 _Buff._getDB = function(self) 109 _Buff._getDB = function(self)
85 return {cv = self._changeV} 110 return {cv = self._changeV}
@@ -306,7 +331,7 @@ local BuffFactory = { @@ -306,7 +331,7 @@ local BuffFactory = {
306 _Buff._effectValue = function(self) 331 _Buff._effectValue = function(self)
307 return self.buffData.effectValue1, self.buffData.effectValue2 * self.layer 332 return self.buffData.effectValue1, self.buffData.effectValue2 * self.layer
308 end 333 end
309 - end 334 + end,
310 335
311 [Buff.ITEM_GET_UP] = function(_Buff) 336 [Buff.ITEM_GET_UP] = function(_Buff)
312 _Buff._effectValue = function(self) 337 _Buff._effectValue = function(self)
src/adv/AdvPlayer.lua
@@ -297,7 +297,9 @@ function BaseObject:reSetHpMax() @@ -297,7 +297,9 @@ function BaseObject:reSetHpMax()
297 end 297 end
298 end 298 end
299 end 299 end
300 - self.hpMax = math.max(1, self.hpMax) 300 + local effect = self:getAttrBuffChange("hp")
  301 + self.hpMax = (self.hpMax + effect[0]) * (1 + effect[1]))
  302 + self.hpMax = math.ceil(math.max(1, self.hpMax))
301 self.hp = math.min(self.hpMax, self.hp) 303 self.hp = math.min(self.hpMax, self.hp)
302 end 304 end
303 305