xiyou_sanguo
parent
58c2e69097
commit
a502721775
|
|
@ -4,7 +4,7 @@ local itemConfig = ConfigManager.GetConfig(ConfigName.ItemConfig)
|
|||
local equipConfig = ConfigManager.GetConfig(ConfigName.EquipConfig)
|
||||
local propertyConfig = ConfigManager.GetConfig(ConfigName.PropertyConfig)
|
||||
local equipStarsConfig = ConfigManager.GetConfig(ConfigName.EquipStarsConfig)
|
||||
local rewardGroupConfig=ConfigManager.GetConfig(ConfigName.RewardGroup)
|
||||
local rewardGroupConfig = ConfigManager.GetConfig(ConfigName.RewardGroup)
|
||||
|
||||
function this.Initialize()
|
||||
this.equipDatas = {}
|
||||
|
|
@ -12,7 +12,7 @@ function this.Initialize()
|
|||
end
|
||||
|
||||
function this.InitHaveEquipDatas(equipList)
|
||||
for k,v in ipairs(equipList) do
|
||||
for k, v in ipairs(equipList) do
|
||||
this.HaveEquipDatas[v.equipId] = v.num
|
||||
end
|
||||
TianShuMiJuanManger.CheckFetterStatus(4)
|
||||
|
|
@ -21,6 +21,7 @@ end
|
|||
function this.GetHaveEquipDatas()
|
||||
return this.HaveEquipDatas
|
||||
end
|
||||
|
||||
--upHeroDid
|
||||
function this.InitUpdateEquipData(id, upHeroDid, isFindHandBook)
|
||||
if not this.equipDatas then
|
||||
|
|
@ -58,9 +59,9 @@ function this.InitUpdateEquipData(id, upHeroDid, isFindHandBook)
|
|||
equipdata.HomeEquipLv = function()
|
||||
local data = HomeLandManager.EquipData[equipdata.position]
|
||||
if data and data.configData and data.configPro then
|
||||
return {data.configData.Level,data.configPro.Level}
|
||||
return { data.configData.Level, data.configPro.Level }
|
||||
end
|
||||
return {0,0}
|
||||
return { 0, 0 }
|
||||
end
|
||||
equipdata.homeEquipLv = equipdata.HomeEquipLv()
|
||||
|
||||
|
|
@ -84,7 +85,7 @@ end
|
|||
function this.GetLimitStarEquipNum(star)
|
||||
local allNum = 0
|
||||
-- 背包里面的
|
||||
local equips = BagManager.GetBagItemDataByItemType(ItemBaseType.Equip)
|
||||
local equips = BagManager.GetBagItemDataByItemType(ItemBaseType.Equip)
|
||||
for _, e in ipairs(equips) do
|
||||
if e.id and e.num > 0 then
|
||||
if equipConfig[e.id].Star >= star then
|
||||
|
|
@ -95,7 +96,7 @@ function this.GetLimitStarEquipNum(star)
|
|||
-- 身上穿的
|
||||
local allHeroDatas = HeroManager.GetAllHeroList()
|
||||
for _, hero in pairs(allHeroDatas) do
|
||||
if hero.equipIdList and #hero.equipIdList > 0 then
|
||||
if hero.equipIdList and #hero.equipIdList > 0 then
|
||||
for i = 1, #hero.equipIdList do
|
||||
local id = tonumber(hero.equipIdList[i])
|
||||
if equipConfig[id].Star >= star then
|
||||
|
|
@ -190,8 +191,8 @@ function this.DeleteSingleEquip(_equipid, _heroDid)
|
|||
_equipid = tonumber(_equipid)
|
||||
if
|
||||
this.equipDatas[_equipid] and this.equipDatas[_equipid].upHeroDidList and
|
||||
this.equipDatas[_equipid].upHeroDidList[_heroDid]
|
||||
then
|
||||
this.equipDatas[_equipid].upHeroDidList[_heroDid]
|
||||
then
|
||||
this.equipDatas[_equipid].upHeroDidList[_heroDid] = nil
|
||||
end
|
||||
end
|
||||
|
|
@ -200,19 +201,19 @@ end
|
|||
function this.GetSingleHeroSingleEquipData(_equipid, _heroDid)
|
||||
_equipid = tonumber(_equipid)
|
||||
if this.equipDatas[_equipid] and this.equipDatas[_equipid].upHeroDidList and this.equipDatas[_equipid].upHeroDidList[_heroDid] then
|
||||
local heroData= HeroManager.GetSingleHeroData(_heroDid)
|
||||
local equipData=this.equipDatas[_equipid]
|
||||
local heroData = HeroManager.GetSingleHeroData(_heroDid)
|
||||
local equipData = this.equipDatas[_equipid]
|
||||
if heroData.equipStrong then
|
||||
for i = 1, #heroData.equipStrong do
|
||||
if equipData.position==i then
|
||||
equipData.homeEquipLv[1]=heroData.equipStrong[i]
|
||||
if equipData.position == i then
|
||||
equipData.homeEquipLv[1] = heroData.equipStrong[i]
|
||||
end
|
||||
end
|
||||
equipData.homeEquipLv[2]=heroData.equipAdvanceLv
|
||||
equipData.homeEquipLv[2] = heroData.equipAdvanceLv
|
||||
end
|
||||
return equipData
|
||||
elseif HarmonyManager.GetSingleAdditions(HarmonyAddType.AddEquip) > 0 and HarmonyManager.IsInfo(_heroDid) then
|
||||
return HarmonyManager.equipDatas[_equipid]--.upHeroDidList[_heroDid]
|
||||
return HarmonyManager.equipDatas[_equipid] --.upHeroDidList[_heroDid]
|
||||
else
|
||||
return nil
|
||||
end
|
||||
|
|
@ -262,6 +263,7 @@ function this.InitMapShotTimeEquipBagData(_mapEquip)
|
|||
Log("存储地图临时装备信息 " .. _mapEquip.id)
|
||||
this.mapShotTimeItemData[#this.mapShotTimeItemData + 1] = _mapEquip
|
||||
end
|
||||
|
||||
--计算战斗力
|
||||
|
||||
function this.CalculateWarForce(equipid, data)
|
||||
|
|
@ -290,8 +292,8 @@ function this.CalculateEquipWarForce(curEquip)
|
|||
for index, prop in pairs(mainAttribute) do
|
||||
local id = prop.propertyId
|
||||
local value = prop.propertyValue
|
||||
--
|
||||
if id~=0 and id~=nil then
|
||||
--
|
||||
if id ~= 0 and id ~= nil then
|
||||
--LogError("id==========="..id)
|
||||
if propertyConfig[id].Style == 2 then
|
||||
value = value / 100
|
||||
|
|
@ -302,7 +304,6 @@ function this.CalculateEquipWarForce(curEquip)
|
|||
addAllProVal[id] = value
|
||||
end
|
||||
end
|
||||
|
||||
end
|
||||
if curEquip and curEquip.Score > 0 then
|
||||
addAllProVal[HeroProType.WarPower] = curEquip.Score
|
||||
|
|
@ -377,6 +378,7 @@ function this.GetEquipCompoundDataByEquipPosition1(_position)
|
|||
end
|
||||
return equips
|
||||
end
|
||||
|
||||
--得到背包里能合成equipSData的装备
|
||||
function this.GetBagCompoundEquipDatasByequipSData(equipSData)
|
||||
--LogBlue(equipSData.Id.." "..equipSData.Position.." "..equipSData.Star)
|
||||
|
|
@ -421,32 +423,36 @@ function this.GetAllSEquipsByPosition(_position)
|
|||
-- end
|
||||
return equips
|
||||
end
|
||||
|
||||
function this.GetAllGodEquips()
|
||||
local starEquips={}
|
||||
local list = ConfigManager.GetAllConfigsDataByKey(ConfigName.EquipConfig, "Quality", 7)
|
||||
for i=1,#list do
|
||||
if list[i].Position<5 then
|
||||
table.insert(starEquips,list[i])
|
||||
local starEquips = {}
|
||||
local list = ConfigManager.GetAllConfigsDataByKey(ConfigName.EquipConfig, "Quality", 6)
|
||||
for i = 1, #list do
|
||||
if list[i].Position < 5 then
|
||||
table.insert(starEquips, list[i])
|
||||
end
|
||||
end
|
||||
local starEquips2 ={}
|
||||
local list2=ConfigManager.GetAllConfigsDataByKey(ConfigName.EquipConfig, "Quality", 8)
|
||||
for i=1,#list2 do
|
||||
if list2[i].Position<5 then
|
||||
table.insert(starEquips,list2[i])
|
||||
local starEquips2 = {}
|
||||
local list2 = ConfigManager.GetAllConfigsDataByKey(ConfigName.EquipConfig, "Quality", 7)
|
||||
for i = 1, #list2 do
|
||||
if list2[i].Position < 5 then
|
||||
table.insert(starEquips, list2[i])
|
||||
end
|
||||
end
|
||||
local equips = {}
|
||||
for i = 1, #starEquips do
|
||||
if starEquips[i].Star and starEquips[i].Star > 0 and starEquips[i].Star ~= 18 then --最低等级的装备 合成不了
|
||||
if starEquips[i].Star and starEquips[i].Star > 0 and starEquips[i].Star ~= 12 then --最低等级的装备 合成不了
|
||||
table.insert(equips, starEquips[i])
|
||||
end
|
||||
end
|
||||
for i = 1, #starEquips2 do
|
||||
--[[
|
||||
for i = 1, #starEquips2 do
|
||||
if starEquips2[i].Star and starEquips2[i].Star > 0 and starEquips2[i].Star ~= 18 then --最低等级的装备 合成不了
|
||||
table.insert(equips, starEquips2[i])
|
||||
end
|
||||
end
|
||||
]]
|
||||
|
||||
table.sort(
|
||||
equips,
|
||||
function(a, b)
|
||||
|
|
@ -464,63 +470,57 @@ function this.GetAllGodEquips()
|
|||
return equips
|
||||
end
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
function this.SetEquipStarShow(spLoader, starGrid, equipId)
|
||||
if equipConfig[equipId] then
|
||||
local curequipStarsConfig = equipStarsConfig[equipConfig[equipId].Star]
|
||||
if curequipStarsConfig then
|
||||
starGrid:SetActive(true)
|
||||
SetHeroStars(spLoader, starGrid, curequipStarsConfig.Stars,1,Vector2.New(32.5,32.5),-15)
|
||||
SetHeroStars(spLoader, starGrid, curequipStarsConfig.Stars, 1, Vector2.New(32.5, 32.5), -15)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
function this.GetMainProList(equipConfig)
|
||||
local propList = {}
|
||||
if equipConfig.Property and #equipConfig.Property>0 then
|
||||
if equipConfig.Property and #equipConfig.Property > 0 then
|
||||
for index, prop in ipairs(equipConfig.Property) do
|
||||
-- propList[index] = {}
|
||||
-- propList[index].propertyId = prop[1]
|
||||
-- propList[index].propertyValue = prop[2]
|
||||
-- propList[index].PropertyConfig = propertyConfig[prop[1]]
|
||||
if tonumber(prop[1])~=0 and tonumber(prop[1])~=nil then
|
||||
local data={}
|
||||
data.propertyId=prop[1]
|
||||
if tonumber(prop[1]) ~= 0 and tonumber(prop[1]) ~= nil then
|
||||
local data = {}
|
||||
data.propertyId = prop[1]
|
||||
data.propertyValue = prop[2]
|
||||
data.PropertyConfig = propertyConfig[prop[1]]
|
||||
table.insert(propList,data)
|
||||
table.insert(propList, data)
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
local len=#equipConfig.Property
|
||||
|
||||
local len = #equipConfig.Property
|
||||
if equipConfig.PlayerProperty then
|
||||
for index, prop in ipairs(equipConfig.PlayerProperty) do
|
||||
if tonumber(prop[1])~=0 and tonumber(prop[1])~=nil then
|
||||
local data={}
|
||||
data.propertyId=prop[1]
|
||||
if tonumber(prop[1]) ~= 0 and tonumber(prop[1]) ~= nil then
|
||||
local data = {}
|
||||
data.propertyId = prop[1]
|
||||
data.propertyValue = prop[2]
|
||||
data.PropertyConfig = propertyConfig[prop[1]]
|
||||
table.insert(propList,data)
|
||||
table.insert(propList, data)
|
||||
end
|
||||
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
return propList
|
||||
end
|
||||
|
||||
function this.GetEquipRewardList(equiplist)
|
||||
local rewardlist = {}
|
||||
for k,v in ipairs(equiplist) do
|
||||
if v.itemConfig.ResolveReward and v.itemConfig.ResolveReward ~="" then
|
||||
local rewardGroup =rewardGroupConfig[tonumber(v.itemConfig.ResolveReward)]
|
||||
if rewardGroup and rewardGroup.ShowItem and #rewardGroup.ShowItem > 0 then
|
||||
for i = 1,#rewardGroup.ShowItem do
|
||||
for k, v in ipairs(equiplist) do
|
||||
if v.itemConfig.ResolveReward and v.itemConfig.ResolveReward ~= "" then
|
||||
local rewardGroup = rewardGroupConfig[tonumber(v.itemConfig.ResolveReward)]
|
||||
if rewardGroup and rewardGroup.ShowItem and #rewardGroup.ShowItem > 0 then
|
||||
for i = 1, #rewardGroup.ShowItem do
|
||||
local rewardId = rewardGroup.ShowItem[i][1]
|
||||
local rewardNum = rewardGroup.ShowItem[i][2]
|
||||
if rewardlist[rewardId] then
|
||||
|
|
@ -544,26 +544,26 @@ function this.GetMinEquipStar(equiplist)
|
|||
local _list = {}
|
||||
|
||||
--print(#equiplist," 1111 @@@@@@@@@")
|
||||
for i = 1, #equiplist do
|
||||
-- body
|
||||
table.insert(_list,equipConfig[tonumber(equiplist[i])])
|
||||
|
||||
--print("执行程序s",equiplist[i],equipConfig[ tonumber(equiplist[i])].Name,equipConfig)
|
||||
end
|
||||
|
||||
-- print(#_list," 1.5 @@@@@@@@@")
|
||||
-- print(LengthOfTable(_list)," 2222 @@@@@@@@@")
|
||||
local _minStar = 999
|
||||
for i = 1, #equiplist do
|
||||
-- body
|
||||
table.insert(_list, equipConfig[tonumber(equiplist[i])])
|
||||
|
||||
for i = 1, #_list do
|
||||
-- body
|
||||
if _minStar > _list[i].Star then
|
||||
-- body
|
||||
_minStar = _list[i].Star
|
||||
end
|
||||
--print(_list[i].Star," !!!!!!!!!!")
|
||||
end
|
||||
return _minStar
|
||||
--print("执行程序s",equiplist[i],equipConfig[ tonumber(equiplist[i])].Name,equipConfig)
|
||||
end
|
||||
|
||||
-- print(#_list," 1.5 @@@@@@@@@")
|
||||
-- print(LengthOfTable(_list)," 2222 @@@@@@@@@")
|
||||
local _minStar = 999
|
||||
|
||||
for i = 1, #_list do
|
||||
-- body
|
||||
if _minStar > _list[i].Star then
|
||||
-- body
|
||||
_minStar = _list[i].Star
|
||||
end
|
||||
--print(_list[i].Star," !!!!!!!!!!")
|
||||
end
|
||||
return _minStar
|
||||
end
|
||||
|
||||
function this.updateHomeLandEquipLv()
|
||||
|
|
@ -571,12 +571,12 @@ function this.updateHomeLandEquipLv()
|
|||
value.HomeEquipLv = function()
|
||||
local data = HomeLandManager.EquipData[value.position]
|
||||
if data and data.configData and data.configPro then
|
||||
return {data.configData.Level,data.configPro.Level}
|
||||
return { data.configData.Level, data.configPro.Level }
|
||||
end
|
||||
return {0,0}
|
||||
return { 0, 0 }
|
||||
end
|
||||
value.homeEquipLv = value.HomeEquipLv()
|
||||
end
|
||||
end
|
||||
|
||||
return this
|
||||
return this
|
||||
|
|
|
|||
Loading…
Reference in New Issue