Commit Graph

2512 Commits

Author SHA1 Message Date
Paul Chote
9e18ec7314 Simplify ScreenMap bounds checking. 2017-12-11 19:45:07 +01:00
reaperrr
85c5259361 Fix AI crashing when trying to make parachuted harvester search map for resources while mid-air 2017-12-11 01:55:18 +01:00
reaperrr
b5ffe17d60 Make AI skip harvester orders if map has no resources 2017-12-11 01:55:18 +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
RoosterDragon
ec84b61316 Reduce memory required in MovementClassDomainIndex
The number of distinct domains on a map is often dozens, or at most hundreds. We can use a ushort to represent this easily, and reduce the size of the backing storage required to track domain indicies over the whole map.
2017-12-11 01:41:07 +01:00
RoosterDragon
5338784e45 Fix bad uses of FirstEnabledTraitOrDefault on TraitInfos.
These are not traits so this method does not work. We can use EnabledByDefault on the ConditionalTraitInfo instead.
2017-12-10 13:39:24 +00:00
RoosterDragon
7a7eed4fb7 Add FirstEnabledTraitOrDefault helper method.
This avoids the allocations caused by LINQ when using traits.FirstOrDefault(Exts.IsTraitEnabled). This is important in FrozenActorLayer.RefreshState which is called very often. We apply the new helper method to all areas using the old pattern. An overload that takes an array allows arrays to be enumerated without causing allocations.
2017-12-10 13:39:24 +00:00
RoosterDragon
62ab6ae6f1 OccupiedCells and TargetableCells must return arrays, not just enumerables.
This allows callers to efficiently enumerate these returned collections without the allocation and overhead imposed by the IEnumerable interface. All implementations were already returning arrays, so this only required a signature change.
2017-12-07 20:39:30 +02:00
Paul Chote
8fea476a0d Fix NRE when ProvidesPrerequisite is defined on the player actor. 2017-11-26 19:51:46 +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
Marwan
8a38c6ef23 WithTextDecoration Fix 2017-11-26 15:35:50 +01:00
Paul Chote
855042894c Fix bogus cached PowerState for map placed actors. 2017-11-26 03:37:33 +01:00
reaperrr
5ec3ad0957 Fix turrets following target even if AttackTurreted is disabled or paused 2017-11-25 03:55:56 +02:00
reaperrr
456d32f3eb Make Attack* traits PausableConditional and replace IsDisabled with IsTraitDisabled checks 2017-11-25 03:55:56 +02:00
reaperrr
68487d1197 Replace turret IsDisabled check with AT.IsTraitDisabled check 2017-11-25 03:55:56 +02:00
reaperrr
cea2658f31 Remove IsDisabled from AffectsShroud traits
Makes them only disableable via conditions.
2017-11-25 03:55:56 +02:00
reaperrr
ede6d5a57d Remove Actor.IsDisabled check from Cloak
Makes cloaking only disableable via conditions.
2017-11-25 03:55:56 +02:00
reaperrr
56b6aabbb8 Use new IAutoRenderSize for determining actor render bounds 2017-11-21 01:00:09 +02:00
reaperrr
5a596d27c9 Switch RenderNameTag to use SelectionOverlayBounds 2017-11-21 01:00:09 +02:00
reaperrr
be290cfabd Split Actor.Bounds into RenderBounds and SelectableBounds
Additionally, internally renamed VisualBounds to SelectionOverlayBounds to avoid confusion with RenderBounds.

This step was necessary to prevent actors with selectable area smaller than their graphics to be removed too early from ScreenMap even though part of the graphics should still be visible.
RA cruisers were a prime example, but to a lesser extent several other actors were affected as well.

This separation also serves as preparation to determine the final RenderBounds from multiple source bounds later, to fix the remaining ScreenMap issues (building 'bibs', aircraft shadows).
2017-11-21 01:00:09 +02:00
Mustafa Alperen Seki
ca1448c7ba Add Support of Types for GivesBuildableArea 2017-11-20 16:17:13 +02:00
Paul Chote
4cbc2ee6f3 Add support for custom sell cursors. 2017-11-19 23:40:33 +01:00
Andre Mohren
25968ee66f Allow WithIdleOverlayInfo to render while the actor is being build. 2017-11-19 16:52:59 +00:00
Forcecore
c762453607 (External)Capturable are now conditional 2017-11-15 13:54:15 +02:00
reaperrr
a7620c97f0 Some internal renamings in power-related traits 2017-11-13 03:09:05 +02:00
reaperrr
917c6884ed Make WithSpriteBody a pausable trait
Allowing to drop the PauseAnimationWhenDisabled property (in favor of using PausOnCondition).
2017-11-13 03:09:05 +02:00
reaperrr
786a0eb07f Refactor PowerManager and RequiresPower to use conditions
Instead of Actor.IsDisabled.
Added INotifyPowerLevelChanged interface to do so as efficiently as possible.
2017-11-13 03:09:05 +02:00
reaperrr
6c02e3f2b7 Refactor CanPowerDown to provide a condition instead of triggering IsDisabled 2017-11-13 03:09:05 +02:00
reaperrr
d602ec6485 Rename SelfReloads to AutoReloads 2017-11-12 19:48:06 +00:00
reaperrr
18c371d702 Changed AmmoCondition to support condition stacking 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
ef878c6aeb Introduced CaptureTypes for TransformOnCapture 2017-11-12 18:14:30 +00:00
Mustafa Alperen Seki
ba50fbba18 Dont show refund text if Sellable: trait is disabled. 2017-11-05 16:22:42 +02:00
Forcecore
4c78a05081 ADD GrantConditionOnAttack Trait
Useful for making Gattling weapons (Yuri's Revenge and C&C Generals) or
Boris (RA2) / Natasha (RA3) call for airstrike.
2017-11-04 17:18:24 +01:00
Mustafa Alperen Seki
8914227811 Add ShowTicks to sellable 2017-11-04 17:16:26 +01:00
Paul Chote
d2f0e5ac2d Replace Allow(Allies|Neutral|Enemies) with ValidStances enum. 2017-11-04 16:08:58 +01:00
Paul Chote
1caf982c1f Support multiple capture types on Capturable. 2017-11-04 16:08:58 +01:00
Paul Chote
1376ad674e Remove Player.CanViewActor and .CanTargetActor. 2017-11-03 09:56:00 +01:00
Paul Chote
47634b25f9 Remove IFogVisibilityModifier. 2017-11-03 09:56:00 +01:00
kosti1
6a750d7a65 Added buildradius checkbox to lobby options 2017-11-01 18:18:41 +01:00
Paul Chote
b8326bfead Fix crash with AllyRepair on dead structures. 2017-10-26 18:48:41 +03:00
Paul Chote
5f9a67ed87 Migrate frozen actors from ExtraData to Target. 2017-10-26 18:48:41 +03:00
Andre Mohren
aadfcdac66 Allow RallyPoint cursor to be defined via Yaml 2017-10-26 01:28:42 +02:00
abcdefg30
cba7c60f6f Fix the "Unit Ready" notification playing erroneously 2017-10-25 22:43:35 +01:00
Paul Chote
cfac996438 Generalize factionVariant to a TypeDictionary of Inits. 2017-10-22 03:32:21 +03:00
Matthias Mailänder
ebb982789e Display a blocked cursor when not allowed to MoveIntoShroud. 2017-10-16 14:38:26 +02:00
Matthias Mailänder
b27289106d Don't give an okay voice when not allowed to move into shroud. 2017-10-16 14:38:26 +02:00
Matthias Mailänder
d4340fa799 Add a MoveIntoShroud switch to AttackMove as well. 2017-10-16 14:38:26 +02:00
Paul Chote
d967c564a2 Remove TargetActor and TargetLocation from order issuing. 2017-10-15 19:07:46 +02:00