Commit Graph

87 Commits

Author SHA1 Message Date
Paul Chote
d52ba83f96 Replace terniary null checks with coalescing. 2021-03-08 18:11:25 +01:00
teinarss
4a1e4f3e16 Use expression body syntax 2021-03-07 13:00:52 +00:00
Paul Chote
fb0031d34a Rename remaining Stance references to PlayerRelationship. 2021-02-04 23:14:09 +01:00
Paul Chote
db2fded24d Fix AutoTarget.ChooseTarget ignoring AttackBase.TargetFrozenActors. 2021-01-21 19:25:07 +01:00
abcdefg30
aac3174efc Rename Stances to Relationships in the yaml api 2020-12-11 17:13:02 +01:00
Paul Chote
77ffc20a5f Convert Attack*.FacingTolerance to WAngle. 2020-11-30 16:39:48 +01:00
abcdefg30
10f645bf77 Replace usage of the Stances dict by a method call 2020-11-14 11:04:41 +00:00
abcdefg30
eda9966d27 Rename Stance to PlayerRelationship 2020-11-14 11:04:41 +00:00
teinarss
13581c030d Use in parameter for Target 2020-11-06 22:02:24 +01:00
abcdefg30
ad3722e19f Add support for circumventing the target scan limit in AttackMove 2020-09-12 00:30:33 +02:00
teinarss
27f1a7ab27 Use out var syntax 2020-08-19 18:11:07 +01:00
Andre Mohren
006a87692a Removed unused imports. 2020-07-28 18:22:51 +02:00
Paul Chote
c6c3a8c60d Make ActorPreview and EditorActorPreview wrap ActorReference. 2020-06-19 17:57:56 +02:00
Paul Chote
b856613194 Add ISingleInstanceInit interface.
Inits that are logically singletons (e.g. actor
location or owner) should implement this interface
to avoid runtime inconsistencies.

Duplicate instances are rejected at init-time,
allowing simpler queries when they are used.
2020-06-19 17:57:56 +02:00
Paul Chote
6adf45bcb4 Convert IFacing.Facing and TurnSpeed to WAngle. 2020-06-12 18:35:41 +02:00
Paul Chote
b38018af9c Replace IActorInit with an abstract class.
A shared ValueActorInit<T> is introduced to reduce duplication
in the most common init cases, and an ActorInitActorReference
allow actors to be referenced by map.yaml name.
2020-06-08 19:18:38 +02:00
Paul Chote
7c6ec577dc Rewrite ActorInit queries. 2020-05-28 19:04:53 +02:00
atlimit8
259c8d2c98 Merge ConditionManager trait directly into Actor 2020-05-09 15:46:11 +02:00
Paul Chote
4a6fefa434 Disable idle scanning on RA planes. 2020-03-02 22:22:56 +01:00
Paul Chote
16e0ea611e Revert "Fix AttackFollow ignoring allowMove flag when auto-targeting."
This reverts commit 3e116060cfc0a3e46563716c3e594a4ba3051b93.
2020-03-02 22:22:56 +01:00
Paul Chote
28f7604172 Reset nextScanTime only when actually scanning for targets. 2020-02-22 16:30:07 +01:00
Paul Chote
ab196a23e6 Fix AttackFollow ignoring allowMove flag when auto-targeting. 2020-02-14 17:30:38 +01:00
Paul Chote
51870a471a Add AttackSource enum. 2020-01-18 16:38:53 +01:00
abcdefg30
23b3c237b7 Update the year numbers in all license headers to 2020 2020-01-05 17:00:34 +00:00
abcdefg30
905e02b765 Prevent a crash in AutoTarget.HasValidTargetPriority 2019-12-14 17:17:36 +01:00
abcdefg30
a586f10875 Don't allow movement for actors without IMove
However, this does not check if any existing IMove traits are enabled.
2019-11-08 23:31:59 +01:00
abcdefg30
980c0c9cd4 Fix actors returning fire at invisible attackers 2019-11-08 23:31:59 +01:00
Turupawn
3240b1e9eb Overhaul target line rendering:
- Targets are now defined by the activities
- Queued activities are shown
- Support custom attack colors
2019-08-05 02:53:09 +01:00
Paul Chote
6eaf615798 Fix conditional traits that incorrectly override INotifyCreated. 2019-07-14 00:41:59 +02:00
Paul Chote
78a70be0d4 Fix and enable SA1133, SA1134 style rules. 2019-05-24 10:47:57 +02:00
Paul Chote
3ca9d4b773 Drop targets when switching to a more restrictive stance. 2019-05-21 15:52:55 +02:00
Paul Chote
62b5d22e53 Add INotify(Activity)StanceChanged interfaces. 2019-05-21 15:52:55 +02:00
Paul Chote
55f6744cf3 Replace IPreventsAutoTarget with IDisable(Enemy)AutoTarget.
This allows traits on the attacking unit to suppress auto targeting
and makes the distinction between the two interfaces clear.
2019-05-19 13:23:01 +02:00
tovl
9abf715fd7 Allow opportunity fire for aircraft. 2019-05-04 23:40:16 +02:00
Mustafa Alperen Seki
e7b8a56511 Add ValidStances to AutoTargetPriority. 2019-04-04 19:08:10 +02:00
tovl
64cec4a0ad Revise AttackMoveActivity. 2019-03-22 19:02:05 +01:00
Paul Chote
ab4a7e3558 Replace System.Drawing primitives with our own. 2019-03-04 18:26:42 +00:00
Paul Chote
012b17b974 Implement a secondary target-of-opportunity for AttackFollow. 2019-02-03 18:07:02 +01:00
matjaeck
b466b5d660 Reset unit stance on owner change. 2019-02-03 16:20:24 +01:00
Paul Chote
0bfc487999 Fix target invalidation and reacquisition in AttackFollow. 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
Paul Chote
5f79c31a57 Add AutoTarget support for FrozenActors. 2018-12-17 22:19:26 +01:00
Paul Chote
4723e5ddb9 Expose common actor Inits in the map editor. 2018-12-08 22:53:13 +01:00
Paul Chote
f6768fe624 Remove legacy editor actor properties plumbing. 2018-12-08 22:53:13 +01:00
reaperrr
7d695f0c8f Fix actors in ReturnFire stance following targets
On bleed, if AllowMovement is true actors with ReturnFire will actually follow the acquired target, unlike in Defend stance.
This is at least unintuitive, since ReturnFire is expected to be more passive than Defend.
2018-11-18 16:19:50 +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
RoosterDragon
0555ce9321 Reduce allocations in AutoTarget.ChooseTarget.
- Cache active target query.
- Prefer .Count == 0 over Any when working with Lists.
- Use helper for GetEnabledTargetTypes.
- Don't declare target variable until actually needed.
2018-03-21 01:08:59 -03:00
Arular101
8a60918841 Update copyright notice year to 2018 2018-01-17 00:47:34 +01:00
Paul Chote
1376ad674e Remove Player.CanViewActor and .CanTargetActor. 2017-11-03 09:56:00 +01:00
reaperrr
83afcc3448 Some misc explicit interfaces
Just a by-product from a previous commit, not meant to do anything specific other than bringing us a tiny step closer to requiring explicit implementations for these interfaces too, at some point.
2017-09-16 15:51:37 +02:00