侧边栏增加前往优惠商城的按钮,修改战斗内技能链接显示bug

This commit is contained in:
xiekaidong 2023-07-13 15:52:18 +08:00
parent 2b0d5b7596
commit 99a26d953d
6 changed files with 79 additions and 1 deletions

View File

@ -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()

View File

@ -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,
}

View File

@ -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",
}

View File

@ -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

View File

@ -0,0 +1,10 @@
fileFormatVersion: 2
guid: 61356e1192048c44aaa97e5f210a046e
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}
serializedVersion: 2
userData:
assetBundleName:
assetBundleVariant:
script: {fileID: 11500000, guid: 3b8b241bab4a4ac9a22fcce9c64f1242, type: 3}

View File

@ -277,6 +277,7 @@ function ShopComp:refreshTime()
end
function ShopComp:refreshDiscountPage()
-- 同SideBarDiscountCell:getIsOpen()一起修改
local y = 0
local cellHeight = 0
-- 章节