Commit Graph

120 Commits

Author SHA1 Message Date
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
Pavel Penev
b00154e2bc Created ShakeScreenWarhead and removed the hardcoded shaking from NukeLaunch and MadTank 2020-01-24 13:09:37 +01: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
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
reaperrr
1c03fb9e51 Revert Simplify CreateEffectWarhead
Reverts #16312.
2019-07-07 19:15:08 +02:00
reaperrr
3735c60533 Simplify CreateEffectWarhead 2019-05-24 20:08:33 +01:00
Paul Chote
78a70be0d4 Fix and enable SA1133, SA1134 style rules. 2019-05-24 10:47:57 +02:00
Zimmermann Gyula
2648764ee3 Add FireClusterWarhead 2019-05-09 22:28:46 +01: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
rob-v
9ed2ffea91 Fix Warhead.IsValidAgainst (FrozenActor.Owner null) 2019-01-19 12:03:15 +00:00
Mustafa Alperen Seki
6a599e57f6 Remove check for full health for negative damage warheads 2018-11-21 19:25:45 +01:00
Andre Mohren
99de33bbe3 Added smudge chance. 2018-11-21 18:00:11 +01:00
Andre Mohren
b1a44086a0 Removed unused using directives. 2018-11-17 17:23:22 +00:00
reaperrr
cd82382f68 Change CreateEffectWarhead to use World.LocalRandom 2018-11-11 19:50:16 +01:00
Andre Mohren
8b8a14e0b8 Proper usage of IHealthInfo. 2018-10-30 20:59:04 +00: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
reaperrr
ade85f8977 Skip DamageWarhead armor lookups if no Versus defined
- directly return 100 when no Versus values are defined (meaning the warhead would have 100% efficiency vs. all armor types anyway)
2018-09-29 12:54:34 +01:00
Chris Forbes
d4ef841678 Convert masses of HashSet<string> to BitSet<DamageType> 2018-07-28 20:12:42 +01:00
Zimmermann Gyula
c4b5ec5241 Shift temporary owner-change logic from D2k to Common. 2018-05-20 19:44:35 +02:00
RoosterDragon
5bd5a384b7 Use a BitSet for representing target types.
- Rename Bits<T> to BitSet<T>.
- Implement set based helpers for BitSet<T>.
- When representing TargetTypes of ITargetable in various traits, use a BitSet<TargetableType> instead of HashSet<string> for better performance & reduced memory usage.
- Fix FieldLoader to trim input values when generating a BitSet<T>.
- Require T in BitSet<T> and BitSetAllocator<T> to be a class since it's just a marker value. This allows the JIT to instantiate generic code for these classes once, as they don't benefit from specialized code for T. (Typically JITs will generate shared code for all reference types, and unique code for every value type encountered).
2018-03-21 12:07:44 +01:00
Mustafa Alperen Seki
5e7e3bb011 Add DamageTypes to Kill() and make some traits use it. 2018-03-09 00:25:29 +01: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
Andre Mohren
edeb980f5b Implemented a percentual chance to play the ImpactSound to CreateEffectWarhead 2017-10-07 10:15:22 +02:00
rob-v
d4e9e0e069 Add Visualization chat commands 2017-07-23 15:08:24 +02:00
reaperrr
1b0ae1e512 Mention hard-coded 'Air' TargetType in CEWH.AirThreshod desc 2017-07-13 20:58:47 +02:00
reaperrr
cf5abc68ad Refactor CreateEffectWarhead ImpactTypes
Use target validity to simplify ImpactTypes.
2017-07-13 20:58:47 +02:00
reaperrr
2650973d51 Add ForceDisplayAtGroundLevel to CreateEffectWarhead
Allows to force the effect to always play at ground level, regardless of explosion altitude.
2017-06-27 23:19:32 +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
atlimit8
4767b91037 Remove LoadUsing where FieldLoader.GetValue works for the dictionaries 2017-04-19 09:51:06 -05:00
Paul Chote
da5a725458 Add support for per-source and total external condition caps. 2017-02-18 19:10:22 +00:00
reaperrr
a8f7b0e2de Add TargetDamageWarhead
Only deals damage to the actor that was targeted by the carrying
projectile.

Currently only supported by InstantHit projectile.
2017-01-30 21:22:06 +01:00
Paul Chote
255214e77c Fix timed external conditions being rejected instead of reset. 2017-01-26 22:52:26 +00:00
reaperrr
7e3e950b5d Fix air explosions leaving smudges
LeaveSmudgeWarhead now only spawns smudges if the explosion happened at or below a certein altitude.
2017-01-01 17:14:31 +01:00
Taryn Hill
43317e0f5d Update copyright notice year to 2017 2016-12-31 23:46:13 -06:00
Paul Chote
f360c10569 Rename ConditionManager variables. 2016-12-23 15:02:52 +00:00
Paul Chote
dcad5c3f7c Rename UpgradeManager to ConditionManager. 2016-12-23 14:57:56 +00:00
Paul Chote
9ddfdc45b3 Introduce SoundType enum. 2016-12-23 11:34:23 +00:00
Paul Chote
764401be10 Port GrantUpgradeWarhead to GrantExternalConditionWarhead. 2016-12-06 17:21:13 +00:00
reaperrr
7235835280 Move ImpactType to Common.Warhead 2016-10-20 20:31:38 +02:00
Paul Chote
365bd5b9bd Rename ResourceType trait fields for consistency. 2016-09-25 17:04:18 +01:00
Zimmermann Gyula
cf8fff2b99 Remove passing the warheads from DamageWarhead to AttackInfo.
Added a Damage class to pass damage value and damage(types) instead.
This removes a great amount of overhead and longterm opens possibilities to have damagetypes without warheads.
2016-07-12 10:09:49 +02:00
reaperrr
4b1e243df3 Make smudges not spawn or grow when cell contains invalid target
This can be used to prevent smudges to spawn below buildings, vehicles etc.
2016-07-07 20:51:21 +02:00
reaperrr
51b88bfbaf Remove Explosion effect and use SpriteEffect instead 2016-05-23 23:30:49 +02:00