四灵提交
parent
a0df277601
commit
23bc139679
|
@ -611,6 +611,7 @@ end
|
|||
function this.SetTalismanLv(did,lv)
|
||||
heroDatas[did].talismanList=lv
|
||||
end
|
||||
|
||||
--获取所有英雄信息
|
||||
function this.GetAllHeroDatas(heros,_lvLimit)
|
||||
local lvLimit = 0
|
||||
|
|
|
@ -132,6 +132,7 @@ function this:RefreshItemData()
|
|||
end
|
||||
|
||||
function this:OnClose()
|
||||
curIndex = 0
|
||||
end
|
||||
|
||||
function this:OnDestroy()
|
||||
|
|
|
@ -87,14 +87,14 @@ this.UpdatePrivilage = function()
|
|||
end
|
||||
--添加事件监听(用于子类重写)
|
||||
function FourElementMonsterCampPanel:AddListener()
|
||||
Game.GlobalEvent:AddEvent(GameEvent.FourEle.UpdatePri, this.UpdatePrivilage)
|
||||
Game.GlobalEvent:AddEvent(GameEvent.FourEle.RefreshView, this.OnShow)
|
||||
Game.GlobalEvent:AddEvent(GameEvent.FourEle.UpdatePri, self.UpdatePrivilage,self)
|
||||
Game.GlobalEvent:AddEvent(GameEvent.FourEle.RefreshView, self.OnShow,self)
|
||||
end
|
||||
|
||||
--移除事件监听(用于子类重写)
|
||||
function FourElementMonsterCampPanel:RemoveListener()
|
||||
Game.GlobalEvent:RemoveEvent(GameEvent.FourEle.UpdatePri, this.UpdatePrivilage)
|
||||
Game.GlobalEvent:RemoveEvent(GameEvent.FourEle.RefreshView, this.OnShow)
|
||||
Game.GlobalEvent:RemoveEvent(GameEvent.FourEle.UpdatePri, self.UpdatePrivilage,self)
|
||||
Game.GlobalEvent:RemoveEvent(GameEvent.FourEle.RefreshView, self.OnShow,self)
|
||||
end
|
||||
|
||||
--界面打开时调用(用于子类重写)
|
||||
|
|
|
@ -9,6 +9,7 @@ local resConfig = ConfigManager.GetConfig(ConfigName.ArtResourcesConfig)
|
|||
local CampTowerConfig = ConfigManager.GetConfig(ConfigName.CampTowerConfig)
|
||||
local campTowerSetting = ConfigManager.GetConfig(ConfigName.CampTowerSetting)
|
||||
local gameSetting = ConfigManager.GetConfig(ConfigName.GameSetting)
|
||||
local itemConfig = ConfigManager.GetConfig(ConfigName.ItemConfig)
|
||||
--四灵试炼数据
|
||||
this.fourMonsterData = {}
|
||||
|
||||
|
@ -197,8 +198,6 @@ end
|
|||
|
||||
------------------------------四灵试炼 助战---------------------------------------
|
||||
|
||||
|
||||
|
||||
--创建一个英雄信息
|
||||
function this.UpdateHeroDatas(_msgHeroData)
|
||||
local heroData = {}
|
||||
|
@ -239,8 +238,14 @@ function this.UpdateHeroDatas(_msgHeroData)
|
|||
local actionPowerRormula= gameSetting[1].ActionPowerRormula
|
||||
heroData.actionPower=heroData.heroViewConfig.ActionPower+math.floor(((actionPowerRormula[1] * math.pow(heroData.lv, 3) + actionPowerRormula[2] * math.pow(heroData.lv, 2) + actionPowerRormula[3] * heroData.lv + actionPowerRormula[4])))--_msgHeroData.actionPower
|
||||
heroData.equipIdList=_msgHeroData.equipIdList
|
||||
for i = 1 , #heroData.equipIdList do
|
||||
EquipManager.SetEquipUpHeroDid(heroData.equipIdList[i],heroData.dynamicId)
|
||||
end
|
||||
heroData.jewels=_msgHeroData.jewels
|
||||
|
||||
this.InitBaoDatas(heroData.jewels)
|
||||
for i = 1 , #heroData.jewels do
|
||||
this.SetEquipTreasureUpHeroDid(heroData.jewels[i],heroData.dynamicId)
|
||||
end
|
||||
heroData.talismanList = _msgHeroData.especialEquipLevel --法宝等级
|
||||
if(#_msgHeroData.soulPos>=1) then
|
||||
local soulPrintList = {}
|
||||
|
@ -271,25 +276,94 @@ function this.UpdateHeroDatas(_msgHeroData)
|
|||
end
|
||||
heroData.name = _configData.ReadingName
|
||||
heroData.property = _configData.PropertyName
|
||||
heroData.warPower = 1000--HeroManager.CalculateHeroAllProValList(1, heroData, false)[HeroProType.WarPower]
|
||||
heroData.warPower = HeroManager.CalculateHeroAllProValList(1, heroData, false)[HeroProType.WarPower]
|
||||
heroData.createtype = 1
|
||||
return heroData
|
||||
end
|
||||
|
||||
--宝器
|
||||
local jewelConfig = ConfigManager.GetConfig(ConfigName.JewelConfig)
|
||||
function this.InitBaoDatas(_soulEquips)
|
||||
if not this.allTreasures then
|
||||
this.allTreasures = {}
|
||||
end
|
||||
if not _soulEquips then return end
|
||||
for i = 1, #_soulEquips do
|
||||
this.InitSingleTreasureData(_soulEquips[i])
|
||||
end
|
||||
end
|
||||
--初始化单个宝物的数据
|
||||
function this.InitSingleTreasureData(_singleData)
|
||||
if _singleData==nil then
|
||||
return
|
||||
end
|
||||
local single={}
|
||||
local staticId=_singleData.equipId
|
||||
local currJewel=jewelConfig[staticId]
|
||||
single.id=staticId
|
||||
single.idDyn=_singleData.id
|
||||
single.lv=_singleData.exp
|
||||
single.refineLv=_singleData.rebuildLevel
|
||||
single.maxLv=currJewel.Max[1]
|
||||
single.maxRefineLv=currJewel.Max[2]
|
||||
single.upHeroDid=""
|
||||
local quantity=currJewel.Level
|
||||
single.quantity=quantity
|
||||
single.frame=GetQuantityImageByquality(quantity)
|
||||
single.name=itemConfig[staticId].Name
|
||||
single.itemConfig=itemConfig[staticId]
|
||||
single.levelPool=currJewel.LevelupPool
|
||||
single.proIcon=GetProStrImageByProNum(currJewel.Race)
|
||||
single.refinePool=currJewel.RankupPool
|
||||
single.equipType=currJewel.Location
|
||||
if currJewel.Location==1 then
|
||||
single.type=Language[10505]
|
||||
else
|
||||
single.type=Language[10506]
|
||||
end
|
||||
single.icon=GetResourcePath(itemConfig[staticId].ResourceID)
|
||||
single.strongConfig=this.GetCurrTreasureLvConfig(1,currJewel.LevelupPool,_singleData.exp)
|
||||
single.refineConfig=this.GetCurrTreasureLvConfig(2,currJewel.RankupPool,_singleData.rebuildLevel)
|
||||
--LogGreen("天宫推送宝器 _singleData.id ".._singleData.id)
|
||||
this.allTreasures[_singleData.id]=single
|
||||
end
|
||||
local jewerLevelUpConfig = ConfigManager.GetConfig(ConfigName.JewelRankupConfig)
|
||||
--获取当前宝物升级数据
|
||||
function this.GetCurrTreasureLvConfig(_type,_id,_lv)
|
||||
for _, configInfo in ConfigPairs(jewerLevelUpConfig) do
|
||||
if configInfo.Type==_type and configInfo.PoolID==_id and configInfo.Level==_lv then
|
||||
return configInfo
|
||||
end
|
||||
end
|
||||
end
|
||||
--根据动态id获取宝物
|
||||
function this.GetSingleTreasureByIdDyn(_idDyn)
|
||||
if not this.allTreasures[_idDyn] == nil then
|
||||
return nil
|
||||
end
|
||||
return this.allTreasures[_idDyn]
|
||||
|
||||
end
|
||||
|
||||
--设置装备穿戴的英雄
|
||||
function this.SetEquipTreasureUpHeroDid(_equipTreasureDid,_heroDid)
|
||||
if this.allTreasures[_equipTreasureDid] then
|
||||
this.allTreasures[_equipTreasureDid].upHeroDid=_heroDid
|
||||
end
|
||||
end
|
||||
-----
|
||||
---好友助战 界面数据
|
||||
function this.GetFriendHelpHeros(trailType,func)
|
||||
this.friendHelpHeros = {}
|
||||
local x = function(msg)
|
||||
--LogGreen("HelpFightListRequest".." trailType:"..tostring(trailType).." #msg.helpHeros:"..#msg.helpHeros)
|
||||
for k,v in ipairs(msg.helpHeros) do
|
||||
if not this.friendHelpHeros[v.trailType] then
|
||||
this.friendHelpHeros[v.trailType] = {}
|
||||
end
|
||||
local tempdata = {}
|
||||
tempdata.player = v
|
||||
tempdata.player = v
|
||||
tempdata.hero = this.UpdateHeroDatas(v.hero)
|
||||
table.insert(this.friendHelpHeros[v.trailType],tempdata)
|
||||
--LogGreen("this.friendHelpHeros[v.trailType]".." trailType:"..tostring(v.trailType).." #this.friendHelpHeros[v.trailType]:"..#this.friendHelpHeros[v.trailType])
|
||||
end
|
||||
if func then
|
||||
func(this.friendHelpHeros[trailType])
|
||||
|
@ -299,18 +373,7 @@ function this.GetFriendHelpHeros(trailType,func)
|
|||
--发消息获取信息 然后调用回调函数x
|
||||
if trailType and trailType > 0 then
|
||||
NetManager.HelpFightListRequest(trailType,x)
|
||||
-- elseif not trailType then
|
||||
-- for i = 1, 4 do
|
||||
-- NetManager.HelpFightListRequest(i,x)
|
||||
-- end
|
||||
end
|
||||
-- LogGreen("this.friendHelpHeros[trailType]"..#this.friendHelpHeros[trailType])
|
||||
-- if trailType and this.friendHelpHeros[trailType] then
|
||||
-- return this.friendHelpHeros[trailType]
|
||||
-- end
|
||||
-- if func then
|
||||
-- func()
|
||||
-- end
|
||||
end
|
||||
|
||||
--设置好友帮助我的英雄 以试炼类型为键
|
||||
|
@ -329,7 +392,8 @@ function this.SetFriendHelpHero(helpFightList,trailType)
|
|||
else
|
||||
if not this.friendHelpHero then
|
||||
this.friendHelpHero = {}
|
||||
end
|
||||
end
|
||||
|
||||
if not this.friendHelpHero[trailType] then
|
||||
this.friendHelpHero[trailType] = {}
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue