From 99a26d953d5cc71f04b7c0abc6409f047daaf18c Mon Sep 17 00:00:00 2001 From: xiekaidong Date: Thu, 13 Jul 2023 15:52:18 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BE=A7=E8=BE=B9=E6=A0=8F=E5=A2=9E=E5=8A=A0?= =?UTF-8?q?=E5=89=8D=E5=BE=80=E4=BC=98=E6=83=A0=E5=95=86=E5=9F=8E=E7=9A=84?= =?UTF-8?q?=E6=8C=89=E9=92=AE=EF=BC=8C=E4=BF=AE=E6=94=B9=E6=88=98=E6=96=97?= =?UTF-8?q?=E5=86=85=E6=8A=80=E8=83=BD=E9=93=BE=E6=8E=A5=E6=98=BE=E7=A4=BA?= =?UTF-8?q?bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../helper/battle_board_touch_helper.lua | 3 +- .../module/battle/helper/battle_formula.lua | 2 + lua/app/module/maincity/maincity_const.lua | 1 + .../main_city/cell/side_bar_discount_cell.lua | 63 +++++++++++++++++++ .../cell/side_bar_discount_cell.lua.meta | 10 +++ lua/app/ui/shop/shop_comp.lua | 1 + 6 files changed, 79 insertions(+), 1 deletion(-) create mode 100644 lua/app/ui/main_city/cell/side_bar_discount_cell.lua create mode 100644 lua/app/ui/main_city/cell/side_bar_discount_cell.lua.meta diff --git a/lua/app/module/battle/helper/battle_board_touch_helper.lua b/lua/app/module/battle/helper/battle_board_touch_helper.lua index b21c13f7..91e683ac 100644 --- a/lua/app/module/battle/helper/battle_board_touch_helper.lua +++ b/lua/app/module/battle/helper/battle_board_touch_helper.lua @@ -130,7 +130,6 @@ function BattleBoardTouchHelper:onLinkEnter(entity, posId, isVirtual) skillPosId = posId end end - self.battleUI:showBoardMask(maskElementType, skillPosId) self.battleData:insertGridSequence(posId, self.battleController:snapshotBoard(), isVirtual) if lastEntity:getNeedChangePos() and not entity:getNeedChangePos() then -- 需要移动到队列末尾 @@ -138,6 +137,7 @@ function BattleBoardTouchHelper:onLinkEnter(entity, posId, isVirtual) local skillId = entity:getSkillId() self.battleController:setGridSkillId(lastPosId, skillId) self.battleController:setGridSkillId(posId, lastSkillId) + skillPosId = posId end local newElementType = elementType or lastElementType @@ -145,6 +145,7 @@ function BattleBoardTouchHelper:onLinkEnter(entity, posId, isVirtual) entity:setElementType(newElementType) lastEntity:setElementType(newElementType) end + self.battleUI:showBoardMask(maskElementType, skillPosId) entity:addLinkSkillCount() diff --git a/lua/app/module/battle/helper/battle_formula.lua b/lua/app/module/battle/helper/battle_formula.lua index ca2d05a3..026d9c66 100644 --- a/lua/app/module/battle/helper/battle_formula.lua +++ b/lua/app/module/battle/helper/battle_formula.lua @@ -52,6 +52,8 @@ BattleFormula.calculateFormula = { local matchType = unitComp.unitEntity:getMatchType() local result = unitComp.unitEntity:getAtk() * buff:getEffectNum() // DEFAULT_FACTOR * (DEFAULT_FACTOR + unitComp.unitEntity:getDmgAddition() - unitComp.unitEntity:getDmgDec() + targetUnit.unitEntity:getWeakness(matchType) - targetUnit.unitEntity:getDecDmg(matchType)) // DEFAULT_FACTOR + -- 最终伤害 + result = result * (DEFAULT_FACTOR - unitComp.unitEntity:getEndDmgDecAll() + unitComp.unitEntity:getEndDmgAddtionAll()) // DEFAULT_FACTOR return result, 0 end, } diff --git a/lua/app/module/maincity/maincity_const.lua b/lua/app/module/maincity/maincity_const.lua index cc661db5..17519814 100644 --- a/lua/app/module/maincity/maincity_const.lua +++ b/lua/app/module/maincity/maincity_const.lua @@ -40,6 +40,7 @@ MainCityConst.RIGHT_SIDE_BARS = { -- "app/ui/main_city/cell/side_bar_first_recharge_cell", 已作废 "app/ui/main_city/cell/side_bar_introduct_gift_cell", "app/ui/main_city/cell/side_bar_beginner_gift_cell", + "app/ui/main_city/cell/side_bar_discount_cell", "app/ui/main_city/cell/side_bar_grow_up_gift_cell", } diff --git a/lua/app/ui/main_city/cell/side_bar_discount_cell.lua b/lua/app/ui/main_city/cell/side_bar_discount_cell.lua new file mode 100644 index 00000000..5a1def40 --- /dev/null +++ b/lua/app/ui/main_city/cell/side_bar_discount_cell.lua @@ -0,0 +1,63 @@ +local SideBarBaseCellComp = require "app/ui/main_city/cell/side_bar_base_cell" +local SideBarDiscountCell = class("SideBarDiscountCell", SideBarBaseCellComp) + +function SideBarDiscountCell:getModuleKey() + return nil +end + +function SideBarDiscountCell:getHasPurchase() + return true +end + +function SideBarDiscountCell:getIsOpen() + -- 同ShopComp:refreshDiscountPage() 一起修改 + if not ModuleManager:getIsOpen(ModuleManager.MODULE_KEY.MALL, false) then + return false + end + + -- 章节礼包 + if #DataManager.ShopData:getActChapterStoreCanBuyActIds() > 0 then + return true + end + + -- 新手礼包 + if not DataManager.ShopData:getBeginnerGiftHasBuy() then + return true + end + + -- 竞技场 + if DataManager.ArenaData:getGiftId() ~= nil then + return true + end + + -- 助力礼包 + if #DataManager.ShopData:getLevelUpGiftActIds() > 0 then + return true + end + + -- 成长礼包 + if DataManager.ShopData:hasGrowUpGift() then + return true + end + + -- 金币 + if DataManager.ShopData:getValidCoinGiftId() ~= nil then + return true + end + + return false +end + +function SideBarDiscountCell:getSpineName() + return "ui_main_btn_hang" +end + +function SideBarDiscountCell:onClick() + EventManager:dispatchEvent(EventManager.CUSTOM_EVENT.GO_SHOP, {page = GConst.ShopConst.PAGE_TYPE.DISCOUNT}) +end + +function SideBarDiscountCell:getIsShowRedPoint() + return false +end + +return SideBarDiscountCell \ No newline at end of file diff --git a/lua/app/ui/main_city/cell/side_bar_discount_cell.lua.meta b/lua/app/ui/main_city/cell/side_bar_discount_cell.lua.meta new file mode 100644 index 00000000..669118c4 --- /dev/null +++ b/lua/app/ui/main_city/cell/side_bar_discount_cell.lua.meta @@ -0,0 +1,10 @@ +fileFormatVersion: 2 +guid: 61356e1192048c44aaa97e5f210a046e +ScriptedImporter: + internalIDToNameTable: [] + externalObjects: {} + serializedVersion: 2 + userData: + assetBundleName: + assetBundleVariant: + script: {fileID: 11500000, guid: 3b8b241bab4a4ac9a22fcce9c64f1242, type: 3} diff --git a/lua/app/ui/shop/shop_comp.lua b/lua/app/ui/shop/shop_comp.lua index f888d987..1c2b787e 100644 --- a/lua/app/ui/shop/shop_comp.lua +++ b/lua/app/ui/shop/shop_comp.lua @@ -277,6 +277,7 @@ function ShopComp:refreshTime() end function ShopComp:refreshDiscountPage() + -- 同SideBarDiscountCell:getIsOpen()一起修改 local y = 0 local cellHeight = 0 -- 章节