diff --git a/lua/app/module/battle/component/battle_unit_comp.lua b/lua/app/module/battle/component/battle_unit_comp.lua index 32a1614f..83997f09 100644 --- a/lua/app/module/battle/component/battle_unit_comp.lua +++ b/lua/app/module/battle/component/battle_unit_comp.lua @@ -1643,7 +1643,7 @@ function BattleUnitComp:takeDamageOrCure(atker, num, effectType, effectStatus, d self:onAttackOver() end - self.battleController:resetTimeSpeed() + self.battleController:resetTimeSpeed(true) self:changeState(UNIT_STATE.DEAD) elseif damage < 0 then diff --git a/lua/app/module/battle/controller/battle_controller.lua b/lua/app/module/battle/controller/battle_controller.lua index 13abc9d3..069c8acb 100644 --- a/lua/app/module/battle/controller/battle_controller.lua +++ b/lua/app/module/battle/controller/battle_controller.lua @@ -456,7 +456,13 @@ function BattleController:addTimeSpeed() DataManager.BattleData:addTimeSpeed() end -function BattleController:resetTimeSpeed() +function BattleController:resetTimeSpeed(isDeadReset) + if isDeadReset then + if self.skillSlowDownDuration then + return + end + end + DataManager.BattleData:resetTimeSpeed() if self.skillSlowDownDuration then self.skillSlowDownDuration = nil diff --git a/lua/app/module/gm/gm_const.lua b/lua/app/module/gm/gm_const.lua index 5aa68163..7460ba4b 100644 --- a/lua/app/module/gm/gm_const.lua +++ b/lua/app/module/gm/gm_const.lua @@ -91,6 +91,13 @@ arg4:buff生效对象,1己方,2敌方 Example: add_buff atkp_add 5000 2 1]], type = "add_buff" }, + { + title = "设置当前不可掉落元素", + desc = [[设置当前不可掉落元素type:set_seal_element +args:不掉落的元素类型 +Example: set_seal_element 1 2 3]], + type = "set_seal_element" + }, } return GMConst \ No newline at end of file diff --git a/lua/app/ui/gm/gm_tool_ui.lua b/lua/app/ui/gm/gm_tool_ui.lua index 593213cc..cf56575b 100644 --- a/lua/app/ui/gm/gm_tool_ui.lua +++ b/lua/app/ui/gm/gm_tool_ui.lua @@ -95,6 +95,12 @@ function GMToolUI:sendMsg(gmCommand) return end self:dealAddBuffGm(args) + elseif args.args[1] == "set_seal_element" then -- 特殊处理 + if not ModuleManager.BattleManager:isInBattle() then + Logger.logHighlight("不在战斗中") + return + end + self:dealSetSealElementGm(args.args) elseif args.args[1] == "time" then -- 特殊处理 local args1 = {} args1.args = {} @@ -133,4 +139,22 @@ function GMToolUI:dealAddBuffGm(args) self:closeUI() end +function GMToolUI:dealSetSealElementGm(args) + local battleController = ModuleManager.BattleManager.battleController + battleController.sealElementType = {} + local index = 2 + while true do + if not args[index] then + break + end + local elementType = tonumber(args[index]) + if not elementType then + break + end + battleController.sealElementType[elementType] = true + index = index + 1 + end + self:closeUI() +end + return GMToolUI diff --git a/lua/app/ui/shop/box_open_ui.lua b/lua/app/ui/shop/box_open_ui.lua index 6628b2fa..a8b34207 100644 --- a/lua/app/ui/shop/box_open_ui.lua +++ b/lua/app/ui/shop/box_open_ui.lua @@ -1,30 +1,10 @@ local BoxOpenUI = class("BoxOpenUI", BaseUI) - -local SUMMON_ICON_NAME = { - [GConst.SummonConst.SUMMON_TYPE.LV_1] = "shop_chest_1", - [GConst.SummonConst.SUMMON_TYPE.LV_2] = "shop_chest_2", - [GConst.SummonConst.SUMMON_TYPE.LV_3] = "shop_chest_3" -} -local BOUNTY_ICON_NAME = { - [GConst.ItemConst.ITEM_ID_BOX_LV_1] = "bounty_chest_1", - [GConst.ItemConst.ITEM_ID_BOX_LV_2] = "bounty_chest_2", - [GConst.ItemConst.ITEM_ID_BOX_LV_3] = "bounty_chest_5", - [GConst.ItemConst.ITEM_ID_BOX_LV_4] = "bounty_chest_3", - [GConst.ItemConst.ITEM_ID_BOX_LV_5] = "bounty_chest_4", -} +local SPINE_OPEN_TIME = 1.4 function BoxOpenUI:ctor(params) self.params = params or {} -- 将信息传递给下一个界面 self.type = self.params and self.params.type - self.iconName = "shop_chest_1" -- 默认图标 - self.iconAtlas = GConst.ATLAS_PATH.SHOP - if self.type == GConst.ShopConst.BOX_REWARD_TYPE.SUMMON then - self.iconAtlas = GConst.ATLAS_PATH.SHOP - self.iconName = SUMMON_ICON_NAME[self.params.params or GConst.SummonConst.SUMMON_TYPE.LV_1] - elseif self.type == GConst.ShopConst.BOX_REWARD_TYPE.BOUNTY then - self.iconAtlas = GConst.ATLAS_PATH.BOUNTY - self.iconName = BOUNTY_ICON_NAME[self.params.params or GConst.ItemConst.ITEM_ID_BOX_KEY_LV_1] - end + self.index = self.params.params end function BoxOpenUI:isFullScreen() @@ -37,25 +17,32 @@ end function BoxOpenUI:onLoadRootComplete() self.uiMap = self.root:genAllChildren() - self.bg = self.uiMap["box_open_ui.bg"] - self.boxImg = self.uiMap["box_open_ui.box"] - self.openBtn = self.uiMap["box_open_ui.open_btn"] - self.btnText = self.uiMap["box_open_ui.open_btn.text"] - - self.boxImg:setSprite(self.iconAtlas, self.iconName) - self.btnText:setText(I18N:getGlobalText(I18N.GlobalConst.SHOP_DESC_7)) -- 立即打开 - - self.openBtn:addClickListener(function() - ModuleManager.ShopManager:showBoxRewardUI(self.params) - end) - + self.summonSpineList = {} + for i = 1, 3 do + table.insert(self.summonSpineList, self.uiMap["box_open_ui.ui_spine_obj_" .. i]) + self.summonSpineList[i]:setVisible(false) + end -- 奖励界面打开时 关闭此界面 self:addEventListener(EventManager.CUSTOM_EVENT.CLOSE_BOX_OPEN_UI, function() self:closeUI() end) - EventManager:dispatchEvent(EventManager.CUSTOM_EVENT.CLOSE_BOX_HERO_UI) + -- 播放spine表现 播放完毕后打开奖励UI + local spineObj + if self.type == GConst.ShopConst.BOX_REWARD_TYPE.SUMMON then + spineObj = self.summonSpineList[self.index] + elseif self.type == GConst.ShopConst.BOX_REWARD_TYPE.BOUNTY then + -- TODOJ + end + if not spineObj then + spineObj = self.summonSpineList[1] + end + spineObj:setVisible(true) + spineObj:playAnim("born", false, true) + self:performWithDelayGlobal(function() + ModuleManager.ShopManager:showBoxRewardUI(self.params) + end, SPINE_OPEN_TIME) end return BoxOpenUI \ No newline at end of file