From c4f14809fef6f4689500c783c69969938bf20e78 Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Tue, 10 Nov 2020 19:56:20 +0800 Subject: [PATCH] =?UTF-8?q?=E5=A2=9E=E5=BC=BA=E7=8E=A9=E5=AE=B6set20G?= =?UTF-8?q?=E6=96=B9=E6=B3=95=EF=BC=8C=E6=96=B0=E5=A2=9EsetHold=E6=96=B9?= =?UTF-8?q?=E6=B3=95=E5=B9=B6=E5=BA=94=E7=94=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- modes/marathon_hard.lua | 2 +- modes/master_phantasm.lua | 4 ++-- parts/gametoolfunc.lua | 2 +- parts/player.lua | 21 ++++++++++++++++++--- 4 files changed, 22 insertions(+), 7 deletions(-) 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,{