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

Commit b5518d5

Browse files
committed
Miscellaneous script changes as requested by Gacyr
1 parent 10328b7 commit b5518d5

File tree

5 files changed

+18
-15
lines changed

5 files changed

+18
-15
lines changed

Base.rte/Devices/Shared/Scripts/BurstFire.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ function Update(self)
66
if self.Magazine then
77
if self.coolDownTimer then
88
local parent = self:GetRootParent();
9-
if self.coolDownTimer:IsPastSimMS(self.coolDownDelay) and (parent and IsActor(parent)) and (not self:IsActivated() or not ToActor(parent):IsPlayerControlled()) then
9+
if self.coolDownTimer:IsPastSimMS(self.coolDownDelay) and parent and IsActor(parent) and not (self:IsActivated() and ToActor(parent):IsPlayerControlled()) then
1010
self.coolDownTimer, self.shotCounter = nil;
1111
else
1212
self:Deactivate();

Base.rte/Devices/Tools/GrappleGun/Grapple.lua

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -73,14 +73,13 @@ function Update(self)
7373
self.lineVec = SceneMan:ShortestDistance(self.parent.Pos, self.Pos, self.mapWrapsX);
7474
self.lineLength = self.lineVec.Magnitude;
7575

76-
if self.parentGun and self.parentGun.ID ~= 255 then
76+
if self.parentGun and self.parentGun.ID ~= rte.NoMOID then
7777
self.parent = ToMOSRotating(MovableMan:GetMOFromID(self.parentGun.RootID));
7878

7979
if self.parentGun.Magazine then
8080
self.parentGun.Magazine.Scale = 0;
8181
end
8282
startPos = self.parentGun.Pos;
83-
-- Rotate the gun towards the hook
8483
local flipAng = self.parent.HFlipped and 3.14 or 0;
8584
self.parentGun.RotAngle = self.lineVec.AbsRadAngle + flipAng;
8685
if self.parentGun.Sharpness ~= 0 then
@@ -103,7 +102,7 @@ function Update(self)
103102
-- We now have a user that controls this grapple
104103
controller = self.parent:GetController();
105104
-- Point the gun towards the hook if our user is holding it
106-
if (self.parentGun and self.parentGun.ID ~= 255) and (self.parentGun:GetRootParent().ID == self.parent.ID) then
105+
if (self.parentGun and self.parentGun.ID ~= rte.NoMOID) and (self.parentGun:GetRootParent().ID == self.parent.ID) then
107106
local offset = Vector(ToMOSprite(self.parentGun:GetParent()):GetSpriteWidth(), 0):RadRotate(self.parent.FlipFactor * (self.lineVec.AbsRadAngle - self.parent:GetAimAngle(true)))
108107
self.parentGun.StanceOffset = offset;
109108
if self.parent.EquippedItem and self.parent.EquippedItem.ID == self.parentGun.ID and (self.parent.Vel.Magnitude < 5 and controller:IsState(Controller.AIM_SHARP)) then

Base.rte/Devices/Tools/GrappleGun/GrappleGun.lua

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,7 @@ function Update(self)
2727
local mouse = controller:IsMouseControlled();
2828
-- Deactivate when equipped in BG arm to allow FG arm shooting
2929
if parent.EquippedBGItem and parent.EquippedItem then
30-
local itemBG = parent.EquippedBGItem;
31-
if itemBG.ID == self.ID then
30+
if parent.EquippedBGItem.ID == self.ID then
3231
self:Deactivate();
3332
end
3433
end

Base.rte/Effects/Pyro/Flame/Flame.lua

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
function Create(self)
2-
self.strength = 80; -- Damage frequency factor
2+
self.strength = 80;
33
self.checkTimer = Timer();
44
self.checkDelay = math.random(20);
55
end
@@ -8,8 +8,8 @@ function Update(self)
88
self.ToSettle = false;
99
if self.target and IsMOSRotating(self.target) then
1010
self.Vel = self.target.Vel;
11-
self.Pos = self.target.Pos - Vector(self.stickPos.X, self.stickPos.Y):RadRotate(self.target.RotAngle - self.tsAngle);
12-
local actor = MovableMan:GetMOFromID(self.target.RootID); -- Inflict damage on the root actor
11+
self.Pos = self.target.Pos - Vector(self.stickPos.X, self.stickPos.Y):RadRotate(self.target.RotAngle - self.targetStickAngle);
12+
local actor = MovableMan:GetMOFromID(self.target.RootID);
1313
if MovableMan:IsActor(actor) then
1414
actor = ToActor(actor);
1515
if math.random() < (self.strength * self.target.DamageMultiplier) / actor.Mass / (self.target.Material.StructuralIntegrity) then
@@ -22,19 +22,19 @@ function Update(self)
2222
self.checkTimer:Reset();
2323
self.checkDelay = self.checkDelay + 1; -- Gradually extend the delay for optimization reasons
2424
local checkPos = self.Pos + Vector(self.Vel.X, self.Vel.Y):SetMagnitude(math.sqrt(self.Vel.Magnitude));
25-
local mocheck = SceneMan:GetMOIDPixel(checkPos.X, checkPos.Y);
26-
if mocheck ~= 255 then
27-
local mo = MovableMan:GetMOFromID(mocheck);
25+
local moCheck = SceneMan:GetMOIDPixel(checkPos.X, checkPos.Y);
26+
if moCheck ~= rte.NoMOID then
27+
local mo = MovableMan:GetMOFromID(moCheck);
2828
if mo then
2929
self.target = ToMOSRotating(mo);
30-
self.tsAngle = mo.RotAngle; -- Target angle when sticking
30+
self.targetStickAngle = mo.RotAngle;
3131
self.stickPos = SceneMan:ShortestDistance(mo.Pos, self.Pos, SceneMan.SceneWrapsX) * 0.8;
3232
self.Pos = mo.Pos - Vector(self.stickPos.X, self.stickPos.Y);
3333
end
3434
end
3535
end
3636
end
37-
local age = self.Age * 0.0001 + 1;
37+
local age = self.Age * 0.0001 + 1; -- Have age slightly affect particle settings relative to 10 seconds
3838
local chance = math.random();
3939
local particle;
4040
if chance < (0.1 / age) then

Base.rte/Scenes/Objects/Bunkers/BunkerSystems/LadderNode.lua

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,4 +23,9 @@ function Update(self)
2323
actor.Vel = actor.Vel + Vector(speed / 2, 0):RadRotate(actor:GetAimAngle(true)) - Vector(0, speed);
2424
elseif controller:IsState(Controller.BODY_CROUCH) then
2525
actor.Vel = actor.Vel / 2;
26-
end end end end end end
26+
end
27+
end
28+
end
29+
end
30+
end
31+
end

0 commit comments

Comments
 (0)