Expose power on fireballs#10302
Merged
Merged
Conversation
Contributor
Author
|
|
86dd768 to
f6f9a5f
Compare
maxcom1
suggested changes
Mar 17, 2024
f6f9a5f to
f06521f
Compare
f06521f to
895a1ef
Compare
Machine-Maker
approved these changes
Mar 20, 2024
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #10186.
Patch previously modified the power of the projectile, which actually controls how fast it accelerates. It now usesAbstractHurtingProjectile#setDirection, which also sets the power, but uses the default magnitude of0.1.Considered also directly exposing the power, but was unsure exactly on the best approach of implementing it.AbstractHurtingProjectile#setDirectionassumes a magnitude of0.1, which would need changing if power could be changed. Could either calculate the magnitude from the current power on setting direction, which would need some consideration for when the projectile is created, or including a field for it that's set when the power is modified.Now entirely reverts the original patch, and adds a javadoc comment to
Fireball#setVelocityto note that fireballs accelerate in the direction of their power. Also addedFireball#setPowerandFireball#getPowerto control the power of the projectile. CurrentlyFireball#getDirectionandFireball#getPowerdo the same thing - should I removeFireball#getPoweror deprecateFireball#getDirectionfor its misleading name?