1
1
function Create (self )
2
2
self .range = math.sqrt (FrameMan .PlayerScreenWidth ^ 2 + FrameMan .PlayerScreenHeight ^ 2 )/ 2 ;
3
- self .penetrationStrength = 125 ;
3
+ self .penetrationStrength = 170 ;
4
+ self .strengthVariation = 5 ;
4
5
-- This value tracks the shots and varies the penetration strength to create a "resistance" effect on tougher materials
5
6
self .shotCounter = 0 ; -- TODO: Rename/describe this variable better
6
7
self .activity = ActivityMan :GetActivity ();
@@ -42,12 +43,12 @@ function Update(self)
42
43
skipPx = 1 ;
43
44
local shortRay = SceneMan :CastObstacleRay (gapPos , Vector (trace .X , trace .Y ):SetMagnitude (range - rayLength + skipPx ), hitPos , gapPos , actor .ID , self .Team , rte .airID , skipPx );
44
45
gapPos = gapPos - Vector (trace .X , trace .Y ):SetMagnitude (skipPx );
45
- local strengthFactor = 1 + ( self . shotCounter + math.min ( rayLength / self .range , 1 )) * RangeRand ( 0.7 , 1.0 ) ;
46
+ local strengthFactor = math.max ( 1 - rayLength / self .range , math.random ( )) * ( self . shotCounter + 1 ) / self . strengthVariation ;
46
47
47
48
local moID = SceneMan :GetMOIDPixel (hitPos .X , hitPos .Y );
48
49
if moID ~= rte .NoMOID and moID ~= self .ID then
49
50
local mo = ToMOSRotating (MovableMan :GetMOFromID (moID ));
50
- if self .penetrationStrength / strengthFactor >= mo . Material . StructuralIntegrity or math.random ( self . penetrationStrength ) > mo .Material .StructuralIntegrity then
51
+ if self .penetrationStrength * strengthFactor >= mo .Material .StructuralIntegrity then
51
52
local moAngle = - mo .RotAngle * mo .FlipFactor ;
52
53
53
54
local woundName = mo :GetEntryWoundPresetName ();
@@ -66,10 +67,10 @@ function Update(self)
66
67
local smoke = CreateMOSParticle (" Tiny Smoke Ball 1" .. (math.random () < 0.5 and " Glow Blue" or " " ), " Base.rte" );
67
68
smoke .Pos = gapPos ;
68
69
smoke .Vel = Vector (- trace .X , - trace .Y ):SetMagnitude (math.random (3 , 6 )):RadRotate (RangeRand (- 1.5 , 1.5 ));
69
- smoke .Lifetime = smoke .Lifetime / strengthFactor ;
70
+ smoke .Lifetime = smoke .Lifetime * strengthFactor ;
70
71
MovableMan :AddParticle (smoke );
71
72
72
- local pix = CreateMOPixel (" Laser Rifle Glow End " .. math.floor (strengthFactor ), " Techion.rte" );
73
+ local pix = CreateMOPixel (" Laser Rifle Glow " .. math.floor (strengthFactor * 4 + 0.5 ), " Techion.rte" );
73
74
pix .Pos = gapPos ;
74
75
pix .Sharpness = self .penetrationStrength / 6 ;
75
76
pix .Vel = Vector (trace .X , trace .Y ):SetMagnitude (6 );
@@ -86,13 +87,13 @@ function Update(self)
86
87
end
87
88
local particleCount = trace .Magnitude * RangeRand (0.4 , 0.8 );
88
89
for i = 0 , particleCount do
89
- local pix = CreateMOPixel (" Laser Rifle Glow" , " Techion.rte" );
90
+ local pix = CreateMOPixel (" Laser Rifle Glow 0 " , " Techion.rte" );
90
91
pix .Pos = startPos + trace * i / particleCount ;
91
92
pix .Vel = self .Vel ;
92
93
MovableMan :AddParticle (pix );
93
94
end
94
95
end
95
- self .shotCounter = (self .shotCounter + 1 ) % 3 ;
96
+ self .shotCounter = (self .shotCounter + 1 ) % self . strengthVariation ;
96
97
self .cooldown :Reset ();
97
98
end
98
99
if self .Magazine and self .Magazine .RoundCount > 0 then
0 commit comments