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
This commit is contained in:
@@ -68,7 +68,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
}
|
||||
}
|
||||
|
||||
bool ICustomMovementLayer.EnabledForActor(ActorInfo a, MobileInfo mi) { return enabled; }
|
||||
bool ICustomMovementLayer.EnabledForActor(ActorInfo a, LocomotorInfo li) { return enabled; }
|
||||
byte ICustomMovementLayer.Index { get { return CustomMovementLayerType.Tunnel; } }
|
||||
bool ICustomMovementLayer.InteractsWithDefaultLayer { get { return false; } }
|
||||
|
||||
@@ -77,12 +77,12 @@ namespace OpenRA.Mods.Common.Traits
|
||||
return cellCenters[cell];
|
||||
}
|
||||
|
||||
int ICustomMovementLayer.EntryMovementCost(ActorInfo a, MobileInfo mi, CPos cell)
|
||||
int ICustomMovementLayer.EntryMovementCost(ActorInfo a, LocomotorInfo li, CPos cell)
|
||||
{
|
||||
return portals.Contains(cell) ? 0 : int.MaxValue;
|
||||
}
|
||||
|
||||
int ICustomMovementLayer.ExitMovementCost(ActorInfo a, MobileInfo mi, CPos cell)
|
||||
int ICustomMovementLayer.ExitMovementCost(ActorInfo a, LocomotorInfo li, CPos cell)
|
||||
{
|
||||
return portals.Contains(cell) ? 0 : int.MaxValue;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user