Commit Graph

32 Commits

Author SHA1 Message Date
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