@@ -8,6 +8,7 @@ function Create(self)
8
8
self .isShort = true ;
9
9
self .deleteDelay = self .Lifetime * RangeRand (0.1 , 0.2 );
10
10
end
11
+ self .shortFlame = CreatePEmitter (" Flame Hurt Short Float" , " Base.rte" );
11
12
end
12
13
function Update (self )
13
14
self .ToSettle = false ;
@@ -29,23 +30,26 @@ function Update(self)
29
30
if self .checkTimer :IsPastSimMS (self .checkDelay ) then
30
31
self .checkTimer :Reset ();
31
32
self .checkDelay = math.floor (self .checkDelay * 1.05 + 3 ); -- Gradually extend the delay for optimization reasons
32
- local checkPos = Vector (self .Pos .X , self .Pos .Y - 1 ) + self .Vel * rte .PxTravelledPerFrame * math.random ();
33
- local moCheck = SceneMan :GetMOIDPixel (checkPos .X , checkPos .Y );
34
- if moCheck ~= rte .NoMOID then
35
- local mo = MovableMan :GetMOFromID (moCheck );
36
- if mo and (self .Team == Activity .NOTEAM or mo .Team ~= self .Team ) then
37
- self .target = ToMOSRotating (mo );
33
+ if self .Vel .Magnitude > 1 then
34
+ local checkPos = Vector (self .Pos .X , self .Pos .Y - 1 ) + self .Vel * rte .PxTravelledPerFrame * math.random ();
35
+ local moCheck = SceneMan :GetMOIDPixel (checkPos .X , checkPos .Y );
36
+ if moCheck ~= rte .NoMOID then
37
+ local mo = MovableMan :GetMOFromID (moCheck );
38
+ if mo and (self .Team == Activity .NOTEAM or mo .Team ~= self .Team ) then
39
+ self .target = ToMOSRotating (mo );
38
40
39
- self .isShort = true ;
40
- self .deleteDelay = math.random (self .Lifetime );
41
- self .GlobalAccScalar = 0.9 ;
42
-
43
- self .targetStickAngle = mo .RotAngle ;
44
- self .stickPos = SceneMan :ShortestDistance (mo .Pos , self .Pos , SceneMan .SceneWrapsX ) * 0.8 ;
41
+ self .isShort = true ;
42
+ self .deleteDelay = math.random (self .Lifetime );
43
+ self .GlobalAccScalar = 0.9 ;
44
+
45
+ self .targetStickAngle = mo .RotAngle ;
46
+ self .stickPos = SceneMan :ShortestDistance (mo .Pos , self .Pos , SceneMan .SceneWrapsX ) * 0.8 ;
47
+ end
45
48
end
46
- elseif not self .isShort and math.random () < 0.1 then
49
+ end
50
+ if not self .isShort and math.random () < 0.1 then
47
51
-- Spawn another, shorter flame particle occasionally
48
- local particle = CreatePEmitter ( " Flame Hurt Short Float " );
52
+ local particle = self . shortFlame : Clone ( );
49
53
particle .Lifetime = particle .Lifetime * RangeRand (0.6 , 0.9 );
50
54
particle .Vel = self .Vel + Vector (0 , - 3 ) + Vector (math.random (), 0 ):RadRotate (math.random () * math.pi * 2 );
51
55
particle .Pos = Vector (self .Pos .X , self .Pos .Y - 1 );
0 commit comments