Commit Graph

178 Commits

Author SHA1 Message Date
Paul Chote
0bfc487999 Fix target invalidation and reacquisition in AttackFollow. 2019-01-26 22:53:46 +00:00
Paul Chote
d03c5b1c48 Split Target.Recalculate into methods with and without invalidation.
TargetExtensions is moved into its own file.
2019-01-26 22:53:46 +00:00
Paul Chote
b2d960ec19 Pass target line color to inner move activities. 2019-01-26 22:53:46 +00:00
abcdefg30
cadbd0d9ab Change the year number in all cs headers from 2018 to 2019 2019-01-26 23:15:21 +01:00
abcdefg30
9c4cb9091e Change the setter of AttackBase.IsAiming to be public 2018-12-29 19:21:54 +01:00
Paul Chote
c34dd4b824 Allow Attack activities to target FrozenActors directly.
Removing the legacy FrozenActor to Actor workaround
fixes a number of long-standing bugs.

This also prevents units from losing their target when
it transforms into a different actor type.
2018-12-17 22:19:26 +01:00
Paul Chote
2ac7e451b4 Remove AttackBase.IgnoresVisibility.
This was a workaround for D2K sandworms, which is
now implemented using a custom attack activity.
2018-12-17 22:19:26 +01:00
Andre Mohren
b1a44086a0 Removed unused using directives. 2018-11-17 17:23:22 +00:00
Paul Chote
e77aaa1a47 Remove (INotify)BuildComplete from Attack* 2018-11-03 15:09:14 +01:00
Mustafa Alperen Seki
abdb1f7547 Add TargetTypes to AttackSuicides 2018-09-30 14:34:14 +02:00
Paul Chote
0a507f3d33 Allow deploy orders to be queued from the command bar. 2018-09-10 19:42:24 +02:00
reaperrr
0bff9e9119 Make some Attack* methods/classes public
Instead of protected, because some 3rd-party mods rely on these being
public.
2018-07-28 21:35:42 +02:00
Chris Forbes
d4ef841678 Convert masses of HashSet<string> to BitSet<DamageType> 2018-07-28 20:12:42 +01:00
reaperrr
bd38fe4926 Add INotifyAiming interface
And trigger notifications from Attack* traits.
2018-06-03 12:23:54 +01: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
Mustafa Alperen Seki
065eb78afc Make AttackSuicides coditional 2018-02-06 03:10:15 +01:00
Paul Chote
2fccfdf1ee Add support for disabling IIssueDeployOrders. 2018-01-28 18:06:30 +01:00
Arular101
8a60918841 Update copyright notice year to 2018 2018-01-17 00:47:34 +01:00
Paul Chote
86bfe28ade Add ScreenBounds method to IRender interface.
This method is expected to return Rectangles that cover
the region where Renderables returned by Render may exist.
2017-12-11 19:45:07 +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
456d32f3eb Make Attack* traits PausableConditional and replace IsDisabled with IsTraitDisabled checks 2017-11-25 03:55:56 +02:00
reaperrr
68487d1197 Replace turret IsDisabled check with AT.IsTraitDisabled check 2017-11-25 03:55:56 +02:00
reaperrr
8b7a71685c Remove AmmoPool-awareness from Armament 2017-11-12 19:48:06 +00:00
Paul Chote
5f9a67ed87 Migrate frozen actors from ExtraData to Target. 2017-10-26 18:48:41 +03:00
Paul Chote
d967c564a2 Remove TargetActor and TargetLocation from order issuing. 2017-10-15 19:07:46 +02:00
reaperrr
28e1f391e0 Make ITick require explicit implementation 2017-09-16 15:51:37 +02:00
reaperrr
c75e64a952 Properly account for disabled Armaments in various places
These places didn't care if an Armament was disabled, which could lead to unexpected behavior.
2017-08-22 20:55:46 +01:00
reaperrr
951ee2210c Consider disabled armaments invalid 2017-08-22 20:55:46 +01:00
abcdefg30
7156c2c09d Add the missing base implementation to AttackFrontal's RulesetLoaded 2017-08-17 19:28:51 +02:00
forcecore
d1328212c6 AttackFrontal's FacingTolerance is now in effect 2017-08-07 10:26:26 +02:00
reaperrr
94fa24088b Add dedicated TDGunboat traits
And get rid of Mobile.OnRails hack.
2017-07-23 15:06:03 +02:00
reaperrr
0a1083e554 Merge the Valid(...)Weapons methods 2017-06-24 11:24:17 +01:00
reaperrr
33e8bf9928 Adapt Attack logic to Weapon.TargetActorCenter 2017-06-24 11:24:17 +01:00
reaperrr
da7433a95f Add plumbing for targeting of target center instead of closest targetable position
Note: Projectiles that can track their target need minor additional changes, but for InstantHit (which already implemented support for this) and unguided projectiles (Bullet, GravityBomb) this commit is already sufficient.
2017-06-15 01:32:37 +02:00
Paul Chote
e8d6d63707 Add IIssueDeployOrder. 2017-06-06 08:53:54 -06:00
reaperrr
6a212eea53 Make attacking actors/turrets face the targeted position 2017-06-05 14:22:47 +02:00
Markus Hartung
f7ddb969c6 Change so Attack* calls Created on base class 2017-06-04 17:11:44 +02:00
Paul Chote
45b13dabfb Explicitly implement interfaces in AttackBase. 2017-05-29 06:27:19 -05:00
Paul Chote
34844e87a3 Replace Lazy trait lookups with INotifyCreated. 2017-05-29 06:27:19 -05:00
atlimit8
4917c6e453 Merge pull request #12924 from reaperrr/fix-tunnel-atk
Prevent units in tunnels/underground from attacking
2017-04-29 00:25:23 -05:00
reaperrr
1fae993593 Prevent attacking while in tunnel/underground 2017-04-27 17:50:02 +02:00
MartinCurwen
ea6e1fdd64 Multiple armament check fix in AttackGarrisoned 2017-04-19 17:40:14 +01:00
Paul Chote
a9cfbd9ad7 Fix Obelisk not dropping targets when they move out of range. 2017-03-10 19:42:15 +00:00
Paul Chote
a52ea71c62 Add AttackCharges trait for TD and TS obelisks. 2017-02-11 16:19:58 +00:00
Paul Chote
a8d46adb2d Rename tesla attack logic and move to Mods.Cnc. 2017-02-11 16:19:58 +00:00
abcdefg30
19549a9068 Fix null being passed through the INotifyAttack interface 2017-01-29 11:07:20 +01:00
Taryn Hill
43317e0f5d Update copyright notice year to 2017 2016-12-31 23:46:13 -06:00
Paul Chote
268ed016ab Rename UpgradableTrait to ConditionalTrait. 2016-12-23 23:28:34 +00:00
Paul Chote
9ddfdc45b3 Introduce SoundType enum. 2016-12-23 11:34:23 +00:00