diff --git a/Zenitha b/Zenitha index 0f8d18f7..7e74fec3 160000 --- a/Zenitha +++ b/Zenitha @@ -1 +1 @@ -Subproject commit 0f8d18f74beb897817e89122647fb2bee8978abe +Subproject commit 7e74fec31ec537e4b29080517b4d4e439dc0e24a diff --git a/assets/game/minoPlayer.lua b/assets/game/minoPlayer.lua index 23b622d4..bc206a81 100644 --- a/assets/game/minoPlayer.lua +++ b/assets/game/minoPlayer.lua @@ -272,62 +272,66 @@ function MP:getSmoothPos() end -------------------------------------------------------------- -- Game methods -function MP:moveHand(action,a,b,c,d) +function MP:moveHand(action,A,B,C,D) --[[ - moveX: dx - moveY: dy - drop: dy + moveX: dx,noShade + moveY: dy,noShade + drop: dy,noShade rotate: x,y,dir,ifInit reset: x,y ]] if action=='moveX' then - self.handX=self.handX+a + self.handX=self.handX+A self:checkLanding() if self.settings.particles then local hx,hy=self.handX,self.handY local mat=self.hand.matrix local w,h=#mat[1],#mat - if a<0 then - for y=1,h do for x=w,1,-1 do - if mat[y][x] then - self:createMoveEffect(hx+x-1+1,hy+y-1,hx+x-1+1-a-1,hy+y-1) - break - end end - end - elseif a>0 then - for y=1,h do for x=1,w do - if mat[y][x] then - self:createMoveEffect(hx+x-1-1,hy+y-1,hx+x-1-1-a+1,hy+y-1) - break - end end + if not B then + if A<0 then + for y=1,h do for x=w,1,-1 do + if mat[y][x] then + self:createMoveEffect(hx+x-1+1,hy+y-1,hx+x-1+1-A-1,hy+y-1) + break + end end + end + elseif A>0 then + for y=1,h do for x=1,w do + if mat[y][x] then + self:createMoveEffect(hx+x-1-1,hy+y-1,hx+x-1-1-A+1,hy+y-1) + break + end end + end end end end elseif action=='moveY' or action=='drop' then - self.handY=self.handY+a + self.handY=self.handY+A self:checkLanding(true,true) if self.settings.particles then local hx,hy=self.handX,self.handY local mat=self.hand.matrix local w,h=#mat[1],#mat - if a<0 then - for x=1,w do for y=h,1,-1 do - if mat[y][x] then - self:createMoveEffect(hx+x-1,hy+y-1+1,hx+x-1,hy+y-1+1-a-1) - break - end end - end - elseif a>0 then - for x=1,w do for y=1,h do - if mat[y][x] then - self:createMoveEffect(hx+x-1,hy+y-1-1,hx+x-1,hy+y-1-1-a+1) - break - end end + if not B then + if A<0 then + for x=1,w do for y=h,1,-1 do + if mat[y][x] then + self:createMoveEffect(hx+x-1,hy+y-1+1,hx+x-1,hy+y-1+1-A-1) + break + end end + end + elseif A>0 then + for x=1,w do for y=1,h do + if mat[y][x] then + self:createMoveEffect(hx+x-1,hy+y-1-1,hx+x-1,hy+y-1-1-A+1) + break + end end + end end end end elseif action=='rotate' or action=='reset' then - self.handX,self.handY=a,b + self.handX,self.handY=A,B self:checkLanding() else error("WTF why action is "..tostring(action)) @@ -365,7 +369,7 @@ function MP:moveHand(action,a,b,c,d) self:ifoverlap(self.hand.matrix,self.handX+1,self.handY) then movement.immobile=true - self:shakeBoard(c=='L' and '-ccw' or c=='R' and '-cw' or '-180') + self:shakeBoard(C=='L' and '-ccw' or C=='R' and '-cw' or '-180') self:playSound('rotate_locked') if self.settings.particles then self:createHandEffect(.942,1,1) @@ -394,9 +398,9 @@ function MP:moveHand(action,a,b,c,d) end end end - self:playSound(d and 'initrotate' or 'rotate') + self:playSound(D and 'initrotate' or 'rotate') if self.settings.particles then - self:createRotateEffect(c,d) + self:createRotateEffect(C,D) end end self.lastMovement=movement @@ -948,28 +952,28 @@ function MP:calculateHolePos(count,splitRate,copyRate,sandwichRate) end function MP:moveLeft(ifInit) if not self:ifoverlap(self.hand.matrix,self.handX-1,self.handY) then - self:moveHand('moveX',-1) + self:moveHand('moveX',-1,true) if not ifInit then self:freshGhost() end return true end end function MP:moveRight(ifInit) if not self:ifoverlap(self.hand.matrix,self.handX+1,self.handY) then - self:moveHand('moveX',1) + self:moveHand('moveX',1,true) if not ifInit then self:freshGhost() end return true end end function MP:moveDown() if not self:ifoverlap(self.hand.matrix,self.handX,self.handY-1) then - self:moveHand('moveY',-1) + self:moveHand('moveY',-1,true) self:freshDelay('drop') return true end end -function MP:moveUp() +function MP:moveUp() -- ? if not self:ifoverlap(self.hand.matrix,self.handX,self.handY+1) then - self:moveHand('moveY',1) + self:moveHand('moveY',1,true) return true end end @@ -1539,7 +1543,7 @@ function MP:updateFrame() self.dropTimer=self.dropTimer-1 if self.dropTimer<=0 then self.dropTimer=SET.dropDelay - self:moveHand('drop',-1) + self:moveHand('drop',-1,true) end elseif self.handY~=self.ghostY then -- If switch to 20G during game, mino won't dropped to bottom instantly so we force fresh it self:freshDelay('drop') diff --git a/assets/game/puyoPlayer.lua b/assets/game/puyoPlayer.lua index 43c6d682..af9fc7cf 100644 --- a/assets/game/puyoPlayer.lua +++ b/assets/game/puyoPlayer.lua @@ -191,54 +191,66 @@ function PP:getSmoothPos() end -------------------------------------------------------------- -- Game methods -function PP:moveHand(action,a,b,c) +function PP:moveHand(action,A,B,C) + --[[ + moveX: dx,noShade + moveY: dy,noShade + drop: dy,noShade + rotate: x,y,ifInit + reset: x,y + ]] if action=='moveX' then - self.handX=self.handX+a + self.handX=self.handX+A self:checkLanding() if self.settings.particles then local hx,hy=self.handX,self.handY local mat=self.hand.matrix local w,h=#mat[1],#mat - if a<0 then - for y=1,h do for x=w,1,-1 do - if mat[y][x] then - self:createMoveEffect(hx+x-1+1,hy+y-1,hx+x-1+1-a-1,hy+y-1) - break - end end - end - elseif a>0 then - for y=1,h do for x=1,w do - if mat[y][x] then - self:createMoveEffect(hx+x-1-1,hy+y-1,hx+x-1-1-a+1,hy+y-1) - break - end end + if not B then + if A<0 then + for y=1,h do for x=w,1,-1 do + if mat[y][x] then + self:createMoveEffect(hx+x-1+1,hy+y-1,hx+x-1+1-A-1,hy+y-1) + break + end end + end + elseif A>0 then + for y=1,h do for x=1,w do + if mat[y][x] then + self:createMoveEffect(hx+x-1-1,hy+y-1,hx+x-1-1-A+1,hy+y-1) + break + end end + end end end end elseif action=='drop' or action=='moveY' then - self.handY=self.handY+a + self.handY=self.handY+A self:checkLanding(true) if self.settings.particles then local hx,hy=self.handX,self.handY local mat=self.hand.matrix local w,h=#mat[1],#mat - if a<0 then - for x=1,w do for y=h,1,-1 do - if mat[y][x] then - self:createMoveEffect(hx+x-1,hy+y-1+1,hx+x-1,hy+y-1+1-a-1) - break - end end - end - elseif a>0 then - for x=1,w do for y=1,h do - if mat[y][x] then - self:createMoveEffect(hx+x-1,hy+y-1-1,hx+x-1,hy+y-1-1-a+1) - break - end end + if not B then + if A<0 then + for x=1,w do for y=h,1,-1 do + if mat[y][x] then + self:createMoveEffect(hx+x-1,hy+y-1+1,hx+x-1,hy+y-1+1-A-1) + break + end end + end + elseif A>0 then + for x=1,w do for y=1,h do + if mat[y][x] then + self:createMoveEffect(hx+x-1,hy+y-1-1,hx+x-1,hy+y-1-1-A+1) + break + end end + end end end - end elseif action=='rotate' or action=='reset' then - self.handX,self.handY=a,b + end + elseif action=='rotate' or action=='reset' then + self.handX,self.handY=A,B else error("WTF why action is "..tostring(action)) end @@ -246,7 +258,7 @@ function PP:moveHand(action,a,b,c) if self.handX%1~=0 or self.handY%1~=0 then error("EUREKA! Decimal position") end if action=='rotate' then - self:playSound(c and 'initrotate' or 'rotate') + self:playSound(C and 'initrotate' or 'rotate') self:checkLanding() end @@ -543,28 +555,28 @@ function PP:isSuffocate() end function PP:moveLeft() if not self:ifoverlap(self.hand.matrix,self.handX-1,self.handY) then - self:moveHand('moveX',-1) + self:moveHand('moveX',-1,true) self:freshGhost() return true end end function PP:moveRight() if not self:ifoverlap(self.hand.matrix,self.handX+1,self.handY) then - self:moveHand('moveX',1) + self:moveHand('moveX',1,true) self:freshGhost() return true end end function PP:moveDown() if not self:ifoverlap(self.hand.matrix,self.handX,self.handY-1) then - self:moveHand('moveY',-1) + self:moveHand('moveY',-1,true) self:freshDelay('drop') return true end end -function PP:moveUp() +function PP:moveUp() -- ? if not self:ifoverlap(self.hand.matrix,self.handX,self.handY+1) then - self:moveHand('moveY',1) + self:moveHand('moveY',1,true) return true end end @@ -1031,7 +1043,7 @@ function PP:updateFrame() self.dropTimer=self.dropTimer-1 if self.dropTimer<=0 then self.dropTimer=SET.dropDelay - self:moveHand('drop',-1) + self:moveHand('drop',-1,true) end elseif self.handY~=self.ghostY then -- If switch to 20G during game, puyo won't dropped to bottom instantly so we force fresh it self:freshDelay('drop')