diff --git a/modes/marathon_hard.lua b/modes/marathon_hard.lua index 6fd8b187..46a9f175 100644 --- a/modes/marathon_hard.lua +++ b/modes/marathon_hard.lua @@ -7,7 +7,7 @@ local function check(P) P.gameEnv.target=100 SFX.play("reach") elseif T==100 then - P:set20G() + P:set20G(true) P.gameEnv.target=200 SFX.play("reach") else diff --git a/modes/master_phantasm.lua b/modes/master_phantasm.lua index e90a9b59..3aaebca9 100644 --- a/modes/master_phantasm.lua +++ b/modes/master_phantasm.lua @@ -66,7 +66,7 @@ local function check_LVup(P) P.waiting=30 ENV.lock=11 ENV.next=6 - ENV.hold=false + P:setHold(false) ENV.bone=true ENV.target=62 @@ -96,7 +96,7 @@ local function check_LVup(P) ENV.lock=10 - ENV.hold=true + P:setHold(true) P.keepVisible=false P.showTime=180 diff --git a/parts/gametoolfunc.lua b/parts/gametoolfunc.lua index 56751a1b..7531155f 100644 --- a/parts/gametoolfunc.lua +++ b/parts/gametoolfunc.lua @@ -393,7 +393,7 @@ function royaleLevelup() P.gameEnv.drop=int(P.gameEnv.drop*.3) if P.gameEnv.drop==0 then P.curY=P.imgY - P:set20G() + P:set20G(true) end end end diff --git a/parts/player.lua b/parts/player.lua index 11343275..89d008e1 100644 --- a/parts/player.lua +++ b/parts/player.lua @@ -1145,6 +1145,10 @@ local function applyGameEnv(P)--Finish gameEnv processing P.keyAvailable[7]=false virtualkey[7].ava=false end + if not ENV.hold then + P.keyAvailable[8]=false + virtualkey[8].ava=false + end if type(ENV.mission)=="table"then P.curMission=1 @@ -1548,10 +1552,21 @@ function player.RND(P,a,b) return R:random(a,b) end -function player.set20G(P) - P._20G=true - if P.AI_mode=="CC"then CC.switch20G(P)end +function player.set20G(P,if20g,init) + P._20G=if20g + P.keyAvailable[7]=not if20g + virtualkey[7].ava=not if20g + if init and if20g and P.AI_mode=="CC"then CC.switch20G(P)end end +function player.setHold(P,ifhold) + P.gameEnv.hold=ifhold + P.keyAvailable[8]=not ifhold + virtualkey[8].ava=not ifhold + if not ifhold then + P.hd=nil + end +end + function player.newTask(P,code,data) local L=P.tasks ins(L,{