miduo_client/Assets/ManagedResources/~Lua/Modules/WorldArena/WorldArenaManager.lua

63 lines
1.5 KiB
Lua
Raw Normal View History

2021-09-07 17:05:46 +08:00
WorldArenaManager = {};
2021-08-31 15:10:27 +08:00
local this = WorldArenaManager
2021-09-07 17:05:46 +08:00
local ArenaSetting = ConfigManager.GetConfig(ConfigName.MServerArenaSetting)
2021-09-07 18:27:23 +08:00
local rankConfig = ConfigManager.GetConfig(ConfigName.MServerRankConfig)
2021-08-31 15:10:27 +08:00
function this.Initialize()
this.rank=0
this.star=0
end
2021-09-09 11:48:09 +08:00
local freeTimes
function this.SetFreeTime(num)
freeTimes=num
end
function this.GetFreeTime()
return freeTimes
end
2021-09-07 17:05:46 +08:00
-- 获取竞技场剩余挑战次数
function this.GetArenaChallengeTimes()
local privilege = ArenaSetting[2].BattleFree
local allTimes = PrivilegeManager.GetPrivilegeNumber(privilege)
local leftTimes = PrivilegeManager.GetPrivilegeRemainValue(privilege)
2021-09-09 15:44:19 +08:00
return freeTimes, allTimes
2021-09-07 17:05:46 +08:00
end
-- 获取竞技场挑战消耗
function this.GetArenaChallengeCost()
local itemId = ArenaSetting[2].Cost[1]
local itemNum = ArenaSetting[2].Cost[2]
return itemId, itemNum
end
2021-09-07 18:27:23 +08:00
--根据积分获取段位图标id
function this.GetRankImgByScore(num)
for k, v in ConfigPairs(rankConfig) do
if v.ScoreLow<num and v.ScoreUp>=num then
2021-09-09 15:44:19 +08:00
return v.RankGrade+1,v
2021-09-07 18:27:23 +08:00
end
end
return 1
end
2021-08-31 15:10:27 +08:00
local _StarShow = {
[0] = {0, 0, 0, 0, 0},
[1] = {0, 0, 1, 0, 0},
[2] = {0, 1, 0, 1, 0},
[3] = {0, 1, 1, 1, 0},
[4] = {1, 1, 0, 1, 1},
[5] = {1, 1, 1, 1, 1},
}
function this.SetStarShow(starList, starLv)
local ss = _StarShow[starLv]
for i = 1, #starList do
starList[i]:SetActive(ss[i] == 1)
end
end
2021-08-31 15:10:27 +08:00
return this