Merge branch 'dev' of git.juzugame.com:b6-client/b6-lua into dev
This commit is contained in:
commit
e15888698e
@ -255,6 +255,7 @@ local BUFF_NAME = {
|
|||||||
COUNTER_ATTACK = "counterattack",
|
COUNTER_ATTACK = "counterattack",
|
||||||
SKILL_HURT_ADD = "skill_hurt_add",
|
SKILL_HURT_ADD = "skill_hurt_add",
|
||||||
DEATH_SUMMON = "death_summon",
|
DEATH_SUMMON = "death_summon",
|
||||||
|
LOCK = "lock",
|
||||||
}
|
}
|
||||||
BattleConst.BUFF_NAME = BUFF_NAME
|
BattleConst.BUFF_NAME = BUFF_NAME
|
||||||
|
|
||||||
|
|||||||
@ -1389,6 +1389,73 @@ function BattleController:generateGridType(skillTypeParameter, monsterPos)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function BattleController:lockElement(lcokElementType, isUnlock)
|
||||||
|
local elementTypeMap = {}
|
||||||
|
local list
|
||||||
|
local lockElementMap
|
||||||
|
local locked = false
|
||||||
|
for posId, entity in pairs(self.battleData:getGridEnties()) do
|
||||||
|
local elementType = entity:getElementType()
|
||||||
|
if not isUnlock then
|
||||||
|
if entity:isEmptyIdle() then
|
||||||
|
if not elementTypeMap[elementType] then
|
||||||
|
elementTypeMap[elementType] = {}
|
||||||
|
if not isUnlock then
|
||||||
|
if not list then
|
||||||
|
list = {}
|
||||||
|
end
|
||||||
|
table.insert(list, elementType)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
table.insert(elementTypeMap[elementType], posId)
|
||||||
|
end
|
||||||
|
if entity:isLock() then
|
||||||
|
locked = true
|
||||||
|
end
|
||||||
|
else
|
||||||
|
if entity:isLock() then
|
||||||
|
if not lockElementMap then
|
||||||
|
lockElementMap = {}
|
||||||
|
end
|
||||||
|
if not lockElementMap[elementType] then
|
||||||
|
lockElementMap[elementType] = {}
|
||||||
|
end
|
||||||
|
table.insert(lockElementMap[elementType], posId)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
|
if isUnlock then
|
||||||
|
if lockElementMap then
|
||||||
|
for elementType, list in pairs(lockElementMap) do
|
||||||
|
self.battleData:cacheLockElement(elementType, nil)
|
||||||
|
for _, posId in ipairs(list) do
|
||||||
|
self.battleData:setGridType(posId, BattleConst.GRID_TYPE.EMPTY)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
else
|
||||||
|
if locked then -- 锁定过就不新锁了
|
||||||
|
return
|
||||||
|
end
|
||||||
|
local elementType = lcokElementType
|
||||||
|
if elementType == BattleConst.ELEMENT_TYPE.NONE then
|
||||||
|
if not list or not list[1] then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
elementType = list[math.random(1, #list)]
|
||||||
|
end
|
||||||
|
self.battleData:cacheLockElement(elementType, true)
|
||||||
|
local list = elementTypeMap[elementType]
|
||||||
|
if list then
|
||||||
|
for _, posId in ipairs(list) do
|
||||||
|
self.battleData:setGridType(posId, BattleConst.GRID_TYPE.LOCK)
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
end
|
||||||
|
|
||||||
function BattleController:getSkillElementList(elementType, count, useAlternate, excludeMap)
|
function BattleController:getSkillElementList(elementType, count, useAlternate, excludeMap)
|
||||||
local result = {}
|
local result = {}
|
||||||
local gridEntities = self.battleData:getGridEnties()
|
local gridEntities = self.battleData:getGridEnties()
|
||||||
|
|||||||
@ -82,6 +82,17 @@ local function _frozenOff(buffSender, target, buff, buffEffect)
|
|||||||
return 1
|
return 1
|
||||||
end
|
end
|
||||||
|
|
||||||
|
local function _lockOn(buffSender, buff, target, buffEffect)
|
||||||
|
target.battleController:lockElement(buff:getEffectNum(), false)
|
||||||
|
return 1
|
||||||
|
end
|
||||||
|
|
||||||
|
local function _lockOff(buffSender, target, buff, buffEffect)
|
||||||
|
target.battleController:lockElement(buff:getEffectNum(), true)
|
||||||
|
return 1
|
||||||
|
end
|
||||||
|
|
||||||
|
|
||||||
local _handleOn = {
|
local _handleOn = {
|
||||||
[BUFF_NAME.ADD_SKILL] = _addSkillOn, -- 添加技能
|
[BUFF_NAME.ADD_SKILL] = _addSkillOn, -- 添加技能
|
||||||
[BUFF_NAME.SKILL_FIRE_TIMES] = _skillFireTimesOn, -- 技能额外使用次数
|
[BUFF_NAME.SKILL_FIRE_TIMES] = _skillFireTimesOn, -- 技能额外使用次数
|
||||||
@ -89,6 +100,7 @@ local _handleOn = {
|
|||||||
[BUFF_NAME.UNDEAD] = _undeadOn, -- 不死
|
[BUFF_NAME.UNDEAD] = _undeadOn, -- 不死
|
||||||
[BUFF_NAME.IMPRISON] = _imprisonOn, -- 禁锢
|
[BUFF_NAME.IMPRISON] = _imprisonOn, -- 禁锢
|
||||||
[BUFF_NAME.FROZEN] = _frozenOn, -- 冻结
|
[BUFF_NAME.FROZEN] = _frozenOn, -- 冻结
|
||||||
|
[BUFF_NAME.LOCK] = _lockOn, -- 锁定
|
||||||
}
|
}
|
||||||
|
|
||||||
local _handleOff = {
|
local _handleOff = {
|
||||||
@ -98,6 +110,7 @@ local _handleOff = {
|
|||||||
[BUFF_NAME.UNDEAD] = _undeadOff, -- 不死
|
[BUFF_NAME.UNDEAD] = _undeadOff, -- 不死
|
||||||
[BUFF_NAME.IMPRISON] = _imprisonOff, -- 禁锢
|
[BUFF_NAME.IMPRISON] = _imprisonOff, -- 禁锢
|
||||||
[BUFF_NAME.FROZEN] = _frozenOff, -- 冻结
|
[BUFF_NAME.FROZEN] = _frozenOff, -- 冻结
|
||||||
|
[BUFF_NAME.LOCK] = _lockOff, -- 锁定
|
||||||
}
|
}
|
||||||
|
|
||||||
local _handleWork = {
|
local _handleWork = {
|
||||||
|
|||||||
@ -23,6 +23,7 @@ function BattleData:init()
|
|||||||
self.needBattleExp = self:getLvNeedExp()
|
self.needBattleExp = self:getLvNeedExp()
|
||||||
self.addLvCount = 0
|
self.addLvCount = 0
|
||||||
self.timeScale = BattleConst.TIME_SCALE.LEVEL_1
|
self.timeScale = BattleConst.TIME_SCALE.LEVEL_1
|
||||||
|
self.lockElementMap = {}
|
||||||
self.data.timeSpeed = 1
|
self.data.timeSpeed = 1
|
||||||
self.data.lvDirty = false
|
self.data.lvDirty = false
|
||||||
BattleSkillEntity.sid = 0
|
BattleSkillEntity.sid = 0
|
||||||
@ -330,6 +331,15 @@ function BattleData:setInfoBySnapshop(posId, snapInfo)
|
|||||||
entity:setInfoBySnapshop(snapInfo)
|
entity:setInfoBySnapshop(snapInfo)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function BattleData:setGridType(posId, gridType)
|
||||||
|
local entity = self.gridEntities[posId]
|
||||||
|
if not entity then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
entity:setGridType(gridType)
|
||||||
|
entity:determineIdleStatus()
|
||||||
|
end
|
||||||
|
|
||||||
function BattleData:getSkillEntities()
|
function BattleData:getSkillEntities()
|
||||||
return self.skillMap
|
return self.skillMap
|
||||||
end
|
end
|
||||||
@ -416,6 +426,14 @@ function BattleData:changeSkillId(elementType, newId)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
function BattleData:cacheLockElement(elementType, status)
|
||||||
|
self.lockElementMap[elementType] = status
|
||||||
|
end
|
||||||
|
|
||||||
|
function BattleData:getCacheLockedElement(elementType)
|
||||||
|
return self.lockElementMap[elementType]
|
||||||
|
end
|
||||||
|
|
||||||
function BattleData:cacheBoardSkill()
|
function BattleData:cacheBoardSkill()
|
||||||
self.cacheSkillList = {}
|
self.cacheSkillList = {}
|
||||||
self.cacheSkillCount = 0
|
self.cacheSkillCount = 0
|
||||||
|
|||||||
@ -214,6 +214,9 @@ end
|
|||||||
|
|
||||||
function BattleGridEntity:setElementType(elementType)
|
function BattleGridEntity:setElementType(elementType)
|
||||||
self.elementType = elementType
|
self.elementType = elementType
|
||||||
|
if DataManager.BattleData:getCacheLockedElement(self.elementType) then
|
||||||
|
self:setGridType(BattleConst.GRID_TYPE.LOCK)
|
||||||
|
end
|
||||||
self:setDirty()
|
self:setDirty()
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user