整理代码,royaleData改为全大写,放入globalTables文件全局变量定义

This commit is contained in:
MrZ626
2021-04-22 21:54:40 +08:00
parent 7971eba517
commit 95c9a1d638
10 changed files with 29 additions and 40 deletions

View File

@@ -478,21 +478,19 @@ do--function drawFWM()
mStr(m[_G["\83\69\84\84\73\78\71"]["\108\97\110\103"]or m[1]],240,60+26*sin(t))
end
end
do--function drawSelfProfile()
function drawSelfProfile()
local selfAvatar=USERS.getAvatar(USER.uid)
gc_push("transform")
gc_translate(1280,0)
function drawSelfProfile()
local selfAvatar=USERS.getAvatar(USER.uid)
gc_push("transform")
gc_translate(1280,0)
--Draw avatar
gc_setLineWidth(2)
gc_setColor(.3,.3,.3,.8)gc_rectangle("fill",-260,0,260,80)
gc_setColor(1,1,1)gc_rectangle("line",-260,0,260,80)
gc_rectangle("line",-73,7,66,66,2)
gc_draw(selfAvatar,-72,8,nil,.5)
--Draw avatar
gc_setLineWidth(2)
gc_setColor(.3,.3,.3,.8)gc_rectangle("fill",-260,0,260,80)
gc_setColor(1,1,1)gc_rectangle("line",-260,0,260,80)
gc_rectangle("line",-73,7,66,66,2)
gc_draw(selfAvatar,-72,8,nil,.5)
gc_pop()
end
gc_pop()
end
function drawWarning()
if SETTING.warn and GAME.warnLVL>0 then

View File

@@ -178,6 +178,10 @@ GAME={--Global game data
mostDangerous=false,--Most dangerous player
secDangerous=false, --Second dangerous player
}
ROYALEDATA={
powerUp=false,
stage=false,
}
--Userdata tables
RANKS=FILE.load("conf/unlock")or{sprint_10l=0}--Ranks of modes

View File

@@ -28,10 +28,8 @@ return{
bg="rainbow",bgm="sugar fairy",
},
load=function()
royaleData={
powerUp={2,5,10,20},
stage={30,20,15,10,5},
}
ROYALEDATA.powerUp={2,5,10,20}
ROYALEDATA.stage={30,20,15,10,5}
PLY.newPlayer(1)
local L={}for i=1,49 do L[i]=true end
local t=CC and 2 or 0

View File

@@ -28,10 +28,8 @@ return{
bg="rainbow",bgm="rockblock",
},
load=function()
royaleData={
powerUp={2,5,10,20},
stage={30,20,15,10,5},
}
ROYALEDATA.powerUp={2,5,10,20}
ROYALEDATA.stage={30,20,15,10,5}
PLY.newPlayer(1)
local L={}for i=1,49 do L[i]=true end
local t=CC and 4 or 0

View File

@@ -28,10 +28,8 @@ return{
bg="rainbow",bgm="magicblock",
},
load=function()
royaleData={
powerUp={2,5,10,20},
stage={30,20,15,10,5},
}
ROYALEDATA.powerUp={2,5,10,20}
ROYALEDATA.stage={30,20,15,10,5}
PLY.newPlayer(1)
local L={}for i=1,49 do L[i]=true end
local t=CC and 6 or 0

View File

@@ -28,10 +28,8 @@ return{
bg="rainbow",bgm="sugar fairy",
},
load=function()
royaleData={
powerUp={2,6,14,30},
stage={75,50,35,20,10},
}
ROYALEDATA.powerUp={2,6,14,30}
ROYALEDATA.stage={75,50,35,20,10}
PLY.newPlayer(1)
local L={}for i=1,100 do L[i]=true end
local t=CC and 4 or 0

View File

@@ -28,10 +28,8 @@ return{
bg="rainbow",bgm="rockblock",
},
load=function()
royaleData={
powerUp={2,6,14,30},
stage={75,50,35,20,10},
}
ROYALEDATA.powerUp={2,6,14,30}
ROYALEDATA.stage={75,50,35,20,10}
PLY.newPlayer(1)
local L={}for i=1,100 do L[i]=true end
local t=CC and 4 or 0

View File

@@ -28,10 +28,8 @@ return{
bg="rainbow",bgm="magicblock",
},
load=function()
royaleData={
powerUp={2,6,14,30},
stage={75,50,35,20,10},
}
ROYALEDATA.powerUp={2,6,14,30}
ROYALEDATA.stage={75,50,35,20,10}
PLY.newPlayer(1)
local L={}for i=1,100 do L[i]=true end
local t=CC and 4 or 0

View File

@@ -1798,7 +1798,7 @@ function Player:lose(force)
end
A.modeData.ko,A.badge=A.modeData.ko+1,A.badge+self.badge+1
for j=A.strength+1,4 do
if A.badge>=royaleData.powerUp[j]then
if A.badge>=ROYALEDATA.powerUp[j]then
A.strength=j
A.frameColor=A.strength
end
@@ -1814,7 +1814,7 @@ function Player:lose(force)
freshMostBadge()
freshMostDangerous()
if #PLY_ALIVE==royaleData.stage[GAME.stage]then
if #PLY_ALIVE==ROYALEDATA.stage[GAME.stage]then
royaleLevelup()
end
self:showTextF(self.modeData.place,0,120,60,"appear",.26,.9)

View File

@@ -32,7 +32,6 @@ function scene.sceneInit()
--Set quick-play-button text
scene.widgetList[2]:setObject(text.WidgetText.main.qplay..": "..text.modes[STAT.lastPlay][1])
quickSure=false
--Create demo player
destroyPlayers()