summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVittorio Romeo <vittorio.romeo@outlook.com>2021-03-03 21:32:39 +0000
committerVittorio Romeo <vittorio.romeo@outlook.com>2021-03-03 21:32:39 +0000
commitc4f0ebdc5e92559d1e290218e52ff7e9121ae333 (patch)
tree57dfbda64173ce40cfb8acf372218ef57d5581cc
parentbcc7568369833e763bdc29c1ac0dafec83fb59a5 (diff)
-rw-r--r--_RELEASE/Packs/cube/Scripts/commonpatterns.lua8
-rw-r--r--_RELEASE/Packs/experimental/Scripts/commonpatterns.lua91
-rw-r--r--_RELEASE/Packs/hypercube/Scripts/commonpatterns.lua9
-rw-r--r--_RELEASE/Packs/workshopexample/Scripts/commonpatterns.lua37
-rw-r--r--_RELEASE/Temp/example/Scripts/commonpatterns.lua37
-rw-r--r--src/SSVOpenHexagon/Components/CPlayer.cpp3
6 files changed, 95 insertions, 90 deletions
diff --git a/_RELEASE/Packs/cube/Scripts/commonpatterns.lua b/_RELEASE/Packs/cube/Scripts/commonpatterns.lua
index 6f8b3df7..47802081 100644
--- a/_RELEASE/Packs/cube/Scripts/commonpatterns.lua
+++ b/_RELEASE/Packs/cube/Scripts/commonpatterns.lua
@@ -16,7 +16,7 @@ end
function pSpiral(mTimes, mExtra)
local oldThickness = THICKNESS
THICKNESS = getPerfectThickness(THICKNESS) * l_getDelayMult()
- local delay = getPerfectDelay(THICKNESS) / l_getDelayMult()
+ local delay = getPerfectDelay(THICKNESS) / l_getDelayMult() * 0.9 -- overlap a bit to avoid going through gaps
local startSide = getRandomSide()
local loopDir = getRandomDir()
local j = 0
@@ -36,7 +36,7 @@ end
function pMirrorSpiral(mTimes, mExtra)
local oldThickness = THICKNESS
THICKNESS = getPerfectThickness(THICKNESS) * l_getDelayMult()
- local delay = getPerfectDelay(THICKNESS) / l_getDelayMult()
+ local delay = getPerfectDelay(THICKNESS) / l_getDelayMult() * 0.9 -- overlap a bit to avoid going through gaps
local startSide = getRandomSide()
local loopDir = getRandomDir()
j = 0
@@ -55,8 +55,8 @@ end
-- pMirrorSpiralDouble: spawns a spiral of rWallEx where you need to change direction
function pMirrorSpiralDouble(mTimes, mExtra)
local oldThickness = THICKNESS
- THICKNESS = getPerfectThickness(THICKNESS)
- local delay = getPerfectDelayDM(THICKNESS)
+ THICKNESS = getPerfectThickness(THICKNESS) * l_getDelayMult()
+ local delay = getPerfectDelayDM(THICKNESS) / l_getDelayMult() * 0.9 -- overlap a bit to avoid going through gaps
local startSide = getRandomSide()
local loopDir = getRandomDir()
local j = 0
diff --git a/_RELEASE/Packs/experimental/Scripts/commonpatterns.lua b/_RELEASE/Packs/experimental/Scripts/commonpatterns.lua
index 6f7258fd..96211325 100644
--- a/_RELEASE/Packs/experimental/Scripts/commonpatterns.lua
+++ b/_RELEASE/Packs/experimental/Scripts/commonpatterns.lua
@@ -3,79 +3,80 @@ u_execScript("common.lua")
-- pAltBarrage: spawns a series of cAltBarrage
function pAltBarrage(mTimes, mStep)
local delay = getPerfectDelayDM(THICKNESS) * 5.6
-
+
for i = 0, mTimes do
cAltBarrage(i, mStep)
t_wait(delay)
end
-
+
t_wait(delay)
end
+
-- pSpiral: spawns a spiral of cWallEx
function pSpiral(mTimes, mExtra)
local oldThickness = THICKNESS
- THICKNESS = getPerfectThickness(THICKNESS)
- local delay = getPerfectDelay(THICKNESS)
+ THICKNESS = getPerfectThickness(THICKNESS) * l_getDelayMult()
+ local delay = getPerfectDelay(THICKNESS) / l_getDelayMult() * 0.9 -- overlap a bit to avoid going through gaps
local startSide = getRandomSide()
- local loopDir = getRandomDir()
+ local loopDir = getRandomDir()
local j = 0
-
+
for i = 0, mTimes do
cWallEx(startSide + j, mExtra)
j = j + loopDir
t_wait(delay)
end
-
+
THICKNESS = oldThickness
-
+
t_wait(getPerfectDelayDM(THICKNESS) * 6.5)
end
-- pMirrorSpiral: spawns a spiral of rWallEx
function pMirrorSpiral(mTimes, mExtra)
local oldThickness = THICKNESS
- THICKNESS = getPerfectThickness(THICKNESS)
- local delay = getPerfectDelay(THICKNESS)
+ THICKNESS = getPerfectThickness(THICKNESS) * l_getDelayMult()
+ local delay = getPerfectDelay(THICKNESS) / l_getDelayMult() * 0.9 -- overlap a bit to avoid going through gaps
local startSide = getRandomSide()
- local loopDir = getRandomDir()
+ local loopDir = getRandomDir()
j = 0
-
+
for i = 0, mTimes do
rWallEx(startSide + j, mExtra)
j = j + loopDir
t_wait(delay)
end
-
+
THICKNESS = oldThickness
-
+
t_wait(getPerfectDelayDM(THICKNESS) * 6.5)
end
-- pMirrorSpiralDouble: spawns a spiral of rWallEx where you need to change direction
function pMirrorSpiralDouble(mTimes, mExtra)
local oldThickness = THICKNESS
- THICKNESS = getPerfectThickness(THICKNESS)
- local delay = getPerfectDelayDM(THICKNESS)
+ THICKNESS = getPerfectThickness(THICKNESS) * l_getDelayMult()
+ local delay = getPerfectDelayDM(THICKNESS) / l_getDelayMult() * 0.9 -- overlap a bit to avoid going through gaps
local startSide = getRandomSide()
- local loopDir = getRandomDir()
+ local loopDir = getRandomDir()
local j = 0
-
+
for i = 0, mTimes do
rWallEx(startSide + j, mExtra)
j = j + loopDir
t_wait(delay)
end
-
+
rWallEx(startSide + j, mExtra)
t_wait(delay * 0.9)
-
+
for i = 0, mTimes + 1 do
rWallEx(startSide + j, mExtra)
j = j - loopDir
t_wait(delay)
end
-
+
THICKNESS = oldThickness
t_wait(getPerfectDelayDM(THICKNESS) * 7.5)
end
@@ -84,16 +85,16 @@ end
function pBarrageSpiral(mTimes, mDelayMult, mStep)
local delay = getPerfectDelayDM(THICKNESS) * 5.6 * mDelayMult
local startSide = getRandomSide()
- local loopDir = mStep * getRandomDir()
+ local loopDir = mStep * getRandomDir()
local j = 0
-
+
for i = 0, mTimes do
cBarrage(startSide + j)
j = j + loopDir
t_wait(delay)
if(l_getSides() < 6) then t_wait(delay * 0.6) end
end
-
+
t_wait(getPerfectDelayDM(THICKNESS) * 6.1)
end
@@ -101,42 +102,42 @@ end
function pDMBarrageSpiral(mTimes, mDelayMult, mStep)
local delay = (getPerfectDelayDM(THICKNESS) * 5.42) * (mDelayMult / (u_getDifficultyMult() ^ 0.4)) * (u_getSpeedMultDM() ^ 0.35)
local startSide = getRandomSide()
- local loopDir = mStep * getRandomDir()
+ local loopDir = mStep * getRandomDir()
local j = 0
-
+
for i = 0, mTimes do
cBarrage(startSide + j)
j = j + loopDir
t_wait(delay)
if(l_getSides() < 6) then t_wait(delay * 0.49) end
end
-
+
t_wait(getPerfectDelayDM(THICKNESS) * (6.7 * (u_getDifficultyMult() ^ 0.7)))
end
-- pWallExVortex: spawns left-left right-right spiral patters
function pWallExVortex(mTimes, mStep, mExtraMult)
- local delay = getPerfectDelayDM(THICKNESS) * 5.0
+ local delay = getPerfectDelayDM(THICKNESS) * 5.0
local startSide = getRandomSide()
local loopDir = getRandomDir()
local currentSide = startSide
-
+
for j = 0, mTimes do
for i = 0, mStep do
currentSide = currentSide + loopDir
rWallEx(currentSide, loopDir * mExtraMult)
t_wait(delay)
end
-
+
loopDir = loopDir * -1
-
+
for i = 0, mStep + 1 do
currentSide = currentSide + loopDir;
rWallEx(currentSide, loopDir * mExtraMult)
t_wait(delay)
end
end
-
+
t_wait(getPerfectDelayDM(THICKNESS) * 5.5)
end
@@ -144,7 +145,7 @@ end
function pInverseBarrage(mTimes)
local delay = getPerfectDelayDM(THICKNESS) * 9.9
local startSide = getRandomSide()
-
+
for i = 0, mTimes do
cBarrage(startSide)
t_wait(delay)
@@ -152,7 +153,7 @@ function pInverseBarrage(mTimes)
cBarrage(startSide + getHalfSides())
t_wait(delay)
end
-
+
t_wait(getPerfectDelayDM(THICKNESS) * 2.5)
end
@@ -160,14 +161,14 @@ end
function pRandomBarrage(mTimes, mDelayMult)
local side = getRandomSide()
local oldSide = 0
-
- for i = 0, mTimes do
+
+ for i = 0, mTimes do
cBarrage(side)
oldSide = side
side = getRandomSide()
t_wait(getPerfectDelayDM(THICKNESS) * (2 + (getSideDistance(side, oldSide)*mDelayMult)))
end
-
+
t_wait(getPerfectDelayDM(THICKNESS) * 5.6)
end
@@ -175,12 +176,12 @@ end
function pMirrorWallStrip(mTimes, mExtra)
local delay = getPerfectDelayDM(THICKNESS) * 3.65
local startSide = getRandomSide()
-
+
for i = 0, mTimes do
rWallEx(startSide, mExtra)
t_wait(delay)
end
-
+
t_wait(getPerfectDelayDM(THICKNESS) * 5.00)
end
@@ -191,19 +192,19 @@ function pTunnel(mTimes)
local delay = getPerfectDelay(myThickness) * 5
local startSide = getRandomSide()
local loopDir = getRandomDir()
-
+
THICKNESS = myThickness
-
+
for i = 0, mTimes do
if i < mTimes then
w_wall(startSide, myThickness + 5 * u_getSpeedMultDM() * delay)
end
-
+
cBarrage(startSide + loopDir)
t_wait(delay)
-
+
loopDir = loopDir * -1
end
-
+
THICKNESS = oldThickness
-end \ No newline at end of file
+end
diff --git a/_RELEASE/Packs/hypercube/Scripts/commonpatterns.lua b/_RELEASE/Packs/hypercube/Scripts/commonpatterns.lua
index 6f8b3df7..51354ffd 100644
--- a/_RELEASE/Packs/hypercube/Scripts/commonpatterns.lua
+++ b/_RELEASE/Packs/hypercube/Scripts/commonpatterns.lua
@@ -12,11 +12,12 @@ function pAltBarrage(mTimes, mStep)
t_wait(delay)
end
+
-- pSpiral: spawns a spiral of cWallEx
function pSpiral(mTimes, mExtra)
local oldThickness = THICKNESS
THICKNESS = getPerfectThickness(THICKNESS) * l_getDelayMult()
- local delay = getPerfectDelay(THICKNESS) / l_getDelayMult()
+ local delay = getPerfectDelay(THICKNESS) / l_getDelayMult() * 0.9 -- overlap a bit to avoid going through gaps
local startSide = getRandomSide()
local loopDir = getRandomDir()
local j = 0
@@ -36,7 +37,7 @@ end
function pMirrorSpiral(mTimes, mExtra)
local oldThickness = THICKNESS
THICKNESS = getPerfectThickness(THICKNESS) * l_getDelayMult()
- local delay = getPerfectDelay(THICKNESS) / l_getDelayMult()
+ local delay = getPerfectDelay(THICKNESS) / l_getDelayMult() * 0.9 -- overlap a bit to avoid going through gaps
local startSide = getRandomSide()
local loopDir = getRandomDir()
j = 0
@@ -55,8 +56,8 @@ end
-- pMirrorSpiralDouble: spawns a spiral of rWallEx where you need to change direction
function pMirrorSpiralDouble(mTimes, mExtra)
local oldThickness = THICKNESS
- THICKNESS = getPerfectThickness(THICKNESS)
- local delay = getPerfectDelayDM(THICKNESS)
+ THICKNESS = getPerfectThickness(THICKNESS) * l_getDelayMult()
+ local delay = getPerfectDelayDM(THICKNESS) / l_getDelayMult() * 0.9 -- overlap a bit to avoid going through gaps
local startSide = getRandomSide()
local loopDir = getRandomDir()
local j = 0
diff --git a/_RELEASE/Packs/workshopexample/Scripts/commonpatterns.lua b/_RELEASE/Packs/workshopexample/Scripts/commonpatterns.lua
index 71567ae2..24fb6601 100644
--- a/_RELEASE/Packs/workshopexample/Scripts/commonpatterns.lua
+++ b/_RELEASE/Packs/workshopexample/Scripts/commonpatterns.lua
@@ -12,17 +12,18 @@ function pAltBarrage(mTimes, mStep)
t_wait(delay)
end
--- pSpiral: spawns a spiral of cWall
+
+-- pSpiral: spawns a spiral of cWallEx
function pSpiral(mTimes, mExtra)
- oldThickness = THICKNESS
+ local oldThickness = THICKNESS
THICKNESS = getPerfectThickness(THICKNESS) * l_getDelayMult()
- delay = getPerfectDelay(THICKNESS) / l_getDelayMult()
- startSide = getRandomSide()
- loopDir = getRandomDir()
- j = 0
+ local delay = getPerfectDelay(THICKNESS) / l_getDelayMult() * 0.9 -- overlap a bit to avoid going through gaps
+ local startSide = getRandomSide()
+ local loopDir = getRandomDir()
+ local j = 0
for i = 0, mTimes do
- cWall(startSide + j, mExtra)
+ cWallEx(startSide + j, mExtra)
j = j + loopDir
t_wait(delay)
end
@@ -34,11 +35,11 @@ end
-- pMirrorSpiral: spawns a spiral of rWallEx
function pMirrorSpiral(mTimes, mExtra)
- oldThickness = THICKNESS
- THICKNESS = getPerfectThickness(THICKNESS)
- delay = getPerfectDelay(THICKNESS)
- startSide = getRandomSide()
- loopDir = getRandomDir()
+ local oldThickness = THICKNESS
+ THICKNESS = getPerfectThickness(THICKNESS) * l_getDelayMult()
+ local delay = getPerfectDelay(THICKNESS) / l_getDelayMult() * 0.9 -- overlap a bit to avoid going through gaps
+ local startSide = getRandomSide()
+ local loopDir = getRandomDir()
j = 0
for i = 0, mTimes do
@@ -54,12 +55,12 @@ end
-- pMirrorSpiralDouble: spawns a spiral of rWallEx where you need to change direction
function pMirrorSpiralDouble(mTimes, mExtra)
- oldThickness = THICKNESS
- THICKNESS = getPerfectThickness(THICKNESS)
- delay = getPerfectDelayDM(THICKNESS)
- startSide = getRandomSide()
- loopDir = getRandomDir()
- j = 0
+ local oldThickness = THICKNESS
+ THICKNESS = getPerfectThickness(THICKNESS) * l_getDelayMult()
+ local delay = getPerfectDelayDM(THICKNESS) / l_getDelayMult() * 0.9 -- overlap a bit to avoid going through gaps
+ local startSide = getRandomSide()
+ local loopDir = getRandomDir()
+ local j = 0
for i = 0, mTimes do
rWallEx(startSide + j, mExtra)
diff --git a/_RELEASE/Temp/example/Scripts/commonpatterns.lua b/_RELEASE/Temp/example/Scripts/commonpatterns.lua
index 71567ae2..24fb6601 100644
--- a/_RELEASE/Temp/example/Scripts/commonpatterns.lua
+++ b/_RELEASE/Temp/example/Scripts/commonpatterns.lua
@@ -12,17 +12,18 @@ function pAltBarrage(mTimes, mStep)
t_wait(delay)
end
--- pSpiral: spawns a spiral of cWall
+
+-- pSpiral: spawns a spiral of cWallEx
function pSpiral(mTimes, mExtra)
- oldThickness = THICKNESS
+ local oldThickness = THICKNESS
THICKNESS = getPerfectThickness(THICKNESS) * l_getDelayMult()
- delay = getPerfectDelay(THICKNESS) / l_getDelayMult()
- startSide = getRandomSide()
- loopDir = getRandomDir()
- j = 0
+ local delay = getPerfectDelay(THICKNESS) / l_getDelayMult() * 0.9 -- overlap a bit to avoid going through gaps
+ local startSide = getRandomSide()
+ local loopDir = getRandomDir()
+ local j = 0
for i = 0, mTimes do
- cWall(startSide + j, mExtra)
+ cWallEx(startSide + j, mExtra)
j = j + loopDir
t_wait(delay)
end
@@ -34,11 +35,11 @@ end
-- pMirrorSpiral: spawns a spiral of rWallEx
function pMirrorSpiral(mTimes, mExtra)
- oldThickness = THICKNESS
- THICKNESS = getPerfectThickness(THICKNESS)
- delay = getPerfectDelay(THICKNESS)
- startSide = getRandomSide()
- loopDir = getRandomDir()
+ local oldThickness = THICKNESS
+ THICKNESS = getPerfectThickness(THICKNESS) * l_getDelayMult()
+ local delay = getPerfectDelay(THICKNESS) / l_getDelayMult() * 0.9 -- overlap a bit to avoid going through gaps
+ local startSide = getRandomSide()
+ local loopDir = getRandomDir()
j = 0
for i = 0, mTimes do
@@ -54,12 +55,12 @@ end
-- pMirrorSpiralDouble: spawns a spiral of rWallEx where you need to change direction
function pMirrorSpiralDouble(mTimes, mExtra)
- oldThickness = THICKNESS
- THICKNESS = getPerfectThickness(THICKNESS)
- delay = getPerfectDelayDM(THICKNESS)
- startSide = getRandomSide()
- loopDir = getRandomDir()
- j = 0
+ local oldThickness = THICKNESS
+ THICKNESS = getPerfectThickness(THICKNESS) * l_getDelayMult()
+ local delay = getPerfectDelayDM(THICKNESS) / l_getDelayMult() * 0.9 -- overlap a bit to avoid going through gaps
+ local startSide = getRandomSide()
+ local loopDir = getRandomDir()
+ local j = 0
for i = 0, mTimes do
rWallEx(startSide + j, mExtra)
diff --git a/src/SSVOpenHexagon/Components/CPlayer.cpp b/src/SSVOpenHexagon/Components/CPlayer.cpp
index 005285fc..ccc1bfa8 100644
--- a/src/SSVOpenHexagon/Components/CPlayer.cpp
+++ b/src/SSVOpenHexagon/Components/CPlayer.cpp
@@ -186,7 +186,7 @@ template <typename Wall>
continue;
}
- switch(getLineCircleIntersection(
+ switch(Utils::getLineCircleIntersection(
vec1, vec2, wVertexes[i], wVertexes[j], mRadiusSquared))
{
case 1u:
@@ -202,6 +202,7 @@ template <typename Wall>
{
vec1 = vec2;
}
+
assignResult();
break;
}