Commit Graph

198 Commits

Author SHA1 Message Date
Paul Chote
0e4cb53ada Pass contextual information to TargetOverridesSelection. 2019-10-30 14:53:23 +01:00
Paul Chote
ae34410c80 Replace MoveIntoWorld with ReturnToCell/AssociateWithAirfield. 2019-10-17 23:31:15 +02:00
Paul Chote
9b4d149a06 Revert "Suppress MoveIntoWorldInit for map-placed Mobile actors."
This reverts commit f0c28cc15334c7224630c375d669274f8da8fb31.
2019-10-17 23:31:15 +02:00
Paul Chote
5eaa99827d Suppress MoveIntoWorldInit for map-placed Mobile actors. 2019-10-07 19:02:48 +02:00
abcdefg30
56726a0533 Add an ICreationActivity interface 2019-10-06 14:42:50 +01:00
tovl
ac6431acf8 Clean up usage of CancelActivity. 2019-10-05 19:07:54 +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
tovl
4a609bbee8 Allow units to give way when path is blocked by oncoming unit. 2019-09-15 17:51:34 +01: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
reaperrr
07de3ba5e0 Change default preview facing to 96
92 is not a multiple of 8, and all sprite actors
in the official mods have at most 32 facings.
2019-08-27 22:59:22 +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
2d394f33b8 Fix units from transports appearing at load point. 2019-08-19 00:33:38 +02:00
Paul Chote
78302ea593 Rework aircraft rally point handling. 2019-08-15 17:02:27 +02:00
reaperrr
08db7586d4 Fix Enter cursor for non-TakeOffOnResupply
If the aircraft does not take off on resupply,
we allow it to enter resuppliers without ForceMove modifier.

ResolveOrder already handled this correctly, only the cursor
shown was wrong.
2019-08-13 02:26:21 +02:00
tovl
c0d5cd750d Add missing target lines. 2019-08-10 12:17:36 +02:00
reaperrr
7cfc65010f Fix that aircraft with TakeOffOnResupply can't force-land 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
4c3f2f3afa Fix aircraft allowing enter when it should not
Show "enter-blocked" cursor when resupply is not possible,
except when
-  the actor CanForceLand,
- does not TakeOffOnResupply,
- and has active ForceEnter modifier.
2019-07-23 17:01:41 +02:00
reaperrr
e7769357a8 Improve AircraftCanEnter readability 2019-07-23 17:01:41 +02: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
reaperrr
bfcdb3a8a2 Add IdleBehavior enum to Aircraft 2019-07-21 16:29:38 +02:00
reaperrr
d185f6e9f1 Remove AbortOnResupply from Aircraft again
This was accidentally re-added during a rebase in
a previous PR.
2019-07-21 16:29:38 +02:00
tovl
c5558e2145 Remove SequenceActivities. 2019-07-20 23:41:31 +02:00
tovl
ed18ecfcaf Allow explicit landing orders to be disabled in yaml. 2019-07-19 12:14:39 +02: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
a010c72780 Fixed comment typo in Aircraft 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
b9c302a73a Move ChildActivity handling into base Activity class. 2019-07-03 20:42:19 +02:00
tovl
5920de1384 Airborne transports only land to (un)load. 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
reaperrr
97084effac Improve Aircraft firstTick code
- Remove ReserveSpawnBuilding:
Only used in one place, and removing it
avoids a double GetActorBelow() look-up.

- Remove FallsToEarth check form Aircraft.firstTick:
Aircraft triggers UnReserve() on actor disposal,
so this work-around should no longer be necessary.
2019-06-09 11:24:07 +01:00
Paul Chote
ebe37a44ad Require force move for all undeploy-triggering orders. 2019-06-08 02:09:30 +02:00
reaperrr
8589e26dc2 Resolve rally point target on first run. 2019-06-07 22:18:33 +01:00
reaperrr
52ef5617d3 Clarify MaximumPitch and AltitudeVelocity descriptions
AltitudeVelocity is strictly only for vertical-only movement,
MaximumPitch is only for altitude changes during horizontal movement.
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
78a70be0d4 Fix and enable SA1133, SA1134 style rules. 2019-05-24 10:47:57 +02:00
reaperrr
7becbe6b14 Allow non-VTOL to LandOnCondition
Note: This might still break in unexpected ways,
since non-VTOLs implicitly rely on ReturnToBase
to calculate the approach vector for them.
2019-05-17 18:51:21 +01: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
reaperrr
c24398e32c Repulsion performance optimizations
`cruising` is updated  on every position change,
so we can safely re-use it instead of
performing another DAT check.
Additionally, if repulsion force is
horizontally zero, it's guaranteed to be WVec.Zero,
so we can save that conversion too.
2019-05-09 19:00:07 +02:00
reaperrr
ad4c0e6dee Remove HeliFlyCircle activity
FlyCircle actually works fine for D2k Carryalls,
and no other place used this.
2019-05-01 20:50:10 +01:00