From 3c4491ec42480fe3c9e5635d376a549b21569233 Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Tue, 15 Sep 2020 00:36:09 +0800 Subject: [PATCH] =?UTF-8?q?=E7=8E=A9=E5=AE=B6=E4=B8=8A=E6=AC=A1=E6=B6=88?= =?UTF-8?q?=E8=A1=8C=E4=BF=A1=E6=81=AFlastClear=E5=B1=9E=E6=80=A7=E6=94=B9?= =?UTF-8?q?=E4=B8=BA=E8=A1=A8=EF=BC=8C=E5=8C=85=E5=90=AB=E6=9B=B4=E5=A4=9A?= =?UTF-8?q?=E4=BF=A1=E6=81=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modes/c4wtrain_lunatic.lua | 10 ++++----- modes/c4wtrain_normal.lua | 10 ++++----- modes/tech_finesse+.lua | 6 +++-- modes/tech_hard+.lua | 6 +++-- modes/tech_lunatic+.lua | 6 +++-- modes/tech_normal+.lua | 6 +++-- modes/tsd_easy.lua | 10 ++++----- modes/tsd_hard.lua | 10 ++++----- modes/tsd_ultimate.lua | 11 ++++----- parts/player.lua | 46 +++++++++++++++++++++++++------------- 10 files changed, 72 insertions(+), 49 deletions(-) diff --git a/modes/c4wtrain_lunatic.lua b/modes/c4wtrain_lunatic.lua index a8d928f2..b2542a68 100644 --- a/modes/c4wtrain_lunatic.lua +++ b/modes/c4wtrain_lunatic.lua @@ -1,13 +1,13 @@ local min=math.min local function check_c4w(P) - for i=1,#P.clearedRow do - P.field[#P.field+1]=freeRow.get(13) - P.visTime[#P.visTime+1]=freeRow.get(20) - for i=4,7 do P.field[#P.field][i]=0 end - end if #P.clearedRow==0 then P:lose() else + for i=1,#P.clearedRow do + P.field[#P.field+1]=freeRow.get(13) + P.visTime[#P.visTime+1]=freeRow.get(20) + for i=4,7 do P.field[#P.field][i]=0 end + end if P.combo>P.modeData.point then P.modeData.point=P.combo end diff --git a/modes/c4wtrain_normal.lua b/modes/c4wtrain_normal.lua index ce4d4588..0f7d710c 100644 --- a/modes/c4wtrain_normal.lua +++ b/modes/c4wtrain_normal.lua @@ -1,11 +1,11 @@ local min=math.min local function check_c4w(P) - for i=1,#P.clearedRow do - P.field[#P.field+1]=freeRow.get(13) - P.visTime[#P.visTime+1]=freeRow.get(20) - for i=4,7 do P.field[#P.field][i]=0 end - end if #P.clearedRow>0 then + for i=1,#P.clearedRow do + P.field[#P.field+1]=freeRow.get(13) + P.visTime[#P.visTime+1]=freeRow.get(20) + for i=4,7 do P.field[#P.field][i]=0 end + end if P.combo>P.modeData.point then P.modeData.point=P.combo end diff --git a/modes/tech_finesse+.lua b/modes/tech_finesse+.lua index 534504f1..1fe9e7bd 100644 --- a/modes/tech_finesse+.lua +++ b/modes/tech_finesse+.lua @@ -1,7 +1,9 @@ local format=string.format local function tech_check_hard(P) - if #P.clearedRow>0 and P.lastClear<10 or P.lastClear==74 then - P:lose() + if #P.clearedRow>0 then + if not(P.lastClear.spin or P.lastClear.pc)then + P:lose() + end end if P.stat.atk>=200 then P:win("finish") diff --git a/modes/tech_hard+.lua b/modes/tech_hard+.lua index 58546a53..0d60b14a 100644 --- a/modes/tech_hard+.lua +++ b/modes/tech_hard+.lua @@ -1,7 +1,9 @@ local format=string.format local function tech_check_hard(P) - if #P.clearedRow>0 and P.lastClear<10 or P.lastClear==74 then - P:lose() + if #P.clearedRow>0 then + if not(P.lastClear.spin or P.lastClear.pc)then + P:lose() + end end if P.stat.atk>=200 then P:win("finish") diff --git a/modes/tech_lunatic+.lua b/modes/tech_lunatic+.lua index ecb5c1b5..7666ebfa 100644 --- a/modes/tech_lunatic+.lua +++ b/modes/tech_lunatic+.lua @@ -1,7 +1,9 @@ local format=string.format local function tech_check_hard(P) - if #P.clearedRow>0 and P.lastClear<10 or P.lastClear==74 then - P:lose() + if #P.clearedRow>0 then + if not(P.lastClear.spin or P.lastClear.pc)then + P:lose() + end end if P.stat.atk>=200 then P:win("finish") diff --git a/modes/tech_normal+.lua b/modes/tech_normal+.lua index cff6f668..579246c4 100644 --- a/modes/tech_normal+.lua +++ b/modes/tech_normal+.lua @@ -1,7 +1,9 @@ local format=string.format local function tech_check_hard(P) - if #P.clearedRow>0 and P.lastClear<10 or P.lastClear==74 then - P:lose() + if #P.clearedRow>0 then + if not(P.lastClear.spin or P.lastClear.pc)then + P:lose() + end end if P.stat.atk>=200 then P:win("finish") diff --git a/modes/tsd_easy.lua b/modes/tsd_easy.lua index ecea074b..693a06e4 100644 --- a/modes/tsd_easy.lua +++ b/modes/tsd_easy.lua @@ -1,8 +1,8 @@ local function check_tsd(P) if #P.clearedRow>0 then - if P.lastClear~=52 then + if P.lastClear.id~=5 or P.lastClear.row~=2 then P:lose() - elseif #P.clearedRow>0 then + else P.modeData.event=P.modeData.event+1 if P.modeData.event==20 then P:win("finish") @@ -24,9 +24,9 @@ return{ PLY.newPlayer(1,340,15) end, mesDisp=function(P,dx,dy) - setFont(75) - mStr(P.modeData.event,69,400) - mText(drawableText.tsd,69,477) + setFont(65) + mStr(P.modeData.event,69,320) + mText(drawableText.tsd,69,385) end, score=function(P)return{P.modeData.event,P.stat.time}end, scoreDisp=function(D)return D[1].."TSD "..toTime(D[2])end, diff --git a/modes/tsd_hard.lua b/modes/tsd_hard.lua index b047da3b..7780ae18 100644 --- a/modes/tsd_hard.lua +++ b/modes/tsd_hard.lua @@ -1,8 +1,8 @@ local function check_tsd(P) if #P.clearedRow>0 then - if P.lastClear~=52 then + if P.lastClear.id~=5 or P.lastClear.row~=2 then P:lose() - elseif #P.clearedRow>0 then + else P.modeData.event=P.modeData.event+1 end end @@ -22,9 +22,9 @@ return{ PLY.newPlayer(1,340,15) end, mesDisp=function(P,dx,dy) - setFont(75) - mStr(P.modeData.event,69,400) - mText(drawableText.tsd,69,477) + setFont(65) + mStr(P.modeData.event,69,320) + mText(drawableText.tsd,69,385) end, score=function(P)return{P.modeData.event,P.stat.time}end, scoreDisp=function(D)return D[1].."TSD "..toTime(D[2])end, diff --git a/modes/tsd_ultimate.lua b/modes/tsd_ultimate.lua index 90135718..11861033 100644 --- a/modes/tsd_ultimate.lua +++ b/modes/tsd_ultimate.lua @@ -1,8 +1,9 @@ local function check_tsd(P) if #P.clearedRow>0 then - if P.lastClear~=52 then + local C=P.lastClear + if P.lastClear.id~=5 or P.lastClear.row~=2 then P:lose() - elseif #P.clearedRow>0 then + else P.modeData.event=P.modeData.event+1 end end @@ -22,9 +23,9 @@ return{ PLY.newPlayer(1,340,15) end, mesDisp=function(P,dx,dy) - setFont(75) - mStr(P.modeData.event,69,400) - mText(drawableText.tsd,69,477) + setFont(65) + mStr(P.modeData.event,69,320) + mText(drawableText.tsd,69,385) end, score=function(P)return{P.modeData.event,P.stat.time}end, scoreDisp=function(D)return D[1].."TSD "..toTime(D[2])end, diff --git a/parts/player.lua b/parts/player.lua index d9476b22..ed622486 100644 --- a/parts/player.lua +++ b/parts/player.lua @@ -1305,7 +1305,16 @@ local function newEmptyPlayer(id,x,y,size) P.next={} P.freshTime=0 - P.spinLast,P.lastClear=false,nil + P.spinLast=false + P.lastClear={ + id=1,--block id + name=1,--block name + row=0,--line cleared + spin=false,--if spin + mini=false,--if mini + pc=false,--if pc + special=false,--if special clear (spin, >=4, pc) + } P.spinSeq=0--For Ospin, each digit mean a spin P.ctrlCount=0--Key press time, for finesse check P.pieceCount=0--Count pieces from next, for drawing bagline @@ -1401,7 +1410,7 @@ end function player.createClearingFX(P,y,spd) ins(P.clearFX,{y,0,spd}) end -function player.createBeam(P,R,send,time,target,color,clear,spin,combo) +function player.createBeam(P,R,send,time,target,color,clear,combo) local x1,y1,x2,y2 if P.small then x1,y1=P.centerX,P.centerY else x1,y1=P.x+(30*(P.curX+P.sc[2])-30+15+150)*P.size,P.y+(600-30*(P.curY+P.sc[1])+15+70)*P.size @@ -1412,9 +1421,9 @@ function player.createBeam(P,R,send,time,target,color,clear,spin,combo) local radius,corner local a,r,g,b=1,unpack(SKIN.libColor[color]) - if clear>10 then + if clear.special then radius=10+3*send+100/(target+4) - local t=clear%10 + local t=clear.row if t==1 then corner=3 r=.3+r*.4 @@ -2168,6 +2177,10 @@ do--player.drop(P)--Place piece end if cc>0 then + local C=P.lastClear + C.id,C.name=CB.id,CB.name + C.row=cc + C.spin=dospin cmb=cmb+1 if dospin then cscore=(spinSCR[CB.name]or spinSCR[8])[cc] @@ -2205,7 +2218,8 @@ do--player.drop(P)--Place piece else P.b2b=P.b2b+b2bPoint[cc] end - P.lastClear=CB.id*10+cc + C.mini=mini + C.special=true if P.human then SFX.play(spin_n[cc]) VOC.play(spinName[CB.name],CHN) @@ -2237,7 +2251,9 @@ do--player.drop(P)--Place piece atk=cc end P.b2b=P.b2b+cc*80-220 - P.lastClear=CB.name*10+cc + C.special=true + else + C.special=false end if P.human then VOC.play(clearName[cc],CHN) @@ -2260,6 +2276,7 @@ do--player.drop(P)--Place piece SFX.play("clear") VOC.play("pc",CHN) end + C.special=true elseif cc>1 or #P.field==P.garbageBeneath then P:showText(text.HPC,0,-80,50,"fly") atk=atk+2 @@ -2270,23 +2287,20 @@ do--player.drop(P)--Place piece if P.human then SFX.play("clear") end - else - goto checkB2Breduce + C.special=true end - P.lastClear=CB.name*10+5 - goto skipB2Breduce + C.pc=true + else + C.pc=false end - ::checkB2Breduce:: - if not(dospin or cc>3)then + if not C.special then P.b2b=max(P.b2b-250,0) P:showText(text.clear[cc],0,-30,27+cc*3,"appear",(8-cc)*.3) atk=cc-.5 sendTime=20+atk*20 cscore=cscore+clearSCR[cc] - P.lastClear=cc end - ::skipB2Breduce:: sendTime=sendTime+25*cmb if cmb>1 then @@ -2330,7 +2344,7 @@ do--player.drop(P)--Place piece local M=#P.atker if M>0 then for i=1,M do - P:attack(P.atker[i],send,sendTime,M,CB.color,P.lastClear,dospin,cmb) + P:attack(P.atker[i],send,sendTime,M,CB.color,C,cmb) end else T=randomTarget(P) @@ -2343,7 +2357,7 @@ do--player.drop(P)--Place piece T=randomTarget(P) end if T then - P:attack(T,send,sendTime,1,CB.color,P.lastClear,dospin,cmb) + P:attack(T,send,sendTime,1,CB.color,C,cmb) end end if P.human and send>3 then SFX.play("emit",min(send,7)*.1)end