Skip to content

Commit

Permalink
Tech Finesse Lock hotfixes
Browse files Browse the repository at this point in the history
  • Loading branch information
Not-A-Normal-Robot authored Aug 26, 2023
1 parent 03eafb4 commit 2e59378
Show file tree
Hide file tree
Showing 3 changed files with 67 additions and 2 deletions.
2 changes: 1 addition & 1 deletion parts/eventsets/tech_finesse_lock.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ local function onRotate(P)
P.holdTime=0
VK.keys[8].ava=false
P.modeData.rotations=P.modeData.rotations+1
if P.modeData.rotations>=2 and not (P.curY>P.gameEnv.fieldH-2 or P:_roofCheck()) then
if P.modeData.rotations>=2 and (P.curY>P.gameEnv.fieldH-2 or P:_roofCheck()) then
P.keyAvailable[3]=false
P.keyAvailable[4]=false
P.keyAvailable[5]=false
Expand Down
65 changes: 65 additions & 0 deletions parts/eventsets/tech_finesse_lock_f.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
local function onMove(P)
if not P.cur then return end
P.holdTime=0
VK.keys[8].ava=false
P.modeData.moveCount=P.modeData.moveCount+1
if P.modeData.moveCount>=2 and (P.curY>P.gameEnv.fieldH-2 or P:_roofCheck()) then
P.keyAvailable[1]=false
P.keyAvailable[2]=false
VK.keys[1].ava=false
VK.keys[2].ava=false
end
end
local function onRotate(P)
if not P.cur then return end
P.holdTime=0
VK.keys[8].ava=false
P.modeData.rotations=P.modeData.rotations+1
if P.modeData.rotations>=2 and (P.curY>P.gameEnv.fieldH-2 or P:_roofCheck()) then
P.keyAvailable[3]=false
P.keyAvailable[4]=false
P.keyAvailable[5]=false
VK.keys[3].ava=false
VK.keys[4].ava=false
VK.keys[5].ava=false
end
end
local function resetLock(P)
for i=1,8 do
P.keyAvailable[i]=true
VK.keys[i].ava=true
end
P.modeData.moveCount=0
P.modeData.rotations=0
P.holdTime=1
end

return {
arr=0,
mesDisp=function(P)
setFont(45)
GC.mStr(("%d"):format(P.stat.atk),63,190)
GC.mStr(("%.2f"):format(P.stat.atk/P.stat.row),63,310)
mText(TEXTOBJ.atk,63,243)
mText(TEXTOBJ.eff,63,363)
end,
task=function(P)
resetLock(P)
end,
hook_drop=function(P)
resetLock(P)

local C=P.lastPiece
if C.row>0 then
if not C.special then
P:lose()
return
end
end
if P.stat.atk>=100 then
P:win('finish')
end
end,
hook_left_manual=onMove, hook_right_manual=onMove,
hook_rotLeft=onRotate, hook_rotRight=onRotate, hook_rot180=onRotate
}
2 changes: 1 addition & 1 deletion parts/modes/tech_finesse_lock_f.lua
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ return {
b2bKill=true,
freshLimit=15,
bg='flink',bgm='infinite',
eventSet='tech_finesse_lock',
eventSet='tech_finesse_lock_f',
},
slowMark=true,
score=function(P) return {P.stat.atk<=100 and math.floor(P.stat.atk) or 100,P.stat.time} end,
Expand Down

0 comments on commit 2e59378

Please sign in to comment.