From 37520a9634549aac3d860944f9879e9e614f1bd1 Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Fri, 5 Mar 2021 18:02:52 +0800 Subject: [PATCH] =?UTF-8?q?=E6=98=BE=E7=A4=BAai=E8=AE=A1=E7=AE=97=E7=9A=84?= =?UTF-8?q?=E4=B8=8B=E4=B8=80=E5=9D=97=E4=BD=8D=E7=BD=AE?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- parts/ai.lua | 4 ++++ parts/player/draw.lua | 9 +++++++++ parts/player/player.lua | 8 ++++---- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/parts/ai.lua b/parts/ai.lua index 37a5786e..32e776f3 100644 --- a/parts/ai.lua +++ b/parts/ai.lua @@ -290,6 +290,10 @@ return{ if result==2 then ins(keys,6) elseif result==0 then + dest[5],dest[6]=dest[1][1],dest[1][2] + dest[7],dest[8]=dest[2][1],dest[2][2] + dest[1],dest[2]=dest[3][1],dest[3][2] + dest[3],dest[4]=dest[4][1],dest[4][2] P.AI_dest=dest if hold then keys[1]=8 end--Hold while move[1]do diff --git a/parts/player/draw.lua b/parts/player/draw.lua index 5eb82a91..ab9a3a5a 100644 --- a/parts/player/draw.lua +++ b/parts/player/draw.lua @@ -622,6 +622,15 @@ function draw.norm(P) drawNextPreview(P,P.nextQueue[1]) end + --Draw AI's drop destination + if P.AI_dest then + local texture=TEXTURE.puzzleMark[21] + local L=P.AI_dest + for i=1,#L,2 do + gc_draw(texture,30*L[i],-30*L[i+1]-30) + end + end + gc.setScissor() gc_pop() diff --git a/parts/player/player.lua b/parts/player/player.lua index 00758114..e15b3b2d 100644 --- a/parts/player/player.lua +++ b/parts/player/player.lua @@ -508,11 +508,11 @@ function Player.lock(P) if CB[i][j]then P.field[y][P.curX+j-1]=P.cur.color P.visTime[y][P.curX+j-1]=P.showTime - local x=P.curX+j-1 if dest then - for k=1,#dest do - if x==dest[k][1]+1 and y==dest[k][2]+1 then - rem(dest,k) + local x=P.curX+j--[[-1]] + for k=1,#dest,2 do + if x==dest[k]--[[+1]]and y==dest[k+1]+1 then + rem(dest,k)rem(dest,k) goto success end end