diff --git a/Zenitha b/Zenitha index 7d7d6662..72299d26 160000 --- a/Zenitha +++ b/Zenitha @@ -1 +1 @@ -Subproject commit 7d7d66620b692fc2caa2fd6ec28086537758ef80 +Subproject commit 72299d268ede941967020c69b6bb30de2e48d907 diff --git a/assets/game/mechanicLib/common/timer.lua b/assets/game/mechanicLib/common/timer.lua index 1bd9dd75..2ea7de71 100644 --- a/assets/game/mechanicLib/common/timer.lua +++ b/assets/game/mechanicLib/common/timer.lua @@ -18,7 +18,7 @@ local timer_drawFunc={ float=function(_,time,time0) FONT.set(100,'bold') local text=("%.1f"):format(time/1000) - local alpha=MATH.listMix(floatMixList,time/time0) + local alpha=MATH.listLerp(floatMixList,time/time0) gc.setColor(0,0,0,alpha) GC.mStr(text,-2,-69,'center') GC.mStr(text,-1,-68,'center') diff --git a/assets/game/mechanicLib/mino/survivor.lua b/assets/game/mechanicLib/mino/survivor.lua index 1a194d3d..651c7558 100644 --- a/assets/game/mechanicLib/mino/survivor.lua +++ b/assets/game/mechanicLib/mino/survivor.lua @@ -38,9 +38,9 @@ function survivor.b2b_event_always(P) local wave=md.wave md.curWaveTime=math.floor( - wave<=40 and MATH.interpolate(wave,0,6000,40,4000) or - wave<=80 and MATH.interpolate(wave,40,4000,80,1500) or - max(MATH.interpolate(wave,80,1500,150,800),800) + wave<=40 and MATH.interpolate(0,6000,40,4000,wave) or + wave<=80 and MATH.interpolate(40,4000,80,1500,wave) or + max(MATH.interpolate(80,1500,150,800,wave),800) ) md.waveTimer=md.curWaveTime GAME.send(nil,GAME.initAtk{ @@ -66,8 +66,8 @@ function survivor.cheese_event_always(P) local wave=md.wave md.curWaveTime=math.floor( - wave<=80 and MATH.interpolate(wave,0,3000,80,2000) or - wave<=150 and MATH.interpolate(wave,80,2000,150,2500) or + wave<=80 and MATH.interpolate(0,3000,80,2000,wave) or + wave<=150 and MATH.interpolate(80,2000,150,2500,wave) or math.max(2000-(wave-150)*10,1000) ) md.waveTimer=md.curWaveTime @@ -79,8 +79,8 @@ function survivor.cheese_event_always(P) time=wave<50 and 100e3/(50+wave)-1000 or 0, fatal=MATH.clamp( ( - wave<100 and MATH.interpolate(wave,0,20,100,60) or - wave<200 and MATH.interpolate(wave,100,60,200,100) or + wave<100 and MATH.interpolate(0,20,100,60,wave) or + wave<200 and MATH.interpolate(100,60,200,100,wave) or 100 )+math.floor((P:random()*2-1)*min(wave,100)/5), 0,100 @@ -100,9 +100,9 @@ function survivor.spike_event_always(P) local wave=md.wave md.curWaveTime=floor( - wave<=10 and MATH.interpolate(wave,0,20e3,10,15e3) or - wave<=30 and MATH.interpolate(wave,10,15e3,30,12e3) or - max(MATH.interpolate(wave,30,12e3,60,10e3),10e3) + wave<=10 and MATH.interpolate(0,20e3,10,15e3,wave) or + wave<=30 and MATH.interpolate(10,15e3,30,12e3,wave) or + max(MATH.interpolate(30,12e3,60,10e3,wave),10e3) ) md.waveTimer=md.curWaveTime for i=1,3 do diff --git a/assets/game/minomap.lua b/assets/game/minomap.lua index 41011707..a1501ad2 100644 --- a/assets/game/minomap.lua +++ b/assets/game/minomap.lua @@ -6,6 +6,11 @@ local gc_setColor,gc_setLineWidth=gc.setColor,gc.setLineWidth local gc_draw,gc_line=gc.draw,gc.line local gc_circle,gc_polygon=gc.circle,gc.polygon +local linear=MATH.interpolate +local expAppr=MATH.expApproach +local dist=MATH.distance +local tau=MATH.tau + -- Y X -- * @@ -104,7 +109,7 @@ local bridges={} local function _newBridge(m1,m2) local x1,y1=m1.x,m1.y local x2,y2=m2.x,m2.y - local dist=MATH.distance(x1,y1,x2,y2) + local dist=dist(x1,y1,x2,y2) -- Cut in-mode parts local p1,p2=(m1.r*1.2)/dist,1-(m2.r*1.2)/dist @@ -237,7 +242,7 @@ local function _onMode(x,y) x,y=SCR.xOy_m:inverseTransformPoint(x,y) x,y=cam.transform:inverseTransformPoint(x,y-100) for _,m in next,modes do - if m.enable and MATH.distance(x,y,m.x,m.y)=200 and 160 or - P.modeData.stat.line>=130 and MATH.interpolate(P.modeData.stat.line,130,120,200,160) or - P.modeData.stat.line>=80 and MATH.interpolate(P.modeData.stat.line,80,90,130,120) or - P.modeData.stat.line>=40 and MATH.interpolate(P.modeData.stat.line,40,40,80,90) or - MATH.interpolate(P.modeData.stat.line,0,0,40,40) + P.modeData.stat.line>=130 and MATH.interpolate(130,120,200,160,P.modeData.stat.line) or + P.modeData.stat.line>=80 and MATH.interpolate(80,90,130,120,P.modeData.stat.line) or + P.modeData.stat.line>=40 and MATH.interpolate(40,40,80,90,P.modeData.stat.line) or + MATH.interpolate(0,0,40,40,P.modeData.stat.line) ) end, resultPage=function(time) diff --git a/assets/game/mode/mino/interior/sprint.lua b/assets/game/mode/mino/interior/sprint.lua index 0a0b320d..ea5fe180 100644 --- a/assets/game/mode/mino/interior/sprint.lua +++ b/assets/game/mode/mino/interior/sprint.lua @@ -31,9 +31,9 @@ return { PROGRESS.setInteriorScore('marathon',30) PROGRESS.setInteriorScore('sprint', P.gameTime<60e3 and 200 or - P.gameTime<90e3 and MATH.interpolate(P.gameTime,90e3,140,60e3,200) or - P.gameTime<180e3 and MATH.interpolate(P.gameTime,180e3,90,90e3,140) or - P.gameTime<300e3 and MATH.interpolate(P.gameTime,300e3,40,180e3,90) or + P.gameTime<90e3 and MATH.interpolate(90e3,140,60e3,200,P.gameTime) or + P.gameTime<180e3 and MATH.interpolate(180e3,90,90e3,140,P.gameTime) or + P.gameTime<300e3 and MATH.interpolate(300e3,40,180e3,90,P.gameTime) or 40 ) else diff --git a/assets/scene/zeta_input_method.lua b/assets/scene/zeta_input_method.lua index c84c849b..aa7fe65e 100644 --- a/assets/scene/zeta_input_method.lua +++ b/assets/scene/zeta_input_method.lua @@ -60,8 +60,8 @@ local function parseStroke(input)-- 横 竖 撇 捺 折 if s[1]areaX+areaR and s[#s-1]>areaX+areaR then return end if s[2]areaY+areaR and s[#s]>areaY+areaR then return end - w[1]=-w[5]+min(MATH.interpolate(width/height,1/2.6,0,2.6,1),1) - w[2]=-w[5]+min(MATH.interpolate(height/width,1.6,0,2.6,1),1) + w[1]=-w[5]+min(MATH.interpolate(1/2.6,0,2.6,1,width/height),1) + w[2]=-w[5]+min(MATH.interpolate(1.6,0,2.6,1,height/width),1) w[3]=-w[5]*.62+1-abs(dir/pi-.8)*3 w[4]=-w[5]*.62+1-abs(dir/pi-.4)