1
1
function Create (self )
2
2
self .effectRadius = 125 ;
3
+ self .materialThreshold = 25 ;
3
4
self .strength = self .PinStrength ; -- Affects the duration of the effect
4
5
self .flashScreen = false ; -- Do not turn on if you are prone to seizures
5
6
@@ -9,9 +10,9 @@ function Create(self)
9
10
for actor in MovableMan .Actors do
10
11
local dist = SceneMan :ShortestDistance (self .Pos , actor .Pos , SceneMan .SceneWrapsX );
11
12
if dist :MagnitudeIsLessThan (self .effectRadius ) then
12
- local skipPx = 1 + ( dist .Magnitude * 0.01 );
13
+ local skipPx = 1 + math.floor ( math.sqrt ( dist .Magnitude ) );
13
14
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
15
16
-- The effect is diminished by target actor mass, material strength and distance
16
17
local resistance = math.sqrt (math.abs (actor .Mass ) + actor .Material .StructuralIntegrity + dist .Magnitude + 1 ) + actorCount ;
17
18
actor :SetNumberValue (" RoninScrambler" , math.floor (actor :GetNumberValue (" RoninScrambler" ) + self .strength / resistance ));
@@ -53,6 +54,14 @@ function Update(self)
53
54
if numberValue > 0 then
54
55
actor .Status = Actor .UNSTABLE ;
55
56
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 ));
56
65
if math.random (50 ) < numberValue then
57
66
for i = 0 , 29 do -- Go through and disable the gameplay-related controller states
58
67
ctrl :SetState (i , false );
0 commit comments