Phobos
Phobos copied to clipboard
Trajectory projectiles enhancement
Some enhancement for trajectory projectiles, especially for Bombard Trajectory. Many thanks to NaotoYuuki who provided trajectory scatter logic and the prototypes of vertical and meteor projectiles, which are used as the base of these additions.
1 - Both Straight Trajectory and Bombard Trajectory now support Inaccurate=true, BallisticScatter.Max and BallisticScatter.Min keys, which allows them to scatter when picking targets.
2 - Bombard Trajectory, instead of simply flying to the top of the target and free fall, is now extended into a series of trajectories which flying to a 'turning point' first, and then turning to the targets or respawning on their top. The behaviors of the projectile and the position of the turning point could be customized by the following tags:
Trajectory.Bombard.FallPercentcontrols the distance of the turning point by its percentage of the total distance between attacker and intended target. If set to 0%, then it'll fly up vertically. If set to 100%, then it'll travel to the top of the intended target.- For each launch the turning point percentage could add or minus a random value, which is not greater than
Trajectory.Bombard.FallPercentShift. If set to 0%, random shift will be disabled. - You can also makes the turning point scatter in a circle with
Trajectory.Bombard.FallScatterRangeas its radius. If set to 0, random scatter will be disabled.
- For each launch the turning point percentage could add or minus a random value, which is not greater than
Trajectory.Bombard.FreeFallOnTargetcontrols how it'll hit the intended target. If set to true, the projectile will be respawned above the intended target and free fall. If set to false, the projectile will travel to the intended target from the turning point.Trajectory.Bombard.NoLaunchcontrols whether the attacker will fire the projectile by itself. If set to true, projectile will directly fall from the turning point.Trajectory.Bombard.FallSpeedcontrols the initial speed of the projectile after it turns. If set to 0.0, then it'll useTrajectory.Speed. Can't work together withTrajectory.Bombard.FreeFallOnTarget=true.Trajectory.Bombard.TargetSnapDistancecontrols the maximum distance in cells from intended target the projectile can be at moment of detonation to make the projectile 'snap' on the intended target. Set to 0 to disable snapping.
In rulesmd.ini:
[SOMEPROJECTILE] ; Projectile
Trajectory=Bombard ; Trajectory type
Trajectory.Bombard.Height=0.0 ; double
Trajectory.Bombard.FallPercent=1.0 ; double
Trajectory.Bombard.FallPercentShift=0.0 ; double
Trajectory.Bombard.FallScatterRange=0.0 ; floating point value
Trajectory.Bombard.FreeFallOnTarget=true ; boolean
Trajectory.Bombard.NoLaunch=false ; boolean
Trajectory.Bombard.FallSpeed=0.0 ; double
Trajectory.Bombard.TargetSnapDistance=0.5 ; floating point value
If all values are set to default, it'll perform as the old Bombard Trajectory, so those who have made use of it don't need to modify their ini if they want it to behave the same.
NOTE: Both the old and new Bombard Trajectory will crash when firing a Voxel=true projectile, which is unresolved yet. Avoid using it for now, and if someone could make it work I'll be really grateful.
Nightly build for this pull request:
- compiled-dll-4bdfff45d232bdadfac60cebe1eed1448361606a.zip These artifacts will expire in 90 days and will not be available for download after that time.
This comment is automatic and is meant to allow guests to get latest nightly builds for this pull request without registering. It is updated on every successful build.
added a tag to display anim when the projectile is 'turning'
Trajectory.Bombard.TurningPointAnim, if set, will play an anim when the projectile reaches the turning point. IfTrajectory.Bombard.FreeFallOnTargetis set to true, it'll be spawned above the target with the projectile together. IfTrajectory.Bombard.NoLaunchis set to true, it'll be played at where the projectile falls, no matter if it's free fall or not.
In rulesmd.ini:
[SOMEPROJECTILE] ; Projectile
Trajectory.Bombard.TurningPointAnim= ; Animation
also, both https://github.com/Phobos-developers/Phobos/pull/1261 and this PR has implemented Inaccurace for trajectory, with different approach however. The other method considered about distance between the target and the firer, which seems to be how it's worked in vanilla. Please check these 2 implementations to see which is better and should be kept.
Close it for now since some logic is conflicted with the one made by CrimRecya, and the pattern of tags need to be uniformed. Will reopen or start a new pull request after some other trajectory pull requests are merged