-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Example Rockets #3501
Merged
Merged
Example Rockets #3501
Conversation
This file contains 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
Rijam
force-pushed
the
1.4.4-ExampleRockets
branch
from
November 16, 2023 18:26
4e27c87
to
a6b67ca
Compare
Still WIP. Need to apply the set to the rest of the EM explosive projectiles and remove the code that the set now handles.
…oader into 1.4.4-ExampleRockets
Also, Celebration plus RocketIV was shooting using starfury logic
Well done, thanks for keeping this alive, it certainly was quite complicated and the examples are great. |
JavidPack
added a commit
that referenced
this pull request
Jul 29, 2024
JavidPack
added a commit
that referenced
this pull request
Jul 29, 2024
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.
What is the new feature?
Improvements to modded rocket ammo.
AmmoID.Sets.SpecificLauncherAmmoProjectileMatches
to provide weapon specific projectiles for specific ammo items, typical of rocket launchers but useable by any weapon.AmmoID.Sets.SpecificLauncherAmmoProjectileFallback
allows for weapons to "inherit" ammo specific projectiles from other weapons, facilitating mod compatibility for these types of weapons.ProjectileID.Sets.Explosive[]
to handle all of the things that Projecitle AI Style 16 (Explosive) did.Projectile.PrepareBombToBlow
and add Mod/GlobalProjectile.PrepareBombToBlow hooks to facilitate modded explosives, allowing explosives to properly adjust properties when exploding.Projectile.HurtPlayer(Rectangle hitbox)
. A simplified copy ofProjectile.BombsHurtPlayers()
which damages the local player if they intersect with the hitbox.Why should this be part of tModLoader?
Rocket ammo is very strange and isn't as intuitive as arrow and bullet ammo. Rocket ammo was quite difficult to deal with because each launcher in vanilla has its own behavior depending on the ammo type. Interaction between mods with custom rocket ammo types were also questionable.
What are the changes to ExampleMod?
Added Example Rocket based on Rocket I which includes
ExampleRocket
item,ExampleRocketLauncher
item,ExampleRocketProjectile
,ExampleGrenadeProjectile
,ExampleProximityMineProjectile
, andExampleSnowmanRocketProjectile
.Even though this is based on Rocket I, I included a few comments about things from Rocket III, Mini Nuke I, and how to destroy tiles like Rocket II.
This PR also updates ExampleExplosive: Updating its sprite, adding Shimmer interaction, adding the new
ProjectileID.Sets.PlayerHurtDamageIgnoresDifficultyScaling
set, and making the projectile damage the player.Are there alternative designs?
ProjectileID.Sets.Explosive
would handle damaging other players in For the Worthy worlds, but it seems like it doesn't because the vanillaKill()
isn't called on ModProjectiles? Might need some more investigation. So, the parts in the projectiles that resize the projectile and damage the player in For the Worthy worlds may or may not be necessary.(old PR things)
Do these changes need additional documentation?
Shouldn't contain any breakage. Any projectile using Projectile AI Style 16 will still work as before. Using
PickAmmo()
instead ofProjectileID.Sets.SpecificLauncherAmmoProjectileMatches
should still work.Short Summary
ProjectileID.Sets.Explosive[]
to match the behavior of vanilla explosives without having to use aiStyle 16Projectile.HurtPlayer(Rectangle hitbox)
method which will damage the local player if they intersect the hitbox.PrepareBombToBlow
hook to implement explosives correctly.Porting Notes
Projectile.aiStyle = ProjAIStyleID.Explosive
(16
) to match the vanilla behavior of explosives, you can now useProjectileID.Sets.Explosive[]
. Also overridePrepareBombToBlow
and add the explosion resizing logic there.ProjectileID.Sets.SpecificLauncherAmmoProjectileMatches
defined for all applicable vanilla launchers.AmmoID.Sets.SpecificLauncherAmmoProjectileFallback
to the closest vanilla launcher to inherit ammo-specific projectiles from.PickAmmo()
or similar to fix your rocket ammo shooting the wrong projectile for the Snowman Cannon and Celebration Mk2, double check that because it is probably not necessary anymore.