[特训]=========================添加特训中的英雄无法分解 升星被吞
parent
35a7c89ee6
commit
111c7255ab
|
@ -661,6 +661,10 @@ function this.GetAllHeroDataMsinusUpWar(_sortTypeId,type) --0全部 1-6属性 7
|
|||
if HarmonyManager:IsEnvoy(v.dynamicId) then
|
||||
heros[i].isHarmonyGongMing = 2
|
||||
end
|
||||
heros[i].isTrain=0
|
||||
if TrainBuildManager.CheckHeroIsTraining(v.dynamicId) then
|
||||
heros[i].isTrain=1
|
||||
end
|
||||
end
|
||||
end
|
||||
--所有的所在队伍id,
|
||||
|
@ -793,6 +797,7 @@ function this.DeleteHeroDatas(heroDIds)
|
|||
--装备的法灵
|
||||
FaLingManager.SetEquipBelongHero(heroDatas[heroDIds[i]].baublesId,nil)
|
||||
HeroManager.SetHeroBaublesId(heroDIds[i],"")
|
||||
TrainBuildManager.RemoveTrainHero(heroDIds[i])
|
||||
--删除英雄
|
||||
heroDatas[heroDIds[i]] = nil
|
||||
end
|
||||
|
|
|
@ -59,8 +59,10 @@ function this.GetAllCanTrainHero()
|
|||
end
|
||||
return heros
|
||||
end
|
||||
|
||||
|
||||
--检测英雄是否正在特训
|
||||
function this.CheckHeroIsTraining(_did)
|
||||
return CheckListIsContainValue1(trainHeroId,_did)
|
||||
end
|
||||
|
||||
---检测功能开启方法
|
||||
function this.CheckBuildIsOpen(str)
|
||||
|
|
|
@ -226,53 +226,57 @@ function TrainBuildPanel:SetBuildsState()
|
|||
end
|
||||
end
|
||||
if data.heroId and data.heroId~="" then
|
||||
--LogError("data.heroid====================="..data.heroId)
|
||||
local heroData=HeroManager.GetSingleHeroData(data.heroId)
|
||||
curObj.Icon.sprite = self.spLoader:LoadSprite(GetResourcePath(heroData.heroConfig.Icon))
|
||||
local pos=data.dataSingle.Position
|
||||
local max=0
|
||||
local curValue=0
|
||||
local train=ConfigManager.TryGetConfigDataByDoubleKey(ConfigName.Train,"HeroID",heroData.heroConfig.Id,"Level",heroData.HeroTraining.trainingLv)
|
||||
if train then
|
||||
local aaa=ConfigManager.TryGetConfigDataByDoubleKey(ConfigName.TrainSetting,"PoolID",train.TrainSettingID,"Level",heroData.HeroTraining.trainingLv)
|
||||
if pos==1 then
|
||||
max=aaa.TrainExp1
|
||||
curValue=heroData.HeroTraining.attackExp
|
||||
elseif pos==2 then
|
||||
max=aaa.TrainExp2
|
||||
curValue=heroData.HeroTraining.defenseExp
|
||||
elseif pos==3 then
|
||||
max=aaa.TrainExp3
|
||||
curValue=heroData.HeroTraining.hpExp
|
||||
end
|
||||
end
|
||||
--LogError("curvalue==========================="..curValue)
|
||||
local endTime=data.heroStarTime+math.ceil((max-curValue)/data.dataSingle.Gain)*60
|
||||
curObj.trainLeftTime=endTime-GetTimeStamp()
|
||||
--LogError("endtime=================================="..endTime.." trainLeftTime=="..curObj.trainLeftTime)
|
||||
curObj.CanGet:SetActive(true)
|
||||
PlayUIAnim(curObj.CanGet)
|
||||
Util.AddOnceClick(curObj.CanGet,function ()
|
||||
if curObj.trainLeftTime>0 then
|
||||
local sureFunc=function()
|
||||
if heroData then
|
||||
curObj.Icon.sprite = self.spLoader:LoadSprite(GetResourcePath(heroData.heroConfig.Icon))
|
||||
local pos=data.dataSingle.Position
|
||||
local max=0
|
||||
local curValue=0
|
||||
local train=ConfigManager.TryGetConfigDataByDoubleKey(ConfigName.Train,"HeroID",heroData.heroConfig.Id,"Level",heroData.HeroTraining.trainingLv)
|
||||
if train then
|
||||
local aaa=ConfigManager.TryGetConfigDataByDoubleKey(ConfigName.TrainSetting,"PoolID",train.TrainSettingID,"Level",heroData.HeroTraining.trainingLv)
|
||||
if pos==1 then
|
||||
max=aaa.TrainExp1
|
||||
curValue=heroData.HeroTraining.attackExp
|
||||
elseif pos==2 then
|
||||
max=aaa.TrainExp2
|
||||
curValue=heroData.HeroTraining.defenseExp
|
||||
elseif pos==3 then
|
||||
max=aaa.TrainExp3
|
||||
curValue=heroData.HeroTraining.hpExp
|
||||
end
|
||||
end
|
||||
--LogError("curvalue==========================="..curValue)
|
||||
local endTime=data.heroStarTime+math.ceil((max-curValue)/data.dataSingle.Gain)*60
|
||||
curObj.trainLeftTime=endTime-GetTimeStamp()
|
||||
--LogError("endtime=================================="..endTime.." trainLeftTime=="..curObj.trainLeftTime)
|
||||
curObj.CanGet:SetActive(true)
|
||||
PlayUIAnim(curObj.CanGet)
|
||||
Util.AddOnceClick(curObj.CanGet,function ()
|
||||
if curObj.trainLeftTime>0 then
|
||||
local sureFunc=function()
|
||||
NetManager.TrainingRequest(data.dataMain.Id,data.heroId,2,function ()
|
||||
self:OnShow()
|
||||
end)
|
||||
end
|
||||
local args={}
|
||||
args[1]="特训未完成是否提前结束?"
|
||||
args[2]="结束"
|
||||
args[3]="取消"
|
||||
args[4]=sureFunc
|
||||
UIManager.OpenPanel(UIName.GMCommonConfirmPanel,args)
|
||||
else
|
||||
LogError("data.heroid==============================="..data.heroId)
|
||||
NetManager.TrainingRequest(data.dataMain.Id,data.heroId,2,function ()
|
||||
self:OnShow()
|
||||
end)
|
||||
end
|
||||
local args={}
|
||||
args[1]="特训未完成是否提前结束?"
|
||||
args[2]="结束"
|
||||
args[3]="取消"
|
||||
args[4]=sureFunc
|
||||
UIManager.OpenPanel(UIName.GMCommonConfirmPanel,args)
|
||||
else
|
||||
LogError("data.heroid==============================="..data.heroId)
|
||||
NetManager.TrainingRequest(data.dataMain.Id,data.heroId,2,function ()
|
||||
self:OnShow()
|
||||
end)
|
||||
end
|
||||
|
||||
end)
|
||||
|
||||
end)
|
||||
else
|
||||
LogError("herodata========================================="..nil)
|
||||
end
|
||||
|
||||
else
|
||||
curObj.trainLeftTime=-1
|
||||
end
|
||||
|
|
|
@ -731,6 +731,7 @@ function this.ExecuteLoading()
|
|||
--[[[58] =]]function() NetManager.RequestMagicSoldierInfo(LoadingPanel.OnStep) end, --神兵
|
||||
--[[[59] =]]function() NetManager.GemNewInfoRequest(LoadingPanel.OnStep) end, --新命石
|
||||
function() NetManager.BaublesAllInfoRequest(LoadingPanel.OnStep) end, --新法宝
|
||||
function() NetManager.TrainingArchitectureInfoRequest(LoadingPanel.OnStep) end,
|
||||
function() -- 登录请求最终接口,所有请求放在此接口之前
|
||||
-- 登录成功确认
|
||||
NetManager.LoginConfimRequest()
|
||||
|
|
|
@ -155,6 +155,10 @@ function this.SingleHeroDataShow(go,_heroData)
|
|||
PopupTipPanel.ShowTip(Language[12184])
|
||||
end)
|
||||
Util.AddOnceClick(cardclickBtn, function()
|
||||
if heroData.isTrain==1 then
|
||||
PopupTipPanel.ShowTip("神将正在特训中")
|
||||
return
|
||||
end
|
||||
if selectHeroData[heroData.dynamicId] then
|
||||
choosed:SetActive(false)
|
||||
selectHeroData[heroData.dynamicId] = nil
|
||||
|
@ -218,24 +222,28 @@ function this.SortHeroDatas(_heroDatas)
|
|||
if (a.isFormation == "" or (a.isFormation ~= "" and a.isFormations[1] == FormationTypeDef.EXPEDITION)) and (b.isFormation == "" or (b.isFormation ~= "" and b.isFormations[1] == FormationTypeDef.EXPEDITION)) then
|
||||
if a.lockState == b.lockState then
|
||||
if a.isHarmonyGongMing == b.isHarmonyGongMing then
|
||||
if a.heroConfig.Natural ==b.heroConfig.Natural then
|
||||
if a.star == b.star then
|
||||
local aGodLv = GodSoulManager.GetGodSoulLv(a.dynamicId)
|
||||
local bGodLv = GodSoulManager.GetGodSoulLv(b.dynamicId)
|
||||
if aGodLv == bGodLv then
|
||||
if a.lv == b.lv then
|
||||
return a.heroConfig.Id > b.heroConfig.Id
|
||||
if a.isTrain ==b.isTrain then
|
||||
if a.heroConfig.Natural ==b.heroConfig.Natural then
|
||||
if a.star == b.star then
|
||||
local aGodLv = GodSoulManager.GetGodSoulLv(a.dynamicId)
|
||||
local bGodLv = GodSoulManager.GetGodSoulLv(b.dynamicId)
|
||||
if aGodLv == bGodLv then
|
||||
if a.lv == b.lv then
|
||||
return a.heroConfig.Id > b.heroConfig.Id
|
||||
else
|
||||
return a.lv < b.lv
|
||||
end
|
||||
else
|
||||
return a.lv < b.lv
|
||||
return aGodLv < bGodLv
|
||||
end
|
||||
else
|
||||
return aGodLv < bGodLv
|
||||
end
|
||||
return a.star < b.star
|
||||
end
|
||||
else
|
||||
return a.star < b.star
|
||||
end
|
||||
return a.heroConfig.Natural < b.heroConfig.Natural
|
||||
end
|
||||
else
|
||||
return a.heroConfig.Natural < b.heroConfig.Natural
|
||||
return a.isTrain < b.isTrain
|
||||
end
|
||||
else
|
||||
return a.isHarmonyGongMing < b.isHarmonyGongMing
|
||||
|
|
|
@ -228,6 +228,10 @@ function this.OnShowSingleCardData(go,heroData)--isSelect 1选择 2 没选择
|
|||
PopupTipPanel.ShowTip(Language[12184])
|
||||
end)
|
||||
Util.AddOnceClick(cardBtn, function()
|
||||
if TrainBuildManager.CheckHeroIsTraining(heroData.dynamicId) then
|
||||
PopupTipPanel.ShowTip("该神将正在特训")
|
||||
return
|
||||
end
|
||||
local isSelect = false
|
||||
local selectIndex = 0
|
||||
for i = 1, #curSelectHeroList do
|
||||
|
@ -377,7 +381,8 @@ function RoleUpStarListPanel:AutoSelectHero()
|
|||
curSelectHeroList = {}
|
||||
for i = 1, #heroDataList do
|
||||
if heroDataList[i].type == RoleUpStarMatType.item and LengthOfTable(curSelectHeroList) < curNeedRoleNum or heroDataList[i].type == RoleUpStarMatType.hero and LengthOfTable(curSelectHeroList) < curNeedRoleNum
|
||||
and heroDataList[i].isFormation == "" and heroDataList[i].lockState == 0 and (not HarmonyManager.IsChangeColor(heroDataList[i].dynamicId) and(not HarmonyManager:IsEnvoy(heroDataList[i].dynamicId))) then
|
||||
and heroDataList[i].isFormation == "" and heroDataList[i].lockState == 0 and (not HarmonyManager.IsChangeColor(heroDataList[i].dynamicId) and(not HarmonyManager:IsEnvoy(heroDataList[i].dynamicId)))
|
||||
and TrainBuildManager.CheckHeroIsTraining(heroDataList[i].dynamicId)==false then
|
||||
-- curSelectHeroList[heroDataList[i].dynamicId]=heroDataList[i]
|
||||
table.insert(curSelectHeroList,heroDataList[i])
|
||||
end
|
||||
|
|
Loading…
Reference in New Issue