[战斗]======神兵服务器发过来的数据处理

dev_chengFeng
wangzhenxing 2023-04-07 16:11:39 +08:00
parent ac104c73ca
commit be9f720590
7 changed files with 54 additions and 35 deletions

View File

@ -139,34 +139,38 @@ function this.GetPassivityData(passivityList)
local orderList = {}
local coverList = {}
for i = 1, #passivityList do
local passiveId = tonumber(passivityList[i])
local passiveId = tonumber(passivityList[i])
if passiveId then
LogError("passiveId======================"..passiveId)
local cfg = PassiveSkillLogicConfig[passiveId]
-- 判断技能是否在战斗中生效
if cfg and cfg.EffectiveRange == 1 then
-- 判断是否有需要覆盖的被动技能
local coverId = cfg.CoverID
if coverId and coverId ~= 0 then
if orderList[coverId] then
orderList[coverId] = nil
end
coverList[coverId] = 1
end
-- 判断该被动技能是否已经被覆盖
if not coverList[passiveId] then
-- 没有被覆盖,数据加入
local pass = {}
if cfg and cfg.Type ~= 0 then
pass[1]=passiveId
pass[2]=cfg.Judge
pass[3] = cfg.Type
for j = 1, #cfg.Value do
pass[j + 3] = cfg.Value[j]
-- 判断技能是否在战斗中生效
if cfg and cfg.EffectiveRange == 1 then
-- 判断是否有需要覆盖的被动技能
local coverId = cfg.CoverID
if coverId and coverId ~= 0 then
if orderList[coverId] then
orderList[coverId] = nil
end
coverList[coverId] = 1
end
-- 判断该被动技能是否已经被覆盖
if not coverList[passiveId] then
-- 没有被覆盖,数据加入
local pass = {}
if cfg and cfg.Type ~= 0 then
pass[1]=passiveId
pass[2]=cfg.Judge
pass[3] = cfg.Type
for j = 1, #cfg.Value do
pass[j + 3] = cfg.Value[j]
end
orderList[passiveId] = pass
end
orderList[passiveId] = pass
end
end
end
end
end
-- 构建数据
@ -354,6 +358,7 @@ function this.GodWeaponUnitAdapter(pokemonUnit,camp,_teamDamage)
camp = camp,
skill = {},
property = {},
passivity = {},
}
-- 技能
LogError("pokemonUnit.unitSkillIds=="..pokemonUnit.unitSkillIds)
@ -362,19 +367,25 @@ function this.GodWeaponUnitAdapter(pokemonUnit,camp,_teamDamage)
if skills then
if skills[1] then
local actives=string.split(skills[1], "#")
local passivityList1 = {}
for i = 1, #actives do
role.skill[i]= this.WeaponSkillAdapter(tonumber(actives[i]))
local shenbing=ShenBingSkill[tonumber(actives[i])]
if shenbing and shenbing.PassiveSkill then
local passs=string.split(shenbing.PassiveSkill, "#")
local passivityList = {}
local skillId=tonumber(actives[i])
role.skill[i]= this.WeaponSkillAdapter(skillId)
LogError("tonumber(actives[i])=="..skillId)
local shenbing=ShenBingSkill[skillId]
if shenbing and shenbing.PassiveSkill~=nil and #shenbing.PassiveSkill~=0 then
--local passs=string.split(shenbing.PassiveSkill, "#")
local passs=shenbing.PassiveSkill
for j = 1, #passs do
table.insert(passivityList, tonumber(passs[j]))
if passs[j]~=0 and passs[j]~=nil and tostring(passs[j])~=nil then
--LogError("passs[j]==="..passs[j])
table.insert(passivityList1, passs[j])
end
end
role.passivity = this.GetPassivityData(passivityList)
end
end
role.passivity = this.GetPassivityData(passivityList1)
end
end
end

View File

@ -204,7 +204,7 @@ function BattleLogic.InitOrder()
local enemyMonsterList = orderList.monsterList
if enemyMonsterList then
for i=1, #enemyMonsterList do
MonsterManager.AddMonster(enemyMonsterList[i])
MonsterManager.AddMonster(enemyMonsterList[i])
end
end

View File

@ -27,7 +27,7 @@ end
-- 创建一个技能
function this.CreateMSkill(monster, group, index, skilldata,groupIndex)
LogError("创建神兵技能====================")
--LogError("创建神兵技能====================")
local owner = group:GetOwner()
local groupIndex = group.groupIndex
local position = owner:GetCamp() * 6 + owner:GetPosition()

View File

@ -353,6 +353,9 @@ function EnemyView:DoScale(scale, dur, func)
if self.dsTween then
self.dsTween:Kill()
end
if self.GameObject==nil then
return
end
self.dsTween = self.GameObject.transform.parent:DOScale(Vector3.one * scale, dur)
:OnComplete(function ()
-- Log("DoScale = "..scale)

View File

@ -378,6 +378,9 @@ function PlayerView:DoScale(scale, dur, func)
if self.dsTween then
self.dsTween:Kill()
end
if self.GameObject==nil then
return
end
self.dsTween = self.GameObject.transform.parent:DOScale(Vector3.one * scale, dur)
:OnComplete(function ()
-- Log("DoScale = "..scale)

View File

@ -103,7 +103,7 @@ function this.OnClickTabBtn(_curIndex)
this.ScrollParentView2:SetActive(true)
pokemonChipList = BagManager.GetDataByItemType(ItemType.GodWeaponChip)
this.PokemonChipDataSort(pokemonChipList)
if redPointList[1] then
if redPointList~=nil and redPointList[1]~=nil then
redPointList[1]:SetActive(GodWeaponManager.WeaponChipCompoundRedPoint())
end
for key, value in pairs(this.ChipItemList) do
@ -229,6 +229,7 @@ end
function this:OnDestroy()
this.spLoader:Destroy()
redPointList={}
end
return this

View File

@ -80,6 +80,7 @@ function GodsWayListPanel:OnShow(...)
--PopupTipPanel.ShowTip(Language[11330])
else
PopupTipPanel.ShowTip("需二队塔通关100层后开启")
PopupTipPanel.ShowTip("暂未开启")
end
end