Commit Graph

28 Commits

Author SHA1 Message Date
reaperrr
8513a83331 Add ImpactOrientation to WarheadArgs
Allows to pass the horizontal facing/yaw
and vertical angle/pitch of the carrier
projectile to warheads for further use.

Add ImpactPosition to WarheadArgs

InflictDamage doesn't pass the impact pos
directly, and the very point of WarheadArgs
is to avoid adding more and more arguments
to the warhead methods.
2020-07-12 19:52:55 +02:00
Pavel Penev
d866286f82 Added back the DescAttributes on projectiles' Inaccuracy fields 2020-07-05 13:04:18 +02:00
Pavel Penev
76dfda164e Moved projectile inaccuracy calculations to Common.Util
Also moved the InaccuracyType enum there. This also quietly adds the RangeModifiers to the calculations for all projectiles, while they were only used on Bullet so far, which seemed very wrong.
2020-07-05 13:04:18 +02:00
Pavel Penev
134d47e48c Added InaccuracyType.Absolute to projectiles 2020-07-05 13:04:18 +02:00
Pavel Penev
c27412c83a Added InaccuracyType enum and updated projectiles accordingly
Also updated the inaccuracy calculations to account for the new inaccuracy type - either based on distance up to a max defined inaccuracy at max range (old style) or based on distance with each cell (1024 range) increasing the inaccuracy with a set step.
2020-07-05 13:04:18 +02:00
Paul Chote
a93aea3e4e AreaBeam Facing -> WAngle. 2020-06-01 21:34:32 +02:00
reaperrr
6220d7e62e Introduce WarheadArgs
- Passes additional arguments to warheads on impact
- Uses that to reduce parameter count of DoImpact by 1
2020-01-21 19:31:34 +01:00
abcdefg30
23b3c237b7 Update the year numbers in all license headers to 2020 2020-01-05 17:00:34 +00:00
Paul Chote
ebf2ce32c0 Make sure braces for multi-line statements are on their own lines. 2019-06-08 19:26:53 +02:00
Paul Chote
78a70be0d4 Fix and enable SA1133, SA1134 style rules. 2019-05-24 10:47:57 +02:00
Paul Chote
3e404f6ac2 Remove HSLColor. 2019-03-04 18:26:42 +00:00
Paul Chote
ab4a7e3558 Replace System.Drawing primitives with our own. 2019-03-04 18:26:42 +00:00
abcdefg30
cadbd0d9ab Change the year number in all cs headers from 2018 to 2019 2019-01-26 23:15:21 +01:00
Andre Mohren
b1a44086a0 Removed unused using directives. 2018-11-17 17:23:22 +00:00
Alexis Hunt
08ad7d7f4e Refactor handling of hit radii in projectiles.
penev discovered that the RulesetLoaded functions of projectiles were
never being called, meaning that their blocking calculations were not
properly accounting for actors with large hitboxes.

The best fix for this is to change FindActorsOnLine to always account
for the largest actor's hit radius, rather than forcing callers to pass
the largest radius. Per the comment in Util.cs, as a result, move this
computation to ActorMap. I decided to simplify by not making a separate
calculation for actors that block projectiles only; this may cause a
small performance degradation as the search space is a bit larger.

Similarly to this, I've removed the ability to specify a search radius
manually. Because this is only a search radius, setting a value smaller
than the largest eligible actor makes no sense; that would lead to
completely inconsistent blocking. Setting a larger value, on the other
hand, would make no difference.

CreateEffectWarhead was the only place in core code any of these search
radii were set, and that's because 0 was a mysterious magic value that
made the warhead incapable of hitting actors. I replaced it with a
boolean flag that more clearly indicates the actual behaviour.

Fixes #14151.
2018-02-21 23:26:41 +01:00
Arular101
8a60918841 Update copyright notice year to 2018 2018-01-17 00:47:34 +01:00
Paul Chote
b898b5001a Rename AttackBase.IsAttacking to IsAiming to make its uses and assumptions clear. 2017-11-26 15:58:00 +01:00
reaperrr
1d2361cdd3 Change default and auto-calc of victim scans to -1
For all projectiles and warheads.

Not really a must for everything else, but for CreateEffectWarhead, the
ImpactTypes refactor (separate PR) makes it a bit harder to make the
warhead valid in every situation, so setting the victim scan to zero is the easiest way to disable scanning for actors completely.
2017-06-25 22:40:12 +02:00
reaperrr
ca475fe133 Projectile style fixes 2017-06-25 22:40:12 +02:00
reaperrr
edffaa4987 Introduce Weapon.TargetActorCenter and adapt projectiles
This also fixes issues with attackers that don't have their own Attack
trait.
2017-06-24 11:24:17 +01:00
reaperrr
7eab278711 Adapt tracking projectiles to support targeting CenterPosition
Instead of closest targetable position.
2017-06-15 01:32:37 +02:00
reaperrr
7acc6dacbc Fix armaments/projectiles to aim at closest Target.Positions
Instead of CenterPosition.
TargetablePositions were already used for targeting/attack decisions, but not armaments/projectiles.
2017-06-05 14:22:47 +02:00
reaperrr
033268a7ba Make projectiles use most sensible blocker scan radius
By default, but allow custom overrides.
2017-05-13 11:15:38 -07:00
Taryn Hill
43317e0f5d Update copyright notice year to 2017 2016-12-31 23:46:13 -06:00
reaperrr
046f857409 Add target tracking support to AreaBeam
Closes #10181.
2016-12-17 15:28:25 +01:00
reaperrr
5463176fa3 Adapt LaserZap Color description and Args structure
To match AreaBeam.
2016-09-20 17:25:28 +02:00
Matthias Mailänder
71743b3b4a Only sync projectiles and future synced effects. 2016-06-13 14:35:28 +02:00
reaperrr
fef4f3eb79 Move projectiles to their own namespace and folder
While they are (currently) technically effects, this makes the actual purpose and wiki more clear.
2016-05-28 14:42:33 +02:00