Commit Graph

32 Commits

Author SHA1 Message Date
abcdefg30
700d141c24 Make AutoTargetIgnore upgradeable 2017-02-27 00:36:00 +01:00
RoosterDragon
6a0b993fa2 Remove attackBases member from AutoTarget.
We can use the activeAttackBases member everywhere.
2017-01-25 18:29:33 +00:00
RoosterDragon
9c59d7e255 Avoid delegate allocation in AutoTarget.
Extract a common method for deciding if an attack should happen, and avoid LINQ inside this method.
2017-01-19 20:23:52 +00:00
RoosterDragon
2239d6c88e Cache activeAttackBases query in AutoTarget. 2017-01-19 20:23:49 +00: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
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
6089599b3f Make AutoTarget handling of AttackFollow more robust
At least in theory, it's possible for an actor to have multiple AttackFollow traits, or AttackFollow is disabled initially but enabled via upgrade later.
To avoid crashes or other issues, let's play it safe and take the same approach as with AttackBase look-ups.
2016-05-23 20:28:02 +02:00
reaperrr
2a19f66a0e Make AutoTarget able to handle multiple Attack* traits 2016-05-23 20:28:02 +02:00
reaperrr
1b6f67e9ee Improve AutoTarget code readability 2016-05-23 20:28:02 +02:00
reaperrr
d5915431dd Made AutoTarget upgradable 2016-05-23 20:28:02 +02: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
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
RoosterDragon
7fbbaa2221 Optimize AutoTarget.ChooseTarget.
Avoid using LINQ for filtering, grouping and dictionary building. Instead, we do these ourselves to reduce overhead.

Actors are checked for AutoTargetIgnoreInfo (rather than the trait) since info checks are marginally faster. This check can now be done immediately to allow us to skip such actors right away.

The ClosestTo calculation is now only run on the group on actors for the selected armament, rather than all potential armaments.
2015-12-12 20:55:22 +00:00
RoosterDragon
487727c9d0 Optimize AutoTarget.ScanForTarget.
The currentTarget parameter is null at the only call site. Inlining it allows us to make some simplifications to the logic.
2015-12-12 20:55:20 +00:00
Michael Rätzel
51bb515a4d prevent allied units from autoattack building which is being captured. resolves #6170. 2015-11-11 14:32:38 +01:00
Pavel Penev
ab2c5ab43d Enable AutoTarget to aquire targets under fog if GPS is present 2015-11-10 22:50:22 +02:00
Oliver Brakmann
b096671acb Add an ActorInit for unit stances 2015-10-27 19:41:49 +01:00
Oliver Brakmann
1a879009f1 Change InitialStance to Defend for human players 2015-10-27 19:41:49 +01:00
Pavel Penev
8c7bdae617 Fix AutoTarget acquiring targets under fog/shroud 2015-10-23 00:27:42 +03:00
Pavel Penev
f68da6ada7 Small refactoring to AutoTarget
- Move a check for AutoTargetIgnore up the chain
 - Simplify some LINQs to a single .FirstOrDefault()
 - Rename local variable
2015-10-21 21:09:26 +03:00
Matija Hustić
2a0a7541ba Gets AttackMove to work with 'Defend' stance 2015-10-11 19:23:08 +02:00
Matija Hustić
d94c645046 First step in the attack mechanism's refactor.
Enabled firing multiple armaments at a target simultaneously.
Each armament defines own cursor for targeting.
The force attack modifier influences armament choice for target.
Autotargeting modified to handle firing multiple armaments simultaneously.
As a consequence, healers (medics) no longer require separate Heal
activity and AttackMedic and AutoHeal traits.
2015-10-06 01:46:55 +02:00
atlimit8
8162fa27ab Add ActorInfo.HasTraitInfo<T>() requiring ITraitInfo types 2015-09-19 09:49:24 -05:00
atlimit8
85fab45451 Remove Actor.HasTrait<T>() 2015-09-19 09:49:23 -05:00
Matthias Mailänder
7447e0bf93 rename WRange to WDist 2015-07-09 10:55:38 +02:00
Paul Chote
0677c309f3 Move Shroud.IsTargetable to Player. 2015-06-19 22:02:08 +01:00
Paul Chote
585a43fd8f Rename Actor.Destroy/Destroyed to Dispose/Disposed. 2015-05-29 19:08:38 +01:00
abcdefg30
8ca61aa917 Updated all year numbers 2015-01-09 21:18:05 +01:00
Matthias Mailänder
bc3acfeee7 StyleCop clean OpenRA.Game 2015-01-04 15:38:54 +01:00
reaperrr
654f56c5d5 Moves Attack, Armament, Move, Air traits and activities as well as anything required by them to Mods.Common.
Extracts Exit from Production into its own trait.
2015-01-04 05:24:28 +01:00