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

This commit is contained in:
CloudJ 2023-05-24 10:07:09 +08:00
commit dca47040cf
13 changed files with 140 additions and 10 deletions

View File

@ -78,6 +78,7 @@ BIReport.ITEM_GET_TYPE = {
SUMMON = "Summon",
PLAYER_LV_UP = "PlayerLvUp",
GOLD_PIG = "GoldPig",
BATTLE_SKILL_REFRESH = "BattleSkillRefresh",
}
BIReport.ADS_CLICK_TYPE = {

View File

@ -25,7 +25,8 @@ EventManager.CUSTOM_EVENT = {
LOGIN_REQ_SUCCESS = "LOGIN_REQ_SUCCESS",
DAILY_TASK_ADD_PROGRESS = "DAILY_TASK_ADD_PROGRESS",
BOSS_ENTER_ANI_OVER = "BOSS_ENTER_ANI_OVER",
TIME_TRIGGERED_NEW_EMAIL = "TIME_TRIGGERED_NEW_EMAIL" -- 邮件到时间请求是否有新邮件
TIME_TRIGGERED_NEW_EMAIL = "TIME_TRIGGERED_NEW_EMAIL", -- 邮件到时间请求是否有新邮件
SKILL_REFRESH_SUCC = "SKILL_REFRESH_SUCC",
-- BORAD_TOUCH_BEGIN = "BORAD_TOUCH_BEGIN",
-- BORAD_TOUCH_OVER = "BORAD_TOUCH_OVER"
}

View File

@ -186,6 +186,7 @@ GConst.ATLAS_PATH = {
UI_SETTING = "assets/arts/atlas/ui/setting.asset",
ICON_TASK = "assets/arts/atlas/icon/task.asset",
SHOP = "assets/arts/atlas/ui/shop.asset",
HERO = "assets/arts/atlas/ui/hero.asset",
}
GConst.TOUCH_EVENT = {

View File

@ -287,6 +287,8 @@ local BUFF_NAME = {
SKILL_HURT_ADD = "skill_hurt_add",
DEATH_SUMMON = "death_summon",
LOCK = "lock",
SHIELD_REBOUND_400 = "shield_rebound_400",
SHIELD_ICE_REBOUND_400 = "shield_ice_rebound_400",
}
BattleConst.BUFF_NAME = BUFF_NAME

View File

@ -22,6 +22,24 @@ function BattleManager:showBoxOpenUI(rewards, callback)
UIManager:showUI("app/ui/battle/battle_box_open_ui", {rewards = rewards, callback = callback})
end
function BattleManager:reqSkillRefresh(isAd)
if not isAd then
local cost = GFunc.getConstReward("refresh_skill_cost")
if not GFunc.checkCost(GFunc.getRewardId(cost), GFunc.getRewardNum(cost), true) then
return
end
end
self:sendMessage(ProtoMsgType.FromMsgEnum.BattleSkillRefreshReq, {ad = isAd}, {}, self.rspSkillRefresh, BIReport.ITEM_GET_TYPE.BATTLE_SKILL_REFRESH, true)
end
function BattleManager:rspSkillRefresh(result)
if result.err_code == GConst.ERROR_STR.SUCCESS then
DataManager.BattleData:addRefreshSkillCount(result.reqData.ad)
EventManager:dispatchEvent(EventManager.CUSTOM_EVENT.SKILL_REFRESH_SUCC)
end
end
function BattleManager:playBattle(battleType, params, returnFunc)
params = params or {}
if self.battleController then -- 同一时间只能有一场战斗

View File

@ -1624,7 +1624,7 @@ function BattleController:findSkillInfluenceGrids()
end
end
function BattleController:getRandomSkillList(getCount, onlyCommonSkill)
function BattleController:getRandomSkillList(getCount, onlyCommonSkill, excludeMap)
local fixedList = self:getFixedRogueSkill()
if fixedList[1] then
return table.remove(fixedList, 1)
@ -1669,6 +1669,12 @@ function BattleController:getRandomSkillList(getCount, onlyCommonSkill)
return table.shuffle(result)
end
if excludeMap then
for skillId, _ in pairs(excludeMap) do
map[skillId] = true
end
end
for elementType, list in pairs(skillPool) do
if self.battleData:isUnlockedSkillElementType(elementType) then
for _, skillId in ipairs(list) do

View File

@ -140,6 +140,20 @@ BattleBuffHandle.addShield = {
target.unitEntity:addAttr(ATTR_NAME.SHIELD_REBOUND, 20000, false)
return shieldNum
end,
-- 反弹目标伤害的400%,直接写死
[BUFF_NAME.SHIELD_REBOUND_400] = function(unitComp, buff, target, buffEffect)
local shieldNum = target.unitEntity:getMaxHp() * buff:getEffectNum() // DEFAULT_FACTOR
target:addShield(shieldNum, buffEffect)
target.unitEntity:addAttr(ATTR_NAME.SHIELD_REBOUND, 40000, false)
return shieldNum
end,
-- 反弹目标伤害的400%,直接写死
[BUFF_NAME.SHIELD_ICE_REBOUND_400] = function(unitComp, buff, target, buffEffect)
local shieldNum = target.unitEntity:getMaxHp() * buff:getEffectNum() // DEFAULT_FACTOR
target:addShield(shieldNum, buffEffect)
target.unitEntity:addAttr(ATTR_NAME.SHIELD_REBOUND, 40000, false)
return shieldNum
end,
}
BattleBuffHandle.removeShield = {
@ -147,6 +161,14 @@ BattleBuffHandle.removeShield = {
target.unitEntity:addAttr(ATTR_NAME.SHIELD_REBOUND, -20000, false)
target:removeShield(buffEffect)
end,
[BUFF_NAME.SHIELD_REBOUND_400] = function(unitComp, buff, target, buffEffect)
target.unitEntity:addAttr(ATTR_NAME.SHIELD_REBOUND, -40000, false)
target:removeShield(buffEffect)
end,
[BUFF_NAME.SHIELD_ICE_REBOUND_400] = function(unitComp, buff, target, buffEffect)
target.unitEntity:addAttr(ATTR_NAME.SHIELD_REBOUND, -40000, false)
target:removeShield(buffEffect)
end,
}
local function _takeEffectShield(unitComp, buff, target, buffEffect)

View File

@ -554,10 +554,17 @@ function BattleTeam:onActionOver()
self:getMainUnit().unitEntity:clearCounterAttackCount()
local teamAction = function()
---- 普攻
local skillMatch
if self.side == BattleConst.SIDE_ATK then
self.battleController.roundStep = BattleConst.BATTLE_ROUND_STEP.ON_ATK_STEP
self.battleController.curTeam = self.battleController.atkTeam
---- 普攻
local skillMatch = self:getMainUnit().unitEntity:getMatchType()
skillMatch = self:getMainUnit().unitEntity:getMatchType()
else
self.battleController.roundStep = BattleConst.BATTLE_ROUND_STEP.ON_DEF_STEP
self.battleController.curTeam = self.battleController.defTeam
end
self:useNormalSkill(skillMatch, counterAttackCount, true, BattleConst.EFFECT_TYPE.COUNTERATTACK, function()
self.battleController:enterNextTeamAction()
end)

View File

@ -82,6 +82,8 @@ local ProtoMsgType = {
[3440328467] = "PigLevelUpNtf",
[3555824176] = "TaskDailyInfoReq",
[3555826009] = "TaskDailyInfoRsp",
[3597633120] = "BattleSkillRefreshReq",
[3597634953] = "BattleSkillRefreshRsp",
[3607879254] = "AuthReq",
[3607881087] = "AuthRsp",
[3624439233] = "NewMailNtf",
@ -186,6 +188,8 @@ local ProtoMsgType = {
PigLevelUpNtf = 3440328467,
TaskDailyInfoReq = 3555824176,
TaskDailyInfoRsp = 3555826009,
BattleSkillRefreshReq = 3597633120,
BattleSkillRefreshRsp = 3597634953,
AuthReq = 3607879254,
AuthRsp = 3607881087,
NewMailNtf = 3624439233,
@ -290,6 +294,8 @@ local ProtoMsgType = {
PigLevelUpNtf = "PigLevelUpNtf",
TaskDailyInfoReq = "TaskDailyInfoReq",
TaskDailyInfoRsp = "TaskDailyInfoRsp",
BattleSkillRefreshReq = "BattleSkillRefreshReq",
BattleSkillRefreshRsp = "BattleSkillRefreshRsp",
AuthReq = "AuthReq",
AuthRsp = "AuthRsp",
NewMailNtf = "NewMailNtf",

View File

@ -19,7 +19,6 @@ end
function BattleSkillSelectComp:_display()
local uiMap = self:getUIMap()
uiMap["battle_select_skill_comp.skill_node.ad_btn.tx"]:setText(I18N:getGlobalText(I18N.GlobalConst.BATTLE_DESC_3))
local bg2 = uiMap["battle_select_skill_comp.bg_2"]
bg2:setVisible(self.onlyCommonSkill)
local bg = uiMap["battle_select_skill_comp.bg_1"]
@ -32,6 +31,7 @@ function BattleSkillSelectComp:_display()
bg:setVisible(true)
end
self:refreshBtns()
self:refreshRogueSkill()
end
@ -43,11 +43,18 @@ function BattleSkillSelectComp:_addListeners()
end
SDKManager:showFullScreenAds(BIReport.ADS_CLICK_TYPE.BATTLE_SKILL_REFRESH, function()
self.skillList = ModuleManager.BattleManager.battleController:getRandomSkillList(nil, self.onlyCommonSkill)
self:refreshRogueSkill()
ModuleManager.BattleManager:reqSkillRefresh(true)
end)
end)
uiMap["battle_select_skill_comp.skill_node.diamond_btn"]:addClickListener(function()
if not ModuleManager.BattleManager.battleController then
return
end
ModuleManager.BattleManager:reqSkillRefresh(false)
end)
self.canvasGroup = uiMap["battle_select_skill_comp.skill_node"]:getComponent(GConst.TYPEOF_UNITY_CLASS.CANVAS_GROUP)
self.canvasGroup.alpha = 1
self.bg = uiMap["battle_select_skill_comp.bg_1"]
@ -62,6 +69,34 @@ function BattleSkillSelectComp:_addListeners()
end)
end
function BattleSkillSelectComp:refreshBtns()
local uiMap = self:getUIMap()
uiMap["battle_select_skill_comp.skill_node.ad_btn.tx"]:setText(I18N:getGlobalText(I18N.GlobalConst.BATTLE_DESC_3))
uiMap["battle_select_skill_comp.skill_node.diamond_btn.tx"]:setText(GFunc.getRewardNum(GFunc.getConstReward("refresh_skill_cost")))
local cfgAdCount = GFunc.getConstIntValue("ad_refresh_skill")
local cfgRefreshCount = GFunc.getConstIntValue("diamond_refresh_skill") + cfgAdCount
local adCount = DataManager.BattleData:getADRefreshSkillCount()
local refreshCount = DataManager.BattleData:getRefreshSkillCount()
local showAdBtn = cfgAdCount > adCount
uiMap["battle_select_skill_comp.skill_node.ad_btn"]:setActive(showAdBtn)
local showBtn = refreshCount < cfgRefreshCount
if showAdBtn then
showBtn = false
end
uiMap["battle_select_skill_comp.skill_node.diamond_btn"]:setActive(showBtn)
end
function BattleSkillSelectComp:getNewRandomSkill()
self:refreshBtns()
local excludeMap = {}
for _, id in ipairs(self.skillList) do
excludeMap[id] = true
end
self.skillList = ModuleManager.BattleManager.battleController:getRandomSkillList(nil, self.onlyCommonSkill, excludeMap)
self:refreshRogueSkill()
end
function BattleSkillSelectComp:refreshRogueSkill()
local uiMap = self:getUIMap()
if not self.selectSkillCells then

View File

@ -79,6 +79,12 @@ function BattleUI:_addListeners()
self:addEventListener(EventManager.CUSTOM_EVENT.SHOW_ELIMINATION_TUTORAIL, function(posIdList)
self:showTutorialFinger(posIdList)
end)
self:addEventListener(EventManager.CUSTOM_EVENT.SKILL_REFRESH_SUCC, function(posIdList)
if self.selectSkillComp then
self.selectSkillComp:getNewRandomSkill()
end
end)
end
function BattleUI:_bind()
@ -530,16 +536,24 @@ end
function BattleUI:initCounterAttack()
self.counterAttackNode = self.uiMap["battle_ui.battle_root.battle_number_node.counter_attack"]
self.counterTx = self.uiMap["battle_ui.battle_root.battle_number_node.counter_attack.text_number"]
self.counterTxTmp = self.counterTx:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_TEXT_MESH_PRO)
self.counterTxbgComp = self.uiMap["battle_ui.battle_root.top_node.counter_attack.bg"]
self.counterAttackNode:setVisible(false)
end
function BattleUI:showCounterAttack(count, side)
local x = 280
local horizontal = 180
if side == GConst.BattleConst.SIDE_ATK then
x = -280
horizontal = 0
self.counterTxTmp.alignment = CS.TMPro.TextAlignmentOptions.MidlineLeft
else
self.counterTxTmp.alignment = CS.TMPro.TextAlignmentOptions.MidlineRight
end
self.counterTxbgComp:setEulerAngles(0, horizontal, 0)
self.counterAttackNode:setAnchoredPositionX(x)
self.counterTx:setText(I18N:getGlobalText(I18N.GlobalConst.COUNTER_ATTACK_DESC) .. "+" .. count)
self.counterTx:setText(I18N:getGlobalText(I18N.GlobalConst.COUNTER_ATTACK_DESC) .. "x" .. count)
self.counterAttackNode:setVisible(true)
end

View File

@ -34,7 +34,7 @@ function HeroDetailUI:_display(lvChange)
uiMap["hero_detail_ui.bg.atk_name"]:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_3))
uiMap["hero_detail_ui.bg.skill_icon"]:setSprite(GConst.ATLAS_PATH.ICON_SKILL_ROGUE, ModuleManager.HeroManager:getSkillRogueIcon(self.heroEntity:getUnlockRogueId()))
uiMap["hero_detail_ui.bg.hero_element"]:setSprite(GConst.ATLAS_PATH.ICON_HERO, ModuleManager.HeroManager:getMatchTypeIcon(self.heroEntity:getMatchType()))
uiMap["hero_detail_ui.bg.hero_element"]:setSprite(GConst.ATLAS_PATH.HERO, ModuleManager.HeroManager:getMatchTypeIcon(self.heroEntity:getMatchType()))
local materials = self.heroEntity:getLvUpMaterials() or {}
local fragmentCount = DataManager.BagData.ItemData:getItemNumById(self.heroEntity:getFragmentId())

View File

@ -27,6 +27,8 @@ function BattleData:init()
self.lockElementMap = {}
self.data.timeSpeed = 1
self.data.lvDirty = false
self.adRefreshSkillCount = 0
self.refreshSkillCount = 0
BattleSkillEntity.sid = 0
self.atkTeam = self:initTeam(BattleConst.SIDE_ATK)
self.defTeam = self:initTeam(BattleConst.SIDE_DEF)
@ -532,6 +534,21 @@ function BattleData:useCommonSelectSkillCount()
return true
end
function BattleData:addRefreshSkillCount(isAd)
if isAd then
self.adRefreshSkillCount = self.adRefreshSkillCount + 1
end
self.refreshSkillCount = self.refreshSkillCount + 1
end
function BattleData:getRefreshSkillCount()
return self.refreshSkillCount
end
function BattleData:getADRefreshSkillCount()
return self.adRefreshSkillCount
end
function BattleData:initTeam(side)
local data = nil
if side == BattleConst.SIDE_ATK then