Commit d232676aa51f3cbb880888e83b4dc0a8bcfdd91b

Authored by zhouhaihai
1 parent 3df1e9ea

功能解锁 冒险返回

@@ -66,6 +66,18 @@ FuncOpenType = { @@ -66,6 +66,18 @@ FuncOpenType = {
66 TimeBoxSlot = 8, -- 时钟箱槽 66 TimeBoxSlot = 8, -- 时钟箱槽
67 } 67 }
68 68
  69 +-- 关卡通关相关的 功能开放 对应 guide_unlock
  70 +FuncUnlock = {
  71 + GetHero = 1, -- 招募
  72 + TaskAchiv = 2, -- 任务成就
  73 + BonusBattle = 3, -- 奖励关卡
  74 + DifficultHang = 4, --困难难度
  75 + Tower = 5, -- 电波塔
  76 + Diner = 6, -- 餐厅
  77 + Pvp = 7, --竞技场
  78 + Adv = 8, -- 冒险
  79 +}
  80 +
69 TypeIsFunc = {} 81 TypeIsFunc = {}
70 for _, v in pairs(FuncOpenType) do 82 for _, v in pairs(FuncOpenType) do
71 TypeIsFunc[v] = true 83 TypeIsFunc[v] = true
@@ -139,16 +151,16 @@ AdvBackEventType = { @@ -139,16 +151,16 @@ AdvBackEventType = {
139 AtkChange = 3, --攻击改变 151 AtkChange = 3, --攻击改变
140 Buff = 4, --buff 改变 152 Buff = 4, --buff 改变
141 Skill = 5, --释放技能 153 Skill = 5, --释放技能
142 - Atk = 6, --攻击动作 154 + BaseAttrChange = 6, -- 基础属性变化
143 Next = 7, --进入下一层 155 Next = 7, --进入下一层
144 End = 8, -- 结束 156 End = 8, -- 结束
145 BlockChange = 9, -- 块改变 157 BlockChange = 9, -- 块改变
146 SpChange = 10, --体力改变 158 SpChange = 10, --体力改变
147 Dead = 11, --怪死亡 159 Dead = 11, --怪死亡
148 - DefChange = 12, -- 防御变化  
149 - Passive = 13, -- 獲得被動  
150 - TurnEnd = 14, -- 回合结束  
151 - Miss = 15, -- miss 160 + Trader = 12, -- 召唤商人
  161 + Monster = 13, -- 召唤怪物
  162 +
  163 +
152 Cost = 16, -- 消耗道具 164 Cost = 16, -- 消耗道具
153 Trap = 17, --陷阱 165 Trap = 17, --陷阱
154 Layer = 18, --切换层 166 Layer = 18, --切换层
src/actions/AdvAction.lua
@@ -85,7 +85,8 @@ function _M.startAdvRpc( agent, data ) @@ -85,7 +85,8 @@ function _M.startAdvRpc( agent, data )
85 local layer = msg.layer or 1 --选择层数 85 local layer = msg.layer or 1 --选择层数
86 local format = msg.format --编队 86 local format = msg.format --编队
87 local supportIdx = msg.supportIdx --选择的支援效果 87 local supportIdx = msg.supportIdx --选择的支援效果
88 - 88 + if not role:isFuncUnlock(FuncUnlock.Adv) then return end
  89 +
89 --上一个关卡结束才可以开始新的关卡 90 --上一个关卡结束才可以开始新的关卡
90 if role:getAdvData():isRunning() then return 8 end 91 if role:getAdvData():isRunning() then return 8 end
91 92
src/actions/HangAction.lua
@@ -71,6 +71,10 @@ function _M.startRpc( agent, data ) @@ -71,6 +71,10 @@ function _M.startRpc( agent, data )
71 local carbonData = csvdb["idle_battleCsv"][carbonId] 71 local carbonData = csvdb["idle_battleCsv"][carbonId]
72 if not carbonData then return 1 end 72 if not carbonData then return 1 end
73 73
  74 + if math.floor(carbonId / 10000) ~= 1 then
  75 + if not role:isFuncUnlock(FuncUnlock.DifficultHang) then return end
  76 + end
  77 +
74 local hangPass = role:getProperty("hangPass") 78 local hangPass = role:getProperty("hangPass")
75 79
76 for _, preCarbonId in ipairs(carbonData.prepose:toArray(true, "=")) do 80 for _, preCarbonId in ipairs(carbonData.prepose:toArray(true, "=")) do
@@ -413,6 +417,9 @@ function _M.startBonusBattleRpc(agent, data) @@ -413,6 +417,9 @@ function _M.startBonusBattleRpc(agent, data)
413 local msg = MsgPack.unpack(data) 417 local msg = MsgPack.unpack(data)
414 local id = msg.id 418 local id = msg.id
415 419
  420 + if not role:isFuncUnlock(FuncUnlock.BonusBattle) then return end
  421 +
  422 +
416 local bonusData = csvdb["bonus_battleCsv"][id] 423 local bonusData = csvdb["bonus_battleCsv"][id]
417 if not bonusData then return 1 end 424 if not bonusData then return 1 end
418 local hangPass = role:getProperty("hangPass") 425 local hangPass = role:getProperty("hangPass")
src/actions/HeroAction.lua
@@ -713,6 +713,7 @@ function _M.drawHeroRpc(agent, data) @@ -713,6 +713,7 @@ function _M.drawHeroRpc(agent, data)
713 local role = agent.role 713 local role = agent.role
714 local msg = MsgPack.unpack(data) 714 local msg = MsgPack.unpack(data)
715 715
  716 + if not role:isFuncUnlock(FuncUnlock.GetHero) then return end
716 local pool = msg.pool -- 1 2 3 717 local pool = msg.pool -- 1 2 3
717 local drawType = msg.type -- 1 单抽 2 十连 718 local drawType = msg.type -- 1 单抽 2 十连
718 719
src/actions/PvpAction.lua
@@ -92,6 +92,8 @@ function _M.infoRpc(agent, data) @@ -92,6 +92,8 @@ function _M.infoRpc(agent, data)
92 local roleId = role:getProperty("id") 92 local roleId = role:getProperty("id")
93 local msg = MsgPack.unpack(data) 93 local msg = MsgPack.unpack(data)
94 local ptype = msg.ptype or 1 94 local ptype = msg.ptype or 1
  95 +
  96 + if not role:isFuncUnlock(FuncUnlock.Pvp) then return end
95 97
96 local response = {} 98 local response = {}
97 if ptype == 1 then -- 普通pvp 99 if ptype == 1 then -- 普通pvp
src/actions/RoleAction.lua
@@ -622,6 +622,9 @@ end @@ -622,6 +622,9 @@ end
622 function _M.taskRpc(agent, data) 622 function _M.taskRpc(agent, data)
623 local role = agent.role 623 local role = agent.role
624 local msg = MsgPack.unpack(data) 624 local msg = MsgPack.unpack(data)
  625 +
  626 + if not role:isFuncUnlock(FuncUnlock.TaskAchiv) then return end
  627 +
625 local taskType = msg.type -- 1 日常 2 周长 628 local taskType = msg.type -- 1 日常 2 周长
626 local taskId = msg.id --任务id 629 local taskId = msg.id --任务id
627 local roleField = {"dTask", "wTask"} 630 local roleField = {"dTask", "wTask"}
@@ -652,6 +655,9 @@ end @@ -652,6 +655,9 @@ end
652 function _M.taskActiveRpc(agent, data) 655 function _M.taskActiveRpc(agent, data)
653 local role = agent.role 656 local role = agent.role
654 local msg = MsgPack.unpack(data) 657 local msg = MsgPack.unpack(data)
  658 +
  659 + if not role:isFuncUnlock(FuncUnlock.TaskAchiv) then return end
  660 +
655 local taskType = msg.type -- 1 日常 2 周长 661 local taskType = msg.type -- 1 日常 2 周长
656 local taskId = msg.id --任务id 662 local taskId = msg.id --任务id
657 local roleField = {"dTask", "wTask"} 663 local roleField = {"dTask", "wTask"}
@@ -681,6 +687,8 @@ function _M.achiveRpc(agent, data) @@ -681,6 +687,8 @@ function _M.achiveRpc(agent, data)
681 local msg = MsgPack.unpack(data) 687 local msg = MsgPack.unpack(data)
682 local taskId = msg.id --任务id 688 local taskId = msg.id --任务id
683 689
  690 + if not role:isFuncUnlock(FuncUnlock.TaskAchiv) then return end
  691 +
684 local achiveTask = csvdb["achievementCsv"][taskId] 692 local achiveTask = csvdb["achievementCsv"][taskId]
685 if not achiveTask then return end 693 if not achiveTask then return end
686 694
src/actions/TowerAction.lua
@@ -52,6 +52,8 @@ function _M.startBattleRpc(agent, data) @@ -52,6 +52,8 @@ function _M.startBattleRpc(agent, data)
52 local role = agent.role 52 local role = agent.role
53 local msg = MsgPack.unpack(data) 53 local msg = MsgPack.unpack(data)
54 local id = msg.id 54 local id = msg.id
  55 +
  56 + if not role:isFuncUnlock(FuncUnlock.Tower) then return end
55 57
56 local towerInfo = role:getProperty("towerInfo") 58 local towerInfo = role:getProperty("towerInfo")
57 59
@@ -979,6 +979,7 @@ local function chooseCommon(self, room, block, chooseData, choose, tag) @@ -979,6 +979,7 @@ local function chooseCommon(self, room, block, chooseData, choose, tag)
979 end, 979 end,
980 [3] = function() --发现怪物 980 [3] = function() --发现怪物
981 self:getCurMap():addNewMonsterRand(effect[2], {room, block}) 981 self:getCurMap():addNewMonsterRand(effect[2], {room, block})
  982 + self:pushBackEvent(AdvBackEventType.Monster, {id = effect[2]})
982 clearBlock = false 983 clearBlock = false
983 end, 984 end,
984 [4] = function() --无事发生 985 [4] = function() --无事发生
@@ -999,6 +1000,7 @@ local function chooseCommon(self, room, block, chooseData, choose, tag) @@ -999,6 +1000,7 @@ local function chooseCommon(self, room, block, chooseData, choose, tag)
999 id = effect[2] 1000 id = effect[2]
1000 }) 1001 })
1001 block:randomEvent() 1002 block:randomEvent()
  1003 + self:pushBackEvent(AdvBackEventType.Trader, {id = effect[2]})
1002 clearBlock = false 1004 clearBlock = false
1003 end, 1005 end,
1004 [7] = function() -- 建筑 1006 [7] = function() -- 建筑
@@ -1386,6 +1388,7 @@ function Adv:doActive(activeId, target) @@ -1386,6 +1388,7 @@ function Adv:doActive(activeId, target)
1386 }) 1388 })
1387 target:randomEvent() 1389 target:randomEvent()
1388 self:backBlockChange(target.room.roomId, target.blockId) 1390 self:backBlockChange(target.room.roomId, target.blockId)
  1391 + self:pushBackEvent(AdvBackEventType.Trader, {id = traderId})
1389 end 1392 end
1390 end 1393 end
1391 return true 1394 return true
@@ -1398,6 +1401,7 @@ function Adv:doActive(activeId, target) @@ -1398,6 +1401,7 @@ function Adv:doActive(activeId, target)
1398 self.battle:removeEnemyById(target.id) 1401 self.battle:removeEnemyById(target.id)
1399 self:getCurMap():addNewMonsterRand(monsterId, {self:getRoom(target.roomId), self:getBlock(target.roomId, target.blockId)}) 1402 self:getCurMap():addNewMonsterRand(monsterId, {self:getRoom(target.roomId), self:getBlock(target.roomId, target.blockId)})
1400 self:backBlockChange(target.roomId, target.blockId) 1403 self:backBlockChange(target.roomId, target.blockId)
  1404 + self:pushBackEvent(AdvBackEventType.Monster, {id = monsterId})
1401 end 1405 end
1402 end 1406 end
1403 return true 1407 return true
@@ -1490,6 +1494,18 @@ function Adv:doActive(activeId, target) @@ -1490,6 +1494,18 @@ function Adv:doActive(activeId, target)
1490 return true 1494 return true
1491 end 1495 end
1492 1496
  1497 + doActiveEffect[12] = function(_, vtype, attrType, value)
  1498 + local attr
  1499 + if attrType == 0 then
  1500 + attr = "sp"
  1501 + else
  1502 + attr = AttsEnumEx[attrType]
  1503 + if not AdvAttsEnum[attr] then return end
  1504 + end
  1505 + self.battle.player:addBaseAttr(attr, value, vtype)
  1506 + return true
  1507 + end
  1508 +
1493 for _, effect in ipairs(activeData.effect:toArray()) do 1509 for _, effect in ipairs(activeData.effect:toArray()) do
1494 local cur = effect:toArray(true, "=") 1510 local cur = effect:toArray(true, "=")
1495 if doActiveEffect[cur[1]] then 1511 if doActiveEffect[cur[1]] then
@@ -1612,36 +1628,12 @@ function Adv:backReward(items, params) @@ -1612,36 +1628,12 @@ function Adv:backReward(items, params)
1612 params = params or {} 1628 params = params or {}
1613 self:pushBackEvent(AdvBackEventType.Reward, {items = items, roomId = params.roomId, blockId = params.blockId}) 1629 self:pushBackEvent(AdvBackEventType.Reward, {items = items, roomId = params.roomId, blockId = params.blockId})
1614 end 1630 end
1615 --- if is player enemyId is nil  
1616 ---isMax 是否是改变血量上限  
1617 -function Adv:backHpChange(enemyId, change, isMax)  
1618 - self:pushBackEvent(AdvBackEventType.HpChange, {enemyId = enemyId, change = change, isMax = isMax})  
1619 -end  
1620 -  
1621 --- if is player enemyId is nil  
1622 -function Adv:backAtkChange(enemyId, change)  
1623 - self:pushBackEvent(AdvBackEventType.AtkChange, {enemyId = enemyId, change = change})  
1624 -end  
1625 1631
1626 -- if is player enemyId is nil 1632 -- if is player enemyId is nil
1627 -function Adv:backDefChange(enemyId, change)  
1628 - self:pushBackEvent(AdvBackEventType.DefChange, {enemyId = enemyId, change = change})  
1629 -end  
1630 -  
1631 --- if is player enemyId is nil  
1632 -function Adv:backBuff(enemyId, buffId, isDel)  
1633 - self:pushBackEvent(AdvBackEventType.Buff, {enemyId = enemyId, buffId = buffId, isDel = isDel})  
1634 -end  
1635 --- if is player enemyId is nil  
1636 function Adv:backSkill(enemyId, skillId, receiver) 1633 function Adv:backSkill(enemyId, skillId, receiver)
1637 self:pushBackEvent(AdvBackEventType.Skill, {enemyId = enemyId, skillId = skillId, receiver = receiver}) 1634 self:pushBackEvent(AdvBackEventType.Skill, {enemyId = enemyId, skillId = skillId, receiver = receiver})
1638 end 1635 end
1639 1636
1640 --- if is player enemyId is nil  
1641 -function Adv:backPassive(enemyId, passiveId)  
1642 - self:pushBackEvent(AdvBackEventType.Passive, {enemyId = enemyId, passiveId = passiveId})  
1643 -end  
1644 -  
1645 function Adv:backNext() 1637 function Adv:backNext()
1646 self:pushBackEvent(AdvBackEventType.Next, {}) 1638 self:pushBackEvent(AdvBackEventType.Next, {})
1647 end 1639 end
src/adv/AdvPassive.lua
@@ -423,6 +423,8 @@ function Passive:effect5(monsterId) @@ -423,6 +423,8 @@ function Passive:effect5(monsterId)
423 end 423 end
424 end 424 end
425 self.owner.battle.adv:getCurMap():addNewMonsterRand(monsterId) 425 self.owner.battle.adv:getCurMap():addNewMonsterRand(monsterId)
  426 + self.owner.battle.adv:pushBackEvent(AdvBackEventType.Monster, {id = monsterId})
  427 +
426 end 428 end
427 429
428 --6=给所有场上怪物增加buff 430 --6=给所有场上怪物增加buff
src/adv/AdvPlayer.lua
@@ -69,7 +69,6 @@ function BaseObject:clearRound() @@ -69,7 +69,6 @@ function BaseObject:clearRound()
69 for i = #self.buffs, 1, -1 do 69 for i = #self.buffs, 1, -1 do
70 if self.buffs[i].isDel then 70 if self.buffs[i].isDel then
71 local buff = self.buffs[i] 71 local buff = self.buffs[i]
72 - self.battle.adv:backBuff(self.monsterId, buff.id, true)  
73 table.remove(self.buffs, i) 72 table.remove(self.buffs, i)
74 buff:endBuff() 73 buff:endBuff()
75 if self.attrChangeCondBuffCheck then 74 if self.attrChangeCondBuffCheck then
@@ -102,8 +101,6 @@ function BaseObject:addPassive(params) @@ -102,8 +101,6 @@ function BaseObject:addPassive(params)
102 local level = params.level or 1 101 local level = params.level or 1
103 if not skillData[level] then return end 102 if not skillData[level] then return end
104 table.insert(self.passives, Passive.new(self, { id = skillId, level = level })) 103 table.insert(self.passives, Passive.new(self, { id = skillId, level = level }))
105 -  
106 - self.battle.adv:backPassive(self.monsterId, skillId)  
107 end 104 end
108 105
109 function BaseObject:getPassiveIdx(passive) 106 function BaseObject:getPassiveIdx(passive)
@@ -151,7 +148,6 @@ function BaseObject:addBuff(buffId, releaser) @@ -151,7 +148,6 @@ function BaseObject:addBuff(buffId, releaser)
151 buff:createAfter() 148 buff:createAfter()
152 end 149 end
153 self:triggerPassive(Passive.GET_BUFF, {buffId = buffId}) 150 self:triggerPassive(Passive.GET_BUFF, {buffId = buffId})
154 - self.battle.adv:backBuff(self.monsterId, buffId)  
155 return true 151 return true
156 end 152 end
157 153
@@ -166,7 +162,6 @@ end @@ -166,7 +162,6 @@ end
166 function BaseObject:delBuffById(bId) 162 function BaseObject:delBuffById(bId)
167 for idx, buff in ipairs(self.buffs) do 163 for idx, buff in ipairs(self.buffs) do
168 if buff.id == bId then 164 if buff.id == bId then
169 - self.battle.adv:backBuff(self.monsterId, buff.id, true)  
170 table.remove(self.buffs, idx) 165 table.remove(self.buffs, idx)
171 buff:endBuff() 166 buff:endBuff()
172 if self.attrChangeCondBuffCheck then 167 if self.attrChangeCondBuffCheck then
@@ -293,13 +288,6 @@ function BaseObject:reSetAttr(field) @@ -293,13 +288,6 @@ function BaseObject:reSetAttr(field)
293 local effect = self:getAttrBuffChange(field) 288 local effect = self:getAttrBuffChange(field)
294 self[field] = math.ceil((self[field] + effect[0]) * (1 + effect[1])) 289 self[field] = math.ceil((self[field] + effect[0]) * (1 + effect[1]))
295 local delta = self[field] - old 290 local delta = self[field] - old
296 - if delta ~= 0 then  
297 - if field == "atk" then  
298 - self.battle.adv:backAtkChange(self.monsterId, delta)  
299 - elseif field == "def" then  
300 - self.battle.adv:backDefChange(self.monsterId, delta)  
301 - end  
302 - end  
303 end 291 end
304 292
305 -- 重新计算 血量上限 293 -- 重新计算 血量上限
@@ -394,7 +382,10 @@ function BaseObject:hurt(value, releaser, params) @@ -394,7 +382,10 @@ function BaseObject:hurt(value, releaser, params)
394 end 382 end
395 383
396 --受伤了~ 384 --受伤了~
397 - self.battle.adv:backHpChange(self.monsterId, -value) 385 + if self:is("Player") and params.hurtType ~= 5 then
  386 + self.battle.adv:pushBackEvent(AdvBackEventType.HpChange, {change = -value})
  387 + end
  388 +
398 if params.hurtType ~= 5 then -- 非客户端发回的伤害 返回更新地块 389 if params.hurtType ~= 5 then -- 非客户端发回的伤害 返回更新地块
399 if self.roomId and self.blockId then 390 if self.roomId and self.blockId then
400 self.battle.adv:backBlockChange(self.roomId, self.blockId) 391 self.battle.adv:backBlockChange(self.roomId, self.blockId)
@@ -423,7 +414,7 @@ function BaseObject:recover(value, releaser, params) @@ -423,7 +414,7 @@ function BaseObject:recover(value, releaser, params)
423 params = params or {} 414 params = params or {}
424 value = math.max(0, math.ceil(value)) 415 value = math.max(0, math.ceil(value))
425 self.hp = math.min(self.hpMax, self.hp + value) 416 self.hp = math.min(self.hpMax, self.hp + value)
426 - self.battle.adv:backHpChange(self.monsterId, value) 417 + self.battle.adv:pushBackEvent(AdvBackEventType.HpChange, {change = value})
427 end 418 end
428 419
429 function BaseObject:addSpecialSkill(skillId, skillLevel, target) 420 function BaseObject:addSpecialSkill(skillId, skillLevel, target)
@@ -516,6 +507,10 @@ end @@ -516,6 +507,10 @@ end
516 function BaseObject:changeSp() 507 function BaseObject:changeSp()
517 end 508 end
518 509
  510 +function BaseObject:is(what)
  511 + return self["is" .. what] and self["is" .. what](self)
  512 +end
  513 +
519 local Enemy = class("Enemy", BaseObject) 514 local Enemy = class("Enemy", BaseObject)
520 function Enemy:ctor(battle, mId, monsterId, roomId, blockId, lock, enemy, mapIdx) 515 function Enemy:ctor(battle, mId, monsterId, roomId, blockId, lock, enemy, mapIdx)
521 Enemy.super.ctor(self, battle) 516 Enemy.super.ctor(self, battle)
@@ -532,6 +527,10 @@ function Enemy:unlock(id) @@ -532,6 +527,10 @@ function Enemy:unlock(id)
532 self.lock = nil 527 self.lock = nil
533 end 528 end
534 529
  530 +function Enemy:isEnemy()
  531 + return true
  532 +end
  533 +
535 local Player = class("Player", BaseObject) 534 local Player = class("Player", BaseObject)
536 function Player:ctor(battle, data) 535 function Player:ctor(battle, data)
537 Player.super.ctor(self, battle) 536 Player.super.ctor(self, battle)
@@ -567,7 +566,7 @@ function Player:addExp(value) @@ -567,7 +566,7 @@ function Player:addExp(value)
567 local delta = level - self.level 566 local delta = level - self.level
568 if delta > 0 then 567 if delta > 0 then
569 for attr, _ in pairs(AdvAttsEnum) do 568 for attr, _ in pairs(AdvAttsEnum) do
570 - self:addBaseAttr(attr, self.growth[attr] * delta) 569 + self:addBaseAttr(attr, self.growth[attr] * delta, 0, true)
571 end 570 end
572 self.battle.adv:pushBackEvent(AdvBackEventType.Level, {level = level, delta = delta}) 571 self.battle.adv:pushBackEvent(AdvBackEventType.Level, {level = level, delta = delta})
573 end 572 end
@@ -576,7 +575,7 @@ function Player:addExp(value) @@ -576,7 +575,7 @@ function Player:addExp(value)
576 return value 575 return value
577 end 576 end
578 --vtype 0/1 值/% 577 --vtype 0/1 值/%
579 -function Player:addBaseAttr(attr, value, vtype) 578 +function Player:addBaseAttr(attr, value, vtype, ignoreBack)
580 local attrName = attr 579 local attrName = attr
581 if attr == "hp" then 580 if attr == "hp" then
582 attrName = "hpMax" 581 attrName = "hpMax"
@@ -601,6 +600,10 @@ function Player:addBaseAttr(attr, value, vtype) @@ -601,6 +600,10 @@ function Player:addBaseAttr(attr, value, vtype)
601 else 600 else
602 self:reSetAttr(attr) 601 self:reSetAttr(attr)
603 end 602 end
  603 +
  604 + if not ignoreBack then
  605 + self.battle.adv:pushBackEvent(AdvBackEventType.BaseAttrChange, {type = AdvAttsEnum[attr] or 0, change = change})
  606 + end
604 end 607 end
605 608
606 --cType 0 or nil 值 1 百分比 609 --cType 0 or nil 值 1 百分比
@@ -649,6 +652,7 @@ function Player:addBuff(buffId, releaser) @@ -649,6 +652,7 @@ function Player:addBuff(buffId, releaser)
649 if status then 652 if status then
650 self.battle.player:attrChangeCondBuffCheck(2, buffId) 653 self.battle.player:attrChangeCondBuffCheck(2, buffId)
651 self.battle.adv:checkAchievement(self.battle.adv.AchievType.GetBuff, 1, buffId) 654 self.battle.adv:checkAchievement(self.battle.adv.AchievType.GetBuff, 1, buffId)
  655 + self.battle.adv:pushBackEvent(AdvBackEventType.Buff, {buffId = buffId})
652 end 656 end
653 return status 657 return status
654 end 658 end
@@ -673,6 +677,10 @@ function Player:attrChangeCondBuffCheck(etype, cond) @@ -673,6 +677,10 @@ function Player:attrChangeCondBuffCheck(etype, cond)
673 end 677 end
674 end 678 end
675 679
  680 +function Player:isPlayer()
  681 + return true
  682 +end
  683 +
676 function Player:getDB() 684 function Player:getDB()
677 local db = Player.super.getDB(self) 685 local db = Player.super.getDB(self)
678 for _ , field in pairs({"level", "exp", "growth", "sp", "spMax"}) do 686 for _ , field in pairs({"level", "exp", "growth", "sp", "spMax"}) do
@@ -705,6 +713,9 @@ end @@ -705,6 +713,9 @@ end
705 function Build:hurt() 713 function Build:hurt()
706 end 714 end
707 715
  716 +function Build:isBuild()
  717 + return true
  718 +end
708 --0 全部 1 怪物 2 玩家 719 --0 全部 1 怪物 2 玩家
709 function Build:getTeam(nType, noSelf, mapIdx, includeLock) 720 function Build:getTeam(nType, noSelf, mapIdx, includeLock)
710 noSelf = false -- 不管怎么都取不到自己 721 noSelf = false -- 不管怎么都取不到自己
src/models/RolePlugin.lua
@@ -692,7 +692,21 @@ function RolePlugin.bind(Role) @@ -692,7 +692,21 @@ function RolePlugin.bind(Role)
692 return globalCsv.adv_endless_daily_cross_count 692 return globalCsv.adv_endless_daily_cross_count
693 end 693 end
694 694
  695 + -- 走 guide_unlock 表的 被动解锁
  696 + function Role:isFuncUnlock(func)
  697 + if not func then return true end -- 没有就是解锁了
  698 + local data = csvdb["guide_unlockCsv"][func]
  699 + if not data then return true end -- 没有就是解锁了
  700 +
  701 + local hangPass = role:getProperty("hangPass")
  702 + if hangPass[data.carbonId] then
  703 + return true
  704 + else
  705 + return false
  706 + end
  707 + end
695 708
  709 + -- 走 unlock 表的主动解锁
696 function Role:isFuncOpen(func) 710 function Role:isFuncOpen(func)
697 return self:getProperty("funcOpen")[func] == 1 711 return self:getProperty("funcOpen")[func] == 1
698 end 712 end