From 051307d4d7501b31f6bd8c554cc61f7aa8c2b686 Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Mon, 26 Oct 2020 08:57:41 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8C=96=E6=8E=98=E7=9B=B8=E5=85=B3=E6=A8=A1?= =?UTF-8?q?=E5=BC=8F=E5=9E=83=E5=9C=BE=E8=A1=8C=E5=B0=BD=E9=87=8F=E4=B8=8D?= =?UTF-8?q?=E5=87=BA=E5=9C=A8=E5=90=8C=E4=B8=80=E5=88=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modes/dig_10.lua | 2 +- modes/dig_100.lua | 4 ++-- modes/dig_40.lua | 4 ++-- modes/dig_400.lua | 4 ++-- modes/dig_hard.lua | 2 +- modes/dig_ultimate.lua | 2 +- parts/player.lua | 11 +++++++++++ 7 files changed, 20 insertions(+), 9 deletions(-) diff --git a/modes/dig_10.lua b/modes/dig_10.lua index 1ae268d8..1872723a 100644 --- a/modes/dig_10.lua +++ b/modes/dig_10.lua @@ -15,7 +15,7 @@ return{ PLY.newPlayer(1,340,15) local P=PLAYERS[1] for _=1,10 do - P:garbageRise(13,1,P:RND(10)) + P:garbageRise(13,1,P:getHolePos()) end P.fieldBeneath=0 end, diff --git a/modes/dig_100.lua b/modes/dig_100.lua index 7cf719f0..9e7639ba 100644 --- a/modes/dig_100.lua +++ b/modes/dig_100.lua @@ -1,6 +1,6 @@ local function check_rise(P) for _=1,math.min(8,100-P.stat.dig)-P.garbageBeneath do - P:garbageRise(13,1,P:RND(10)) + P:garbageRise(13,1,P:getHolePos()) end if P.stat.dig==100 then P:win("finish") @@ -18,7 +18,7 @@ return{ PLY.newPlayer(1,340,15) local P=PLAYERS[1] for _=1,10 do - P:garbageRise(13,1,P:RND(10)) + P:garbageRise(13,1,P:getHolePos()) end P.fieldBeneath=0 end, diff --git a/modes/dig_40.lua b/modes/dig_40.lua index f2d8ff21..63831589 100644 --- a/modes/dig_40.lua +++ b/modes/dig_40.lua @@ -1,6 +1,6 @@ local function check_rise(P) for _=1,math.min(8,40-P.stat.dig)-P.garbageBeneath do - P:garbageRise(13,1,P:RND(10)) + P:garbageRise(13,1,P:getHolePos()) end if P.stat.dig==40 then P:win("finish") @@ -18,7 +18,7 @@ return{ PLY.newPlayer(1,340,15) local P=PLAYERS[1] for _=1,10 do - P:garbageRise(13,1,P:RND(10)) + P:garbageRise(13,1,P:getHolePos()) end P.fieldBeneath=0 end, diff --git a/modes/dig_400.lua b/modes/dig_400.lua index a9271cd7..71b4587e 100644 --- a/modes/dig_400.lua +++ b/modes/dig_400.lua @@ -1,6 +1,6 @@ local function check_rise(P) for _=1,math.min(8,400-P.stat.dig)-P.garbageBeneath do - P:garbageRise(13,1,P:RND(10)) + P:garbageRise(13,1,P:getHolePos()) end if P.stat.dig==400 then P:win("finish") @@ -18,7 +18,7 @@ return{ PLY.newPlayer(1,340,15) local P=PLAYERS[1] for _=1,10 do - P:garbageRise(13,1,P:RND(10)) + P:garbageRise(13,1,P:getHolePos()) end P.fieldBeneath=0 end, diff --git a/modes/dig_hard.lua b/modes/dig_hard.lua index 4eb51fa7..259bc8a3 100644 --- a/modes/dig_hard.lua +++ b/modes/dig_hard.lua @@ -10,7 +10,7 @@ return{ local D=P.modeData D.counter=D.counter+1 if D.counter>=max(90,180-D.event)then - P:garbageRise(10,1,P:RND(10)) + P:garbageRise(10,1,P:getHolePos()) P.stat.recv=P.stat.recv+1 D.counter=0 D.event=D.event+1 diff --git a/modes/dig_ultimate.lua b/modes/dig_ultimate.lua index f73ffb55..3150f08e 100644 --- a/modes/dig_ultimate.lua +++ b/modes/dig_ultimate.lua @@ -9,7 +9,7 @@ return{ local D=P.modeData D.counter=D.counter+1 if D.counter>=max(30,80-.3*D.event)then - P:garbageRise(13+D.event%5,1,P:RND(10)) + P:garbageRise(13+D.event%5,1,P:getHolePos()) P.stat.recv=P.stat.recv+1 D.counter=0 D.event=D.event+1 diff --git a/parts/player.lua b/parts/player.lua index d2363b53..ad08ff31 100644 --- a/parts/player.lua +++ b/parts/player.lua @@ -1601,6 +1601,17 @@ function player.attack(P,R,send,time,...) end end +function player.getHolePos(P) + if P.garbageBeneath==0 then + return P:RND(10) + else + local p=P:RND(10) + if P.field[1][p]>0 then + return P:RND(10) + end + return p + end +end function player.garbageRelease(P) local n,flag=1 while true do