添加剩余时间接口
parent
2a5a23f3ed
commit
6db6317da2
|
|
@ -142,6 +142,25 @@ function this.InitHeroData(goodsInfo,type)
|
||||||
LogGreen("得到的招募数量:"..#this.HeroData)
|
LogGreen("得到的招募数量:"..#this.HeroData)
|
||||||
return this.HeroData
|
return this.HeroData
|
||||||
end
|
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
|
-- type 1初始化 2添加 boss
|
||||||
function this.InitMonsterData(BackMonsterDatas,type)
|
function this.InitMonsterData(BackMonsterDatas,type)
|
||||||
|
|
@ -227,7 +246,7 @@ function this.SortMonster(MonsterData)
|
||||||
end
|
end
|
||||||
end)
|
end)
|
||||||
end
|
end
|
||||||
|
--boss 剩余时间
|
||||||
function this.GetMonsterDataReMainTimesAndTime()
|
function this.GetMonsterDataReMainTimesAndTime()
|
||||||
if not this.MonsterData or #this.MonsterData < 1 then
|
if not this.MonsterData or #this.MonsterData < 1 then
|
||||||
return nil
|
return nil
|
||||||
|
|
@ -239,7 +258,7 @@ function this.GetMonsterDataReMainTimesAndTime()
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
this.SortMonster(this.MonsterData)
|
this.SortMonster(this.MonsterData)
|
||||||
return #this.MonsterData,this.MonsterData[#this.MonsterData].remainTime
|
return (this.MonsterData[#this.MonsterData].remainTime - PlayerManager.serverTime)
|
||||||
end
|
end
|
||||||
|
|
||||||
--开始战斗
|
--开始战斗
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue