Commit Graph

272 Commits

Author SHA1 Message Date
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
reaperrr
bc0d8ca015 Remove ResupplyAircraft and AllowYieldingReservation
The few extra things those two activities did can be done
in Resupply, making them redundant.
2019-04-29 01:40:52 +01:00
reaperrr
ba4b5738d7 Merge Rearm and Repair into Resupply activity
Allows parallel rearming and repairing.
2019-04-29 01:40:52 +01:00
BGluth
55aa346ad7 Aircraft can now scatter 2019-04-22 22:04:51 +02:00
tovl
560f8c26bc Add crushing logic to aircraft. 2019-04-22 02:56:57 +02:00
tovl
c633e07410 Make aircraft occupy cells when landed. 2019-04-22 02:56:57 +02:00
reaperrr
840eb7006d Make actors ignore ReturnToBase order if already on resupplier 2019-04-13 18:47:08 +02:00
reaperrr
717b8a24f1 Fix ReturnToBase restarting on each hotkey press
Now that the RTB process is a single activity with childs,
it's relatively easy to prevent the activity from restarting
every time the deploy/RTB hotkey is pressed.
2019-04-13 18:47:08 +02:00
reaperrr
b24e4510c8 Make aircraft without TakeOffOnResupply always land
on resupplier, even if ammo is full, when given a
"ReturnToBase" order via deploy key.
In other words, in that case treat the RTB order like an
explicit "Repair" or "Enter" order.
2019-04-13 18:47:08 +02:00
reaperrr
2cdae0b380 Merge HeliReturnToBase into ReturnToBase 2019-04-13 18:47:08 +02:00
tovl
25bc3ae2d2 Fix chinook being unable to land. 2019-03-31 18:25:14 +02:00
reaperrr
a10af382b4 Add plumbing for notifying traits of movement
More precisely, about start and stop of movement.
2019-03-30 16:24:47 +00:00
reaperrr
32ab822786 Fix ResupplyAircraft being cancelable by Stop command
It is now immediately queued again, as long as the actor
has not finished rearming/repairing yet.
2019-03-30 16:44:04 +01:00
reaperrr
b92aef5754 Make Aircraft.GetActorBelow() LandAltitude-aware 2019-03-30 16:44:04 +01:00
reaperrr
3211119027 Simplify ResupplyAircraft
By moving part of the take-off prevention (when TakeOffOnResupply
is set to false) to Aircraft.

Main reason & advantage is that dropping the 'WaitFor' child
makes this activity always end when resupplies are done,
which makes it more compatible with being queued as ChildActivity
itself (for example by ReturnToBase).
2019-03-30 16:44:04 +01:00
tovl
e2e4caf0ba Make Aircraft.OnBecomingIdle accesible. 2019-03-22 19:02:05 +01:00
tovl
64cec4a0ad Revise AttackMoveActivity. 2019-03-22 19:02:05 +01:00
reaperrr
5ec47b47af Rename fields on Repairable traits
To bring them in line with RearmActors,
Repairable.RepairBuildings and
RepairableNear.Buildings have been renamed
to RepairActors.
Additionally, their RA-specific internal
defaults were removed and the FieldLoader
now requires them to be set explicitly.
2019-03-10 19:19:49 +01: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
reaperrr
2ac9d92ce7 Remove some legacy activity cruft from Aircraft
You only need to look at the RTB activities to tell that
Aircraft doing its own stuff here was somewhat redundant
and just made things worse regarding debugging and
code consistency.
2019-03-09 12:12:51 +00:00
Paul Chote
ab4a7e3558 Replace System.Drawing primitives with our own. 2019-03-04 18:26:42 +00:00
Paul Chote
cd92e94d74 Remove Order.TargetLocation from Aircraft. 2019-03-04 18:08:42 +00:00
tovl
dc9c758f12 unreserve when not queued 2019-02-22 21:48:34 +00:00
tovl
2975738477 make ReturnToBase order queueable 2019-02-22 21:48:34 +00:00
portablestew
a49287cc97 Possible fix for #14102: Consider airfield available if already reserved for the same actor 2019-02-15 13:59:53 +01:00
Paul Chote
70f4c51a17 Add AttackMove workaround for Aircraft. 2019-01-27 00:19:50 +00:00
Paul Chote
2080c72ab9 Define plumbing to pass initial target positions to inner move activities. 2019-01-26 22:53:46 +00:00