Browse Source

敖丙技能实现

gitxsm 1 năm trước cách đây
mục cha
commit
ab5f430b48

+ 9 - 1
script/module/combat/CombatBuff.lua

@@ -319,7 +319,7 @@ function onBufferChange(obj)
 					local key = attrData[1]
                     local value = 0
                     if not conf.attrRate then
-                       value = attrData[2] 
+                       value = attrData[2]
                     else
                        value = conf.attrRate
                     end
@@ -990,6 +990,9 @@ function onHit(attacker, skillTargets, skillConfig, cmdTargets, otherArgs)
 
     local buffers = getSkillBuffers(skillConfig)
     local statusBuffRate = skillConfig.otherArgs.statusBuffRate
+	local jobRateAdd = skillConfig.otherArgs.jobRateAdd
+
+
     for i = 1, #buffers do
         local bufferID = buffers[i][1]
         if type(bufferID) == "table" then
@@ -1023,6 +1026,11 @@ function onHit(attacker, skillTargets, skillConfig, cmdTargets, otherArgs)
                 if statusBuffRate and bufferConf.cmd == statusBuffRate[1] and isStatus(target, statusBuffRate[2]) then
                     r = r + statusBuffRate[3]
                 end
+
+				if jobRateAdd and bufferConf.cmd == jobRateAdd[1] and isJob(target, jobRateAdd[2]) then
+					r = r + jobRateAdd[3]
+				end
+
                 if canAdd(target, bufferID, r, attacker, skillConfig) then
                     local arg
                     if bufferConf.cmd == "zuzhou" then

+ 5 - 3
script/module/combat/CombatLogic.lua

@@ -567,7 +567,7 @@ local function fontCombatHeroNet(net, obj)
 			end
 		end
 	end
-	net.hpMax = CombatObj.getHpMax(obj)
+	net.hpMax = obj.hpMax --CombatObj.getHpMax(obj)
 	net.hpNow = obj.initHp
 	net.icon = config.head
 	net.width = config.width
@@ -1090,7 +1090,8 @@ function recalcHpFightBegin(human, combatType, cbParam)
 				elseif combatType == CombatDefine.COMBAT_TYPE8 then
 					LianyuLogic.recalcHpFightBegin(human, i, atkObj)
                 end
-			end						
+			end
+			atkObj.hpMax = CombatObj.getHpMax(atkObj)
 			atkObj.hp = atkObj.hp or CombatObj.getHpMax(atkObj)
 			atkObj.mp = atkObj.mp or atkObj.attr[RoleDefine.INIT_MP]
 			atkObj.initHp = atkObj.hp
@@ -1106,7 +1107,8 @@ function recalcHpFightBegin(human, combatType, cbParam)
 				elseif combatType == CombatDefine.COMBAT_TYPE17 then
 					ValleyLogic.calcAttr(CombatDefine.DEFEND_SIDE, i, defObj, cbParam)
 				end	
-			end			
+			end
+			defObj.hpMax = CombatObj.getHpMax(defObj)
 			defObj.hp = defObj.hp or CombatObj.getHpMax(defObj)
 			defObj.mp = defObj.mp or defObj.attr[RoleDefine.INIT_MP]
 			defObj.initHp = defObj.hp

+ 10 - 1
script/module/combat/CombatObj.lua

@@ -10,6 +10,10 @@ local CombatImpl = require("combat.CombatImpl")
 
 objs	= objs or {} 		-- [pos]->obj
 helps	= helps or {}
+
+
+side2AddTimes = {}
+
 -- 初始化
 function initAfterStart()
 	for pos = 1, CombatDefine.COMBAT_HERO_ALL_CNT do
@@ -215,7 +219,7 @@ function calcAttr(obj)
 	local sysAttr 	= obj.sysAttr
 	local bufferAttr= obj.bufferAttr
 	local bufferAttr2 = obj.bufferAttr2
-	
+
 	for key, val in pairs(initAttr) do
 		attr[key] = val
 	end
@@ -236,6 +240,11 @@ function calcAttr(obj)
 
 	calcFinalAttr(attr)
 	checkLimit(attr)
+
+	if attr[RoleDefine.HP_RATE] > 0 and not side2AddTimes[obj.pos] then
+		obj.hp = getHpMax(obj)
+		side2AddTimes[obj.pos] = true
+	end
 end
 
 function getHpMax(obj)