Commit Graph

244 Commits

Author SHA1 Message Date
reaperrr
ac44367440 Refactor Spin to MaximumSpinSpeed
Additionally, add descriptions to
other FallsToEarth properties.
2020-01-06 21:47:53 +00:00
reaperrr
4499343ed2 Make Aircraft actually pausable/disableable
This commit makes aircraft
- ignore any aircraft-specific orders while disabled
- show blocked move cursor while paused
- set speeds to zero while paused or disabled
2020-01-06 21:47:53 +00:00
reaperrr
4b006bc484 Make Aircraft PausableConditional
Note: This commit only does the minimum changes
to implement PausableConditional, there are no
logic changes yet (like disabling movement on PauseOnCondition).
2020-01-06 21:47:53 +00:00
abcdefg30
23b3c237b7 Update the year numbers in all license headers to 2020 2020-01-05 17:00:34 +00:00
abcdefg30
1e138a9774 Drop invisible invalid targets immediately when changing stance 2019-12-14 17:17:36 +01:00
reaperrr
ee00954f2e Replace AmmoPool lookup methods with properties
And gave the more suitable names while at it.
This is more in line with how we do things in
other places.
2019-11-20 15:45:41 +01:00
Paul Chote
69970d42f3 Prevent movement pausing at invalid position. 2019-10-19 13:11:00 +02:00
Abdurrahmaan Iqbal
763e6d8109 Fix #17229: Refactor ReturnToBase.cs 2019-10-17 10:28:43 +02:00
tovl
33d089a9d6 Fix lastVisibleTarget not being set in FlyAttack and AttackActivity. 2019-10-14 01:22:04 +02:00
tovl
145b6a05a3 Refactor unreserve actions. 2019-09-26 18:39:44 +02:00
tovl
5787f74af9 Prevent bogus attackmove on take-off. 2019-09-26 18:39:44 +02:00
reaperrr
801f5ba525 Rename FlyCircle to FlyIdle and make it tick TickIdle
It now handles both hovering and circling aircraft, for consistency.
2019-09-01 16:38:44 +02:00
tovl
ed8abe9861 Define nearenough parameter for aircraft so they can exit movement early when stuck. 2019-08-23 13:54:58 +02:00
tovl
70459b311e Refactor FlyAttack to make strafing runs interruptible when target becomes invalid. 2019-08-18 12:50:20 +02:00
Paul Chote
78302ea593 Rework aircraft rally point handling. 2019-08-15 17:02:27 +02:00
reaperrr
b7d966f78f Don't exit FlyOffMap immediately on leaving map
Usually they'll get removed afterwards, so they need to be
out of players' sight before ending this activity.
2019-08-11 16:28:42 +02:00
reaperrr
64780fc865 Fix ProductionAirdrop aircraft removal timing
...when leaving map before finishing TakeOff.
2019-08-11 16:28:42 +02:00
tovl
c0d5cd750d Add missing target lines. 2019-08-10 12:17:36 +02:00
reaperrr
969be686a3 Fix aircraft with TakeOffOnResupply not taking off
...after auto-resupply.
2019-08-09 09:45:40 +02: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
e662f17f06 Fix that VTOLs can ignore TurnToDock/-Land
When already at horizontal target position, no Turn was queued.
2019-07-23 16:17:18 +02:00
reaperrr
bfcdb3a8a2 Add IdleBehavior enum to Aircraft 2019-07-21 16:29:38 +02:00
tovl
a38c2d9aae Allow ReturnToBase to exit if actor does not land at building. 2019-07-19 12:19:15 +02:00
tovl
d59b01597a Always clear requested targets when exiting AttackActivity/Flyattack. 2019-07-18 23:14:56 +01:00
reaperrr
cf4d73ab91 Revert FlightDynamics
This needs more thought and most parts might get superseded
by other approaches.

Kept CanSlide separation from CanHover.
2019-07-18 10:26:43 +02:00
reaperrr
5211eb25aa Improve handling of finished/cancelled Resupply 2019-07-15 23:48:54 +01:00
reaperrr
e4011b86ac Move AbortOnResupply to AttackAircraft
Additionally, if AbortOnResupply is set to 'true',
abort FlyAttack right away when queueing ReturnToBase.
2019-07-15 23:48:54 +01:00
reaperrr
0ebeb30880 Replace various Aircraft fields with FlightDynamics
Replaces various booleans with a FlightDynamics flag list.
2019-07-05 00:03:36 +02:00
tovl
985020b4ad Simplify special exits of several acitivities. 2019-07-03 20:42:19 +02:00
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
tovl
71a035315c Prevent infinite loop between FlyAttack and ReturnToBase. 2019-06-30 18:04:43 +02:00
tovl
76422933f6 Allow forced landing on helipads and enforce takeoff otherwise. 2019-06-30 18:04:43 +02:00
tovl
79a48765d9 Allow VTOLs to land with force-move 2019-06-30 18:04:43 +02:00
tovl
8e5875453a Improve Carryall behaviour and integration with Aircraft. 2019-06-30 18:04:43 +02:00
tovl
adecd4ca87 Overhaul Land activity:
- Landing on an actor is no longer blocked by the underlying terrain
- Land in a nearby cell if the requested location is blocked
- Internally manages the fixed-wing landing sequence
- ProductionAirdrop transport waits until the exit is free before landing
2019-06-30 18:04:43 +02:00
Paul Chote
8f7426f579 Reduce duplication around AttackFollow's targets. 2019-06-29 23:28:23 +02:00
reaperrr
db0c6d88bf Fix AbortOnResupply not working
Going by yaml rules, all(!) aircraft in the shipping
mods should be aborting any previous activities
on resupply. None actually did, due to this bug.
2019-06-20 15:01:30 +01: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
reaperrr
8589e26dc2 Resolve rally point target on first run. 2019-06-07 22:18:33 +01:00
reaperrr
ac08f24828 Make aircraft move to CruiseAltitude on new order 2019-06-07 22:18:33 +01:00
reaperrr
ce3d7c98ad Refactor TakeOff
- Make it self-contained by moving actual take-off
  from 'Fly' to this
- Make 'moveToRallyPoint' a simple boolean
- Make AttackMove to rally point a child activity
- Make TakeOff uninterruptible
2019-06-07 22:18:33 +01:00
reaperrr
4f8f8cfb9d Merge HeliFly into Fly 2019-06-07 22:18:33 +01:00
reaperrr
5698ea0910 Remove HeliFlyAndLandWhenIdle
Already obsolete, as aircraft with CanHover do properly become idle
and land when LandOnIdle is set to 'true'.
They currently need VTOL too, but all CanHover-aircraft
in the shipping mods have that and it will be fixed soon as well.
2019-06-07 22:18:33 +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
reaperrr
0c2666b97e Streamline Land activity
Removed some redundant parameters, some redundant overloads
and made Land always consider LandAltitude relative to target.
2019-05-17 18:51:21 +01:00
reaperrr
14bd5ada1a Merge HeliLand into Land activity 2019-05-17 18:51:21 +01:00
tovl
0b747ba927 Rework Carryall drop-off queueing and ordering. 2019-05-12 19:06:52 +02:00