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