From a4d6585e9cc933d9b51cf0a5fdc3e81e5611b6e0 Mon Sep 17 00:00:00 2001 From: NOT_A_ROBOT <76723917+Not-A-Normal-Robot@users.noreply.github.com> Date: Sun, 17 Jul 2022 22:23:46 +0700 Subject: [PATCH] Add ability to remove garbage by clearing [height+2] lines or more (#714) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Resolve #684 * oh right almost forgor stack_u 💀 --- parts/eventsets/stack_e.lua | 7 ++++++- parts/eventsets/stack_u.lua | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/parts/eventsets/stack_e.lua b/parts/eventsets/stack_e.lua index a7ceed5e..e35ca2ed 100644 --- a/parts/eventsets/stack_e.lua +++ b/parts/eventsets/stack_e.lua @@ -11,7 +11,12 @@ return{ local cc=P:clearFilledLines(P.garbageBeneath+1,#P.field-P.garbageBeneath) if cc>0 then local h=20-cc-P.garbageBeneath - if h>0 then + if h<-1 and P.garbageBeneath>0 then + for i=1,math.min(P.garbageBeneath,-h-1) do + LINE.discard(table.remove(P.field,1)) + LINE.discard(table.remove(P.visTime,1)) + end + elseif h>0 then P:garbageRise(21,h,2e10-1) if P.garbageBeneath>=20 then P:lose() diff --git a/parts/eventsets/stack_u.lua b/parts/eventsets/stack_u.lua index 7f08bd9d..32c59e4c 100644 --- a/parts/eventsets/stack_u.lua +++ b/parts/eventsets/stack_u.lua @@ -11,7 +11,12 @@ return{ local cc=P:clearFilledLines(P.garbageBeneath+1,#P.field-P.garbageBeneath) if cc>0 then local h=20-cc-P.garbageBeneath-3 - if h>0 then + if h<-1 and P.garbageBeneath>0 then + for i=1,math.min(P.garbageBeneath,-h-1) do + LINE.discard(table.remove(P.field,1)) + LINE.discard(table.remove(P.visTime,1)) + end + elseif h>0 then P:garbageRise(21,h,2e10-1) if P.garbageBeneath>=20 then P:lose()