Quellcode durchsuchen

1.失落神庙满足条件后开启跳过战斗功能 2.统一onFightEnd()参数

gitxsm vor 1 Jahr
Ursprung
Commit
e60940bdb8

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

@@ -231,12 +231,12 @@ end
 
 
 -- 战斗结束回调 在发送GC_COMBAT_FINISH前
-local function onFightEnd(human, result, combatType, cbParam, combatInfo, isSaodang,param)
+local function onFightEnd(human, result, combatType, cbParam, combatInfo, param, isSaodang)
 	local moduleFn = getModule(combatType)
 	if not moduleFn then return end
 	if not moduleFn.onFightEnd then return end
 
-	moduleFn.onFightEnd(human, result, combatType, cbParam, combatInfo, isSaodang,param)
+	moduleFn.onFightEnd(human, result, combatType, cbParam, combatInfo, param, isSaodang)
 end
 
 -- 战斗名称
@@ -1296,7 +1296,7 @@ function combatBegin(human, mapID, param, combatType, cbParam, isSaodang)
 	local isQuick = human.db.combatQuick[combatType] == 1-- 是否跳过战斗
 	if isSaodang or isQuick then 
 		-- 扫荡/跳过战斗需要立刻出结果
-		onFightEnd(human, result, combatType, cbParam, combatInfo, isSaodang,param)
+		onFightEnd(human, result, combatType, cbParam, combatInfo, param, isSaodang)
 		sendCombatFinish(human, combatInfo)
 	else
 		-- 发送战斗开始+战斗帧

+ 1 - 1
script/module/friend/FriendLogic.lua

@@ -457,7 +457,7 @@ function fight(human, args)
 end
 
 
-function onFightEnd(human, result, combatType, cbParam, combatInfo, isSaodang)
+function onFightEnd(human, result, combatType, cbParam, combatInfo, param, isSaodang)
     local videoUuid = CombatVideo.saveCombatVideo(human, true)
     if videoUuid then		
        local msgRet = Msg.gc.GC_COMBAT_RETURN_RECORD

+ 1 - 1
script/module/jjcLadder/JjcLadderLogic.lua

@@ -530,7 +530,7 @@ function fight(human, args, combatType)
 end
 
 -- 战斗结束回调
-function onFightEnd(human, result, combatType, cbParam, combatInfo, isSaodang, param)
+function onFightEnd(human, result, combatType, cbParam, combatInfo, param, isSaodang)
 	print("   onFightEnd   onFightEnd  onFightEnd onFightEnd")
 	--print("fight end", result, combatInfo, result)
 	if not cbParam or not cbParam.uuid then

+ 2 - 0
script/module/lostTemple/Proto.lua

@@ -65,6 +65,8 @@ GC_LOST_TEMPLE_MONSTER = {
     { "gdReward", 10, ItemData },
     { "randomReward", 10, ItemData },
     { "list", 6, HeroSimple },
+    {"quick",     1,       "byte"},    -- 是否勾选了跳过,0-没有勾选,1-勾选了
+    {"showNext",  1,       "byte"},    -- 是否显示跳过,0-不显示,1-显示
 }
 
 -- 英雄信息

+ 8 - 0
script/module/lostTemple/lostTempleCombatLogic.lua

@@ -26,6 +26,8 @@ local BeSkill = require("combat.BeSkill")
 local Skill = require("combat.Skill")
 local RoleAttr = require("role.RoleAttr")
 local ItemDefine = require("bag.ItemDefine")
+local Broadcast = require("broadcast.Broadcast")
+local Lang = require("common.Lang")
 
 
 -------------------------------------- combat -----------------------------------------
@@ -238,6 +240,12 @@ function fight(human, args)
     if not grid then return end
     if not grid.monsterOutID then return end
 
+    local power = CombatPosLogic.getCombatHeroZDL(human, CombatDefine.COMBAT_TYPE24)
+    if power <= 0 then
+        Broadcast.sendErr(human, Lang.COMBAT_ERR_NO_SET_FIGHT)
+        return
+    end
+
     CombatLogic.combatBegin(human, 1001, args, CombatDefine.COMBAT_TYPE24)
 end
 

+ 14 - 0
script/module/lostTemple/lostTempleLogic.lua

@@ -38,6 +38,9 @@ DAY_7s = 604800
 DAY_2s = 172800
 DAY_1s = 86400
 
+--跳过战斗需要的战力
+local SHOWQUICKPOWER = 2000000
+
 function initAfterHot()
 
 end
@@ -807,6 +810,17 @@ local function monsterQuery(human, grid, elementConfig)
             HeroGrid.makeHeroSimpleByMonsterID(msgRet.list[msgRet.list[0]], monsterID, others)
         end
     end
+
+    msgRet.showNext = 0
+    if human.db.zhandouli >= SHOWQUICKPOWER then
+        msgRet.showNext = 1
+    end
+
+    msgRet.quick = 0
+    if human.db.combatQuick[CombatDefine.COMBAT_TYPE24] == 1 then
+        msgRet.quick = 1
+    end
+
     Msg.send(msgRet, human.fd)
 end
 

+ 1 - 1
script/module/valley/ValleyLogic.lua

@@ -1034,7 +1034,7 @@ function onFightBegin(human, cbParam)
 end
 
 -- 战斗结束回调
-function onFightEnd(human, result, combatType, cbParam, combatInfo, isSaodang)
+function onFightEnd(human, result, combatType, cbParam, combatInfo, param, isSaodang)
 	print("fight end", result, combatInfo, result)
 
 	-- 如果两边都没死,按照

+ 1 - 1
script/module/yjTreasure/YjTreasureCombat.lua

@@ -531,7 +531,7 @@ function sdMonsterOpenGrids(human,gridIndex,itemTb)
 	YjTreasureDBLogic.updateUuid2Role(roleData)
 end
 
-function onFightEnd(human, result, type, gridIndex, combatInfo, isQuick)
+function onFightEnd(human, result, type, gridIndex, combatInfo, param, isQuick)
 	resetCombatHp(human.db._id,combatInfo,gridIndex) --刷新血量
 	if CombatDefine.RESULT_WIN == result then -- 胜利处理
 		killMonsterOpenGrids(human,gridIndex)