Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: wind charge trajectory #4012

Merged
merged 1 commit into from
Sep 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -115,11 +115,13 @@ object ModuleTrajectories : Module("Trajectories", Category.RENDER) {
cos(yawRadians) * cos(pitchRadians).toDouble()
).normalize() * trajectoryInfo.initialVelocity

velocity += Vec3d(
otherPlayer.velocity.x,
if (otherPlayer.isOnGround) 0.0 else otherPlayer.velocity.y,
otherPlayer.velocity.z
)
if (trajectoryInfo.copiesPlayerVelocity) {
velocity += Vec3d(
otherPlayer.velocity.x,
if (otherPlayer.isOnGround) 0.0 else otherPlayer.velocity.y,
otherPlayer.velocity.z
)
}

val renderer = TrajectoryInfoRenderer(
owner = otherPlayer,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@ object TrajectoryData {
is EggItem -> TrajectoryInfo.GENERIC
is ExperienceBottleItem -> TrajectoryInfo.EXP_BOTTLE
is FireChargeItem -> TrajectoryInfo.FIREBALL
is WindChargeItem -> TrajectoryInfo.WIND_CHARGE
else -> null
}
}
Expand Down Expand Up @@ -102,7 +103,8 @@ data class TrajectoryInfo(
val initialVelocity: Double = 1.5,
val drag: Double = 0.99,
val dragInWater: Double = 0.6,
val roll: Float = 0.0F
val roll: Float = 0.0F,
val copiesPlayerVelocity: Boolean = true,
) {
companion object {
val GENERIC = TrajectoryInfo(0.03, 0.25)
Expand All @@ -113,5 +115,6 @@ data class TrajectoryInfo(
val TRIDENT = PERSISTENT.copy(initialVelocity = 2.5, gravity = 0.05, dragInWater = 0.99)
val BOW_FULL_PULL = PERSISTENT.copy(initialVelocity = 3.0)
val FIREBALL = TrajectoryInfo(gravity = 0.0, hitboxRadius = 1.0)
val WIND_CHARGE = TrajectoryInfo(gravity = 0.0, hitboxRadius = 1.0, copiesPlayerVelocity = false)
}
}
Loading