diff --git a/lua/app/config/chapter.lua b/lua/app/config/chapter.lua index 5817f146..ef8000e0 100644 --- a/lua/app/config/chapter.lua +++ b/lua/app/config/chapter.lua @@ -58,8 +58,8 @@ local chapter = { { ["type"]=1, ["type_for_nothing"]="Vw==", - ["id"]=4, - ["id_for_nothing"]="Ug==", + ["id"]=12001, + ["id_for_nothing"]="VwpcA2Q=", ["num"]=3, ["num_for_nothing"]="VQ==" } @@ -141,8 +141,8 @@ local chapter = { { ["type"]=1, ["type_for_nothing"]="Vw==", - ["id"]=4, - ["id_for_nothing"]="Ug==", + ["id"]=22001, + ["id_for_nothing"]="VApcA2Q=", ["num"]=5, ["num_for_nothing"]="Uw==" } @@ -258,10 +258,10 @@ local chapter = { { ["type"]=1, ["type_for_nothing"]="Vw==", - ["id"]=4, - ["id_for_nothing"]="Ug==", - ["num"]=10, - ["num_for_nothing"]="Vwg=" + ["id"]=52001, + ["id_for_nothing"]="UwpcA2Q=", + ["num"]=3, + ["num_for_nothing"]="VQ==" }, { ["type"]=1, diff --git a/lua/app/config/strings/cn/chapter.lua b/lua/app/config/strings/cn/chapter.lua index 5c84409c..03e39e04 100644 --- a/lua/app/config/strings/cn/chapter.lua +++ b/lua/app/config/strings/cn/chapter.lua @@ -1,33 +1,33 @@ local chapter = { [1]={ - ["name"]="第1关" + ["name"]="1.废弃小镇" }, [2]={ - ["name"]="第2关" + ["name"]="2.小镇幽径" }, [3]={ - ["name"]="第3关" + ["name"]="3.小镇矿山" }, [4]={ - ["name"]="第4关" + ["name"]="4.幽深丛林" }, [5]={ - ["name"]="第5关" + ["name"]="5.碎石溪岸(西)" }, [6]={ - ["name"]="第6关" + ["name"]="6.碎石溪岸(东)" }, [7]={ - ["name"]="第7关" + ["name"]="7.城堡外围" }, [8]={ - ["name"]="第8关" + ["name"]="8.城堡大门" }, [9]={ - ["name"]="第9关" + ["name"]="9.城堡内部" }, [10]={ - ["name"]="第10关" + ["name"]="10.城堡深处" } } local config = { diff --git a/lua/app/config/tutorial.lua.meta b/lua/app/config/tutorial.lua.meta index 5c61822d..70e6e41c 100644 --- a/lua/app/config/tutorial.lua.meta +++ b/lua/app/config/tutorial.lua.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 5b5a5d0a581e34e4783076bf305923c8 +guid: c2def61829e024e499f536c5f7210ed1 ScriptedImporter: internalIDToNameTable: [] externalObjects: {} diff --git a/lua/app/config/tutorial_start.lua.meta b/lua/app/config/tutorial_start.lua.meta index 669f93e0..5c9ad0d2 100644 --- a/lua/app/config/tutorial_start.lua.meta +++ b/lua/app/config/tutorial_start.lua.meta @@ -1,5 +1,5 @@ fileFormatVersion: 2 -guid: 7b1900921f574ae4cb9a7a9ac0e55f5c +guid: 770896b6b97988447b9808e171b31e86 ScriptedImporter: internalIDToNameTable: [] externalObjects: {} diff --git a/lua/app/module/battle/battle_const.lua b/lua/app/module/battle/battle_const.lua index 80bf108d..c84eb200 100644 --- a/lua/app/module/battle/battle_const.lua +++ b/lua/app/module/battle/battle_const.lua @@ -37,6 +37,7 @@ BattleConst.ANIMATOR_HASH_NAME_NUMBER_MOVE_L = -526518883 BattleConst.ANIMATOR_HASH_NAME_NUMBER_MOVE_R = 445827326 BattleConst.ANIMATOR_HASH_NAME_NUMBER_CRIT = -1734531349 BattleConst.ANIMATOR_HASH_NAME_NUMBER_BUFF = 1364146828 +BattleConst.UNLOCK_SKILL_ROGUE_TYPE = 6 BattleConst.RECOVER_HP_COUNT = 3 BattleConst.RECOVER_HP_INTERVAL = 0.2 BattleConst.RECOVER_HP_PERCENT = 333 diff --git a/lua/app/module/battle/controller/battle_controller.lua b/lua/app/module/battle/controller/battle_controller.lua index 95a040e1..54bc2976 100644 --- a/lua/app/module/battle/controller/battle_controller.lua +++ b/lua/app/module/battle/controller/battle_controller.lua @@ -1269,6 +1269,34 @@ function BattleController:getRandomSkillList(getCount) end end + for elementType, list in pairs(skillPool) do + if self.battleData:isUnlockedSkillElementType(elementType) then + for _, skillId in ipairs(list) do + local skillCfg = cfg[skillId] + if skillCfg and (not skillCfg.limit_times or self.battleData:getSkillCount(skillId) < skillCfg.limit_times) then + if not map[skillId] then + table.insert(newSkillPool, skillId) + table.insert(skillWeight, skillCfg.weight) + count = count + 1 + map[skillId] = true + end + end + end + else + local skillEntity = self.battleData:getSkillEntityByElement(elementType) + if skillEntity then + local skillId = skillEntity:getUnlockId() + if skillId and not map[skillId] then + local skillCfg = cfg[skillId] + table.insert(newSkillPool, skillId) + table.insert(skillWeight, skillCfg.weight) + count = count + 1 + map[skillId] = true + end + end + end + end + if count > 0 then local index = GFunc.getRandomIndex(skillWeight) local skillId = table.remove(newSkillPool, index) @@ -1298,6 +1326,9 @@ function BattleController:getRandomSkillList(getCount) table.remove(skillWeight, index) count = count - 1 table.insert(result, skillId) + if count <= 0 then + break + end end result = table.shuffle(result) diff --git a/lua/app/module/battle/skill/battle_rogue_skill_handle.lua b/lua/app/module/battle/skill/battle_rogue_skill_handle.lua index 6bf90faf..749dc0be 100644 --- a/lua/app/module/battle/skill/battle_rogue_skill_handle.lua +++ b/lua/app/module/battle/skill/battle_rogue_skill_handle.lua @@ -99,6 +99,14 @@ local _addAttr = function(skillInfo, battleData, battleController, value) battleController:addHeroAttr(skillInfo.attr.type, value) end +local _unlockSkill = function(skillInfo, battleData, battleController, value) + if not skillInfo.skill_position then + return + end + + battleData:unlockSkillEntity(skillInfo.skill_position) +end + local _addSkillEffectParams = function(skillInfo, battleData, battleController) local elementType = skillInfo.skill_position if not elementType or not skillInfo.parameter then @@ -273,7 +281,7 @@ BattleRogueSkillHandle._effectOn = { [3] = _addLinkAtkp, -- 增加链接伤害 [4] = _canLinkAnyElement, -- 可与任何技能连接 [5] = _addAttr, -- 纯粹增加属性 - -- [6] = _addSkillReleaseCount, -- 技能增加释放次数 + [6] = _unlockSkill, -- 技能增加释放次数 [7] = _addSkillEffectParams, -- 增加技能效果参数(比如护盾的承伤增加) [8] = _addSkillRound, -- 增加技能效果持续回合(比如护盾从1回合改为2回合) [9] = _addSkillEffect, -- 获得技能效果 diff --git a/lua/app/module/hero/hero_manager.lua b/lua/app/module/hero/hero_manager.lua index a5d1d984..cc8848f5 100644 --- a/lua/app/module/hero/hero_manager.lua +++ b/lua/app/module/hero/hero_manager.lua @@ -90,6 +90,9 @@ end function HeroManager:getSkillRogueBg(skillId) local cfg = ConfigManager:getConfig("skill_rogue")[skillId] + if cfg.type == GConst.BattleConst.UNLOCK_SKILL_ROGUE_TYPE then -- 解锁技能类型 + return "frame_skill_" .. cfg.skill_position + end return cfg and "frame_" .. cfg.qlt end diff --git a/lua/app/ui/battle/battle_ui.lua b/lua/app/ui/battle/battle_ui.lua index ab9f6090..1db95413 100644 --- a/lua/app/ui/battle/battle_ui.lua +++ b/lua/app/ui/battle/battle_ui.lua @@ -91,7 +91,7 @@ function BattleUI:initSkill() local uiMap = self.root:genAllChildren() for name, elementType in pairs(GConst.BattleConst.ELEMENT_TYPE) do - local obj = uiMap["battle_ui.bg_2.skill_node_cell_" .. elementType] + local obj = uiMap["battle_ui.bg_2.skill_node.skill_node_cell_" .. elementType] if obj then self.skillNodeCells[elementType] = CellManager:addCellComp(obj, SKILL_NODE_CELL) local skillEntity = DataManager.BattleData:getSkillEntities()[elementType] diff --git a/lua/app/ui/battle/cell/skill_node_cell.lua b/lua/app/ui/battle/cell/skill_node_cell.lua index 052aced3..6c23ff47 100644 --- a/lua/app/ui/battle/cell/skill_node_cell.lua +++ b/lua/app/ui/battle/cell/skill_node_cell.lua @@ -8,6 +8,13 @@ function SkillNodeCell:refresh(skillEntity, elementMap) end local uiMap = self:getUIMap() + local iconNode = uiMap["skill_node_cell.icon_node"] + if not skillEntity:getUnlocked() then + iconNode:setVisible(false) + return + else + iconNode:setVisible(true) + end if not self.imgComp then self.imgComp = uiMap["skill_node_cell.energy_bg"]:getComponent(GConst.TYPEOF_UNITY_CLASS.UI_IMAGE) end diff --git a/lua/app/ui/hero/hero_detail_ui.lua b/lua/app/ui/hero/hero_detail_ui.lua index f20d0733..e7cd93d0 100644 --- a/lua/app/ui/hero/hero_detail_ui.lua +++ b/lua/app/ui/hero/hero_detail_ui.lua @@ -58,14 +58,14 @@ function HeroDetailUI:_display() skillBg:addClickListener(function() ModuleManager.TipsManager:showDescTips(ModuleManager.HeroManager:getSkillRogueDesc(skillId), skillIcon) end) - skillBg:setSprite(GConst.ATLAS_PATH.ICON_SKILL_ROGUE, ModuleManager.HeroManager:getSkillRogueBg(skillId)) skillIcon:setSprite(GConst.ATLAS_PATH.ICON_SKILL_ROGUE, ModuleManager.HeroManager:getSkillRogueIcon(skillId)) - skillBg:setImageGray(i > activeCount) skillBg:setTouchEnable(true) if i > activeCount then skillLv:setText(I18N:getGlobalText(I18N.GlobalConst.HERO_DESC_1, skillLvs[i] or 0)) + skillBg:setSprite(GConst.ATLAS_PATH.ICON_SKILL_ROGUE, "frame_0") else skillLv:setText(GConst.EMPTY_STRING) + skillBg:setSprite(GConst.ATLAS_PATH.ICON_SKILL_ROGUE, ModuleManager.HeroManager:getSkillRogueBg(skillId)) end end end diff --git a/lua/app/userdata/battle/battle_data.lua b/lua/app/userdata/battle/battle_data.lua index 5b9028c1..c419b967 100644 --- a/lua/app/userdata/battle/battle_data.lua +++ b/lua/app/userdata/battle/battle_data.lua @@ -101,9 +101,13 @@ function BattleData:initRogueSkills() local cfg = SKILL_CFG[skillId] self.skillMap[cfg.position] = BATTLE_BOARD_SKILL_ENTITY:create(skillId) self.skillMap[cfg.position]:addUpSkills(heroEntity:getRogueSkillList()) + self.skillMap[cfg.position]:setUnlockId(heroEntity:getUnlockRogueId()) for _, id in ipairs(heroEntity:getActiveTogueSkills()) do if not skillmap[id] then - table.insert(self.skillPool, id) + if not self.skillPool[cfg.position] then + self.skillPool[cfg.position] = {} + end + table.insert(self.skillPool[cfg.position], id) skillmap[id] = true end end @@ -315,13 +319,28 @@ function BattleData:getSkillEntityBySkillId(skillId) return self.skillMap[cfg.position] end +function BattleData:unlockSkillEntity(elementType) + if self.skillMap[elementType] then + self.skillMap[elementType]:setUnlock() + end +end + +function BattleData:isUnlockedSkillElementType(elementType) + if not self.skillMap[elementType] then + return false + end + return self.skillMap[elementType]:getUnlocked() +end + function BattleData:addSkillEnergy(elementMap) if not self.skillMap then return end for elementType, entity in pairs(self.skillMap) do - entity:addEnergy(elementMap[elementType] or 0) + if entity:getUnlocked() then + entity:addEnergy(elementMap[elementType] or 0) + end end end diff --git a/lua/app/userdata/battle/skill/battle_board_skill_entity.lua b/lua/app/userdata/battle/skill/battle_board_skill_entity.lua index 1299a0a8..10dd6574 100644 --- a/lua/app/userdata/battle/skill/battle_board_skill_entity.lua +++ b/lua/app/userdata/battle/skill/battle_board_skill_entity.lua @@ -27,6 +27,25 @@ function BattleBoardSkillEntity:getSkillId() return self.skillId end +function BattleBoardSkillEntity:getUnlocked() + return self.unlocked +end + +function BattleBoardSkillEntity:setUnlock() + if self.unlocked then + return + end + self.unlocked = true +end + +function BattleBoardSkillEntity:setUnlockId(unlockId) + self.unlockId = unlockId +end + +function BattleBoardSkillEntity:getUnlockId() + return self.unlockId +end + function BattleBoardSkillEntity:getNeedEnergy() if not self.config then return 1 diff --git a/lua/app/userdata/hero/hero_entity.lua b/lua/app/userdata/hero/hero_entity.lua index 4bfb7e0d..796807a6 100644 --- a/lua/app/userdata/hero/hero_entity.lua +++ b/lua/app/userdata/hero/hero_entity.lua @@ -225,6 +225,10 @@ function HeroEntity:getActiveRogueCount() return lvInfo.unlock_skill end +function HeroEntity:getUnlockRogueId() + return self.config.rouge_skill +end + function HeroEntity:getRogueSkillList() if not self.rogueSkillList then self.rogueSkillList = {}