From cba9464b6f950213a08ba1729bd87dbae1861b78 Mon Sep 17 00:00:00 2001 From: MrZ626 <1046101471@qq.com> Date: Sun, 9 May 2021 22:30:59 +0800 Subject: [PATCH] =?UTF-8?q?=E8=BF=9C=E7=A8=8B=E5=AF=B9=E6=89=8B=E6=8C=89?= =?UTF-8?q?=E7=85=A7=E5=BD=95=E5=83=8F=E6=B5=81=E9=95=BF=E5=BA=A6=E8=BF=9B?= =?UTF-8?q?=E8=A1=8C=E6=9B=B4=E5=BF=AB=E9=80=9F=E7=9A=84=E8=BF=BD=E5=B8=A7?= =?UTF-8?q?=EF=BC=8C=E8=A7=A3=E5=86=B3=E6=9C=AC=E5=9C=B0=E5=8D=A1=E9=A1=BF?= =?UTF-8?q?=E5=AF=BC=E8=87=B4=E7=9C=8B=E5=88=B0=E5=AF=B9=E6=89=8B=E4=B9=9F?= =?UTF-8?q?=E4=BC=9A=E5=8D=A1=E9=A1=BF=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- parts/player/update.lua | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/parts/player/update.lua b/parts/player/update.lua index 3b8620d7..76c66b73 100644 --- a/parts/player/update.lua +++ b/parts/player/update.lua @@ -397,14 +397,16 @@ function update.dead(P,dt) updateTasks(P) end function update.remote_alive(P,dt) - local frmDelta=PLAYERS[1].frameRun-P.frameRun - for _=1, - frmDelta<20 and 1 or - frmDelta<45 and rnd(2)or - frmDelta<90 and 2 or - frmDelta<180 and rnd(2,3)or - 3 - do + local frameRate=(P.stream[#P.stream-1]or 0)-P.frameRun + frameRate=frameRate<20 and 1 or + frameRate<30 and rnd(2)or + frameRate<60 and 2 or + frameRate<90 and 3 or + frameRate<120 and 5 or + frameRate<150 and 7 or + frameRate<180 and 10 or + 20 + for _=1,frameRate do local eventTime=P.stream[P.streamProgress] if eventTime then--Normal state, event forward if P.frameRun==eventTime then--Event time, execute action, read next so don't update immediately @@ -444,7 +446,7 @@ function update.remote_alive(P,dt) end P.streamProgress=P.streamProgress+2 else--No event now, run one frame - update.alive(P,dt) + update.alive(P,dt/frameRate) end else--Pause state, no actions, quit loop break