添加剩余时间接口

jiaoyangna 2020-10-16 18:01:29 +08:00
parent 2a5a23f3ed
commit 6db6317da2
1 changed files with 21 additions and 2 deletions

View File

@ -142,6 +142,25 @@ function this.InitHeroData(goodsInfo,type)
LogGreen("得到的招募数量:"..#this.HeroData)
return this.HeroData
end
--获取招募时间
function this.GetHeroDataTime()
if not this.HeroData or #this.HeroData < 1 then
return nil
end
for i,v in ipairs(this.HeroData) do
if v.remainTime - PlayerManager.serverTime < 1 then
if v.goodsIndex == this.GetHeroIndex then
this.GetHeroIndex = 0
end
table.remove(this.HeroData,i)
end
end
table.sort(this.HeroData,function(a,b)
return a.goodsIndex > b.goodsIndex
end)
return (this.HeroData[#this.HeroData].remainTime - PlayerManager.serverTime)
end
-- type 1初始化 2添加 boss
function this.InitMonsterData(BackMonsterDatas,type)
@ -227,7 +246,7 @@ function this.SortMonster(MonsterData)
end
end)
end
--boss 剩余时间
function this.GetMonsterDataReMainTimesAndTime()
if not this.MonsterData or #this.MonsterData < 1 then
return nil
@ -239,7 +258,7 @@ function this.GetMonsterDataReMainTimesAndTime()
end
end
this.SortMonster(this.MonsterData)
return #this.MonsterData,this.MonsterData[#this.MonsterData].remainTime
return (this.MonsterData[#this.MonsterData].remainTime - PlayerManager.serverTime)
end
--开始战斗