Merge branch 'dev' of git.juzugame.com:b6-client/b6-lua into dev
This commit is contained in:
commit
902db9d49b
@ -16,18 +16,37 @@ AudioManager.CLICK_ID = {
|
||||
|
||||
AudioManager.EFFECT_ID = {
|
||||
BUTTON = "assets/arts/sounds/sfx/ui/ui_button.wav",
|
||||
REWARD = "assets/arts/sounds/sfx/ui/sfx_reward.wav",
|
||||
SFX_TOAST = "assets/arts/sounds/sfx/ui/sfx_toast.wav",
|
||||
SFX_SUMMON = "assets/arts/sounds/sfx/ui/sfx_summon.wav",
|
||||
SFX_ITEM_9 = "assets/arts/sounds/sfx/ui/sfx_item_9.wav",
|
||||
SFX_ITEM_10 = "assets/arts/sounds/sfx/ui/sfx_item_10.wav",
|
||||
SFX_ITEM_11 = "assets/arts/sounds/sfx/ui/sfx_item_11.wav",
|
||||
SFX_UPGRADE = "assets/arts/sounds/sfx/ui/sfx_upgrade.wav",
|
||||
SFX_TRAIN = "assets/arts/sounds/sfx/ui/sfx_train.wav",
|
||||
LINK_BO_1 = "assets/arts/sounds/sfx/battle/bo1.wav",
|
||||
LINK_BO_2 = "assets/arts/sounds/sfx/battle/bo2.wav",
|
||||
LINK_BO_3 = "assets/arts/sounds/sfx/battle/bo3.wav",
|
||||
LINK_BO_4 = "assets/arts/sounds/sfx/battle/bo4.wav",
|
||||
LINK_BO_5 = "assets/arts/sounds/sfx/battle/bo5.wav",
|
||||
LINK_BO_6 = "assets/arts/sounds/sfx/battle/bo6.wav",
|
||||
LINK_BO_7 = "assets/arts/sounds/sfx/battle/bo7.wav",
|
||||
LINK_BO_8 = "assets/arts/sounds/sfx/battle/bo8.wav",
|
||||
LINK_OVER = "assets/arts/sounds/sfx/battle/link_over.wav",
|
||||
LINK_READY = "assets/arts/sounds/sfx/battle/link_ready.wav",
|
||||
LINK_SKILL = "assets/arts/sounds/sfx/battle/link_skill.wav",
|
||||
}
|
||||
|
||||
AudioManager.BO_EFFECT_ID = {
|
||||
[1] = AudioManager.EFFECT_ID.LINK_BO_1,
|
||||
[2] = AudioManager.EFFECT_ID.LINK_BO_2,
|
||||
[3] = AudioManager.EFFECT_ID.LINK_BO_3,
|
||||
[4] = AudioManager.EFFECT_ID.LINK_BO_4,
|
||||
[5] = AudioManager.EFFECT_ID.LINK_BO_5,
|
||||
[6] = AudioManager.EFFECT_ID.LINK_BO_6,
|
||||
[7] = AudioManager.EFFECT_ID.LINK_BO_7,
|
||||
[8] = AudioManager.EFFECT_ID.LINK_BO_8,
|
||||
}
|
||||
|
||||
AudioManager.EFFECT_PREFIX = "assets/arts/sounds/sfx/ui/%s.wav"
|
||||
|
||||
function AudioManager:getBoEffectID(index)
|
||||
local id = AudioManager.BO_EFFECT_ID[index] or AudioManager.EFFECT_ID.LINK_BO_8
|
||||
return id
|
||||
end
|
||||
|
||||
function AudioManager:init()
|
||||
self.musicEnabled = nil
|
||||
self.effectEnabled = nil
|
||||
|
||||
@ -526,6 +526,10 @@ function BattleController:onTouchEvent(eventType, posId, isVirtual)
|
||||
if eventType == ELIMINATION_TOUCH_EVENT.DOWN then
|
||||
self:onLinkStart(entity, posId, isVirtual)
|
||||
elseif eventType == ELIMINATION_TOUCH_EVENT.ENTER then
|
||||
if self.battleData:getIsVirtual() then
|
||||
return
|
||||
end
|
||||
|
||||
self:onLinkEnter(entity, posId, isVirtual)
|
||||
elseif eventType == ELIMINATION_TOUCH_EVENT.EXIT then
|
||||
|
||||
@ -557,17 +561,25 @@ function BattleController:onLinkStart(entity, posId, isVirtual)
|
||||
if #self.battleData:getGridSequence() > 0 then
|
||||
self.battleData:clearGridSequence()
|
||||
end
|
||||
self.battleData:insertGridSequence(posId, self:snapshotBoard())
|
||||
self.battleData:insertGridSequence(posId, self:snapshotBoard(), isVirtual)
|
||||
local skillEntity = self.battleData:getSkillEntityBySkillId(entity:getSkillId())
|
||||
local maskElementType = entity:getElementType(skillEntity)
|
||||
self.battleUI:showBoardMask(maskElementType)
|
||||
self:findSkillInfluenceGrids()
|
||||
self:onLinkChange()
|
||||
|
||||
if not isVirtual then
|
||||
AudioManager:playEffect(AudioManager.EFFECT_ID.LINK_BO_1)
|
||||
if skillEntity then
|
||||
AudioManager:playEffect(AudioManager.EFFECT_ID.LINK_SKILL)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function BattleController:onLinkEnter(entity, posId, isVirtual)
|
||||
local sequence = self.battleData:getGridSequence()
|
||||
local info = sequence[#sequence]
|
||||
local sequenceCount = #sequence
|
||||
local info = sequence[sequenceCount]
|
||||
local lastPosId = info and info.posId
|
||||
if not lastPosId then
|
||||
return
|
||||
@ -625,7 +637,7 @@ function BattleController:onLinkEnter(entity, posId, isVirtual)
|
||||
local maskElementType = elementType or lastElementType
|
||||
self.battleUI:showBoardMask(maskElementType)
|
||||
|
||||
self.battleData:insertGridSequence(posId, self:snapshotBoard())
|
||||
self.battleData:insertGridSequence(posId, self:snapshotBoard(), isVirtual)
|
||||
if lastEntity:getNeedChangePos() and not entity:getNeedChangePos() then -- 需要移动到队列末尾
|
||||
local lastSkillId = lastEntity:getSkillId()
|
||||
local skillId = entity:getSkillId()
|
||||
@ -643,6 +655,16 @@ function BattleController:onLinkEnter(entity, posId, isVirtual)
|
||||
|
||||
self:findSkillInfluenceGrids()
|
||||
self:onLinkChange()
|
||||
|
||||
if not isVirtual then
|
||||
if sequenceCount + 1 == self:getMinEliminationCount() then
|
||||
AudioManager:playEffect(AudioManager.EFFECT_ID.LINK_READY)
|
||||
end
|
||||
AudioManager:playEffect(AudioManager:getBoEffectID(sequenceCount + 1))
|
||||
if skillEntity then
|
||||
AudioManager:playEffect(AudioManager.EFFECT_ID.LINK_SKILL)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function BattleController:onLinkCancelOrUp(entity, posId, isVirtual)
|
||||
@ -650,6 +672,8 @@ function BattleController:onLinkCancelOrUp(entity, posId, isVirtual)
|
||||
return
|
||||
end
|
||||
|
||||
AudioManager:playEffect(AudioManager.EFFECT_ID.LINK_OVER)
|
||||
|
||||
local tutorialElementList
|
||||
if DataManager.TutorialData:getIsInTutorial() then
|
||||
tutorialElementList = DataManager.TutorialData:getTargetElement()
|
||||
|
||||
@ -44,6 +44,7 @@ function BattleSkillSelectUI:_addListeners()
|
||||
end)
|
||||
|
||||
self.canvasGroup = uiMap["battle_skill_select_ui.skill_node"]:getComponent(GConst.TYPEOF_UNITY_CLASS.CANVAS_GROUP)
|
||||
self.canvasGroup.alpha = 1
|
||||
self.bg = uiMap["battle_skill_select_ui.bg_1"]
|
||||
uiMap["battle_skill_select_ui.look_btn"]:addTouchListener(function(eventType, x, y)
|
||||
if eventType == GConst.TOUCH_EVENT.DOWN or eventType == GConst.TOUCH_EVENT.DRAG then
|
||||
|
||||
@ -180,6 +180,10 @@ function BattleData:alreadyInsertSequence(posId)
|
||||
return self.gridSequenceMap[posId] == true
|
||||
end
|
||||
|
||||
function BattleData:getIsVirtual()
|
||||
return self.isVirtual
|
||||
end
|
||||
|
||||
function BattleData:getSequenceHadSkill()
|
||||
for _, info in ipairs(self:getGridSequence()) do
|
||||
local entity = self.gridEntities[info.posId]
|
||||
@ -190,12 +194,13 @@ function BattleData:getSequenceHadSkill()
|
||||
return
|
||||
end
|
||||
|
||||
function BattleData:insertGridSequence(posId, snapshot)
|
||||
function BattleData:insertGridSequence(posId, snapshot, isVirtual)
|
||||
if self:alreadyInsertSequence(posId) then
|
||||
return false
|
||||
end
|
||||
|
||||
self.gridSequenceMap[posId] = true
|
||||
self.isVirtual = isVirtual
|
||||
table.insert(self.gridSequence, {posId = posId, snapshot = snapshot})
|
||||
return true
|
||||
end
|
||||
@ -248,6 +253,7 @@ end
|
||||
function BattleData:clearGridSequence()
|
||||
self.gridSequence = {} -- 格子队列
|
||||
self.gridSequenceMap = {} -- 格子队列对应的map,方面查找
|
||||
self.isVirtual = nil
|
||||
self:clearSkillInfluenceGrids()
|
||||
end
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user