Make RepairsUnits pausable-conditional
This commit is contained in:
@@ -9,11 +9,9 @@
|
|||||||
*/
|
*/
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
using OpenRA.Traits;
|
|
||||||
|
|
||||||
namespace OpenRA.Mods.Common.Traits
|
namespace OpenRA.Mods.Common.Traits
|
||||||
{
|
{
|
||||||
public class RepairsUnitsInfo : TraitInfo<RepairsUnits>
|
public class RepairsUnitsInfo : PausableConditionalTraitInfo
|
||||||
{
|
{
|
||||||
[Desc("Cost in % of the unit value to fully repair the unit.")]
|
[Desc("Cost in % of the unit value to fully repair the unit.")]
|
||||||
public readonly int ValuePercentage = 20;
|
public readonly int ValuePercentage = 20;
|
||||||
@@ -30,7 +28,12 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
|
|
||||||
[Desc("Experience gained by the player owning this actor for repairing an allied unit.")]
|
[Desc("Experience gained by the player owning this actor for repairing an allied unit.")]
|
||||||
public readonly int PlayerExperience = 0;
|
public readonly int PlayerExperience = 0;
|
||||||
|
|
||||||
|
public override object Create(ActorInitializer init) { return new RepairsUnits(this); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class RepairsUnits { }
|
public class RepairsUnits : PausableConditionalTrait<RepairsUnitsInfo>
|
||||||
|
{
|
||||||
|
public RepairsUnits(RepairsUnitsInfo info) : base(info) { }
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -105,7 +105,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
|
|
||||||
void AfterReachActivities(Actor self, Order order, IMove movement)
|
void AfterReachActivities(Actor self, Order order, IMove movement)
|
||||||
{
|
{
|
||||||
if (!order.TargetActor.IsInWorld || order.TargetActor.IsDead || order.TargetActor.IsDisabled())
|
if (!order.TargetActor.IsInWorld || order.TargetActor.IsDead || order.TargetActor.TraitsImplementing<RepairsUnits>().All(r => r.IsTraitDisabled))
|
||||||
return;
|
return;
|
||||||
|
|
||||||
// TODO: This is hacky, but almost every single component affected
|
// TODO: This is hacky, but almost every single component affected
|
||||||
|
|||||||
@@ -211,6 +211,7 @@ GAHPAD:
|
|||||||
PrimaryCondition: primary
|
PrimaryCondition: primary
|
||||||
Reservable:
|
Reservable:
|
||||||
RepairsUnits:
|
RepairsUnits:
|
||||||
|
PauseOnCondition: empdisable
|
||||||
PlayerExperience: 15
|
PlayerExperience: 15
|
||||||
ProductionBar:
|
ProductionBar:
|
||||||
WithIdleOverlay@PLATFORM:
|
WithIdleOverlay@PLATFORM:
|
||||||
@@ -258,6 +259,7 @@ GADEPT:
|
|||||||
MaxHeightDelta: 3
|
MaxHeightDelta: 3
|
||||||
Reservable:
|
Reservable:
|
||||||
RepairsUnits:
|
RepairsUnits:
|
||||||
|
PauseOnCondition: empdisable
|
||||||
PlayerExperience: 15
|
PlayerExperience: 15
|
||||||
RallyPoint:
|
RallyPoint:
|
||||||
Palette: mouse
|
Palette: mouse
|
||||||
|
|||||||
@@ -222,6 +222,7 @@ NAHPAD:
|
|||||||
PrimaryCondition: primary
|
PrimaryCondition: primary
|
||||||
Reservable:
|
Reservable:
|
||||||
RepairsUnits:
|
RepairsUnits:
|
||||||
|
PauseOnCondition: empdisable
|
||||||
PlayerExperience: 15
|
PlayerExperience: 15
|
||||||
ProductionBar:
|
ProductionBar:
|
||||||
WithIdleOverlay@PLATFORM:
|
WithIdleOverlay@PLATFORM:
|
||||||
|
|||||||
Reference in New Issue
Block a user