@@ -21,7 +21,7 @@ function Create(self)
21
21
self .canTap = false
22
22
23
23
self .fireVel = 40 -- This immediately overwrites the .ini FireVel
24
- self .maxLineLength = 400 -- Shorter rope for faster gameplay
24
+ self .maxLineLength = 600 -- Shorter rope for faster gameplay (Increased from 400)
25
25
self .maxShootDistance = self .maxLineLength * 0.95 -- 95% of maxLineLength (5% less shooting distance)
26
26
self .setLineLength = 0
27
27
self .lineStrength = 10000 -- EXTREMELY HIGH force threshold - virtually unbreakable (was 120)
@@ -81,7 +81,7 @@ function Create(self)
81
81
82
82
-- Find the parent gun that fired us
83
83
for gun in MovableMan :GetMOsInRadius (self .Pos , 50 ) do
84
- if gun and gun .ClassName == " HDFirearm" and gun .PresetName == " Grapple Gun" and SceneMan :ShortestDistance (self .Pos , ToHDFirearm (gun ).MuzzlePos , self .mapWrapsX ):MagnitudeIsLessThan (5 ) then
84
+ if gun and gun .ClassName == " HDFirearm" and gun .PresetName == " Grapple Gun" and SceneMan :ShortestDistance (self .Pos , ToHDFirearm (gun ).MuzzlePos , self .mapWrapsX ):MagnitudeIsLessThan (15 ) then -- Increased threshold from 5 to 15
85
85
self .parentGun = ToHDFirearm (gun )
86
86
self .parent = MovableMan :GetMOFromID (gun .RootID )
87
87
if MovableMan :IsActor (self .parent ) then
@@ -92,7 +92,7 @@ function Create(self)
92
92
self .parent = ToACrab (self .parent )
93
93
end
94
94
95
- self .Vel = ( self .parent .Vel * 0.5 ) + Vector (self .fireVel , 0 ):RadRotate (self .parent :GetAimAngle (true ))
95
+ self .Vel = self .parent .Vel + Vector (self .fireVel , 0 ):RadRotate (self .parent :GetAimAngle (true )) -- Changed: Use full parent velocity
96
96
self .parentGun :RemoveNumberValue (" GrappleMode" )
97
97
for part in self .parent .Attachables do
98
98
local radcheck = SceneMan :ShortestDistance (self .parent .Pos , part .Pos , self .mapWrapsX ).Magnitude + part .Radius
@@ -135,7 +135,7 @@ function Update(self)
135
135
self .lineLength = self .lineVec .Magnitude
136
136
self .currentLineLength = self .lineLength
137
137
138
- -- Check if we\ 've reached the maximum shooting distance during flight
138
+ -- Check if we've reached the maximum shooting distance during flight
139
139
if self .lineLength >= self .maxShootDistance then
140
140
-- Stop the claw at max shooting distance but keep it in flight mode
141
141
local maxShootVec = self .lineVec :SetMagnitude (self .maxShootDistance )
@@ -154,11 +154,10 @@ function Update(self)
154
154
self .apy [self .currentSegments ] = self .Pos .Y
155
155
156
156
-- Set all lastX/lastY positions to prevent velocity inheritance from previous mode
157
- -- Commenting out this loop allows for rope physics during flight
158
- -- for i = 0, self.currentSegments do
159
- -- self.lastX[i] = self.apx[i]
160
- -- self.lastY[i] = self.apy[i]
161
- -- end
157
+ for i = 0 , self .currentSegments do
158
+ self .lastX [i ] = self .apx [i ]
159
+ self .lastY [i ] = self .apy [i ]
160
+ end
162
161
end
163
162
164
163
-- Calculate optimal number of segments based on rope length using our module function
@@ -180,18 +179,18 @@ function Update(self)
180
179
181
180
-- Apply constraints and check for rope breaking (extremely high threshold)
182
181
local ropeBreaks = RopePhysics .applyRopeConstraints (self , self .currentLineLength )
183
- if ropeBreaks or self .shouldBreak then
184
- -- Rope snapped due to EXTREME tension (500% stretch)
185
- self .ToDelete = true
186
- if self .parent and self .parent :IsPlayerControlled () then
187
- -- Add screen shake and sound effect when rope breaks
188
- FrameMan :SetScreenScrollSpeed (10.0 ) -- More dramatic shake for extreme break
189
- if self .returnSound then
190
- self .returnSound :Play (self .parent .Pos )
182
+ if ropeBreaks or self .shouldBreak then
183
+ -- Rope snapped due to EXTREME tension (500% stretch)
184
+ self .ToDelete = true
185
+ if self .parent and self .parent :IsPlayerControlled () then
186
+ -- Add screen shake and sound effect when rope breaks
187
+ FrameMan :SetScreenScrollSpeed (10.0 ) -- More dramatic shake for extreme break
188
+ if self .returnSound then
189
+ self .returnSound :Play (self .parent .Pos )
190
+ end
191
191
end
192
+ return -- Exit early since rope is breaking
192
193
end
193
- return -- Exit early since rope is breaking
194
- end
195
194
196
195
-- Special handling for attached targets (MO grabbing)
197
196
if self .actionMode == 3 and self .target and self .target .ID ~= rte .NoMOID then
@@ -391,16 +390,16 @@ function Update(self)
391
390
self .returnSound :Play (self .parent .Pos )
392
391
end
393
392
394
- else
395
- self .ToDelete = true -- Parent Actor has no controller
393
+ else -- Parent Actor has no controller
394
+ self .ToDelete = true
396
395
end
397
- else
398
- self .ToDelete = true -- Parent is not an Actor
399
- end
400
- else
396
+ else -- else for 'if MovableMan:IsActor(self.parent) then'
397
+ self .ToDelete = true
398
+ end -- end for 'if MovableMan:IsActor(self.parent) then'
399
+ else -- else for 'if self.parent and IsMOSRotating(self.parent) and self.parent:HasObject("Grapple Gun") then'
401
400
self .ToDelete = true -- Parent is nil, not MOSRotating, or doesn't have "Grapple Gun"
402
- end
403
- end
401
+ end -- end for 'if self.parent and IsMOSRotating(self.parent) and self.parent:HasObject("Grapple Gun") then'
402
+ end -- end for 'function Update(self)'
404
403
405
404
function Destroy (self )
406
405
if MovableMan :IsParticle (self .crankSound ) then
0 commit comments