← Back to changelog
What changed
JumpBike · v1.0.5 → v1.0.6 (current)
Diff
4 added · 4 removed · 503 → 503 total lines
1
1
/*▄▄▄ ███▄ ▄███▓ ▄████ ▄▄▄██▀▀▀▓█████▄▄▄█████▓
2
2
▓█████▄ ▓██▒▀█▀ ██▒ ██▒ ▀█▒ ▒██ ▓█ ▀▓ ██▒ ▓▒
3
3
▒██▒ ▄██▓██ ▓██░▒██░▄▄▄░ ░██ ▒███ ▒ ▓██░ ▒░
4
4
▒██░█▀ ▒██ ▒██ ░▓█ ██▓▓██▄██▓ ▒▓█ ▄░ ▓██▓ ░
5
5
░▓█ ▀█▓▒██▒ ░██▒░▒▓███▀▒ ▓███▒ ░▒████▒ ▒██▒ ░
6
6
░▒▓███▀▒░ ▒░ ░ ░ ░▒ ▒ ▒▓▒▒░ ░░ ▒░ ░ ▒ ░░
7
7
▒░▒ ░ ░ ░ ░ ░ ░ ▒ ░▒░ ░ ░ ░ ░
8
8
░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░ ░
9
9
░ ░ ░ ░ ░ ░ ░*/
10
10
using HarmonyLib;
11
11
using Newtonsoft.Json;
12
12
using Oxide.Core.Plugins;
13
13
using System.Collections.Generic;
14
14
using System.Linq;
15
15
using UnityEngine;
16
16
namespace Oxide.Plugins
17
17
{
18
-
[Info("JumpBike", "bmgjet", "1.0.5")]
18
+
[Info("JumpBike", "bmgjet", "1.0.6")]
19
19
class JumpBike : RustPlugin
20
20
{
21
21
private static JumpBike plugin;
22
22
private readonly string permUse = "JumpBike.Allow";
23
23
private readonly string permUnlimitedFuel = "JumpBike.Fuel";
24
24
private readonly string permMyBike = "JumpBike.MyBike";
25
25
private readonly string permView = "JumpBike.View";
26
26
private readonly string permSuper = "JumpBike.Super";
27
27
private Dictionary<ulong, ModDefaults> jumpBikes = new Dictionary<ulong, ModDefaults>();
28
28
private List<ulong> TPView = new List<ulong>();
29
29
30
30
public class ModDefaults
31
31
{
32
32
public object idleFuelPerSec;
33
33
public object maxFuelPerSec;
34
34
public object airControlTorquePower;
35
35
public object sprintTime;
36
36
public object sprintRegenTime;
37
37
public object sprintBoostPercent;
38
38
public object playerDamageThreshold;
39
39
public object playerDeathThreshold;
40
40
41
41
public ModDefaults Init(Bike bike)
42
42
{
43
43
idleFuelPerSec = bike.idleFuelPerSec;
44
44
maxFuelPerSec = bike.maxFuelPerSec;
45
45
airControlTorquePower = bike.airControlTorquePower;
46
46
sprintTime = bike.sprintTime;
47
47
sprintRegenTime = bike.sprintRegenTime;
48
48
sprintBoostPercent = bike.sprintBoostPercent;
49
49
playerDamageThreshold = bike.playerDamageThreshold;
50
50
playerDeathThreshold = bike.playerDeathThreshold;
51
51
return this;
52
52
}
53
53
}
54
54
55
55
#region Config
56
56
private Configuration config;
57
57
private class Configuration
58
58
{
59
59
[JsonProperty("Jump Cool Down (Sec)")]
60
60
public int JumpCoolDown = 2;
61
61
62
62
[JsonProperty("Jump Force (Mass X ThisValue)")]
63
63
public float JumpForce = 4;
64
64
65
65
[JsonProperty("[Super] Jump Force (Mass X ThisValue)")]
66
66
public float SuperJumpForce = 6;
67
67
68
68
[JsonProperty("Disable Bike Collision Damage")]
69
69
public bool NoBikeDamage = false;
70
70
71
71
[JsonProperty("Jump Sound Effect (Blank = Disabled)")]
72
72
public string JumpFX = "assets/bundled/prefabs/fx/player/gutshot_scream.prefab";
73
73
74
74
[JsonProperty("Third Person View Distance")]
75
75
public float ViewDistance = 4.5f;
76
76
77
77
[JsonProperty("Enable Speed Boost On Motor Bikes (Applies To All Motor Bikes)")]
78
78
public bool motorBikeSprint = false;
79
79
80
80
[JsonProperty("[MotorBike] Air Control Shift/Ctrl Torque")]
81
81
public float airControlTorquePowerMotorBike = 0.075f;
82
82
83
83
[JsonProperty("[MotorBike] How Many Seconds Of Sprint Pedal Bike Has")]
84
84
public float sprintTimeMotorBike = 5f;
85
85
86
86
[JsonProperty("[MotorBike] How Many Seconds To Regen Sprint")]
87
87
public float sprintRegenTimeMotorBike = 10f;
88
88
89
89
[JsonProperty("[MotorBike] Sprint Speed Boost Amount")]
90
90
public float sprintBoostPercentMotorBike = 0.3f;
91
91
92
92
[JsonProperty("[MotorBike] Player Damage Threshold (Amount Of Collision Damage For Bike To Hurt Player)")]
93
93
public float playerDamageThresholdMotorBike = 40;
94
94
95
95
[JsonProperty("[MotorBike] Player Death Threshold (Amount Of Collision Damage For Bike To Kill Player)")]
96
96
public float playerDeathThresholdMotorBike = 80;
97
97
98
98
[JsonProperty("[MotorBike_Sidecar] Air Control Shift/Ctrl Torque")]
99
99
public float airControlTorquePowerMotorBike_Sidecar = 0.075f;
100
100
101
101
[JsonProperty("[MotorBike_Sidecar] How Many Seconds Of Sprint Pedal Bike Has")]
102
102
public float sprintTimeMotorBike_Sidecar = 5f;
103
103
104
104
[JsonProperty("[MotorBike_Sidecar] How Many Seconds To Regen Sprint")]
105
105
public float sprintRegenTimeMotorBike_Sidecar = 10f;
106
106
107
107
[JsonProperty("[MotorBike_Sidecar] Sprint Speed Boost Amount")]
108
108
public float sprintBoostPercentMotorBike_Sidecar = 0.3f;
109
109
110
110
[JsonProperty("[MotorBike_Sidecar] Player Damage Threshold (Amount Of Collision Damage For Bike To Hurt Player)")]
111
111
public float playerDamageThresholdMotorBike_Sidecar = 40;
112
112
113
113
[JsonProperty("[MotorBike_Sidecar] Player Death Threshold (Amount Of Collision Damage For Bike To Kill Player)")]
114
114
public float playerDeathThresholdMotorBike_Sidecar = 80;
115
115
116
116
[JsonProperty("[PedalBike] Air Control Shift/Ctrl Torque")]
117
117
public float airControlTorquePowerPedalBike = 0.075f;
118
118
119
119
[JsonProperty("[PedalBike] How Many Seconds Of Sprint Pedal Bike Has")]
120
120
public float sprintTimePedalBike = 5f;
121
121
122
122
[JsonProperty("[PedalBike] How Many Seconds To Regen Sprint")]
123
123
public float sprintRegenTimePedalBike = 10f;
124
124
125
125
[JsonProperty("[PedalBike] Sprint Speed Boost Amount")]
126
126
public float sprintBoostPercentPedalBike = 0.3f;
127
127
128
128
[JsonProperty("[PedalBike] Player Damage Threshold (Amount Of Collision Damage For Bike To Hurt Player)")]
129
129
public float playerDamageThresholdPedalBike = 40;
130
130
131
131
[JsonProperty("[PedalBike] Player Death Threshold (Amount Of Collision Damage For Bike To Kill Player)")]
132
132
public float playerDeathThresholdPedalBike = 75;
133
133
134
134
[JsonProperty("[PedalTrike] Air Control Shift/Ctrl Torque")]
135
135
public float airControlTorquePowerPedalTrike = 0.075f;
136
136
137
137
[JsonProperty("[PedalTrike] How Many Seconds Of Sprint Pedal Bike Has")]
138
138
public float sprintTimePedalTrike = 5f;
139
139
140
140
[JsonProperty("[PedalTrike] How Many Seconds To Regen Sprint")]
141
141
public float sprintRegenTimePedalTrike = 10f;
142
142
143
143
[JsonProperty("[PedalTrike] Sprint Speed Boost Amount")]
144
144
public float sprintBoostPercentPedalTrike = 0.3f;
145
145
146
146
[JsonProperty("[PedalTrike] Player Damage Threshold (Amount Of Collision Damage For Bike To Hurt Player)")]
147
147
public float playerDamageThresholdPedalTrike = 40;
148
148
149
149
[JsonProperty("[PedalTrike] Player Death Threshold (Amount Of Collision Damage For Bike To Kill Player)")]
150
150
public float playerDeathThresholdPedalTrike = 75;
151
151
152
152
public string ToJson() => JsonConvert.SerializeObject(this);
153
153
154
154
public Dictionary<string, object> ToDictionary() => JsonConvert.DeserializeObject<Dictionary<string, object>>(ToJson());
155
155
}
156
156
157
157
protected override void LoadDefaultConfig() => config = new Configuration();
158
158
159
159
protected override void LoadConfig()
160
160
{
161
161
base.LoadConfig();
162
162
try
163
163
{
164
164
config = Config.ReadObject<Configuration>();
165
165
if (config == null) { throw new JsonException(); }
166
166
if (!config.ToDictionary().Keys.SequenceEqual(Config.ToDictionary(x => x.Key, x => x.Value).Keys))
167
167
{
168
168
PrintWarning("Configuration appears to be outdated; updating and saving");
169
169
SaveConfig();
170
170
}
171
171
}
172
172
catch
173
173
{
174
174
PrintWarning($"Configuration file {Name}.json is invalid; using defaults");
175
175
LoadDefaultConfig();
176
176
}
177
177
}
178
178
179
179
protected override void SaveConfig()
180
180
{
181
181
PrintWarning($"Configuration changes saved to {Name}.json");
182
182
Config.WriteObject(config, true);
183
183
}
184
184
#endregion
185
185
186
186
#region Chat Commands
187
187
[ChatCommand("mybike")]
188
188
private void MyBike(BasePlayer player, string command, string[] args)
189
189
{
190
190
if (!permission.UserHasPermission(player.UserIDString, permMyBike)) { return; }
191
191
if (args.Length != 1)
192
192
{
193
193
player.ChatMessage("Command /mybike set - Set A Bike");
194
194
player.ChatMessage("Command /mybike get - Get A Bike");
195
195
return;
196
196
}
197
197
if (args[0] == "set")
198
198
{
199
199
if (player?.GetMountedVehicle() is not Bike)
200
200
{
201
201
player.ChatMessage("You Must Be Sitting On A Bike");
202
202
return;
203
203
}
204
204
player?.SetInfo("MyBike", player?.GetMountedVehicle()?.net?.ID.Value.ToString());
205
205
player.ChatMessage("Temporary Bike ID Set!");
206
206
}
207
207
if (args[0] == "get")
208
208
{
209
209
ulong ID = 0;
210
210
if (ulong.TryParse(player.GetInfoString("MyBike", "0"), out ID))
211
211
{
212
212
if (ID != 0)
213
213
{
214
214
BaseNetworkable baseNetworkable = BaseNetworkable.serverEntities.Find(new NetworkableId(ID));
215
215
if (baseNetworkable == null || baseNetworkable.IsDestroyed)
216
216
{
217
217
player.ChatMessage("No /mybike set");
218
218
return;
219
219
}
220
220
Bike bike = baseNetworkable as Bike;
221
221
if (bike != null)
222
222
{
223
223
TPBike(bike, player);
224
224
return;
225
225
}
226
226
}
227
227
}
228
228
}
229
229
}
230
230
#endregion
231
231
232
232
#region Oxide Hooks
233
233
private void Init() { plugin = this; permission.RegisterPermission(permUse, this); permission.RegisterPermission(permUnlimitedFuel, this); permission.RegisterPermission(permMyBike, this); permission.RegisterPermission(permView, this); permission.RegisterPermission(permSuper, this); }
234
234
235
235
private void Unload()
236
236
{
237
237
foreach (var ID in jumpBikes)
238
238
{
239
239
BaseNetworkable baseNetworkable = BaseNetworkable.serverEntities.Find(new NetworkableId(ID.Key));
240
240
if (baseNetworkable != null)
241
241
{
242
242
Bike bike = baseNetworkable as Bike;
243
243
if (bike != null && !bike.IsDestroyed) { bike.DismountAllPlayers(); }
244
244
}
245
245
}
246
246
foreach (var ID in TPView)
247
247
{
248
248
BasePlayer player = BasePlayer.FindAwakeOrSleepingByID(ID);
249
249
if (player != null) { ToggleThirdPerson(player, false); }
250
250
}
251
251
plugin = null;
252
252
}
253
253
254
254
private void OnPlayerSleepEnded(BasePlayer player)
255
255
{
256
256
if (TPView.Contains(player.userID))
257
257
{
258
258
ToggleThirdPerson(player, false);
259
259
TPView.Remove(player.userID);
260
260
}
261
261
}
262
262
263
263
private void OnEntityMounted(BaseMountable mountable, BasePlayer player)
264
264
{
265
265
Bike bike = mountable?.VehicleParent() as Bike;
266
266
if (bike != null)
267
267
{
268
268
if (!jumpBikes.ContainsKey(bike.net.ID.Value) && permission.UserHasPermission(player.UserIDString, permUse))
269
269
{
270
270
jumpBikes.Add(bike.net.ID.Value, new ModDefaults().Init(bike));
271
271
ModBike(bike, player);
272
272
}
273
273
}
274
274
}
275
275
276
276
private void OnEntityDismounted(BaseMountable mountable, BasePlayer player)
277
277
{
278
278
Bike bike = mountable?.VehicleParent() as Bike;
279
279
if (bike != null)
280
280
{
281
281
if (jumpBikes.ContainsKey(bike.net.ID.Value))
282
282
{
283
283
ModBike(bike, player, false);
284
284
jumpBikes.Remove(bike.net.ID.Value);
285
285
}
286
286
if (TPView.Contains(player.userID))
287
287
{
288
288
ToggleThirdPerson(player, false);
289
289
TPView.Remove(player.userID);
290
290
}
291
291
}
292
292
}
293
293
#endregion
294
294
295
295
#region Harmony
296
296
[AutoPatch]
297
297
[HarmonyPatch(typeof(Bike), "AwakeBikePhysicsTick")]
298
298
internal class Bike_AwakeBikePhysicsTick
299
299
{
300
300
[HarmonyPostfix]
301
301
static void Postfix(Bike __instance, CarPhysics<Bike> ___carPhysics)
302
302
{
303
303
BasePlayer player = __instance?.GetDriver();
304
304
if (player == null) { return; }
305
305
if (player.serverInput.IsDown(BUTTON.FIRE_SECONDARY) && player.GetInfoInt("BikeView", 0) <= Time.realtimeSinceStartup && plugin.permission.UserHasPermission(player.UserIDString, plugin.permView))
306
306
{
307
307
player.SetInfo("BikeView", (((int)Time.realtimeSinceStartup + 2)).ToString());
308
308
if (plugin.TPView.Contains(player.userID))
309
309
{
310
310
plugin.ToggleThirdPerson(player, false);
311
311
plugin.TPView.Remove(player.userID);
312
312
}
313
313
else
314
314
{
315
315
plugin.ToggleThirdPerson(player, true);
316
316
plugin.TPView.Add(player.userID);
317
317
}
318
318
}
319
319
if (___carPhysics.IsGrounded() && player.serverInput.IsDown(BUTTON.RELOAD) && player.GetInfoInt("BikeJump", 0) <= Time.realtimeSinceStartup && plugin.permission.UserHasPermission(player.UserIDString, plugin.permUse))
320
320
{
321
321
bool isKinematic = __instance.rigidBody.isKinematic;
322
322
float jumpforce = plugin.permission.UserHasPermission(player.UserIDString, plugin.permSuper) ? plugin.config.SuperJumpForce : plugin.config.JumpForce;
323
323
__instance.rigidBody.isKinematic = false;
324
324
player.SetInfo("BikeJump", (((int)Time.realtimeSinceStartup + plugin.config.JumpCoolDown)).ToString());
325
325
__instance.rigidBody.AddForce(__instance.transform.up * __instance.rigidBody.mass * jumpforce, ForceMode.Impulse);
326
326
__instance.rigidBody.isKinematic = isKinematic;
327
327
if (!string.IsNullOrEmpty(plugin.config.JumpFX)) { Effect.server.Run(plugin.config.JumpFX, player.transform.position); }
328
328
}
329
-
else if (plugin.config.motorBikeSprint && __instance.poweredBy == Bike.PoweredBy.Fuel && player.serverInput.IsDown(BUTTON.SPRINT)) { __instance.SetFlag(BaseEntity.Flags.Reserved9, true, false, false); }
329
+
else if (plugin.config.motorBikeSprint && __instance.poweredBy == Bike.PoweredBy.Fuel && player.serverInput.IsDown(BUTTON.SPRINT)) { __instance.SetFlagLocal(BaseEntity.Flags.Reserved9, true, false); }
330
330
}
331
331
}
332
332
333
333
[AutoPatch]
334
334
[HarmonyPatch(typeof(Bike), "DoCollisionDamage", typeof(BaseEntity), typeof(float))]
335
335
internal class Bike_DoCollisionDamage
336
336
{
337
337
[HarmonyPrefix]
338
338
static bool HarmonyPrefix() { return !plugin.config.NoBikeDamage; }
339
339
}
340
340
#endregion
341
341
342
342
#region Methods
343
343
private void TPBike(Bike bike, BasePlayer player)
344
344
{
345
345
if (bike.AnyMounted())
346
346
{
347
347
player.ChatMessage("Can't Teleport Bike While Its Mounted!");
348
348
return;
349
349
}
350
350
if (player.IsBuildingBlocked())
351
351
{
352
352
player.ChatMessage("You Are Building Blocked!");
353
353
return;
354
354
}
355
355
if (player.transform.position.y < -5)
356
356
{
357
357
player.ChatMessage("You Can't Be Below Ground!");
358
358
return;
359
359
}
360
360
Vector3 pos = player.eyes.transform.position + (player.eyes.BodyForward() * 1.7f);
361
361
float terrainheight = TerrainMeta.HeightMap.GetHeight(pos);
362
362
if (pos.y < terrainheight) { pos.y = terrainheight + 0.2f; }
363
363
string Colliders = CheckColliders(pos, 1.7f);
364
364
if (!string.IsNullOrEmpty(Colliders))
365
365
{
366
366
player.ChatMessage("Bike Teleport Blocked By Prefab: " + Colliders);
367
367
return;
368
368
}
369
369
if (PlayersNearby(player, pos, 1.8f))
370
370
{
371
371
player.ChatMessage("Bike Teleport Blocked By Player");
372
372
return;
373
373
}
374
374
player.ChatMessage("Teleported Bike To You");
375
375
bike.transform.position = pos;
376
376
bike.SendNetworkUpdate();
377
377
}
378
378
379
379
public bool PlayersNearby(BasePlayer owner, Vector3 pos, float distance)
380
380
{
381
381
List<BasePlayer> list = Facepunch.Pool.Get<List<BasePlayer>>();
382
382
Vis.Entities<BasePlayer>(pos, distance, list, 131072, QueryTriggerInteraction.Collide);
383
383
bool flag = false;
384
384
foreach (BasePlayer basePlayer in list)
385
385
{
386
386
if (basePlayer.IsAlive())
387
387
{
388
388
if (basePlayer == owner) { continue; }
389
389
flag = true;
390
390
break;
391
391
}
392
392
}
393
393
Facepunch.Pool.FreeUnmanaged(ref list);
394
394
return flag;
395
395
}
396
396
397
397
private string CheckColliders(Vector3 position, float distance)
398
398
{
399
399
foreach (Collider col in Physics.OverlapSphere(position, distance, LayerMask.GetMask("Construction", "Default", "Deployed", "Resource", "Terrain", "Water", "World", "Tree", "Vehicle_Large", "Vehicle_World", "Vehicle_Detailed", "Physics_Debris", "Clutter", "TransparentFX", "Harvestable")))
400
400
{
401
401
if (col.gameObject.name != "Terrain") { return col.gameObject.name; }
402
402
}
403
403
return string.Empty;
404
404
}
405
405
406
406
private void ToggleThirdPerson(BasePlayer player, bool enable)
407
407
{
408
408
//Check for admin toggle plugins
409
409
if (!player.IsAdmin && !player.IsDeveloper && player.IsFlying) { return; }// BasePlayer => FinalizeTick => NoteAdminHack => Ban => Cheat Detected!
410
410
bool _isadmin = player.IsAdmin; //Check if is admin
411
411
if (_isadmin)
412
412
{
413
413
player.SetPlayerFlag(BasePlayer.PlayerFlags.IsAdmin, false);
414
414
player.SendNetworkUpdateImmediate();
415
415
}
416
416
timer.Once(0.1f, () =>
417
417
{
418
418
if (!player.isMounted) { enable = false; }
419
419
player.SetPlayerFlag(BasePlayer.PlayerFlags.ThirdPersonViewmode, enable);
420
420
player.Command("camoffset", 0.0, 4.5f, 0.0);
421
421
player.Command("camdist", config.ViewDistance);
422
422
player.Command("camfov", 100);
423
423
if (_isadmin)
424
424
{
425
425
timer.Once(0.1f, () =>
426
426
{
427
427
player.SetPlayerFlag(BasePlayer.PlayerFlags.IsAdmin, true);
428
428
player.SendNetworkUpdateImmediate();
429
429
});
430
430
}
431
431
player.SendNetworkUpdateImmediate();
432
432
});
433
433
}
434
434
435
435
private void ModBike(Bike bike, BasePlayer player, bool doMod = true)
436
436
{
437
437
ulong ID = bike.net.ID.Value;
438
438
if (player != null && bike?.poweredBy == Bike.PoweredBy.Fuel)
439
439
{
440
440
if (permission.UserHasPermission(player.UserIDString, permUnlimitedFuel))
441
441
{
442
442
bike.idleFuelPerSec = doMod ? 0 : (float)jumpBikes[ID].idleFuelPerSec;
443
443
bike.maxFuelPerSec = doMod ? 0 : (float)jumpBikes[ID].maxFuelPerSec;
444
444
StorageContainer fuelContainer = (bike?.GetFuelSystem() as EntityFuelSystem)?.GetFuelContainer();
445
445
if (fuelContainer != null)
446
446
{
447
447
if (doMod)
448
448
{
449
449
fuelContainer.inventory.AddItem(fuelContainer.allowedItem, 1);
450
-
fuelContainer.SetFlag(BaseEntity.Flags.Locked, true);
450
+
fuelContainer.SetFlagLocal(BaseEntity.Flags.Locked, true);
451
451
}
452
452
else
453
453
{
454
454
if (fuelContainer.HasFlag(BaseEntity.Flags.Locked))
455
455
{
456
456
fuelContainer.inventory.Clear();
457
-
fuelContainer.SetFlag(BaseEntity.Flags.Locked, false);
457
+
fuelContainer.SetFlagLocal(BaseEntity.Flags.Locked, false);
458
458
}
459
459
}
460
460
}
461
461
fuelContainer.SendNetworkUpdateImmediate();
462
462
}
463
463
}
464
464
switch (bike.prefabID)
465
465
{
466
466
case 248647596: //motorbike
467
467
bike.airControlTorquePower = doMod ? config.airControlTorquePowerMotorBike : (float)jumpBikes[ID].airControlTorquePower;
468
468
bike.sprintTime = doMod ? config.sprintTimeMotorBike : (float)jumpBikes[ID].sprintTime;
469
469
bike.sprintRegenTime = doMod ? config.sprintRegenTimeMotorBike : (float)jumpBikes[ID].sprintRegenTime;
470
470
bike.sprintBoostPercent = doMod ? config.sprintBoostPercentMotorBike : (float)jumpBikes[ID].sprintBoostPercent;
471
471
bike.playerDamageThreshold = doMod ? config.playerDamageThresholdMotorBike : (float)jumpBikes[ID].playerDamageThreshold;
472
472
bike.playerDeathThreshold = doMod ? config.playerDeathThresholdMotorBike : (float)jumpBikes[ID].playerDeathThreshold;
473
473
break;
474
474
case 573812: //motorbike_sidecar
475
475
bike.airControlTorquePower = doMod ? config.airControlTorquePowerMotorBike_Sidecar : (float)jumpBikes[ID].airControlTorquePower;
476
476
bike.sprintTime = doMod ? config.sprintTimeMotorBike_Sidecar : (float)jumpBikes[ID].sprintTime;
477
477
bike.sprintRegenTime = doMod ? config.sprintRegenTimeMotorBike_Sidecar : (float)jumpBikes[ID].sprintRegenTime;
478
478
bike.sprintBoostPercent = doMod ? config.sprintBoostPercentMotorBike_Sidecar : (float)jumpBikes[ID].sprintBoostPercent;
479
479
bike.playerDamageThreshold = doMod ? config.playerDamageThresholdMotorBike_Sidecar : (float)jumpBikes[ID].playerDamageThreshold;
480
480
bike.playerDeathThreshold = doMod ? config.playerDeathThresholdMotorBike_Sidecar : (float)jumpBikes[ID].playerDeathThreshold;
481
481
break;
482
482
case 226383098: //pedalbike
483
483
bike.airControlTorquePower = doMod ? config.airControlTorquePowerPedalBike : (float)jumpBikes[ID].airControlTorquePower;
484
484
bike.sprintTime = doMod ? config.sprintTimePedalBike : (float)jumpBikes[ID].sprintTime;
485
485
bike.sprintRegenTime = doMod ? config.sprintRegenTimePedalBike : (float)jumpBikes[ID].sprintRegenTime;
486
486
bike.sprintBoostPercent = doMod ? config.sprintBoostPercentPedalBike : (float)jumpBikes[ID].sprintBoostPercent;
487
487
bike.playerDamageThreshold = doMod ? config.playerDamageThresholdPedalBike : (float)jumpBikes[ID].playerDamageThreshold;
488
488
bike.playerDeathThreshold = doMod ? config.playerDeathThresholdPedalBike : (float)jumpBikes[ID].playerDeathThreshold;
489
489
break;
490
490
case 383359455: //pedaltrike
491
491
bike.airControlTorquePower = doMod ? config.airControlTorquePowerPedalTrike : (float)jumpBikes[ID].airControlTorquePower;
492
492
bike.sprintTime = doMod ? config.sprintTimePedalTrike : (float)jumpBikes[ID].sprintTime;
493
493
bike.sprintRegenTime = doMod ? config.sprintRegenTimePedalTrike : (float)jumpBikes[ID].sprintRegenTime;
494
494
bike.sprintBoostPercent = doMod ? config.sprintBoostPercentPedalTrike : (float)jumpBikes[ID].sprintBoostPercent;
495
495
bike.playerDamageThreshold = doMod ? config.playerDamageThresholdPedalTrike : (float)jumpBikes[ID].playerDamageThreshold;
496
496
bike.playerDeathThreshold = doMod ? config.playerDeathThresholdPedalTrike : (float)jumpBikes[ID].playerDeathThreshold;
497
497
break;
498
498
}
499
499
bike.SendNetworkUpdateImmediate();
500
500
}
501
501
#endregion
502
502
}
503
503
}