Commit Graph

296 Commits

Author SHA1 Message Date
Chris Forbes
dcf93203ea Get rid of unit pathing delay completely 2018-07-26 13:19:31 +01:00
Paul Chote
01c3c14a4c Add ITransformActorInitModifier.
Remove hardcoded Cargo reference from Transform.
2018-07-22 13:45:37 +01:00
reaperrr
6984c0ec10 Add AlwaysConsiderTurnAsMove plumbing to Mobile
Can be used to make walker units like the TS mechs display move animations while turning on the spot.
2018-07-19 22:09:43 +02:00
reaperrr
4c239d4ebc Set Mobile.IsMoving to "true" if queueing a turn that takes only a single tick
At the end of L-turns, actors often end up with an internal facing not 100% matching the direction of the next cell on their path.
As a result, if they haven't reached their destination yet, Move queues a quick Turn as ChildActivity, which previously was not considered as IsMoving.
However, we don't want those mini-turns to interrupt move animations, so we now consider them a move as well. Additionally, to avoid any issues, we make these mini-turns non-interruptible, just like the MovePart activities already are.
2018-07-01 15:33:30 +01:00
reaperrr
e167d1f848 Add plumbing to make Turn uninterruptible 2018-07-01 15:33:30 +01:00
reaperrr
c93333a816 Cache IFacing in Turn activity
Instead of looking it up every tick.
2018-07-01 15:33:30 +01:00
reaperrr
96377a99c4 Fix losing a tick when next Move.ChildActivity is Turn
While the first tick of the MoveFirstHalf child would run at the parent Move tick (see 2nd-to-last line in Move.Tick), this was not the case for Turn.
As a result, this Move tick would get wasted if a Turn was necessary, which at least contibuted to that visible jerk at the end of each L-turn (actors usually don't have the exact facing needed for the next move at the end of an L-turn).
2018-07-01 15:33:30 +01:00
Paul Chote
1ac13de4b2 Remove byte order marks from C# files. 2018-07-01 11:08:32 +02:00
Paul Chote
8c0f4fde81 Fix newlines in C# files. 2018-07-01 11:08:32 +02:00
Paul Chote
10aaa8eea8 Cancel Rearm activity when the host goes away.
This also ensures that the first reload tick always
takes the correct amount of time.
2018-05-30 18:17:37 +02:00
teinarss
dcc11c7a41 Added HpPerStep to Repairable for enable repair speed to be changed per unit. 2018-05-14 19:56:35 +02:00
GSonderling
bf4dbd9b80 Added checks to make sure cash can't be < 0. 2018-05-07 19:47:41 +02:00
reaperrr
5364515004 Don't pass movement class via IsPassable directly
Let IsPassable get that info from the locomotor instead.
2018-05-03 10:49:21 +02:00
reaperrr
81343926b6 Split Locomotor trait from Mobile
Add GrantConditionOn*Layer traits

This allows to
- drop some booleans from Locomotor
- drop a good part of the subterranean- and jumpjet-specific code/hacks from Mobile
- grant more than 1 condition per layer type (via multiple traits)
- easily add more traits of this kind for other layers
2018-05-03 10:49:21 +02:00
reaperrr
3069bbfa7d Fix infinite loop in HeliReturnToBase
This can happen if HeliAttack tells the heli to return to base when the player doesn't have any of the RearmBuildings available, because the activity queues itself after the HRTB, and the latter will, after a forced land, then queue back HeliAttack, which then immediately queues back HRTB and so on.

Instead, we now assume that if there is no base to return to, going to NextActivity is pointless and don't queue NextActivity.
RTB was likely ordered by HeliAttack due to lack of ammo, so resuming the attack would be pointless.
2018-03-22 22:50:50 +01:00
DESKTOP-7PLKRFC\jur_1
311cd521e3 Refinery spawned harvesters should prioritize lower ore #14827 2018-03-11 00:50:55 +01:00
Arular101
8a60918841 Update copyright notice year to 2018 2018-01-17 00:47:34 +01:00
Arular101
24b7f7a23f Cast to long to avoid overflow when multiplying by the health (part 2) 2018-01-13 17:32:34 +01:00
Arular101
30acee38c9 Cast to long to avoid overflow when multiplying by the health 2018-01-13 17:32:34 +01:00
Andrii Yukhymchak
11db40a2b3 Fixed issue with unit ready when capturing 2018-01-01 12:52:47 +00:00
Unknown
4be593123d add me (jongleur1983) to AUTHORS
#14558: MovingToRefinery takes actor instead of CPos

DeliveryOffset (previously added by the harvester) is now taken into account by the AutoCarryable
fix whitespaces
2017-12-25 03:52:44 +01:00
Paul Chote
30cafcbc25 Use Util.AdjacentCells to determine ExternalCapture validity.
This matches the set of cells targeted by MoveAdjacentTo.
2017-12-18 07:47:15 +00:00
GSonderling
488cec64b8 Added support for filtering exits by production type. 2017-12-13 04:08:52 +01:00
reaperrr
9ad0d78cdd Make the AI only consider harvesters 'idle' if last resource search failed
Otherwise the AI would consider the harvester 'idle' in too many situations.
This way, the AI now only uses its own resource search algorithm if the next resource patch is too far away for the FindResources activity to find it.
2017-12-11 01:55:18 +01:00
Paul Chote
b898b5001a Rename AttackBase.IsAttacking to IsAiming to make its uses and assumptions clear. 2017-11-26 15:58:00 +01:00
Paul Chote
ea05221180 Count AttackStatus.NeedsToTurn as valid for AttackBase.IsAttacking. 2017-11-26 15:58:00 +01:00
Forcecore
c762453607 (External)Capturable are now conditional 2017-11-15 13:54:15 +02: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
Forcecore
d49c98ce18 Move activity implementation now uses ChildActivity 2017-11-12 19:46:05 +01:00
Mustafa Alperen Seki
8914227811 Add ShowTicks to sellable 2017-11-04 17:16:26 +01:00
Paul Chote
1376ad674e Remove Player.CanViewActor and .CanTargetActor. 2017-11-03 09:56:00 +01:00
reaperrr
db2d432c39 Fix Helis facing target center instead of attacked position 2017-10-16 14:25:03 +02:00
Forcecore
18c6fe09db Sound and Animation support for DonateCash 2017-10-06 18:07:18 +02:00
Forcecore
b86d632c8c Land activity now lets the actor to land midair
Midair, at the altitude of the target actor.
2017-09-24 15:03:20 +02:00
Matthias Mailänder
0018bf3063 Add start and stop repair overlay animation support. 2017-09-24 11:43:49 +01:00
Mustafa Alperen Seki
c0b8bb3fcf Add Generals Pilot Logic 2017-09-14 23:26:10 +02:00
gwenzek
11a990e352 check if target is alive 2017-09-14 23:19:28 +02:00
gwenzek
7721d0b328 add a "capturing" condition for ExternalCapture 2017-09-14 23:19:28 +02:00
abcdefg30
71f2026b32 Remove the hardcoded cloak reference from activities 2017-09-13 21:18:21 +02:00
Paul Chote
e3212d1e64 Move the IMove interface to Mods.Common. 2017-09-10 18:36:39 +02:00
reaperrr
5d58374962 Remove FlyCircleTimed activity
A FlyCircle overload is sufficient.
2017-08-31 18:03:59 +02:00
reaperrr
c9ff362ea2 Add TakeOffOnCreation and TakeOffOnResupply to Aircraft
Before this, it was impossible to replicate the behavior of the original games (staying on pad/airfield after reload) without hacking around in Mods.Common.
This allows modders to disable these without meddling with code.
2017-08-31 18:03:59 +02: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
Mustafa Alperen Seki
f7983692ae Make Captures Upgradeable 2017-08-21 13:06:00 +02:00
reaperrr
eb5fb5abba Allow skipping 'sell'/undeploy anim for actors that TransformOnCapture 2017-08-17 22:03:42 +01:00
Paul Chote
4e493f265f Revert TicksBeforePathing move from Mobile to Move.
This partially reverts commit 11c8cda0c38ad0ac71c58557d34480925307cebd.
2017-08-13 13:31:58 +02:00
Paul Chote
dd709a2679 Revert "Have some activities count as idle activities"
This reverts commit ae111248f3.
2017-08-10 12:22:28 +02: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