Commit Graph

45 Commits

Author SHA1 Message Date
tovl
3790169db9 Make Tick return bool 2019-07-03 20:42:19 +02:00
tovl
b9c302a73a Move ChildActivity handling into base Activity class. 2019-07-03 20:42:19 +02:00
Paul Chote
8f7426f579 Reduce duplication around AttackFollow's targets. 2019-06-29 23:28:23 +02:00
reaperrr
c8a42cbce2 Introduce AirAttackType
Aircraft attack behavior (currently FlyBy or Hover)
is now controlled via this instead of the CanHover boolean.
2019-06-10 12:43:34 +02:00
reaperrr
979ed1b140 Merge HeliAttack into FlyAttack
And polish CanHover FlyAttack behavior:

- Get rid of direct TickFacing usage
- Fix that the CanHover facing/altitude update would override
  TakeOff child of Fly
- Streamline the queueing of child activities
- Get rid of a direct FlyTick in favor of relying on Fly activity
- Pull queueing of TakeOff out of the if-else
2019-06-08 17:07:18 +01:00
Paul Chote
3ca9d4b773 Drop targets when switching to a more restrictive stance. 2019-05-21 15:52:55 +02:00
Paul Chote
44c5d38a0e Disable AutoTarget if targeting a persistent fallback. 2019-05-19 13:23:01 +02:00
tovl
9abf715fd7 Allow opportunity fire for aircraft. 2019-05-04 23:40:16 +02:00
tovl
f16ff9eaa0 Base AttackAircraft on AttackFollow and get rid of SequenceActivities. 2019-05-04 23:40:16 +02:00
tovl
a17cd0fa06 Replaced Canceled state with Canceling state. 2019-03-09 21:47:43 +00:00
tovl
8191a6566b Add missing self and optional pretick parameters to Queue, QueueChild and PrintActivity methods.
This means sequenceActivities needs to accept self as well.
2019-03-09 21:47:43 +00:00
Paul Chote
ab4a7e3558 Replace System.Drawing primitives with our own. 2019-03-04 18:26:42 +00:00
Paul Chote
8efa0da54d Fix target invalidation and reacquisition in (Fly|Heli)Attack. 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
abcdefg30
cadbd0d9ab Change the year number in all cs headers from 2018 to 2019 2019-01-26 23:15:21 +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
reaperrr
e42094625d Merge AttackPlane and AttackHeli into AttackAircraft 2018-11-03 11:37:23 +00:00
reaperrr
8f1d8a67cc Remove RearmBuildings from Aircraft and Minelayer
In favor of using Rearmable trait.
2018-11-02 22:28:08 +00:00
Arular101
8a60918841 Update copyright notice year to 2018 2018-01-17 00:47:34 +01:00
reaperrr
d602ec6485 Rename SelfReloads to AutoReloads 2017-11-12 19:48:06 +00:00
reaperrr
8b7a71685c Remove AmmoPool-awareness from Armament 2017-11-12 19:48:06 +00:00
reaperrr
6f95080aa4 Add ReloadAmmoPool and adapt AmmoPool
Refactored and simplified Rearm activity.
Uses local Reload now.

Removed AmmoPool.SelfReloads.
2017-11-12 19:48:06 +00: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
Jean-Rémy Buchs
1d1802a163 Add LandOnCondition to the trait Aircraft which triggers a landing and prevents takeoffs while the condition is met 2017-08-08 15:13:50 -05:00
Oliver Brakmann
9b0780e87c Make FlyAttack use child activities 2017-01-22 20:41:41 +01:00
Taryn Hill
43317e0f5d Update copyright notice year to 2017 2016-12-31 23:46:13 -06:00
Oliver Brakmann
2c66ee8c13 Add native support for uninterruptible activities
This pattern occurs a few times throughout the code, so it makes sense to bake it into the Activity class itself.
2016-10-31 18:46:27 +01:00
Paul Chote
34b10dcb77 Hack around the Lua API. 2016-09-26 17:48:25 +01:00
Oliver Brakmann
7f64495d6f Make aircraft continue attack on same target after re-arming 2016-09-04 21:31:05 +02:00
Oliver Brakmann
e7d07e5a01 Fix FlyAttack not calling TakeOff for landed aircraft 2016-09-04 21:31:05 +02:00
PedroFerreiraRamos
958e35d61f Fix air unit resupply #5966 2016-07-12 20:17:45 -03: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
0039a2bdbf Split out an ActivityUtils class. 2016-01-19 23:34:13 +00:00
RoosterDragon
8e89a6a696 Simplify names, remove unused usings, remove redundant casts. 2016-01-17 21:35:36 +00:00
pevers
6ed0273656 Actors will lose targets and AI won't follow indefinitely 2015-06-28 19:11:53 +02:00
Matthias Mailänder
723c2d82c8 fix a possible NRE 2015-05-31 15:58:55 +02:00
RoosterDragon
fb0cab7481 Cache results of TraitsImplementing calls.
If a class is caching the TraitsImplementing enumerable, instead cache the results of enumerating it to an array. The avoids having to enumerate the sequence each time it is needed.
2015-04-25 20:42:27 +01:00
Oliver Brakmann
b1d3486561 Expose Plane turn-to-attack delay to yaml 2015-04-04 00:10:06 +02:00
Oliver Brakmann
32ed63727d Revert "Expose Plane turn-to-attack delay to yaml."
This reverts commit 02da41e5c5.
2015-04-03 23:42:35 +02:00
Taryn Hill
02da41e5c5 Expose Plane turn-to-attack delay to yaml.
Require Plane in some ctors.
2015-04-01 00:12:20 -05:00
reaperrr
1e9d1a6cb7 Cache trait look-ups in the constructor where possible for Air activities/traits 2015-03-27 13:47:04 +01:00
reaperrr
38d5163062 Refactors LimitedAmmo to AmmoPool.
Removes Reloads trait.

This enables adding multiple AmmoPools via @ differentiators and
Name which adds the possibility to assign each armament to a specific
ammo pool.

Furthermore, this moves all Reloads functionality onto AmmoPool.

Now a combination of all three is possible on a single actor: no limited
ammo, limited ammo that can reload on its own, and limited ammo which
needs to be reloaded at a rearm actor.

Additionally moves RearmSound from Minelayer to AmmoPool.
2015-03-26 23:21:01 +01:00
abcdefg30
8ca61aa917 Updated all year numbers 2015-01-09 21:18:05 +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