Skip to content

Commit c1b1a72

Browse files
authored
Merge pull request #266 from jacenhan/development
Weapon & Activity Script Fixes
2 parents d0afdd6 + 41c3d28 commit c1b1a72

5 files changed

Lines changed: 20 additions & 20 deletions

File tree

Data/Base.rte/Activities/BunkerBreach.lua

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -142,16 +142,16 @@ function BunkerBreach:SetupDefenderActors()
142142
local crabToHumanSpawnRatio = self:GetCrabToHumanSpawnRatio(techID);
143143

144144
local loadoutNames = {"Light", "Heavy", "Sniper", "Engineer", "Mecha", "Turret"};
145-
145+
146146
local hasSpawnAreas = false;
147147
for _, loadoutName in pairs(loadoutNames) do
148148
if SceneMan.Scene:HasArea(loadoutName .. " Defenders") then
149149
hasSpawnAreas = true;
150150
end
151151
end
152-
152+
153153
for actor in MovableMan.AddedActors do
154-
if not actor:IsInGroup("Brains") and not actor:IsInGroup("Bunker Systems") then
154+
if not actor:IsInGroup("Brains") and not actor:IsInGroup("Bunker Systems") and not IsADoor(actor) then
155155
if hasSpawnAreas then
156156
actor.ToDelete = true;
157157
elseif actor.Team ~= self.defenderTeam then
@@ -162,7 +162,7 @@ function BunkerBreach:SetupDefenderActors()
162162
actor.Team = self.defenderTeam;
163163
end
164164
end
165-
165+
166166
if hasSpawnAreas then
167167
for _, loadoutName in pairs({"Light", "Heavy", "Sniper", "Engineer", "Mecha", "Turret"}) do
168168
if SceneMan.Scene:HasArea(loadoutName .. " Defenders") then
@@ -261,7 +261,7 @@ function BunkerBreach:StartActivity(isNewGame)
261261
FrameMan:ClearScreenText(self:ScreenOfPlayer(player));
262262
end
263263
end
264-
264+
265265
MusicMan:PlayDynamicSong("Generic Battle Music");
266266

267267
if isNewGame then
@@ -675,7 +675,7 @@ function BunkerBreach:CreateInternalReinforcements(loadout, numberOfReinforcemen
675675
numberOfInternalReinforcementsToCreateAtPosition = 3;
676676
end
677677
end
678-
678+
679679
for i = 1, numberOfInternalReinforcementsToCreateAtPosition do
680680
local internalReinforcement;
681681
if loadout then

Data/Base.rte/Craft/Shared/AttachableTurret.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ function Update(self)
5656
PrimitiveMan:DrawCirclePrimitive(self.Team, aimPos, (self.searchRange * 0.5), 13);
5757
end
5858
local aimTarget = MovableMan:GetClosestEnemyActor(self.Team, aimPos, (self.searchRange * 0.5), Vector());
59-
if aimTarget and aimTarget.Status < Actor.INACTIVE then
59+
if aimTarget and aimTarget.Status < Actor.INACTIVE and aimTarget.GetsHitByMOs then
6060
--Debug: visualize search trace
6161
if self.showAim then
6262
PrimitiveMan:DrawLinePrimitive(self.Team, aimPos, aimTarget.Pos, 13);
@@ -89,7 +89,7 @@ function Update(self)
8989
end
9090

9191
local color = 13; --Debug trace color: red
92-
if target and IsActor(target) and ToActor(target).Status < Actor.INACTIVE then
92+
if target and IsActor(target) and ToActor(target).Status < Actor.INACTIVE and target.GetsHitByMOs then
9393
self:EnableEmission(true);
9494
self:TriggerBurst();
9595
self.fireTimer:Reset();
@@ -106,7 +106,7 @@ function Update(self)
106106
end
107107
end
108108
end
109-
109+
110110
if self.fireTimer:IsPastSimTimeLimit() then
111111
self:EnableEmission(false);
112112
end

Data/Browncoats.rte/Devices/Weapons/Flash/Flash.lua

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
11
function Create(self)
22
self.fireVel = 17;
33
self.spread = math.rad(self.ShakeRange);
4-
4+
55
self.searchRange = 100 + FrameMan.PlayerScreenWidth * 0.3;
66
self.searchTimer = Timer();
77
self.searchTimer:SetSimTimeLimitMS(250);
88
self.lockThreshold = 2;
9-
9+
1010
self.targets = {};
11-
11+
1212
self.targetLockSound = CreateSoundContainer("Mine Activate", "Base.rte");
1313
end
1414

@@ -45,16 +45,16 @@ function ThreadedUpdate(self)
4545
end
4646
if self.Magazine.RoundCount > 0 then
4747
if controller:IsState(Controller.AIM_SHARP) then
48-
48+
4949
if self.searchTimer:IsPastSimTimeLimit() then
5050
self.searchTimer:Reset();
51-
51+
5252
local searchPos = parent.ViewPoint;
5353
local lastTargetCount = #self.targets;
5454
self.targets = {};
5555

5656
for actor in MovableMan.Actors do
57-
if #self.targets < self.RoundInMagCapacity and actor.Team ~= self.Team then
57+
if #self.targets < self.RoundInMagCapacity and actor.Team ~= self.Team and actor.GetsHitByMOs then
5858

5959
if (SceneMan:ShortestDistance(searchPos, actor.Pos, SceneMan.SceneWrapsX).Magnitude - actor.Radius) < self.searchRange
6060
and (actor.Vel.Magnitude + math.abs(actor.AngularVel) + 1)/math.sqrt(actor.Radius) < self.lockThreshold
@@ -99,7 +99,7 @@ function ThreadedUpdate(self)
9999
if target.actor and target.actor.ID ~= rte.NoMOID then
100100
local screen = ActivityMan:GetActivity():ScreenOfPlayer(ToActor(parent):GetController().Player);
101101
PrimitiveMan:DrawBoxPrimitive(screen, target.actor.Pos + target.topLeft, target.actor.Pos + target.bottomRight, 149);
102-
102+
103103
if self.RoundInMagCount == 0 then
104104
target.topLeft = target.topLeft * 0.9;
105105
target.bottomRight = target.bottomRight * 0.9;

Data/Coalition.rte/Devices/Weapons/MissileLauncher/MissileLauncher.lua

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ function ThreadedUpdate(self)
4343
local moCheck = SceneMan:GetMOIDPixel(hitPos.X, hitPos.Y);
4444
if moCheck ~= rte.NoMOID then
4545
local mo = ToMOSRotating(MovableMan:GetMOFromID(MovableMan:GetMOFromID(moCheck).RootID));
46-
if mo and mo.ClassName ~= "ADoor" and mo.Team ~= parent.Team then
46+
if mo and mo.ClassName ~= "ADoor" and mo.Team ~= parent.Team and mo.GetsHitByMOs then
4747
local movement = (mo.Vel.Magnitude + math.abs(mo.AngularVel) + 0.1) * math.sqrt(mo.Radius);
4848
if movement > self.lockThreshold then
4949

Data/Techion.rte/Devices/Weapons/NucleoSwarm/NucleoSwarmShot.lua

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ function Create(self)
2121
local moCheck = SceneMan:GetMOIDPixel(checkPos.X, checkPos.Y);
2222
if moCheck ~= rte.NoMOID then
2323
local actor = MovableMan:GetMOFromID(MovableMan:GetMOFromID(moCheck).RootID);
24-
if actor and actor.Team ~= self.Team then
24+
if actor and actor.Team ~= self.Team and actor.GetsHitByMOs then
2525
self.target = actor;
2626
break;
2727
end
@@ -66,7 +66,7 @@ function Update(self)
6666
self.seekerTimer:Reset();
6767
self.seekerDelay = 1000 - math.random(1000);
6868
for actor in MovableMan.Actors do
69-
if actor.Team ~= self.Team then
69+
if actor.Team ~= self.Team and actor.GetsHitByMOs then
7070
self.potentialtargetdist = SceneMan:ShortestDistance(self.Pos, actor.Pos, SceneMan.SceneWrapsX);
7171
if (self.lastdist == nil or (self.lastdist ~= nil and self.potentialtargetdist:MagnitudeIsLessThan(self.lastdist))) and not self.potentialtargetdist:MagnitudeIsGreaterThan(500) and SceneMan:CastStrengthRay(self.Pos, self.potentialtargetdist:SetMagnitude(self.potentialtargetdist.Magnitude - actor.Radius), 0, Vector(), 5, rte.airID, SceneMan.SceneWrapsX) == false then
7272
self.lastdist = self.potentialtargetdist.Magnitude;
@@ -81,7 +81,7 @@ function Update(self)
8181
if self.lifeTimer:IsPastSimMS(8000) then
8282
self:GibThis();
8383
end
84-
84+
8585
--TODO: Add wounds through Lua like the other disintegrator weapons
8686
if SceneMan:GetTerrMatter(self.Pos.X, self.Pos.Y) == rte.airID then
8787
local moCheck = SceneMan:GetMOIDPixel(self.Pos.X, self.Pos.Y);

0 commit comments

Comments
 (0)