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

Commit c0d33c4

Browse files
committed
Added Powered Ladders that offer scripted vertical assistance
1 parent 1d50814 commit c0d33c4

File tree

9 files changed

+159
-1
lines changed

9 files changed

+159
-1
lines changed

Base.rte/Scenes/Objects/Bunkers/BunkerSystems/BunkerSystems.ini

Lines changed: 133 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,4 +75,136 @@ AddTerrainObject = TerrainObject
7575
Y = -39
7676
HFlipped = 1
7777
Rotation = Matrix
78-
AngleDegrees = 90
78+
AngleDegrees = 90
79+
80+
// This particle is for creating cracks around the destroyed node
81+
AddParticle = MOPixel
82+
PresetName = Node Spark
83+
Mass = 1
84+
RestThreshold = 500
85+
LifeTime = 10
86+
Sharpness = 10
87+
HitsMOs = 0
88+
GetsHitByMOs = 0
89+
Color = Color
90+
R = 255
91+
G = 255
92+
B = 255
93+
Atom = Atom
94+
Material = Material
95+
CopyOf = Air Blast
96+
TrailColor = Color
97+
R = 255
98+
G = 255
99+
B = 255
100+
TrailLength = 25
101+
102+
103+
AddActor = MOSRotating
104+
PresetName = Powered Ladder Node
105+
PinStrength = 1000
106+
Mass = 20
107+
RestThreshold = 0
108+
HitsMOs = 0
109+
GetsHitByMOs = 1
110+
SpriteFile = ContentFile
111+
FilePath = Base.rte/Scenes/Objects/Bunkers/BunkerSystems/LadderNode.bmp
112+
FrameCount = 1
113+
SpriteOffset = Vector
114+
X = -12
115+
Y = -12
116+
ScriptPath = Base.rte/Scenes/Objects/Bunkers/BunkerSystems/LadderNode.lua
117+
EntryWound = AEmitter
118+
CopyOf = Dent Metal
119+
ExitWound = AEmitter
120+
CopyOf = Dent Metal
121+
AtomGroup = AtomGroup
122+
AutoGenerate = 1
123+
Material = Material
124+
CopyOf = Military Stuff
125+
Resolution = 1
126+
Depth = 0
127+
DeepGroup = AtomGroup
128+
AutoGenerate = 1
129+
Material = Material
130+
CopyOf = Military Stuff
131+
Resolution = 4
132+
Depth = 6
133+
DeepCheck = 0
134+
AddGib = Gib
135+
GibParticle = MOSParticle
136+
CopyOf = Gib Glass Micro A
137+
Count = 3
138+
AddGib = Gib
139+
GibParticle = MOPixel
140+
CopyOf = Spark Yellow 1
141+
Count = 6
142+
Spread = 3.14
143+
MaxVelocity = 30
144+
MinVelocity = 15
145+
LifeVariation = 0.30
146+
AddGib = Gib
147+
GibParticle = MOSParticle
148+
CopyOf = Tiny Smoke Ball 1
149+
Count = 3
150+
Spread = 3.14
151+
MaxVelocity = 30
152+
MinVelocity = 15
153+
LifeVariation = 0.30
154+
AddGib = Gib
155+
GibParticle = MOPixel
156+
CopyOf = Node Spark
157+
Count = 9
158+
Spread = 3.14
159+
MaxVelocity = 30
160+
MinVelocity = 15
161+
GibImpulseLimit = 500
162+
GibWoundLimit = 5
163+
GibSound = Sound
164+
CopyOf = Robot Death
165+
166+
167+
AddTerrainObject = TerrainObject
168+
PresetName = Powered Ladder Left
169+
Description = Having trouble climbing regular ladders? This model will offer you the vertical assistance you need.
170+
AddToGroup = Bunker Systems
171+
GoldValue = 10
172+
FGColorFile = ContentFile
173+
Path = Base.rte/Scenes/Objects/Bunkers/BunkerSystems/LadderAFG.bmp
174+
MaterialFile = ContentFile
175+
Path = Base.rte/Scenes/Objects/Bunkers/BunkerSystems/LadderAMat.bmp
176+
BGColorFile = ContentFile
177+
Path = Base.rte/Scenes/Objects/Bunkers/BunkerSystems/LadderABG.bmp
178+
BitmapOffset = Vector
179+
X = 0
180+
Y = 0
181+
AddChildObject = SOPlacer
182+
PlacedObject = MOSRotating
183+
CopyOf = Powered Ladder Node
184+
Offset = Vector
185+
X = 12
186+
Y = 12
187+
188+
189+
AddTerrainObject = TerrainObject
190+
PresetName = Powered Ladder Right
191+
Description = Having trouble climbing regular ladders? This model will offer you the vertical assistance you need.
192+
AddToGroup = Bunker Systems
193+
GoldValue = 10
194+
FGColorFile = ContentFile
195+
Path = Base.rte/Scenes/Objects/Bunkers/BunkerSystems/LadderBFG.bmp
196+
MaterialFile = ContentFile
197+
Path = Base.rte/Scenes/Objects/Bunkers/BunkerSystems/LadderBMat.bmp
198+
BGColorFile = ContentFile
199+
Path = Base.rte/Scenes/Objects/Bunkers/BunkerSystems/LadderBBG.bmp
200+
BitmapOffset = Vector
201+
X = 0
202+
Y = 0
203+
AddChildObject = SOPlacer
204+
PlacedObject = MOSRotating
205+
CopyOf = Powered Ladder Node
206+
Offset = Vector
207+
X = 12
208+
Y = 12
209+
HFlipped = 1
210+
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
function Create(self)
2+
self.checkTimer = Timer();
3+
self.checkTimer:SetSimTimeLimitMS(51);
4+
self.width = (ToMOSprite(self):GetSpriteWidth() / 2) - 1;
5+
self.height = (ToMOSprite(self):GetSpriteHeight() / 2) - 1;
6+
end
7+
function Update(self)
8+
if self.PinStrength > 0 and self.checkTimer:IsPastSimTimeLimit() then
9+
self.checkTimer:Reset();
10+
self.checkTimer:SetSimTimeLimitMS(51 + self.WoundCount * 34);
11+
self.Vel, self.AngularVel = Vector(), 0;
12+
local checkPos = self.Pos + Vector(self.width * self.FlipFactor, math.random(-self.height, self.height)):RadRotate(self.RotAngle);
13+
local moCheck = SceneMan:GetMOIDPixel(checkPos.X, checkPos.Y);
14+
if moCheck ~= 255 then
15+
local mo = MovableMan:GetMOFromID(moCheck);
16+
if IsAttachable(mo) and ToAttachable(mo):GetParent() and IsAHuman(ToAttachable(mo):GetParent()) then
17+
local actor = ToAHuman(MovableMan:GetMOFromID(mo.RootID));
18+
local controller, velFactor = actor:GetController(), 1 + actor.Vel.Magnitude * 0.3;
19+
if actor.Status == Actor.STABLE and actor.FlipFactor ~= self.FlipFactor and not controller:IsState(Controller.BODY_JUMP) then
20+
actor.Vel = actor.Vel * (1 - 1 / velFactor);
21+
if controller:IsState(Controller.MOVE_LEFT) or controller:IsState(Controller.MOVE_RIGHT) then
22+
local speed = actor:GetLimbPathSpeed(1) / velFactor;
23+
actor.Vel = actor.Vel + Vector(speed / 2, 0):RadRotate(actor:GetAimAngle(true)) - Vector(0, speed);
24+
elseif controller:IsState(Controller.BODY_CROUCH) then
25+
actor.Vel = actor.Vel / 2;
26+
end end end end end end

0 commit comments

Comments
 (0)