Merge branch 'dev' of git.juzugame.com:b6-client/b6-lua into dev

This commit is contained in:
chenxi 2023-05-30 15:58:06 +08:00
commit 2ba96c7b3f
3 changed files with 42 additions and 1 deletions

View File

@ -41,6 +41,10 @@ function BattleManager:rspSkillRefresh(result)
end
end
function BattleManager:isInBattle()
return self.battleController ~= nil
end
function BattleManager:playBattle(battleType, params, returnFunc)
params = params or {}
if self.battleController then -- 同一时间只能有一场战斗

View File

@ -81,6 +81,16 @@ arg2:任务参数
Example: trig_event 22 5]],
type = "trig_event"
},
{
title = "添加buff",
desc = [[buff type:add_buff
arg1:buff名字
arg2:buff参数
arg3:buff回合数
arg4:buff生效对象12
Example: add_buff atkp_add 5000 2 1]],
type = "add_buff"
},
}
return GMConst

View File

@ -89,7 +89,13 @@ function GMToolUI:sendMsg(gmCommand)
else
local args = {}
args.args = string.split(gmCommand, " ")
if args.args[1] == "time" then -- 特殊处理
if args.args[1] == "add_buff" then -- 特殊处理
if not ModuleManager.BattleManager:isInBattle() then
Logger.logHighlight("不在战斗中")
return
end
self:dealAddBuffGm(args)
elseif args.args[1] == "time" then -- 特殊处理
local args1 = {}
args1.args = {}
args1.args[1] = args.args[1]
@ -106,4 +112,25 @@ function GMToolUI:updateTime()
uiMap["gm_tool_ui.time"]:setText(Time:formatTimeYMDHMS(Time:getServerTime()))
end
function GMToolUI:dealAddBuffGm(args)
local battleController = ModuleManager.BattleManager.battleController
local effect = {
["type"]=args.args[2],
["num"]=tonumber(args.args[3]),
["ratio"]=10000,
["round"]=tonumber(args.args[4])
}
local targetUnit = battleController.atkTeam:getMainUnit()
if tonumber(args.args[5]) == GConst.BattleConst.SIDE_DEF then
targetUnit = battleController.defTeam:getMainUnit()
end
local BattleBuffEntity = require "app/userdata/battle/skill/battle_buff_entity"
local buffEntity = BattleBuffEntity:create()
buffEntity:init(effect, targetUnit.unitEntity)
buffEntity:setTargetSide(targetUnit)
targetUnit:takeEffect(buffEntity, targetUnit)
self:closeUI()
end
return GMToolUI