Commit Graph

81 Commits

Author SHA1 Message Date
Paul Chote
0e4cb53ada Pass contextual information to TargetOverridesSelection. 2019-10-30 14:53:23 +01:00
tovl
4a609bbee8 Allow units to give way when path is blocked by oncoming unit. 2019-09-15 17:51:34 +01:00
tovl
5393b689d4 Disable preemptive targeting for queued orders. 2019-08-10 19:10:45 +01:00
tovl
b7a7b7aa7e Revise target line colours to distinguish different attack types. 2019-08-05 02:53:09 +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
reaperrr
30c2e6b4d2 Remove Resupply re-queueing hack from Aircraft
By preventing that other traits can remotely cancel Resupply
or ReturnToBase.
2019-07-21 16:29:38 +02:00
Paul Chote
ff9db0bf7a Reset RequestedTargets that are cancelled before the first attack tick. 2019-06-29 23:28:23 +02:00
Paul Chote
1b026b7e20 Disable out-of-range non-force targeting for deployed units. 2019-06-08 02:09:30 +02:00
Paul Chote
78a70be0d4 Fix and enable SA1133, SA1134 style rules. 2019-05-24 10:47:57 +02:00
tovl
9abf715fd7 Allow opportunity fire for aircraft. 2019-05-04 23:40:16 +02:00
Lars Beckers
e6750bf19c Fix attack behaviour of disabled units. 2019-04-20 02:28:27 +02:00
Paul Chote
ab4a7e3558 Replace System.Drawing primitives with our own. 2019-03-04 18:26:42 +00:00
Paul Chote
0464a0db58 Remove unused negativeDamage variable from AttackBase. 2019-02-01 23:18:18 +00:00
Paul Chote
ab6dd3dcf2 Add ForceFireIgnoresActors to AttackBase. 2019-01-28 00:14:27 +01:00
Paul Chote
dc40a973e3 Allow attack orders to preempt move completion for turreted units. 2019-01-27 15:21:13 +01: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
Paul Chote
e77aaa1a47 Remove (INotify)BuildComplete from Attack* 2018-11-03 15:09:14 +01: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
reaperrr
bd38fe4926 Add INotifyAiming interface
And trigger notifications from Attack* traits.
2018-06-03 12:23:54 +01:00
Arular101
8a60918841 Update copyright notice year to 2018 2018-01-17 00:47:34 +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
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
951ee2210c Consider disabled armaments invalid 2017-08-22 20:55:46 +01: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
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
reaperrr
1fae993593 Prevent attacking while in tunnel/underground 2017-04-27 17:50:02 +02: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
reaperrr
c8012baffb Make all Attack* traits listen to Stop order 2016-07-02 16:02:00 +02:00
reaperrr
27993729be Make attack cursor smarter
Rather than simply taking the first valid armament, regardless of available ammo and regardless of which valid armament has the highest range, the attack cursor is now chosen a) by whether the armament has ammo and b) by which valid armament has the highest range.
2016-06-23 15:09:11 +02:00
reaperrr
4f55b088eb Check if weapon without self-reloading is out of ammo when deciding validity
This should prevent attacking helicopters (or other actors) staying at the range to target of a weapon that is out of ammo and needs manual reloading at a RearmBuilding or via upgrades.
2016-06-23 14:47:41 +02:00
reaperrr
2f1a6e8807 Add maximum and minimum range vs. target checks
This adresses the issue that actors would ignore the validity of weapons when deciding the attack distance versus a target. This could result in actors staying out of range of a weapon valid versus target if they carried a weapon with higher range but invalid versus target.
2016-06-16 20:39:45 +02:00
Paul Chote
acab6f1f4b Fix custom order generators for left-click targeting. 2016-04-09 11:59:54 -04: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
Paul Chote
5f4ca605bd Merge pull request #10420 from Mailaender/revert-fixAttack
Revert "Don't attack actors that you can't see"
2016-01-23 12:45:55 +00:00
RoosterDragon
8e89a6a696 Simplify names, remove unused usings, remove redundant casts. 2016-01-17 21:35:36 +00:00
Matthias Mailänder
aa9ef48737 Revert "Don't attack actors that you can't see"
This reverts commit d235ea3a52.
2016-01-04 23:02:03 +01:00
RoosterDragon
adc7e902e3 Speed up AutoTarget.ChooseTarget among groups of allied units.
Most auto target scans will be conducted among groups of allied units unable to target each other because they are allied and their weapons only target enemies. Since they cannot target each other, the scan will be repeated constantly. Realising this, we can significantly reduce the performance impact of auto target scanning by bailing early in this scenario to avoid carrying out expensive targeting checks on friendly units which we know will fail anyway.
2016-01-04 07:07:26 +00:00
Matthias Mailänder
b289478123 Merge pull request #10189 from reaperrr/less-lazy1
AttackBase and Armament optimizations
2015-12-25 14:04:46 +01:00