From ee4ca51affd50b9c0c450dca11ceb57d02484ab7 Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Mon, 10 May 2021 14:40:55 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=B4=E7=90=86=E4=BB=A3=E7=A0=81=EF=BC=8C?= =?UTF-8?q?=E7=95=A5=E5=BE=AE=E4=BC=98=E5=8C=96=E6=80=A7=E8=83=BD=EF=BC=8C?= =?UTF-8?q?=E8=B0=83=E6=95=B4=E7=8E=A9=E5=AE=B6=E6=94=BB=E5=87=BB=E5=8A=9B?= =?UTF-8?q?=E5=92=8C=E6=A1=86=E9=A2=9C=E8=89=B2=E7=9B=B8=E5=85=B3=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=EF=BC=8C=E8=81=94=E7=BD=91=E5=AF=B9=E6=88=98=E6=AF=8F?= =?UTF-8?q?=E5=88=86=E9=92=9F=E4=BC=9A=E5=A2=9E=E5=8A=A0=E6=94=BB=E5=87=BB?= =?UTF-8?q?=E5=8A=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- main.lua | 8 ++--- parts/gametoolfunc.lua | 22 +++++++------- parts/language/lang_en.lua | 1 + parts/language/lang_zh.lua | 1 + parts/modes/netBattle.lua | 8 +++++ parts/modes/techmino49_e.lua | 14 ++++----- parts/modes/techmino49_h.lua | 14 ++++----- parts/modes/techmino49_u.lua | 14 ++++----- parts/modes/techmino99_e.lua | 14 ++++----- parts/modes/techmino99_h.lua | 14 ++++----- parts/modes/techmino99_u.lua | 14 ++++----- parts/player/draw.lua | 5 ++-- parts/player/init.lua | 2 +- parts/player/player.lua | 58 ++++++++++++++++++++---------------- 14 files changed, 97 insertions(+), 92 deletions(-) diff --git a/main.lua b/main.lua index dad1de2b..0cc540c7 100644 --- a/main.lua +++ b/main.lua @@ -55,10 +55,6 @@ end require"Zframework" SCR.setSize(1280,720)--Initialize Screen size -require"parts.list" -require"parts.globalTables" -require"parts.gametoolfunc" - --Load shader files from SOURCE ONLY SHADER={} for _,v in next,fs.getDirectoryItems("parts/shaders")do @@ -68,6 +64,10 @@ for _,v in next,fs.getDirectoryItems("parts/shaders")do end end +require"parts.list" +require"parts.globalTables" +require"parts.gametoolfunc" + FREEROW= require"parts.freeRow" DATA= require"parts.data" diff --git a/parts/gametoolfunc.lua b/parts/gametoolfunc.lua index 9dda328c..d2f395e9 100644 --- a/parts/gametoolfunc.lua +++ b/parts/gametoolfunc.lua @@ -579,20 +579,22 @@ do--function drawSelfProfile() gc.pop() end end -function drawWarning() - if SETTING.warn and GAME.warnLVL>0 then - gc.push('transform') - gc.origin() - SHADER.warning:send("level",GAME.warnLVL) - gc.setShader(SHADER.warning) - gc.rectangle('fill',0,0,SCR.w,SCR.h) - gc.setShader() - gc.pop() +do--function drawWarning() + local SETTING,GAME,shader_warning,SCR=SETTING,GAME,SHADER.warning,SCR + function drawWarning() + if SETTING.warn and GAME.warnLVL>0 then + gc.push('transform') + gc.origin() + shader_warning:send("level",GAME.warnLVL) + gc.setShader(shader_warning) + gc.rectangle('fill',0,0,SCR.w,SCR.h) + gc.setShader() + gc.pop() + end end end - --Widget function shortcuts function backScene()SCN.back()end do--function goScene(name,style) diff --git a/parts/language/lang_en.lua b/parts/language/lang_en.lua index 5babdc51..ea142bbe 100644 --- a/parts/language/lang_en.lua +++ b/parts/language/lang_en.lua @@ -11,6 +11,7 @@ return{ atkModeName={"Random","Badges","K.O.s","Attackers"}, royale_remain="$1 Player(s) Remaining", + powerUp={[0]="000%UP","025%UP","050%UP","075%UP","100%UP"}, cmb={nil,"1 Combo","2 Combo","3 Combo","4 Combo","5 Combo","6 Combo","7 Combo","8 Combo","9 Combo","10 Combo!","11 Combo!","12 Combo!","13 Combo!","14 Combo!!","15 Combo!!","16 Combo!!","17 Combo!!!","18 Combo!!!","19 Combo!!!","MEGACMB"}, spin="-Spin ", clear={"Single","Double","Triple","Techrash","Pentacrash","Hexacrash"}, diff --git a/parts/language/lang_zh.lua b/parts/language/lang_zh.lua index 887b65ce..46c5e0fd 100644 --- a/parts/language/lang_zh.lua +++ b/parts/language/lang_zh.lua @@ -11,6 +11,7 @@ return{ atkModeName={"随机","徽章","击杀","反击"}, royale_remain="剩余 $1 名玩家", + powerUp={[0]="000%UP","025%UP","050%UP","075%UP","100%UP"}, cmb={nil,"1 Combo","2 Combo","3 Combo","4 Combo","5 Combo","6 Combo","7 Combo","8 Combo","9 Combo","10 Combo!","11 Combo!","12 Combo!","13 Combo!","14 Combo!","15 Combo!","16 Combo!","17 Combo!","18 Combo!","19 Combo!","MEGACMB"}, spin="-spin ", clear={"single","double","triple","Techrash","Pentcrash","Hexcrash"}, diff --git a/parts/modes/netBattle.lua b/parts/modes/netBattle.lua index ba8f2da5..cddb352e 100644 --- a/parts/modes/netBattle.lua +++ b/parts/modes/netBattle.lua @@ -1,3 +1,4 @@ +local yield=YIELD return{ color=COLOR.white, env={ @@ -6,6 +7,13 @@ return{ pushSpeed=5, garbageSpeed=2, allowMod=false, + task=function(P) + local S=P.stat + while true do yield()if S.time>60 then P.strength=1 break end end + while true do yield()if S.time>120 then P.strength=2 break end end + while true do yield()if S.time>180 then P.strength=3 break end end + while true do yield()if S.time>240 then P.strength=4 break end end + end, bgm={'battle','cruelty','distortion','far','final','hope','magicblock','new era','push','race','rockblock','secret7th','secret8th','shining terminal','storm','super7th','warped','waterfall'}, }, load=function() diff --git a/parts/modes/techmino49_e.lua b/parts/modes/techmino49_e.lua index b71df99d..22d9f059 100644 --- a/parts/modes/techmino49_e.lua +++ b/parts/modes/techmino49_e.lua @@ -1,6 +1,4 @@ local gc=love.graphics -local rnd=math.random -local powerUp={[0]="000%UP","025%UP","050%UP","075%UP","100%UP",} local function selectTarget(P) if SETTING.swap then for i=1,#P.keyPressing do @@ -34,23 +32,23 @@ return{ local L={}for i=1,49 do L[i]=true end local t=CC and 2 or 0 while t>0 do - local r=rnd(2,49) + local r=math.random(2,49) if L[r]then L[r],t=false,t-1 end end local n=2 for _=1,4 do for _=1,6 do if L[n]then - PLY.newAIPlayer(n,AIBUILDER('9S',rnd(4,6)),true) + PLY.newAIPlayer(n,AIBUILDER('9S',math.random(4,6)),true) else - PLY.newAIPlayer(n,AIBUILDER('CC',rnd(2,4),2,true,20000),true) + PLY.newAIPlayer(n,AIBUILDER('CC',math.random(2,4),2,true,20000),true) end n=n+1 end end for _=9,12 do for _=1,6 do if L[n]then - PLY.newAIPlayer(n,AIBUILDER('9S',rnd(4,5)),true) + PLY.newAIPlayer(n,AIBUILDER('9S',math.random(4,5)),true) else - PLY.newAIPlayer(n,AIBUILDER('CC',rnd(3,5),2,true,20000),true) + PLY.newAIPlayer(n,AIBUILDER('CC',math.random(3,5),2,true,20000),true) end n=n+1 end end @@ -65,7 +63,7 @@ return{ gc.print(P.badge,103,227) gc.setColor(1,1,1) setFont(25) - gc.print(powerUp[P.strength],18,290) + gc.print(text.powerUp[P.strength],18,290) for i=1,P.strength do gc.draw(IMG.badgeIcon,16*i+12,260) end diff --git a/parts/modes/techmino49_h.lua b/parts/modes/techmino49_h.lua index bfff4560..e7bb4954 100644 --- a/parts/modes/techmino49_h.lua +++ b/parts/modes/techmino49_h.lua @@ -1,6 +1,4 @@ local gc=love.graphics -local rnd=math.random -local powerUp={[0]="000%UP","025%UP","050%UP","075%UP","100%UP",} local function selectTarget(P) if SETTING.swap then for i=1,#P.keyPressing do @@ -34,23 +32,23 @@ return{ local L={}for i=1,49 do L[i]=true end local t=CC and 4 or 0 while t>0 do - local r=rnd(2,49) + local r=math.random(2,49) if L[r]then L[r],t=false,t-1 end end local n=2 for _=1,4 do for _=1,6 do if L[n]then - PLY.newAIPlayer(n,AIBUILDER('9S',rnd(4,8)),true) + PLY.newAIPlayer(n,AIBUILDER('9S',math.random(4,8)),true) else - PLY.newAIPlayer(n,AIBUILDER('CC',rnd(3,6),3,true,30000),true) + PLY.newAIPlayer(n,AIBUILDER('CC',math.random(3,6),3,true,30000),true) end n=n+1 end end for _=9,12 do for _=1,6 do if L[n]then - PLY.newAIPlayer(n,AIBUILDER('9S',rnd(4,7)),true) + PLY.newAIPlayer(n,AIBUILDER('9S',math.random(4,7)),true) else - PLY.newAIPlayer(n,AIBUILDER('CC',rnd(4,6),3,true,30000),true) + PLY.newAIPlayer(n,AIBUILDER('CC',math.random(4,6),3,true,30000),true) end n=n+1 end end @@ -65,7 +63,7 @@ return{ gc.print(P.badge,103,227) gc.setColor(1,1,1) setFont(25) - gc.print(powerUp[P.strength],18,290) + gc.print(text.powerUp[P.strength],18,290) for i=1,P.strength do gc.draw(IMG.badgeIcon,16*i+12,260) end diff --git a/parts/modes/techmino49_u.lua b/parts/modes/techmino49_u.lua index 51463f8a..e147f838 100644 --- a/parts/modes/techmino49_u.lua +++ b/parts/modes/techmino49_u.lua @@ -1,6 +1,4 @@ local gc=love.graphics -local rnd=math.random -local powerUp={[0]="000%UP","025%UP","050%UP","075%UP","100%UP",} local function selectTarget(P) if SETTING.swap then for i=1,#P.keyPressing do @@ -34,23 +32,23 @@ return{ local L={}for i=1,49 do L[i]=true end local t=CC and 6 or 0 while t>0 do - local r=rnd(2,49) + local r=math.random(2,49) if L[r]then L[r],t=false,t-1 end end local n=2 for _=1,4 do for _=1,6 do if L[n]then - PLY.newAIPlayer(n,AIBUILDER('9S',rnd(8,10)),true) + PLY.newAIPlayer(n,AIBUILDER('9S',math.random(8,10)),true) else - PLY.newAIPlayer(n,AIBUILDER('CC',rnd(4,7),3,true,40000),true) + PLY.newAIPlayer(n,AIBUILDER('CC',math.random(4,7),3,true,40000),true) end n=n+1 end end for _=9,12 do for _=1,6 do if L[n]then - PLY.newAIPlayer(n,AIBUILDER('9S',rnd(8,9)),true) + PLY.newAIPlayer(n,AIBUILDER('9S',math.random(8,9)),true) else - PLY.newAIPlayer(n,AIBUILDER('CC',rnd(5,8),3,true,40000),true) + PLY.newAIPlayer(n,AIBUILDER('CC',math.random(5,8),3,true,40000),true) end n=n+1 end end @@ -65,7 +63,7 @@ return{ gc.print(P.badge,103,227) gc.setColor(1,1,1) setFont(25) - gc.print(powerUp[P.strength],18,290) + gc.print(text.powerUp[P.strength],18,290) for i=1,P.strength do gc.draw(IMG.badgeIcon,16*i+12,260) end diff --git a/parts/modes/techmino99_e.lua b/parts/modes/techmino99_e.lua index 55091c89..bdd80d11 100644 --- a/parts/modes/techmino99_e.lua +++ b/parts/modes/techmino99_e.lua @@ -1,6 +1,4 @@ local gc=love.graphics -local rnd=math.random -local powerUp={[0]="000%UP","025%UP","050%UP","075%UP","100%UP",} local function selectTarget(P) if SETTING.swap then for i=1,#P.keyPressing do @@ -34,23 +32,23 @@ return{ local L={}for i=1,100 do L[i]=true end local t=CC and 4 or 0 while t>0 do - local r=rnd(2,99) + local r=math.random(2,99) if L[r]then L[r],t=false,t-1 end end local n=2 for _=1,7 do for _=1,7 do if L[n]then - PLY.newAIPlayer(n,AIBUILDER('9S',rnd(4,6)),true) + PLY.newAIPlayer(n,AIBUILDER('9S',math.random(4,6)),true) else - PLY.newAIPlayer(n,AIBUILDER('CC',rnd(2,4),2,true,20000),true) + PLY.newAIPlayer(n,AIBUILDER('CC',math.random(2,4),2,true,20000),true) end n=n+1 end end for _=15,21 do for _=1,7 do if L[n]then - PLY.newAIPlayer(n,AIBUILDER('9S',rnd(4,5)),true) + PLY.newAIPlayer(n,AIBUILDER('9S',math.random(4,5)),true) else - PLY.newAIPlayer(n,AIBUILDER('CC',rnd(3,5),2,true,20000),true) + PLY.newAIPlayer(n,AIBUILDER('CC',math.random(3,5),2,true,20000),true) end n=n+1 end end @@ -65,7 +63,7 @@ return{ gc.print(P.badge,103,227) gc.setColor(1,1,1) setFont(25) - gc.print(powerUp[P.strength],18,290) + gc.print(text.powerUp[P.strength],18,290) for i=1,P.strength do gc.draw(IMG.badgeIcon,16*i+12,260) end diff --git a/parts/modes/techmino99_h.lua b/parts/modes/techmino99_h.lua index 68aa7d8c..9e6a3080 100644 --- a/parts/modes/techmino99_h.lua +++ b/parts/modes/techmino99_h.lua @@ -1,6 +1,4 @@ local gc=love.graphics -local rnd=math.random -local powerUp={[0]="000%UP","025%UP","050%UP","075%UP","100%UP",} local function selectTarget(P) if SETTING.swap then for i=1,#P.keyPressing do @@ -34,23 +32,23 @@ return{ local L={}for i=1,100 do L[i]=true end local t=CC and 4 or 0 while t>0 do - local r=rnd(2,99) + local r=math.random(2,99) if L[r]then L[r],t=false,t-1 end end local n=2 for _=1,7 do for _=1,7 do if L[n]then - PLY.newAIPlayer(n,AIBUILDER('9S',rnd(4,8)),true) + PLY.newAIPlayer(n,AIBUILDER('9S',math.random(4,8)),true) else - PLY.newAIPlayer(n,AIBUILDER('CC',rnd(3,6),3,true,30000),true) + PLY.newAIPlayer(n,AIBUILDER('CC',math.random(3,6),3,true,30000),true) end n=n+1 end end for _=15,21 do for _=1,7 do if L[n]then - PLY.newAIPlayer(n,AIBUILDER('9S',rnd(4,7)),true) + PLY.newAIPlayer(n,AIBUILDER('9S',math.random(4,7)),true) else - PLY.newAIPlayer(n,AIBUILDER('CC',rnd(4,6),3,true,30000),true) + PLY.newAIPlayer(n,AIBUILDER('CC',math.random(4,6),3,true,30000),true) end n=n+1 end end @@ -65,7 +63,7 @@ return{ gc.print(P.badge,103,227) gc.setColor(1,1,1) setFont(25) - gc.print(powerUp[P.strength],18,290) + gc.print(text.powerUp[P.strength],18,290) for i=1,P.strength do gc.draw(IMG.badgeIcon,16*i+12,260) end diff --git a/parts/modes/techmino99_u.lua b/parts/modes/techmino99_u.lua index a0894058..6ed61432 100644 --- a/parts/modes/techmino99_u.lua +++ b/parts/modes/techmino99_u.lua @@ -1,6 +1,4 @@ local gc=love.graphics -local rnd=math.random -local powerUp={[0]="000%UP","025%UP","050%UP","075%UP","100%UP",} local function selectTarget(P) if SETTING.swap then for i=1,#P.keyPressing do @@ -34,23 +32,23 @@ return{ local L={}for i=1,100 do L[i]=true end local t=CC and 4 or 0 while t>0 do - local r=rnd(2,99) + local r=math.random(2,99) if L[r]then L[r],t=false,t-1 end end local n=2 for _=1,7 do for _=1,7 do if L[n]then - PLY.newAIPlayer(n,AIBUILDER('9S',rnd(8,10)),true) + PLY.newAIPlayer(n,AIBUILDER('9S',math.random(8,10)),true) else - PLY.newAIPlayer(n,AIBUILDER('CC',rnd(4,7),3,true,40000),true) + PLY.newAIPlayer(n,AIBUILDER('CC',math.random(4,7),3,true,40000),true) end n=n+1 end end for _=15,21 do for _=1,7 do if L[n]then - PLY.newAIPlayer(n,AIBUILDER('9S',rnd(8,9)),true) + PLY.newAIPlayer(n,AIBUILDER('9S',math.random(8,9)),true) else - PLY.newAIPlayer(n,AIBUILDER('CC',rnd(5,8),3,true,40000),true) + PLY.newAIPlayer(n,AIBUILDER('CC',math.random(5,8),3,true,40000),true) end n=n+1 end end @@ -65,7 +63,7 @@ return{ gc.print(P.badge,103,227) gc.setColor(1,1,1) setFont(25) - gc.print(powerUp[P.strength],18,290) + gc.print(text.powerUp[P.strength],18,290) for i=1,P.strength do gc.draw(IMG.badgeIcon,16*i+12,260) end diff --git a/parts/player/draw.lua b/parts/player/draw.lua index a133e76d..85ed7c4e 100644 --- a/parts/player/draw.lua +++ b/parts/player/draw.lua @@ -16,7 +16,6 @@ local shader_alpha,shader_lighter=SHADER.alpha,SHADER.lighter local drawableText,missionEnum,minoColor=drawableText,missionEnum,minoColor local RCPB={5,33,195,33,100,5,100,60} -local frameColorList={[0]=COLOR.Z,COLOR.lG,COLOR.lB,COLOR.lV,COLOR.lO} local attackColor={ {COLOR.dH,COLOR.Z}, {COLOR.H,COLOR.Z}, @@ -239,7 +238,7 @@ local function drawNextPreview(P,B) end local function drawBoarders(P) gc_setLineWidth(2) - gc_setColor(frameColorList[P.frameColor]) + gc_setColor(P.frameColor) gc_rectangle('line',-1,-11,302,612)--Bis Boarder gc_rectangle('line',301,-3,15,604)--AtkBuffer boarder gc_rectangle('line',-16,-3,15,604)--B2b bar boarder @@ -836,7 +835,7 @@ function draw.small(P) --Draw boarder if P.alive then gc_setLineWidth(2) - gc_setColor(frameColorList[P.frameColor]) + gc_setColor(P.frameColor) gc_rectangle('line',0,0,60,120) end diff --git a/parts/player/init.lua b/parts/player/init.lua index 7457bd38..1a55c72c 100644 --- a/parts/player/init.lua +++ b/parts/player/init.lua @@ -94,7 +94,7 @@ local function newEmptyPlayer(id,mini) a=0,va=0, } P.x,P.y,P.size=0,0,1 - P.frameColor=0 + P.frameColor=COLOR.Z --Set these at Player:setPosition() -- P.fieldX,P.fieldY=... diff --git a/parts/player/player.lua b/parts/player/player.lua index 528ee1a9..c07211ef 100644 --- a/parts/player/player.lua +++ b/parts/player/player.lua @@ -149,29 +149,35 @@ function Player:setPosition(x,y,size) self.absFieldX,self.absFieldY=x+150*size,y-10*size end end -local function task_movePosition(self,x,y,size) - local x1,y1,size1=self.x,self.y,self.size - while true do - yield() - if (x1-x)^2+(y1-y)^2<1 then - self:setPosition(x,y,size) - return true - else - x1=x1+(x-x1)*.126 - y1=y1+(y-y1)*.126 - size1=size1+(size-size1)*.126 - self:setPosition(x1,y1,size1) +do--function Player:movePosition(x,y,size) + local function task_movePosition(self,x,y,size) + local x1,y1,size1=self.x,self.y,self.size + while true do + yield() + if (x1-x)^2+(y1-y)^2<1 then + self:setPosition(x,y,size) + return true + else + x1=x1+(x-x1)*.126 + y1=y1+(y-y1)*.126 + size1=size1+(size-size1)*.126 + self:setPosition(x1,y1,size1) + end end end -end -local function checkPlayer(obj,Ptar) - return obj.args[1]==Ptar -end -function Player:movePosition(x,y,size) - TASK.removeTask_iterate(checkPlayer,self) - TASK.new(task_movePosition,self,x,y,size or self.size) + local function checkPlayer(obj,Ptar) + return obj.args[1]==Ptar + end + function Player:movePosition(x,y,size) + TASK.removeTask_iterate(checkPlayer,self) + TASK.new(task_movePosition,self,x,y,size or self.size) + end end +local frameColorList={[0]=COLOR.Z,COLOR.lG,COLOR.lB,COLOR.lV,COLOR.lO} +function Player:setFrameColor(c) + self.frameColor=frameColorList[c] +end function Player:switchKey(id,on) self.keyAvailable[id]=on if not on then @@ -1723,19 +1729,19 @@ function Player:lose(force) self.modeData.place=#PLY_ALIVE+1 self.strength=0 if self.lastRecv then - local A,i=self,0 + local A,depth=self,0 repeat - A,i=A.lastRecv,i+1 - until not A or A.alive or A==self or i==3 + A,depth=A.lastRecv,depth+1 + until not A or A.alive or A==self or depth==3 if A and A.alive then if self.id==1 or A.id==1 then self.killMark=A.id==1 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 - A.strength=j - A.frameColor=A.strength + for i=A.strength+1,4 do + if A.badge>=ROYALEDATA.powerUp[i]then + A.strength=i + A:setFrameColor(A.strength) end end self.lastRecv=A