Skip to content

Commit dc4d4bf

Browse files
committed
re-enable turrets, tiny tweaks
1 parent 9d948b9 commit dc4d4bf

File tree

8 files changed

+47
-31
lines changed

8 files changed

+47
-31
lines changed

Data/Browncoats.rte/Actors.ini

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,5 +17,5 @@ IncludeFile = Browncoats.rte/Actors/Infantry/BrowncoatBoss/BrowncoatBoss.ini
1717
///////////////////////////////////////////////////////////////////////
1818
// Turrets
1919

20-
//IncludeFile = Browncoats.rte/Actors/Turrets/Hearthkeeper/Hearthkeeper.ini
21-
//IncludeFile = Browncoats.rte/Actors/Turrets/Thunderer/Thunderer.ini
20+
IncludeFile = Browncoats.rte/Actors/Turrets/Hearthkeeper/Hearthkeeper.ini
21+
IncludeFile = Browncoats.rte/Actors/Turrets/Thunderer/Thunderer.ini

Data/Browncoats.rte/Actors/Turrets/Thunderer/Thunderer.ini

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -493,6 +493,7 @@ AddActor = ACrab
493493
Health = 100
494494
Mechanical = 1
495495
ImpulseDamageThreshold = 10000
496+
AimRange = 0.80
496497
AimDistance = 30
497498
Perceptiveness = 0.75
498499
CharHeight = 40

Data/Browncoats.rte/Actors/Turrets/Thunderer/ThundererBase.lua

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
11
function Create(self)
2-
if self:GetNumberValue("KeepUnflipped") == -1 then
3-
self.keepFlipped = true;
4-
else
5-
self.keepFlipped = false;
6-
end
7-
82
-- saving and loading can mess this up, so handle it:
93

104
self.pinPos = Vector(self.Pos.X, self.Pos.Y);
@@ -18,6 +12,18 @@ function Create(self)
1812
end
1913

2014
self.AIMode = Actor.AIMODE_SENTRY;
15+
16+
if self:GetNumberValue("KeepUnflipped") == -1 then
17+
self.keepFlipped = true;
18+
else
19+
self.keepFlipped = false;
20+
end
21+
22+
if self.Turret then
23+
if self.Turret.MountedDevice then
24+
self.Turret.MountedDevice:SendMessage("SetKeepUnflipped", self:GetNumberValue("KeepUnflipped"));
25+
end
26+
end
2127
end
2228

2329
function Update(self)

Data/Browncoats.rte/Actors/Turrets/Thunderer/ThundererGun.lua

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
1-
-- This script incorporates Filipawn Industries code and the vanilla burstfire script together
2-
-- There is likely better ways of doing a lot of this, potentially even standardizing it so it can be easily used more widely
1+
function OnMessage(self, message, context)
2+
if message == "SetKeepUnflipped" then
3+
self.keepFlipped = context == -1 and true or false;
4+
end
5+
end
36

47
function OnFire(self)
58
CameraMan:AddScreenShake(7, self.Pos);
@@ -58,10 +61,14 @@ function Create(self)
5861
self.rotationSpeed = 0.10;
5962
self.smoothedRotAngle = self.RotAngle;
6063
self.InheritedRotAngleTarget = 0;
64+
65+
self.keepFlipped = false;
6166
end
6267

6368
function Update(self)
6469
--self.servoLoopSound.Pos = self.Pos;
70+
71+
self.HFlipped = self.keepFlipped;
6572

6673
self.parent = IsActor(self:GetRootParent()) and ToActor(self:GetRootParent()) or nil;
6774

@@ -102,7 +109,7 @@ function Update(self)
102109
local frameNum = math.floor(4 * progress);
103110
self.Frame = self.currentBaseFrame + frameNum;
104111

105-
local barrel = self.currentBarrel == 0 and self.topBarrel or self.bottomBarrel;
112+
local barrel = self.currentBarrel == 0 and self.bottomBarrel or self.topBarrel;
106113
local jointOffsetX = 10 * math.sin(progress * math.pi);
107114
barrel.JointOffset = Vector(jointOffsetX, 0);
108115

Data/Coalition.rte/Actors.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@ IncludeFile = Coalition.rte/Actors/Mecha/BlastRunner/BlastRunner.ini
2323

2424
// Turrets
2525

26-
//IncludeFile = Coalition.rte/Actors/Turrets/BunkerCannon/BunkerCannon.ini
26+
IncludeFile = Coalition.rte/Actors/Turrets/BunkerCannon/BunkerCannon.ini
2727
IncludeFile = Coalition.rte/Actors/Turrets/GatlingTurret/GatlingTurret.ini

Data/Coalition.rte/Actors/Turrets/BunkerCannon/BunkerCannon.ini

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,6 @@ AddActor = Turret
463463
Mass = 1
464464
HitsMOs = 1
465465
GetsHitByMOs = 1
466-
ScriptPath = Coalition.rte/Actors/Turrets/BunkerCannon/BunkerCannonTurret.lua
467466
SpriteFile = ContentFile
468467
FilePath = Coalition.rte/Actors/Turrets/BunkerCannon/CoalitionBunkerCannonBraceCirclepieceB.png
469468
FrameCount = 1
@@ -774,6 +773,8 @@ AddActor = ACrab
774773
// GibSound = SoundContainer
775774
// AddSound = ContentFile
776775
// FilePath = Base.rte/Cool explosion sound here
776+
AddCustomValue = NumberValue
777+
KeepUnflipped = 1
777778

778779

779780
AddTerrainObject = TerrainObject
@@ -809,8 +810,6 @@ AddDevice = HDFirearm
809810
PresetName = Coalition Bunker Cannon Gun Left
810811
SpriteFile = ContentFile
811812
FilePath = Coalition.rte/Actors/Turrets/BunkerCannon/CoalitionBunkerCannonGunA.png
812-
AddCustomValue = NumberValue
813-
KeepUnflipped = -1
814813

815814

816815
///////////////////////////////////////////////////////////////////////

Data/Coalition.rte/Actors/Turrets/BunkerCannon/BunkerCannonBrace.lua

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,4 @@
11
function Create(self)
2-
if self:GetNumberValue("KeepUnflipped") == -1 then
3-
self.keepFlipped = true;
4-
else
5-
self.keepFlipped = false;
6-
end
7-
82
-- saving and loading can mess this up, so handle it:
93

104
self.pinPos = Vector(self.Pos.X, self.Pos.Y);
@@ -18,6 +12,18 @@ function Create(self)
1812
end
1913

2014
self.AIMode = Actor.AIMODE_SENTRY;
15+
16+
if self:GetNumberValue("KeepUnflipped") == -1 then
17+
self.keepFlipped = true;
18+
else
19+
self.keepFlipped = false;
20+
end
21+
22+
if self.Turret then
23+
if self.Turret.MountedDevice then
24+
self.Turret.MountedDevice:SendMessage("SetKeepUnflipped", self:GetNumberValue("KeepUnflipped"));
25+
end
26+
end
2127
end
2228

2329
function Update(self)

Data/Coalition.rte/Actors/Turrets/BunkerCannon/BunkerCannonGun.lua

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,11 @@
11
-- This script incorporates Filipawn Industries code and the vanilla burstfire script together
22
-- There is likely better ways of doing a lot of this, potentially even standardizing it so it can be easily used more widely
33

4-
-- Last worked on 29/08/2023
4+
function OnMessage(self, message, context)
5+
if message == "SetKeepUnflipped" then
6+
self.keepFlipped = context == -1 and true or false;
7+
end
8+
end
59

610
function OnFire(self)
711

@@ -18,7 +22,6 @@ function OnReload(self)
1822
end
1923

2024
function Create(self)
21-
2225
self.servoLoopSound = CreateSoundContainer("Coalition Bunker Cannon Servo Loop", "Coalition.rte");
2326
self.servoLoopSound.Volume = 0;
2427
self.servoLoopSound.Pitch = 1;
@@ -46,15 +49,9 @@ function Create(self)
4649
self.InheritedRotAngleTarget = 0;
4750

4851
self.shotsPerBurst = self:NumberValueExists("ShotsPerBurst") and self:GetNumberValue("ShotsPerBurst") or 3;
49-
self.coolDownDelay = 500;
52+
self.coolDownDelay = 500;
5053

51-
if self:NumberValueExists("KeepUnflipped") then
52-
self.keepFlipped = true;
53-
else
54-
self.keepFlipped = false;
55-
end
56-
57-
54+
self.keepFlipped = false;
5855
end
5956

6057
function Update(self)

0 commit comments

Comments
 (0)