Skip to content

Commit a64783d

Browse files
Merge pull request #356 from millennIumAMbiguity/1.18.x/engine-boost
Engine boost
2 parents 8248ab2 + 8854aba commit a64783d

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

common/src/main/kotlin/org/valkyrienskies/eureka/EurekaConfig.kt

+9
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,15 @@ object EurekaConfig {
4646
@JsonSchema(description = "Fuel burn time multiplier")
4747
val engineFuelMultiplier = 2f
4848

49+
@JsonSchema(description = "Extra engine power for when having multiple engines per engine")
50+
val engineBoost = 0.2
51+
52+
@JsonSchema(description = "At what amount of engines the boost will start taking effect")
53+
val engineBoostOffset = 2.5
54+
55+
@JsonSchema(description = "The final linear boost will be raised to the power of 2, and the result of the delta is multiple by this value")
56+
val engineBoostExponentialPower = 0.000001
57+
4958
@JsonSchema(description = "Max speed of a ship without boosting")
5059
val maxCasualSpeed = 15.0
5160

common/src/main/kotlin/org/valkyrienskies/eureka/ship/EurekaShipControl.kt

+4
Original file line numberDiff line numberDiff line change
@@ -314,6 +314,10 @@ class EurekaShipControl : ShipForcesInducer, ServerTickListener {
314314
val forwardForce = Vector3d(baseForwardVel).sub(velOrthogonalToPlayerUp).mul(mass10)
315315

316316
if (extraForceLinear != 0.0) {
317+
// engine boost
318+
val boost = max((extraForceLinear - EurekaConfig.SERVER.enginePowerLinear * EurekaConfig.SERVER.engineBoostOffset) * EurekaConfig.SERVER.engineBoost, 0.0);
319+
extraForceLinear += boost + boost * boost * EurekaConfig.SERVER.engineBoostExponentialPower;
320+
317321
// This is the maximum speed we want to go in any scenario (when not sprinting)
318322
val idealForwardVel = Vector3d(forwardVector).mul(EurekaConfig.SERVER.maxCasualSpeed)
319323
val idealForwardForce = Vector3d(idealForwardVel).sub(velOrthogonalToPlayerUp).mul(mass10)

0 commit comments

Comments
 (0)