This commit is contained in:
chenxi 2023-04-20 21:48:51 +08:00
commit a8261cd641
14 changed files with 118 additions and 26 deletions

View File

@ -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,

View File

@ -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 = {

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 5b5a5d0a581e34e4783076bf305923c8
guid: c2def61829e024e499f536c5f7210ed1
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}

View File

@ -1,5 +1,5 @@
fileFormatVersion: 2
guid: 7b1900921f574ae4cb9a7a9ac0e55f5c
guid: 770896b6b97988447b9808e171b31e86
ScriptedImporter:
internalIDToNameTable: []
externalObjects: {}

View File

@ -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

View File

@ -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)

View File

@ -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, -- 获得技能效果

View File

@ -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

View File

@ -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]

View File

@ -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

View File

@ -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

View File

@ -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,14 +319,29 @@ 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
if entity:getUnlocked() then
entity:addEnergy(elementMap[elementType] or 0)
end
end
end
function BattleData:addSkillCount(skillId, value)

View File

@ -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

View File

@ -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 = {}