Skip to content
This repository was archived by the owner on Jan 5, 2024. It is now read-only.

Commit f29eb30

Browse files
committed
Scrambler tweaks;
- You can now hopelessly squirm while scrambled
1 parent 1c6529d commit f29eb30

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

Data/Ronin.rte/Devices/Special/Scrambler/Scramble.lua

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
function Create(self)
22
self.effectRadius = 125;
3+
self.materialThreshold = 25;
34
self.strength = self.PinStrength; --Affects the duration of the effect
45
self.flashScreen = false; --Do not turn on if you are prone to seizures
56

@@ -9,9 +10,9 @@ function Create(self)
910
for actor in MovableMan.Actors do
1011
local dist = SceneMan:ShortestDistance(self.Pos, actor.Pos, SceneMan.SceneWrapsX);
1112
if dist:MagnitudeIsLessThan(self.effectRadius) then
12-
local skipPx = 1 + (dist.Magnitude * 0.01);
13+
local skipPx = 1 + math.floor(math.sqrt(dist.Magnitude));
1314
local strCheck = SceneMan:CastStrengthSumRay(self.Pos, self.Pos + dist, skipPx, rte.airID);
14-
if strCheck < (100/skipPx) then
15+
if strCheck < self.materialThreshold/skipPx then
1516
--The effect is diminished by target actor mass, material strength and distance
1617
local resistance = math.sqrt(math.abs(actor.Mass) + actor.Material.StructuralIntegrity + dist.Magnitude + 1) + actorCount;
1718
actor:SetNumberValue("RoninScrambler", math.floor(actor:GetNumberValue("RoninScrambler") + self.strength/resistance));
@@ -53,6 +54,14 @@ function Update(self)
5354
if numberValue > 0 then
5455
actor.Status = Actor.UNSTABLE;
5556
local ctrl = actor:GetController();
57+
local dir = 0;
58+
if ctrl:IsState(Controller.MOVE_LEFT) then
59+
dir = dir - 1;
60+
end
61+
if ctrl:IsState(Controller.MOVE_RIGHT) then
62+
dir = dir + 1;
63+
end
64+
actor.AngularVel = actor.AngularVel - dir/(1 + math.abs(actor.AngularVel));
5665
if math.random(50) < numberValue then
5766
for i = 0, 29 do --Go through and disable the gameplay-related controller states
5867
ctrl:SetState(i, false);

0 commit comments

Comments
 (0)