Commit Graph

50 Commits

Author SHA1 Message Date
RoosterDragon
8a285f9b19 Fix IDE0090 2023-04-08 16:51:51 +03:00
RoosterDragon
5254348819 Fix IDE0056 2023-04-08 16:51:51 +03:00
abcdefg30
5bf7fe852c Remove the copyright year numbers 2023-01-11 11:58:54 +02:00
Vapre
e3aa2dc6c0 HitShape, query trait via actor cached targetable positions. 2022-09-10 18:23:12 +02:00
Gustas
d3589c051d Add descriptions to all projectiles and warheads 2022-08-29 12:26:33 +03:00
abcdefg30
6a31b1f9f3 Update the copyright header year 2022-05-28 00:35:10 -05:00
penev92
86515610a5 Made all projectile and warhead fields readonly
This came up while working on the new documentation generation and comparing the results to ORAIDE's own code parser.
2022-04-26 22:37:12 +02:00
penev92
8ba6d13b2f Removed unused using directives 2021-10-15 13:12:33 +02:00
Andre Mohren
6810469634 Updated copyright years. 2021-06-29 18:33:21 -05:00
teinarss
19b02875c7 Use Tuple syntax 2020-08-15 10:37:10 +01:00
reaperrr
baf58f53b3 Adapt SpreadDamageWH to ImpactOrientation
The ImpactOrientation needs to be computed from
point of impact to target if the target wasn't hit directly.

Also adapted warhead code to use WarheadArgs consistently,
as well as pass HitShape instead of just HitShapeInfo
(both needed for future and/or downstream features).
2020-07-12 19:52:55 +02:00
Pavel Penev
4740266308 Added DamageCalculationType enum to SpreadDamageWarhead 2020-05-27 10:28:25 +02:00
Pavel Penev
78139413d7 Equalized the DoImpact methods in damage warheads 2020-05-27 10:28:25 +02:00
Pavel Penev
f0578a75f4 Cleaned up DamageWarhead
Reordered methods and fixed access modifiers. Also removed unused using statements from warheads.
2020-05-27 10:28:25 +02:00
reaperrr
2b4035979b Make all warheads use WarheadArgs
Instead of passing damageModifiers directly.
2020-05-02 03:09:18 +03:00
reaperrr
9dcba8710b Add turret-linking support to HitShape
Allows to link a HitShape to the
position and facing of a turret.
2020-01-25 13:38:35 +01:00
abcdefg30
23b3c237b7 Update the year numbers in all license headers to 2020 2020-01-05 17:00:34 +00:00
reaperrr
8edd202b64 Move InflictDamage method back to DamageWarhead
From TargetDamageWarhead.
Saves a few lines and allows warheads that are not
TargetDamageWarhead-based to use it.
2019-08-27 23:05:19 +02:00
abcdefg30
cadbd0d9ab Change the year number in all cs headers from 2018 to 2019 2019-01-26 23:15:21 +01:00
reaperrr
f18ce8cfda Make HitShape mandatory for damaging actors and refactor warheads.
* Adds support for linking Armor traits to HitShapes.
* Adds spread support to TargetDamageWarhead
* Removes ring-damage support from HealthPercentageDamage
* Removes IsValidAgainst check from DoImpact(Actor victim...) overload
  and instead lets warheads perform the check beforehand
  (to avoid HitShape look-ups on invalid targets).
* Reduces duplication and improves readability of Warhead implementations
2018-10-26 22:03:34 +02:00
Andre Mohren
640078a2b1 Refactored Health usage to IHealth. 2018-09-29 18:12:40 +02: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
rob-v
d4e9e0e069 Add Visualization chat commands 2017-07-23 15:08:24 +02: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
dc5818d035 Warhead style fixes
Implement interfaces explicitly
2017-06-25 22:40:12 +02:00
reaperrr
43b55ae333 Move Shape from Health to new HitShape trait
Renamed Shape to Type
2017-06-04 00:07:08 +02:00
reaperrr
d04c6275da Make warheads use the the most sensible victim 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
Paul Chote
e71225496b Clarify GPL version. 2016-02-21 16:30:48 +00:00
Paul Chote
b396965fd9 Update licence header year. 2016-02-21 16:27:31 +00:00
RoosterDragon
8e89a6a696 Simplify names, remove unused usings, remove redundant casts. 2016-01-17 21:35:36 +00:00
Huw Pascoe
a8299221db Integrated HitShapes
Integrated hit shapes with field loader and warhead calculations.
2015-12-28 23:25:35 +00:00
Taryn Hill
9b9d3c8af5 Add DebugOverlayColor to Warhead
This allows us to render WarheadDebugOverlay circles in a
color-per-warhead fashion.
2015-12-09 20:48:10 -06:00
Zimmermann Gyula
0f14339763 Fix (HealthPercentage)DamageWarheads ignoring stances/TargetTypes.
Moves the IsValidAgainst check from SpreadDamage level to Damage level
and adds a duplication to HealthPercentageDamageWarhead.
2015-11-01 21:06:54 +01:00
reaperrr
731875c270 Reduce default warhead TargetExtraSearchRadius
There aren't any actors in any shipping mod where a health radius larger
than 1c512 would be feasible, so no need to make the default larger than necessary.
2015-10-26 16:24:16 +01:00
reaperrr
fa29b16967 Skip DoImpact if actor has no Health trait 2015-10-25 13:23:21 +01:00
reaperrr
92c05912e1 Remove negligible stages from default warhead Falloff
- reduces situations where infantry goes prone even though the impact was rather far away and damage absolutely negligible
- saves a little bit of performance by reducing the total area of effect, resulting in lower average number of calls to Health.InflictDamage at a given Spread value
2015-10-25 11:55:47 +01:00
atlimit8
6992decad0 InvalidOperationException => YamlException in SpreadDamageWarhead 2015-10-23 02:37:39 -05:00
atlimit8
e86eea383a SpreadDamageWarhead.Range loading 2015-10-02 13:42:26 -05:00
Huw Pascoe
cfd179b0c6 Added warhead visualization to combat debug overlay. 2015-10-02 02:48:21 +01:00
reaperrr
74da2a2c72 Add TargetExtraSearchRadius to SpreadDamageWarhead
Allows to customize the victim scan radius. Necessary to ensure that actors where health radius is close enough, but CenterPosition isn't, properly receive damage.
2015-09-25 15:11:06 +02:00
atlimit8
09984683a7 Add ActorInfo.TraitInfo[OrDefault]<T>() requiring ITraitIfo types 2015-09-19 09:56:14 -05:00
Matthias Mailänder
413baf9d8b rename WDist.Range to WDist.Length 2015-07-09 10:55:38 +02:00
Matthias Mailänder
7447e0bf93 rename WRange to WDist 2015-07-09 10:55:38 +02:00
penev92
c3fcd9a8a1 Some cleanups 2015-07-06 22:24:50 +03:00
abcdefg30
8ca61aa917 Updated all year numbers 2015-01-09 21:18:05 +01:00
reaperrr
d074fb4471 Move *ResourceWarheads to Common, move warheads to Common.Warheads namespace 2014-12-26 21:38:50 +01:00
Paul Chote
362b4aeaef Fix variable ordering. 2014-12-26 12:13:08 +13:00
reaperrr
52bb0e8c6b Move some Warheads to Mods.Common 2014-11-07 15:15:47 +01:00