@@ -22,6 +22,7 @@ function Create(self)
22
22
23
23
self .fireVel = 40 -- This immediately overwrites the .ini FireVel
24
24
self .maxLineLength = 400 -- Shorter rope for faster gameplay
25
+ self .maxShootDistance = self .maxLineLength * 0.95 -- 95% of maxLineLength (5% less shooting distance)
25
26
self .setLineLength = 0
26
27
self .lineStrength = 10000 -- EXTREMELY HIGH force threshold - virtually unbreakable (was 120)
27
28
@@ -134,17 +135,30 @@ function Update(self)
134
135
self .lineLength = self .lineVec .Magnitude
135
136
self .currentLineLength = self .lineLength
136
137
138
+ -- Check if we\'ve reached the maximum shooting distance during flight
139
+ if self .lineLength >= self .maxShootDistance then
140
+ -- Stop the claw at max shooting distance but keep it in flight mode
141
+ local maxShootVec = self .lineVec :SetMagnitude (self .maxShootDistance )
142
+ self .Pos = self .parent .Pos + maxShootVec
143
+ self .Vel = Vector (0 , 0 ) -- Stop the claw
144
+ self .currentLineLength = self .maxShootDistance
145
+ self .limitReached = true
146
+ -- Keep actionMode = 1 (flight) so it can still detect collisions
147
+ self .clickSound :Play (self .parent .Pos )
148
+ end
149
+
137
150
-- Update rope anchor points directly for flight mode
138
151
self .apx [0 ] = self .parent .Pos .X
139
152
self .apy [0 ] = self .parent .Pos .Y
140
153
self .apx [self .currentSegments ] = self .Pos .X
141
154
self .apy [self .currentSegments ] = self .Pos .Y
142
155
143
156
-- Set all lastX/lastY positions to prevent velocity inheritance from previous mode
144
- for i = 0 , self .currentSegments do
145
- self .lastX [i ] = self .apx [i ]
146
- self .lastY [i ] = self .apy [i ]
147
- end
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
148
162
end
149
163
150
164
-- Calculate optimal number of segments based on rope length using our module function
@@ -161,28 +175,22 @@ function Update(self)
161
175
-- Proper rope physics simulation using the RopePhysics module
162
176
local endPos = self .Pos
163
177
164
- -- Choose physics simulation based on rope mode
165
- if self .actionMode == 1 then
166
- -- Flight mode - keep rope tight and straight
167
- RopePhysics .updateRopeFlightPath (self )
168
- else
169
- -- Attached mode - run full physics simulation
170
- RopePhysics .updateRopePhysics (self , startPos , endPos , self .currentLineLength )
171
-
172
- -- Apply constraints and check for rope breaking (extremely high threshold)
173
- local ropeBreaks = RopePhysics .applyRopeConstraints (self , self .currentLineLength )
174
- if ropeBreaks or self .shouldBreak then
175
- -- Rope snapped due to EXTREME tension (500% stretch)
176
- self .ToDelete = true
177
- if self .parent and self .parent :IsPlayerControlled () then
178
- -- Add screen shake and sound effect when rope breaks
179
- FrameMan :SetScreenScrollSpeed (10.0 ) -- More dramatic shake for extreme break
180
- if self .returnSound then
181
- self .returnSound :Play (self .parent .Pos )
182
- end
178
+ -- Use full rope physics simulation for both flight and attached modes
179
+ RopePhysics .updateRopePhysics (self , startPos , endPos , self .currentLineLength )
180
+
181
+ -- Apply constraints and check for rope breaking (extremely high threshold)
182
+ 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 )
183
191
end
184
- return -- Exit early since rope is breaking
185
192
end
193
+ return -- Exit early since rope is breaking
186
194
end
187
195
188
196
-- Special handling for attached targets (MO grabbing)
@@ -237,16 +245,15 @@ function Update(self)
237
245
self .setLineLength = self .currentLineLength
238
246
end
239
247
240
- -- Single length limit check - removed redundant checkLineLengthUpdate call
248
+ -- Single length limit check - now handled during flight phase
241
249
if self .currentLineLength > self .maxLineLength then
242
250
self .currentLineLength = self .maxLineLength
243
251
self .setLineLength = self .maxLineLength
244
- if not self .limitReached then
245
- self .limitReached = true
246
- self .clickSound :Play (self .parent .Pos )
247
- end
252
+ -- limitReached is now set during flight phase
248
253
else
249
- self .limitReached = false
254
+ if self .actionMode > 1 then -- Only reset limit flag when attached, not during flight
255
+ self .limitReached = false
256
+ end
250
257
end
251
258
252
259
if self .parentGun and self .parentGun .ID ~= rte .NoMOID then
0 commit comments