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

Commit 104f09f

Browse files
committed
Techion Pulse Shot tweaks
1 parent 998e6ed commit 104f09f

File tree

2 files changed

+9
-4
lines changed

2 files changed

+9
-4
lines changed

Techion.rte/Devices/Shared/Scripts/PulseShot.lua

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
function Create(self)
22
self.disintegrationStrength = 50;
33
self.EffectRotAngle = self.Vel.AbsRadAngle;
4-
self.lastVel = Vector(self.Vel.X, self.Vel.Y);
54
--Check backward (second argument) on the first frame as the projectile might be bouncing off something immediately
65
PulsarDissipate(self, true);
76

@@ -21,6 +20,8 @@ function Update(self)
2120
self.trailPar.Pos = self.Pos - Vector(self.Vel.X, self.Vel.Y):SetMagnitude(6);
2221
self.trailPar.Vel = self.Vel * 0.5;
2322
self.trailPar.Lifetime = self.Age + TimerMan.DeltaTimeMS;
23+
else
24+
self.trailPar = nil;
2425
end
2526
end
2627
self.EffectRotAngle = self.Vel.AbsRadAngle;
@@ -44,7 +45,7 @@ function PulsarDissipate(self, inverted)
4445
melt.Pos = self.Pos;
4546
melt.Team = self.Team;
4647
melt.Sharpness = mo.RootID;
47-
melt.PinStrength = self.disintegrationStrength;
48+
melt.PinStrength = self.disintegrationStrength or 1;
4849
MovableMan:AddMO(melt);
4950
end
5051
else
@@ -53,7 +54,7 @@ function PulsarDissipate(self, inverted)
5354
hit = true;
5455
end
5556
end
56-
if hit or math.abs(self.Vel.AbsRadAngle - self.lastVel.AbsRadAngle) > 0.1 or self.Vel.Magnitude < self.lastVel.Magnitude * 0.5 then
57+
if hit or math.abs(math.sin(self.Vel.AbsRadAngle - self.lastVel.AbsRadAngle)) > 0.1 or self.Vel.Magnitude < self.lastVel.Magnitude * 0.5 then
5758
local offset = Vector(self.Vel.X, self.Vel.Y):SetMagnitude(skipPx);
5859
self.explosion = CreateAEmitter("Techion.rte/Laser Dissipate Effect");
5960
self.explosion.Pos = hitPos - offset;

Techion.rte/Devices/Weapons/MicroPulsar/HomingPulsarShot.lua

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
function Create(self)
22

33
self.disintegrationStrength = 50;
4-
self.adjustmentAmount = 2;
4+
self.adjustmentAmount = 1;
55

66
self.delayTimer = Timer();
77

@@ -39,6 +39,7 @@ function Create(self)
3939
end
4040
end
4141
end
42+
self.lastVel = Vector(self.Vel.X, self.Vel.Y);
4243
PulsarDissipate(self, true);
4344

4445
self.trailPar = CreateMOPixel("Techion Pulse Shot Trail Glow Small");
@@ -48,6 +49,7 @@ function Create(self)
4849
MovableMan:AddParticle(self.trailPar);
4950
end
5051
function Update(self)
52+
self.lastVel = Vector(self.Vel.X, self.Vel.Y);
5153
if self.delayTimer:IsPastSimMS(25) and self.target ~= null and self.target.ID ~= rte.NoMOID then
5254
local checkVel = SceneMan:ShortestDistance(self.Pos, self.target.Pos, SceneMan.SceneWrapsX);
5355
checkVel = checkVel:SetMagnitude(checkVel.Magnitude - self.target.Radius);
@@ -65,6 +67,8 @@ function Update(self)
6567
self.trailPar.Pos = self.Pos - Vector(self.Vel.X, self.Vel.Y):SetMagnitude(3);
6668
self.trailPar.Vel = self.Vel * 0.5;
6769
self.trailPar.Lifetime = self.Age + TimerMan.DeltaTimeMS;
70+
else
71+
self.trailPar = nil;
6872
end
6973
end
7074
self.EffectRotAngle = self.Vel.AbsRadAngle;

0 commit comments

Comments
 (0)