소스 검색

1.修改战斗逻辑——触发物连后身上控制buff只有chanrao时,可以触发物连 2.修改战斗逻辑——新增战斗时采用的属性:剩余血量百分比 3.处理穿着的装备洗练属性后没有及时刷新英雄面板问题

gitxsm 1 년 전
부모
커밋
745f5843aa

+ 6 - 6
script/module/battle/BattleLogic.lua

@@ -3741,13 +3741,13 @@ function BattleLogic_AddMopup(human, nGoodsID, nGoodsNum)
         return
     end
 
-    -- 检测数量
-    if false == BagLogic.checkItemCnt(human, nGoodsID, nGoodsNum) then
-        return
-    end
+    -- -- 检测数量
+    -- if false == BagLogic.checkItemCnt(human, nGoodsID, nGoodsNum) then
+    --     return
+    -- end
 
-    -- 消耗物品
-    BagLogic.delItem(human, nGoodsID, nGoodsNum, "battle")
+    -- -- 消耗物品
+    -- BagLogic.delItem(human, nGoodsID, nGoodsNum, "battle")
 
     -- 增加次数
     BattleLogic_SetAddFreeMopupNum(human, nGoodsNum)

+ 23 - 0
script/module/combat/CombatBuff.lua

@@ -44,6 +44,29 @@ function isStop(obj)
 	return ret
 end
 
+--判断英雄身上是否只有控制buff中的charao
+function IsJustHaveChanraoBuff(obj)
+	if not obj then
+		return false
+	end
+
+	local bufferCmd = obj.bufferCmd
+	if not bufferCmd then
+		return false
+	end
+	
+	if bufferCmd["xuanyun"] or bufferCmd["shihua"] or bufferCmd["bingdong"] then
+		return false
+	end
+
+	if bufferCmd["chanrao"] then
+		return true
+	end
+	return false
+end
+
+
+
 --使用主动技能
 function isJingji(obj)
 	if obj.bufferCmd["jinmo"] then

+ 4 - 1
script/module/combat/CombatImpl.lua

@@ -1023,7 +1023,10 @@ end
 function comboAgain(obj, type, hurtRate, comboSkillID, skip)
     if not obj or obj.hp <=0 then return end
 	local stop = CombatBuff.isStop(obj)
-    if stop and skip == nil then return end
+
+	--新增条件,如果控制buff只有chanrao也能继续执行
+	if stop and skip == nil and not CombatBuff.IsJustHaveChanraoBuff(obj)  then return end
+
     local skillID = comboSkillID or getSkillID(obj)
     if skillID then
        comboType = type

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

@@ -423,7 +423,20 @@ function getValue(obj,key)
 	if obj.isPet then
 		return 0
 	end
-	return obj.attr[key] or 0
+
+	if key == RoleDefine.SUB_HP_COMBAT then
+		local hpNow = obj.hp or 0
+		local hpMax = getHpMax(obj) or 0
+		if hpMax <= 0 then
+			print(string.format("战斗数据错误, obj.id: %d, obj.pos: %d", obj.id, obj.pos))
+			return 0
+		end
+		local res = hpNow / hpMax
+		res = math.floor(res * 10000) --取到小数点后四位,再转成整数
+		return res
+	else
+		return obj.attr[key] or 0
+	end
 end
 
 function setValue(obj,key,value)

+ 9 - 0
script/module/equip/EquipWash.lua

@@ -12,6 +12,7 @@ local Broadcast = require("broadcast.Broadcast")
 local HeroLogic = require("hero.HeroLogic")
 local Util = require("common.Util")
 local HeroGrowUp = require("absAct.HeroGrowUp")
+local ObjHuman = require("core.ObjHuman")
 
 -- 取出合适的装备
 local function getEquipGrid(human, bagIndex, heroUuid, pos)
@@ -252,4 +253,12 @@ function randomSave(human, bagIndex, heroUuid, pos)
 
     Broadcast.sendErr(human, Lang.EQUIP_WASH_SAVE_SUC)
     randomQuery(human, bagIndex, heroUuid, pos)
+
+    --刷新属性
+    local heroGrid, heroIndex = HeroLogic.getHeroGridByUuid(human, heroUuid)
+    if not heroGrid or not heroIndex or not heroGrid.id then
+        return Broadcast.sendErr(human, Lang.DRILL_CHOOSE_FRIEND_ERR_INFO)
+    end
+    ObjHuman.doCalcHero(human, heroIndex)
+    HeroLogic.sendHeroBagDynamic(human, heroGrid.id, heroIndex)
 end

+ 1 - 0
script/module/role/RoleDefine.lua

@@ -138,6 +138,7 @@ INIT_HP_COMBAT		= 312 --战斗时的初始血量
 HURT_RATE_MAX 		= 313 --最大伤害率(最大血量为基数)
 BACKUP_COMBAT		= 314 -- 援军替换站位
 HURT_COMBAT_TOTAL	= 315 -- 总伤害
+SUB_HP_COMBAT		= 316 --剩余血量百分比
 
 JIANSHANG_RATE_MAX	= 7000 --减伤率上限7000
 DEFAUT_MINGZHONG = 10000 -- 默认命中