ff to current state #6

Merged
kistaro merged 27 commits from pyrex/chameleonic:main into main 2022-12-19 07:03:33 +00:00
Showing only changes of commit 456796beca - Show all commits

View File

@ -1487,7 +1487,7 @@ function rope:_tug(hypothetically)
(dmx!=0 and sgn0(pull_dx)!=dmx) or (dmx!=0 and sgn0(pull_dx)!=dmx) or
(dmy!=0 and sgn0(pull_dy)!=dmy) or (dmy!=0 and sgn0(pull_dy)!=dmy) or
_vec_ang_diff(pull_anc.x\8-mx0,pull_anc.y\8-my0,dmx,dmy) > 0.125 or _vec_ang_diff(pull_anc.x\8-mx0,pull_anc.y\8-my0,dmx,dmy) >= 0.185 or
sgn0(mx0-mxa)!= sgn0(mx0-mxa)!=
sgn0(mx0+dmx-mxa) or sgn0(mx0+dmx-mxa) or
@ -1538,14 +1538,14 @@ function rope:_calc_push(
local mx,dmx local mx,dmx
if a0.x%8==0 and a0.x>an.x+7 then if a0.x%8==0 and a0.x>an.x+7 then
needs_good_pull=needs_good_pull or af.x>=a1.x needs_good_pull=needs_good_pull or af.x>=a1.x
if (needs_good_pull and _ang_diff(pull_ang,0.0)>=0.125) return {} if (needs_good_pull and _ang_diff(pull_ang,0.0)>=0.185) return {}
-- push left -- push left
mx=(a0.x-1)\8 mx=(a0.x-1)\8
dmx=-1 dmx=-1
elseif a0.x%8==7 and a0.x<an.x-7 then elseif a0.x%8==7 and a0.x<an.x-7 then
needs_good_pull=needs_good_pull or af.x<=a1.x needs_good_pull=needs_good_pull or af.x<=a1.x
if (needs_good_pull and _ang_diff(pull_ang,0.5)>=0.125) return {} if (needs_good_pull and _ang_diff(pull_ang,0.5)>=0.185) return {}
-- push right -- push right
mx=(a0.x+1)\8 mx=(a0.x+1)\8
@ -1570,7 +1570,7 @@ function rope:_calc_push(
local my,dmy local my,dmy
if a0.y%8==0 and a0.y>an.y+6 then if a0.y%8==0 and a0.y>an.y+6 then
needs_good_pull=needs_good_pull or af.y>=a1.y needs_good_pull=needs_good_pull or af.y>=a1.y
if (needs_good_pull and _ang_diff(pull_ang,0.75)>=0.125) return {} if (needs_good_pull and _ang_diff(pull_ang,0.75)>=0.185) return {}
-- push up -- push up
my=(a0.y-1)\8 my=(a0.y-1)\8
@ -1578,7 +1578,7 @@ function rope:_calc_push(
elseif a0.y%8==7 and a0.y<an.y-6 then elseif a0.y%8==7 and a0.y<an.y-6 then
needs_good_pull=needs_good_pull or af.y<=a1.y needs_good_pull=needs_good_pull or af.y<=a1.y
if (needs_good_pull and _ang_diff(pull_ang,0.25)>=0.125) return {} if (needs_good_pull and _ang_diff(pull_ang,0.25)>=0.185) return {}
-- push down -- push down
my=(a0.y+1)\8 my=(a0.y+1)\8