This commit is contained in:
xiekaidong 2023-04-21 20:43:52 +08:00
commit ac9bea5776
5 changed files with 45 additions and 11 deletions

View File

@ -6,7 +6,8 @@ local MAX_EFFECT_NUM = 30
local AUDIO_CLIP = typeof(CS.UnityEngine.AudioClip) local AUDIO_CLIP = typeof(CS.UnityEngine.AudioClip)
AudioManager.BGM_ID = { AudioManager.BGM_ID = {
MAINCITY = "assets/arts/sounds/music/bgm_main.wav", MAINCITY = "assets/arts/sounds/music/main_city.wav",
BATTLE = "assets/arts/sounds/music/battle.wav",
} }
AudioManager.CLICK_ID = { AudioManager.CLICK_ID = {

View File

@ -361,7 +361,6 @@ function BattleController:enterNextWave()
if self.waveIndex == 1 then -- 第一波 if self.waveIndex == 1 then -- 第一波
self:generateBoard(true) self:generateBoard(true)
end end
self.defTeam:prepare() self.defTeam:prepare()
self:enterRoundBegin() self:enterRoundBegin()
self.isBossWave = self.defTeam:getMainUnit().unitEntity:getIsBoss() self.isBossWave = self.defTeam:getMainUnit().unitEntity:getIsBoss()
@ -902,11 +901,28 @@ function BattleController:generateInstructions(skillEntity, elementType, lineCou
---- 技能 ---- 技能
if skillEntity then if skillEntity then
if elementType == skillEntity:getMatchType() then
table.insert(self.instructions, { table.insert(self.instructions, {
name = BattleConst.INSTRUCTION_NAME.PLAY_SKILL, name = BattleConst.INSTRUCTION_NAME.PLAY_SKILL,
skillMatch = elementType, skillMatch = elementType,
count = elementTypeCount, count = elementTypeCount,
}) })
else
if skillEntity:getSkillEffectType() ~= nil then
table.insert(self.instructions, {
name = BattleConst.INSTRUCTION_NAME.PLAY_SKILL,
skillMatch = skillEntity:getPosition(),
count = 0,
})
end
if elementTypeCount > 0 then
table.insert(self.instructions, {
name = BattleConst.INSTRUCTION_NAME.GENERAL_ATTACK,
skillMatch = elementType,
count = elementTypeCount,
})
end
end
else else
---- 普攻 ---- 普攻
if elementTypeCount > 0 then if elementTypeCount > 0 then

View File

@ -10,7 +10,6 @@ local BOARD_POS_UP = BF.Vector2(0, 47)
local BOARD_POS_DOWN = BF.Vector2(0, -740) local BOARD_POS_DOWN = BF.Vector2(0, -740)
local BG_PATH = "assets/arts/textures/background/battle/%s.png" local BG_PATH = "assets/arts/textures/background/battle/%s.png"
local CacheVector2 = CS.UnityEngine.Vector2(0, 0) local CacheVector2 = CS.UnityEngine.Vector2(0, 0)
local CacheVector3 = CS.UnityEngine.Vector3(0, 0, 0)
function BattleUI:getPrefabPath() function BattleUI:getPrefabPath()
return "assets/prefabs/ui/battle/battle_ui.prefab" return "assets/prefabs/ui/battle/battle_ui.prefab"
@ -20,6 +19,10 @@ function BattleUI:onClose()
self:clear() self:clear()
end end
function BattleUI:getBGMId()
return AudioManager.BGM_ID.BATTLE
end
function BattleUI:onLoadRootComplete() function BattleUI:onLoadRootComplete()
self:_display() self:_display()
self:_addListeners() self:_addListeners()
@ -1192,6 +1195,12 @@ function BattleUI:clear()
if self.battleNode then if self.battleNode then
self.battleNode:removeAllChildren() self.battleNode:removeAllChildren()
end end
if self.fxNode then
self.fxNode:removeAllChildren()
end
if self.battleNumberNode then
self.battleNumberNode:removeAllChildren()
end
if self.hpProgressYellowLeftSid then if self.hpProgressYellowLeftSid then
self:unscheduleGlobal(self.hpProgressYellowLeftSid) self:unscheduleGlobal(self.hpProgressYellowLeftSid)
self.hpProgressYellowLeftSid = nil self.hpProgressYellowLeftSid = nil
@ -1224,9 +1233,6 @@ function BattleUI:clear()
self.shakeTween:Kill() self.shakeTween:Kill()
self.shakeTween = nil self.shakeTween = nil
end end
if self.battleNumberNode then
self.battleNumberNode:removeAllChildren()
end
end end
return BattleUI return BattleUI

View File

@ -21,6 +21,10 @@ function MainCityUI:getUIType()
return UIManager.UI_TYPE.MAIN return UIManager.UI_TYPE.MAIN
end end
function MainCityUI:getBGMId()
return AudioManager.BGM_ID.MAINCITY
end
function MainCityUI:getCurrencyParams() function MainCityUI:getCurrencyParams()
if self.currencyParams == nil then if self.currencyParams == nil then
self.currencyParams = { self.currencyParams = {

View File

@ -81,6 +81,13 @@ function BattleBoardSkillEntity:getSkillTypeParameter()
return self.config.skill_type_parameter return self.config.skill_type_parameter
end end
function BattleBoardSkillEntity:getSkillEffectType()
if not self.config then
return nil
end
return self.config.effect_type
end
function BattleBoardSkillEntity:getBoardRange() function BattleBoardSkillEntity:getBoardRange()
if not self.config or not self.config.boardrange then if not self.config or not self.config.boardrange then
return return