Merge pull request #12996 from atlimit8/RemoveIDisable-part2
Remove IDisable - part 2
This commit is contained in:
@@ -88,7 +88,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
|||||||
var pos = world.Map.CenterOfCell(cell);
|
var pos = world.Map.CenterOfCell(cell);
|
||||||
var range = attack.GetMaximumRange().LengthSquared;
|
var range = attack.GetMaximumRange().LengthSquared;
|
||||||
|
|
||||||
return instance.Instances.Where(i => !i.Self.IsDisabled()).MinByOrDefault(a => (a.Self.CenterPosition - pos).HorizontalLengthSquared).Self;
|
return instance.Instances.Where(i => !i.IsTraitPaused).MinByOrDefault(a => (a.Self.CenterPosition - pos).HorizontalLengthSquared).Self;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsValidTarget(World world, CPos cell)
|
bool IsValidTarget(World world, CPos cell)
|
||||||
@@ -96,7 +96,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
|||||||
var pos = world.Map.CenterOfCell(cell);
|
var pos = world.Map.CenterOfCell(cell);
|
||||||
var range = attack.GetMaximumRange().LengthSquared;
|
var range = attack.GetMaximumRange().LengthSquared;
|
||||||
|
|
||||||
return world.Map.Contains(cell) && instance.Instances.Any(a => !a.Self.IsDisabled() && (a.Self.CenterPosition - pos).HorizontalLengthSquared < range);
|
return world.Map.Contains(cell) && instance.Instances.Any(a => !a.IsTraitPaused && (a.Self.CenterPosition - pos).HorizontalLengthSquared < range);
|
||||||
}
|
}
|
||||||
|
|
||||||
IEnumerable<Order> IOrderGenerator.Order(World world, CPos cell, int2 worldPixel, MouseInput mi)
|
IEnumerable<Order> IOrderGenerator.Order(World world, CPos cell, int2 worldPixel, MouseInput mi)
|
||||||
@@ -122,7 +122,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
|||||||
|
|
||||||
IEnumerable<IRenderable> IOrderGenerator.RenderAboveShroud(WorldRenderer wr, World world)
|
IEnumerable<IRenderable> IOrderGenerator.RenderAboveShroud(WorldRenderer wr, World world)
|
||||||
{
|
{
|
||||||
foreach (var a in instance.Instances.Where(i => !i.Self.IsDisabled()))
|
foreach (var a in instance.Instances.Where(i => !i.IsTraitPaused))
|
||||||
{
|
{
|
||||||
yield return new RangeCircleRenderable(
|
yield return new RangeCircleRenderable(
|
||||||
a.Self.CenterPosition,
|
a.Self.CenterPosition,
|
||||||
|
|||||||
@@ -101,18 +101,18 @@ namespace OpenRA.Mods.Cnc.Traits
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool NoActiveRadar { get { return !self.World.ActorsHavingTrait<ProvidesRadar>(r => !r.IsTraitDisabled).Any(a => a.Owner == self.Owner); } }
|
bool NoActiveRadar { get { return !self.World.ActorsHavingTrait<ProvidesRadar>(r => !r.IsTraitDisabled).Any(a => a.Owner == self.Owner); } }
|
||||||
bool wasDisabled;
|
bool wasPaused;
|
||||||
|
|
||||||
void ITick.Tick(Actor self)
|
void ITick.Tick(Actor self)
|
||||||
{
|
{
|
||||||
if (!wasDisabled && (self.IsDisabled() || (info.RequiresActiveRadar && NoActiveRadar)))
|
if (!wasPaused && (IsTraitPaused || (info.RequiresActiveRadar && NoActiveRadar)))
|
||||||
{
|
{
|
||||||
wasDisabled = true;
|
wasPaused = true;
|
||||||
RemoveGps(self);
|
RemoveGps(self);
|
||||||
}
|
}
|
||||||
else if (wasDisabled && !self.IsDisabled() && !(info.RequiresActiveRadar && NoActiveRadar))
|
else if (wasPaused && !IsTraitPaused && !(info.RequiresActiveRadar && NoActiveRadar))
|
||||||
{
|
{
|
||||||
wasDisabled = false;
|
wasPaused = false;
|
||||||
owner.GpsAdd(self);
|
owner.GpsAdd(self);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -53,6 +53,7 @@ namespace OpenRA.Mods.Common.Commands
|
|||||||
register("all", "toggles all cheats and gives you some cash for your trouble.");
|
register("all", "toggles all cheats and gives you some cash for your trouble.");
|
||||||
register("crash", "crashes the game.");
|
register("crash", "crashes the game.");
|
||||||
register("levelup", "adds a specified number of levels to the selected actors.");
|
register("levelup", "adds a specified number of levels to the selected actors.");
|
||||||
|
register("poweroutage", "causes owners of selected actors to have a 5 second power outage.");
|
||||||
}
|
}
|
||||||
|
|
||||||
public void InvokeCommand(string name, string arg)
|
public void InvokeCommand(string name, string arg)
|
||||||
@@ -123,6 +124,11 @@ namespace OpenRA.Mods.Common.Commands
|
|||||||
}
|
}
|
||||||
|
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case "poweroutage":
|
||||||
|
foreach (var player in world.Selection.Actors.Select(a => a.Owner.PlayerActor).Distinct())
|
||||||
|
world.IssueOrder(new Order("PowerOutage", player, false) { ExtraData = 250 });
|
||||||
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,23 +15,39 @@ using OpenRA.Traits;
|
|||||||
namespace OpenRA.Mods.Common.Traits
|
namespace OpenRA.Mods.Common.Traits
|
||||||
{
|
{
|
||||||
[Desc("Disables the actor when a power outage is triggered (see `InfiltrateForPowerOutage` for more information).")]
|
[Desc("Disables the actor when a power outage is triggered (see `InfiltrateForPowerOutage` for more information).")]
|
||||||
public class AffectedByPowerOutageInfo : ITraitInfo
|
public class AffectedByPowerOutageInfo : ConditionalTraitInfo
|
||||||
{
|
{
|
||||||
public object Create(ActorInitializer init) { return new AffectedByPowerOutage(init.Self); }
|
[GrantedConditionReference]
|
||||||
|
[Desc("The condition to grant while there is a power outage.")]
|
||||||
|
public readonly string Condition = null;
|
||||||
|
|
||||||
|
public override object Create(ActorInitializer init) { return new AffectedByPowerOutage(init.Self, this); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class AffectedByPowerOutage : INotifyOwnerChanged, ISelectionBar, IPowerModifier, IDisable
|
public class AffectedByPowerOutage : ConditionalTrait<AffectedByPowerOutageInfo>, INotifyOwnerChanged, ISelectionBar, INotifyCreated, INotifyAddedToWorld
|
||||||
{
|
{
|
||||||
PowerManager playerPower;
|
PowerManager playerPower;
|
||||||
|
ConditionManager conditionManager;
|
||||||
|
int token = ConditionManager.InvalidConditionToken;
|
||||||
|
|
||||||
public AffectedByPowerOutage(Actor self)
|
public AffectedByPowerOutage(Actor self, AffectedByPowerOutageInfo info)
|
||||||
|
: base(info)
|
||||||
{
|
{
|
||||||
playerPower = self.Owner.PlayerActor.Trait<PowerManager>();
|
playerPower = self.Owner.PlayerActor.Trait<PowerManager>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void INotifyAddedToWorld.AddedToWorld(Actor self) { UpdateStatus(self); }
|
||||||
|
protected override void TraitEnabled(Actor self) { UpdateStatus(self); }
|
||||||
|
protected override void TraitDisabled(Actor self) { Revoke(self); }
|
||||||
|
|
||||||
|
void INotifyCreated.Created(Actor self)
|
||||||
|
{
|
||||||
|
conditionManager = self.TraitOrDefault<ConditionManager>();
|
||||||
|
}
|
||||||
|
|
||||||
float ISelectionBar.GetValue()
|
float ISelectionBar.GetValue()
|
||||||
{
|
{
|
||||||
if (playerPower.PowerOutageRemainingTicks <= 0)
|
if (IsTraitDisabled || playerPower.PowerOutageRemainingTicks <= 0)
|
||||||
return 0;
|
return 0;
|
||||||
|
|
||||||
return (float)playerPower.PowerOutageRemainingTicks / playerPower.PowerOutageTotalTicks;
|
return (float)playerPower.PowerOutageRemainingTicks / playerPower.PowerOutageTotalTicks;
|
||||||
@@ -44,19 +60,30 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
|
|
||||||
bool ISelectionBar.DisplayWhenEmpty { get { return false; } }
|
bool ISelectionBar.DisplayWhenEmpty { get { return false; } }
|
||||||
|
|
||||||
int IPowerModifier.GetPowerModifier()
|
public void UpdateStatus(Actor self)
|
||||||
{
|
{
|
||||||
return playerPower.PowerOutageRemainingTicks > 0 ? 0 : 100;
|
if (!IsTraitDisabled && playerPower.PowerOutageRemainingTicks > 0)
|
||||||
|
Grant(self);
|
||||||
|
else
|
||||||
|
Revoke(self);
|
||||||
}
|
}
|
||||||
|
|
||||||
public bool Disabled
|
void Grant(Actor self)
|
||||||
{
|
{
|
||||||
get { return playerPower.PowerOutageRemainingTicks > 0; }
|
if (token == ConditionManager.InvalidConditionToken)
|
||||||
|
token = conditionManager.GrantCondition(self, Info.Condition);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Revoke(Actor self)
|
||||||
|
{
|
||||||
|
if (token != ConditionManager.InvalidConditionToken)
|
||||||
|
token = conditionManager.RevokeCondition(self, token);
|
||||||
}
|
}
|
||||||
|
|
||||||
void INotifyOwnerChanged.OnOwnerChanged(Actor self, Player oldOwner, Player newOwner)
|
void INotifyOwnerChanged.OnOwnerChanged(Actor self, Player oldOwner, Player newOwner)
|
||||||
{
|
{
|
||||||
playerPower = newOwner.PlayerActor.Trait<PowerManager>();
|
playerPower = newOwner.PlayerActor.Trait<PowerManager>();
|
||||||
|
UpdateStatus(self);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,7 @@
|
|||||||
*/
|
*/
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
using System;
|
||||||
using System.Collections.Generic;
|
using System.Collections.Generic;
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using OpenRA.Traits;
|
using OpenRA.Traits;
|
||||||
@@ -24,7 +25,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
public object Create(ActorInitializer init) { return new PowerManager(init.Self, this); }
|
public object Create(ActorInitializer init) { return new PowerManager(init.Self, this); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class PowerManager : ITick, ISync
|
public class PowerManager : ITick, ISync, IResolveOrder
|
||||||
{
|
{
|
||||||
readonly Actor self;
|
readonly Actor self;
|
||||||
readonly PowerManagerInfo info;
|
readonly PowerManagerInfo info;
|
||||||
@@ -140,11 +141,17 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
|
|
||||||
void UpdatePowerOutageActors()
|
void UpdatePowerOutageActors()
|
||||||
{
|
{
|
||||||
var actors = self.World.ActorsHavingTrait<AffectedByPowerOutage>()
|
var traitPairs = self.World.ActorsWithTrait<AffectedByPowerOutage>()
|
||||||
.Where(a => !a.IsDead && a.IsInWorld && a.Owner == self.Owner);
|
.Where(p => !p.Actor.IsDead && p.Actor.IsInWorld && p.Actor.Owner == self.Owner);
|
||||||
|
|
||||||
foreach (var a in actors)
|
foreach (var p in traitPairs)
|
||||||
UpdateActor(a);
|
p.Trait.UpdateStatus(p.Actor);
|
||||||
|
}
|
||||||
|
|
||||||
|
void IResolveOrder.ResolveOrder(Actor self, Order order)
|
||||||
|
{
|
||||||
|
if (devMode.Enabled && order.OrderString == "PowerOutage")
|
||||||
|
TriggerPowerOutage((int)order.ExtraData);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -21,9 +21,6 @@ namespace OpenRA.Mods.Common.Traits.Render
|
|||||||
|
|
||||||
public readonly int Interval = 750;
|
public readonly int Interval = 750;
|
||||||
|
|
||||||
[Desc("Pause when the actor is disabled. Deprecated. Use conditions instead.")]
|
|
||||||
public readonly bool PauseOnLowPower = false;
|
|
||||||
|
|
||||||
public override object Create(ActorInitializer init) { return new WithIdleAnimation(init.Self, this); }
|
public override object Create(ActorInitializer init) { return new WithIdleAnimation(init.Self, this); }
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -48,7 +45,6 @@ namespace OpenRA.Mods.Common.Traits.Render
|
|||||||
|
|
||||||
if (--ticks <= 0)
|
if (--ticks <= 0)
|
||||||
{
|
{
|
||||||
if (!(Info.PauseOnLowPower && self.IsDisabled()))
|
|
||||||
wsb.PlayCustomAnimation(self, Info.Sequences.Random(Game.CosmeticRandom), () => wsb.CancelCustomAnimation(self));
|
wsb.PlayCustomAnimation(self, Info.Sequences.Random(Game.CosmeticRandom), () => wsb.CancelCustomAnimation(self));
|
||||||
ticks = Info.Interval;
|
ticks = Info.Interval;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -18,7 +18,7 @@ using OpenRA.Traits;
|
|||||||
namespace OpenRA.Mods.Common.Traits.Render
|
namespace OpenRA.Mods.Common.Traits.Render
|
||||||
{
|
{
|
||||||
[Desc("Renders a decorative animation on units and buildings.")]
|
[Desc("Renders a decorative animation on units and buildings.")]
|
||||||
public class WithIdleOverlayInfo : ConditionalTraitInfo, IRenderActorPreviewSpritesInfo, Requires<RenderSpritesInfo>, Requires<BodyOrientationInfo>
|
public class WithIdleOverlayInfo : PausableConditionalTraitInfo, IRenderActorPreviewSpritesInfo, Requires<RenderSpritesInfo>, Requires<BodyOrientationInfo>
|
||||||
{
|
{
|
||||||
[Desc("Animation to play when the actor is created.")]
|
[Desc("Animation to play when the actor is created.")]
|
||||||
[SequenceReference] public readonly string StartSequence = null;
|
[SequenceReference] public readonly string StartSequence = null;
|
||||||
@@ -35,8 +35,6 @@ namespace OpenRA.Mods.Common.Traits.Render
|
|||||||
[Desc("Custom palette is a player palette BaseName")]
|
[Desc("Custom palette is a player palette BaseName")]
|
||||||
public readonly bool IsPlayerPalette = false;
|
public readonly bool IsPlayerPalette = false;
|
||||||
|
|
||||||
public readonly bool PauseOnLowPower = false;
|
|
||||||
|
|
||||||
public override object Create(ActorInitializer init) { return new WithIdleOverlay(init.Self, this); }
|
public override object Create(ActorInitializer init) { return new WithIdleOverlay(init.Self, this); }
|
||||||
|
|
||||||
public IEnumerable<IActorPreview> RenderPreviewSprites(ActorPreviewInitializer init, RenderSpritesInfo rs, string image, int facings, PaletteReference p)
|
public IEnumerable<IActorPreview> RenderPreviewSprites(ActorPreviewInitializer init, RenderSpritesInfo rs, string image, int facings, PaletteReference p)
|
||||||
@@ -72,7 +70,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public class WithIdleOverlay : ConditionalTrait<WithIdleOverlayInfo>, INotifyDamageStateChanged, INotifyBuildComplete, INotifySold, INotifyTransform
|
public class WithIdleOverlay : PausableConditionalTrait<WithIdleOverlayInfo>, INotifyDamageStateChanged, INotifyBuildComplete, INotifySold, INotifyTransform
|
||||||
{
|
{
|
||||||
readonly Animation overlay;
|
readonly Animation overlay;
|
||||||
bool buildComplete;
|
bool buildComplete;
|
||||||
@@ -84,8 +82,7 @@ namespace OpenRA.Mods.Common.Traits.Render
|
|||||||
var body = self.Trait<BodyOrientation>();
|
var body = self.Trait<BodyOrientation>();
|
||||||
|
|
||||||
buildComplete = !self.Info.HasTraitInfo<BuildingInfo>(); // always render instantly for units
|
buildComplete = !self.Info.HasTraitInfo<BuildingInfo>(); // always render instantly for units
|
||||||
overlay = new Animation(self.World, rs.GetImage(self),
|
overlay = new Animation(self.World, rs.GetImage(self), () => IsTraitPaused || !buildComplete);
|
||||||
() => (info.PauseOnLowPower && self.IsDisabled()) || !buildComplete);
|
|
||||||
if (info.StartSequence != null)
|
if (info.StartSequence != null)
|
||||||
overlay.PlayThen(RenderSprites.NormalizeSequence(overlay, self.GetDamageState(), info.StartSequence),
|
overlay.PlayThen(RenderSprites.NormalizeSequence(overlay, self.GetDamageState(), info.StartSequence),
|
||||||
() => overlay.PlayRepeating(RenderSprites.NormalizeSequence(overlay, self.GetDamageState(), info.Sequence)));
|
() => overlay.PlayRepeating(RenderSprites.NormalizeSequence(overlay, self.GetDamageState(), info.Sequence)));
|
||||||
|
|||||||
@@ -14,32 +14,29 @@ using OpenRA.Traits;
|
|||||||
namespace OpenRA.Mods.Common.Traits.Render
|
namespace OpenRA.Mods.Common.Traits.Render
|
||||||
{
|
{
|
||||||
[Desc("Replaces the building animation when it rearms a unit.")]
|
[Desc("Replaces the building animation when it rearms a unit.")]
|
||||||
public class WithRearmAnimationInfo : ITraitInfo, Requires<WithSpriteBodyInfo>
|
public class WithRearmAnimationInfo : ConditionalTraitInfo, Requires<WithSpriteBodyInfo>
|
||||||
{
|
{
|
||||||
[Desc("Sequence name to use")]
|
[Desc("Sequence name to use")]
|
||||||
[SequenceReference] public readonly string Sequence = "active";
|
[SequenceReference] public readonly string Sequence = "active";
|
||||||
|
|
||||||
public readonly bool PauseOnLowPower = false;
|
public override object Create(ActorInitializer init) { return new WithRearmAnimation(init.Self, this); }
|
||||||
|
|
||||||
public object Create(ActorInitializer init) { return new WithRearmAnimation(init.Self, this); }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class WithRearmAnimation : INotifyRearm, INotifyBuildComplete, INotifySold
|
public class WithRearmAnimation : ConditionalTrait<WithRearmAnimationInfo>, INotifyRearm, INotifyBuildComplete, INotifySold
|
||||||
{
|
{
|
||||||
readonly WithRearmAnimationInfo info;
|
|
||||||
readonly WithSpriteBody spriteBody;
|
readonly WithSpriteBody spriteBody;
|
||||||
bool buildComplete;
|
bool buildComplete;
|
||||||
|
|
||||||
public WithRearmAnimation(Actor self, WithRearmAnimationInfo info)
|
public WithRearmAnimation(Actor self, WithRearmAnimationInfo info)
|
||||||
|
: base(info)
|
||||||
{
|
{
|
||||||
this.info = info;
|
|
||||||
spriteBody = self.TraitOrDefault<WithSpriteBody>();
|
spriteBody = self.TraitOrDefault<WithSpriteBody>();
|
||||||
}
|
}
|
||||||
|
|
||||||
void INotifyRearm.Rearming(Actor self, Actor target)
|
void INotifyRearm.Rearming(Actor self, Actor target)
|
||||||
{
|
{
|
||||||
if (buildComplete && spriteBody != null && !(info.PauseOnLowPower && self.IsDisabled()))
|
if (buildComplete && spriteBody != null && !IsTraitDisabled)
|
||||||
spriteBody.PlayCustomAnimation(self, info.Sequence, () => spriteBody.CancelCustomAnimation(self));
|
spriteBody.PlayCustomAnimation(self, Info.Sequence, () => spriteBody.CancelCustomAnimation(self));
|
||||||
}
|
}
|
||||||
|
|
||||||
void INotifyBuildComplete.BuildingComplete(Actor self)
|
void INotifyBuildComplete.BuildingComplete(Actor self)
|
||||||
|
|||||||
@@ -14,32 +14,29 @@ using OpenRA.Traits;
|
|||||||
namespace OpenRA.Mods.Common.Traits.Render
|
namespace OpenRA.Mods.Common.Traits.Render
|
||||||
{
|
{
|
||||||
[Desc("Replaces the building animation when it repairs a unit.")]
|
[Desc("Replaces the building animation when it repairs a unit.")]
|
||||||
public class WithRepairAnimationInfo : ITraitInfo, Requires<WithSpriteBodyInfo>
|
public class WithRepairAnimationInfo : ConditionalTraitInfo, Requires<WithSpriteBodyInfo>
|
||||||
{
|
{
|
||||||
[Desc("Sequence name to use")]
|
[Desc("Sequence name to use")]
|
||||||
[SequenceReference] public readonly string Sequence = "active";
|
[SequenceReference] public readonly string Sequence = "active";
|
||||||
|
|
||||||
public readonly bool PauseOnLowPower = false;
|
public override object Create(ActorInitializer init) { return new WithRepairAnimation(init.Self, this); }
|
||||||
|
|
||||||
public object Create(ActorInitializer init) { return new WithRepairAnimation(init.Self, this); }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class WithRepairAnimation : INotifyRepair, INotifyBuildComplete, INotifySold
|
public class WithRepairAnimation : ConditionalTrait<WithRepairAnimationInfo>, INotifyRepair, INotifyBuildComplete, INotifySold
|
||||||
{
|
{
|
||||||
readonly WithRepairAnimationInfo info;
|
|
||||||
readonly WithSpriteBody spriteBody;
|
readonly WithSpriteBody spriteBody;
|
||||||
bool buildComplete;
|
bool buildComplete;
|
||||||
|
|
||||||
public WithRepairAnimation(Actor self, WithRepairAnimationInfo info)
|
public WithRepairAnimation(Actor self, WithRepairAnimationInfo info)
|
||||||
|
: base(info)
|
||||||
{
|
{
|
||||||
this.info = info;
|
|
||||||
spriteBody = self.TraitOrDefault<WithSpriteBody>();
|
spriteBody = self.TraitOrDefault<WithSpriteBody>();
|
||||||
}
|
}
|
||||||
|
|
||||||
void INotifyRepair.Repairing(Actor self, Actor target)
|
void INotifyRepair.Repairing(Actor self, Actor target)
|
||||||
{
|
{
|
||||||
if (buildComplete && spriteBody != null && !(info.PauseOnLowPower && self.IsDisabled()))
|
if (buildComplete && spriteBody != null && !IsTraitDisabled)
|
||||||
spriteBody.PlayCustomAnimation(self, info.Sequence, () => spriteBody.CancelCustomAnimation(self));
|
spriteBody.PlayCustomAnimation(self, Info.Sequence, () => spriteBody.CancelCustomAnimation(self));
|
||||||
}
|
}
|
||||||
|
|
||||||
void INotifyBuildComplete.BuildingComplete(Actor self)
|
void INotifyBuildComplete.BuildingComplete(Actor self)
|
||||||
|
|||||||
@@ -16,7 +16,7 @@ using OpenRA.Traits;
|
|||||||
namespace OpenRA.Mods.Common.Traits.Render
|
namespace OpenRA.Mods.Common.Traits.Render
|
||||||
{
|
{
|
||||||
[Desc("Displays an overlay when the building is being repaired by the player.")]
|
[Desc("Displays an overlay when the building is being repaired by the player.")]
|
||||||
public class WithRepairOverlayInfo : ITraitInfo, Requires<RenderSpritesInfo>, Requires<BodyOrientationInfo>
|
public class WithRepairOverlayInfo : PausableConditionalTraitInfo, Requires<RenderSpritesInfo>, Requires<BodyOrientationInfo>
|
||||||
{
|
{
|
||||||
[Desc("Sequence name to use")]
|
[Desc("Sequence name to use")]
|
||||||
[SequenceReference] public readonly string Sequence = "active";
|
[SequenceReference] public readonly string Sequence = "active";
|
||||||
@@ -30,30 +30,28 @@ namespace OpenRA.Mods.Common.Traits.Render
|
|||||||
[Desc("Custom palette is a player palette BaseName")]
|
[Desc("Custom palette is a player palette BaseName")]
|
||||||
public readonly bool IsPlayerPalette = false;
|
public readonly bool IsPlayerPalette = false;
|
||||||
|
|
||||||
public readonly bool PauseOnLowPower = false;
|
public override object Create(ActorInitializer init) { return new WithRepairOverlay(init.Self, this); }
|
||||||
|
|
||||||
public object Create(ActorInitializer init) { return new WithRepairOverlay(init.Self, this); }
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public class WithRepairOverlay : INotifyDamageStateChanged, INotifyBuildComplete, INotifySold, INotifyRepair
|
public class WithRepairOverlay : PausableConditionalTrait<WithRepairOverlayInfo>, INotifyDamageStateChanged, INotifyBuildComplete, INotifySold, INotifyRepair
|
||||||
{
|
{
|
||||||
readonly Animation overlay;
|
readonly Animation overlay;
|
||||||
bool buildComplete;
|
bool buildComplete;
|
||||||
bool visible;
|
bool visible;
|
||||||
|
|
||||||
public WithRepairOverlay(Actor self, WithRepairOverlayInfo info)
|
public WithRepairOverlay(Actor self, WithRepairOverlayInfo info)
|
||||||
|
: base(info)
|
||||||
{
|
{
|
||||||
var rs = self.Trait<RenderSprites>();
|
var rs = self.Trait<RenderSprites>();
|
||||||
var body = self.Trait<BodyOrientation>();
|
var body = self.Trait<BodyOrientation>();
|
||||||
|
|
||||||
buildComplete = !self.Info.HasTraitInfo<BuildingInfo>(); // always render instantly for units
|
buildComplete = !self.Info.HasTraitInfo<BuildingInfo>(); // always render instantly for units
|
||||||
overlay = new Animation(self.World, rs.GetImage(self),
|
overlay = new Animation(self.World, rs.GetImage(self), () => IsTraitPaused);
|
||||||
() => info.PauseOnLowPower && self.IsDisabled());
|
|
||||||
overlay.PlayThen(info.Sequence, () => visible = false);
|
overlay.PlayThen(info.Sequence, () => visible = false);
|
||||||
|
|
||||||
var anim = new AnimationWithOffset(overlay,
|
var anim = new AnimationWithOffset(overlay,
|
||||||
() => body.LocalToWorld(info.Offset.Rotate(body.QuantizeOrientation(self, self.Orientation))),
|
() => body.LocalToWorld(info.Offset.Rotate(body.QuantizeOrientation(self, self.Orientation))),
|
||||||
() => !visible || !buildComplete,
|
() => IsTraitDisabled || !visible || !buildComplete,
|
||||||
p => RenderUtils.ZOffsetFromCenter(self, p, 1));
|
p => RenderUtils.ZOffsetFromCenter(self, p, 1));
|
||||||
|
|
||||||
rs.Add(anim, info.Palette, info.IsPlayerPalette);
|
rs.Add(anim, info.Palette, info.IsPlayerPalette);
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ using OpenRA.Traits;
|
|||||||
|
|
||||||
namespace OpenRA.Mods.Common.Traits
|
namespace OpenRA.Mods.Common.Traits
|
||||||
{
|
{
|
||||||
public abstract class SupportPowerInfo : ConditionalTraitInfo
|
public abstract class SupportPowerInfo : PausableConditionalTraitInfo
|
||||||
{
|
{
|
||||||
[Desc("Measured in seconds.")]
|
[Desc("Measured in seconds.")]
|
||||||
public readonly int ChargeTime = 0;
|
public readonly int ChargeTime = 0;
|
||||||
@@ -76,7 +76,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
public SupportPowerInfo() { OrderName = GetType().Name + "Order"; }
|
public SupportPowerInfo() { OrderName = GetType().Name + "Order"; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class SupportPower : ConditionalTrait<SupportPowerInfo>
|
public class SupportPower : PausableConditionalTrait<SupportPowerInfo>
|
||||||
{
|
{
|
||||||
public readonly Actor Self;
|
public readonly Actor Self;
|
||||||
readonly SupportPowerInfo info;
|
readonly SupportPowerInfo info;
|
||||||
|
|||||||
@@ -179,11 +179,6 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
prereqsAvailable = available;
|
prereqsAvailable = available;
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool InstanceDisabled(SupportPower sp)
|
|
||||||
{
|
|
||||||
return sp.Self.IsDisabled();
|
|
||||||
}
|
|
||||||
|
|
||||||
bool notifiedCharging;
|
bool notifiedCharging;
|
||||||
bool notifiedReady;
|
bool notifiedReady;
|
||||||
public void Tick()
|
public void Tick()
|
||||||
@@ -192,7 +187,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
if (!instancesEnabled)
|
if (!instancesEnabled)
|
||||||
RemainingTime = TotalTime;
|
RemainingTime = TotalTime;
|
||||||
|
|
||||||
Active = !Disabled && Instances.Any(i => !i.Self.IsDisabled());
|
Active = !Disabled && Instances.Any(i => !i.IsTraitPaused);
|
||||||
if (!Active)
|
if (!Active)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -224,7 +219,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
if (!Ready)
|
if (!Ready)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var power = Instances.FirstOrDefault();
|
var power = Instances.FirstOrDefault(i => !i.IsTraitPaused);
|
||||||
if (power == null)
|
if (power == null)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
@@ -236,7 +231,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
if (!Ready)
|
if (!Ready)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var power = Instances.Where(i => !InstanceDisabled(i))
|
var power = Instances.Where(i => !i.IsTraitPaused)
|
||||||
.MinByOrDefault(a =>
|
.MinByOrDefault(a =>
|
||||||
{
|
{
|
||||||
if (a.Self.OccupiesSpace == null)
|
if (a.Self.OccupiesSpace == null)
|
||||||
|
|||||||
@@ -601,6 +601,40 @@ namespace OpenRA.Mods.Common.UtilityCommands
|
|||||||
if (node.Key == "SoundFile" && parent.Key.StartsWith("AmbientSound", StringComparison.Ordinal))
|
if (node.Key == "SoundFile" && parent.Key.StartsWith("AmbientSound", StringComparison.Ordinal))
|
||||||
RenameNodeKey(node, "SoundFiles");
|
RenameNodeKey(node, "SoundFiles");
|
||||||
|
|
||||||
|
// PauseOnLowPower property has been replaced with PauseOnCondition/RequiresCondition
|
||||||
|
if (engineVersion < 20170501)
|
||||||
|
{
|
||||||
|
if (node.Key.StartsWith("WithRearmAnimation", StringComparison.Ordinal) || node.Key.StartsWith("WithRepairAnimation", StringComparison.Ordinal)
|
||||||
|
|| node.Key.StartsWith("WithIdleAnimation", StringComparison.Ordinal))
|
||||||
|
{
|
||||||
|
var pauseOnLowPowerNode = node.Value.Nodes.FirstOrDefault(n => n.Key == "PauseOnLowPower");
|
||||||
|
if (pauseOnLowPowerNode != null)
|
||||||
|
{
|
||||||
|
node.Value.Nodes.Remove(pauseOnLowPowerNode);
|
||||||
|
Console.WriteLine("PauseOnLowPower has been removed from {0}; use RequiresCondition instead.".F(node.Key));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (node.Key.StartsWith("WithIdleOverlay", StringComparison.Ordinal) || node.Key.StartsWith("WithRepairOverlay", StringComparison.Ordinal))
|
||||||
|
{
|
||||||
|
var pauseOnLowPowerNode = node.Value.Nodes.FirstOrDefault(n => n.Key == "PauseOnLowPower");
|
||||||
|
if (pauseOnLowPowerNode != null)
|
||||||
|
{
|
||||||
|
node.Value.Nodes.Remove(pauseOnLowPowerNode);
|
||||||
|
Console.WriteLine("PauseOnLowPower has been removed from {0}; use PauseOnCondition or RequiresCondition instead.".F(node.Key));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (node.Key.StartsWith("AffectedByPowerOutage", StringComparison.Ordinal))
|
||||||
|
{
|
||||||
|
Console.WriteLine("Actor {0} has AffectedByPowerOutage; use the Condition property to apply its effects.".F(node.Key));
|
||||||
|
}
|
||||||
|
else if (node.Key.StartsWith("IonCannonPower", StringComparison.Ordinal) || node.Key.StartsWith("ProduceActorPower", StringComparison.Ordinal)
|
||||||
|
|| node.Key.StartsWith("NukePower", StringComparison.Ordinal) || node.Key.StartsWith("AttackOrderPower", StringComparison.Ordinal)
|
||||||
|
|| node.Key.StartsWith("GpsPower", StringComparison.Ordinal))
|
||||||
|
{
|
||||||
|
Console.WriteLine("{0} requires PauseOnCondition for pausing.".F(node.Key));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
UpgradeActorRules(modData, engineVersion, ref node.Value.Nodes, node, depth + 1);
|
UpgradeActorRules(modData, engineVersion, ref node.Value.Nodes, node, depth + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -477,6 +477,7 @@ HQ:
|
|||||||
DetectCloaked:
|
DetectCloaked:
|
||||||
Range: 5c0
|
Range: 5c0
|
||||||
AirstrikePower:
|
AirstrikePower:
|
||||||
|
PauseOnCondition: disabled
|
||||||
Prerequisites: ~techlevel.superweapons
|
Prerequisites: ~techlevel.superweapons
|
||||||
Icon: airstrike
|
Icon: airstrike
|
||||||
ChargeTime: 240
|
ChargeTime: 240
|
||||||
@@ -573,6 +574,7 @@ EYE:
|
|||||||
DetectCloaked:
|
DetectCloaked:
|
||||||
Range: 5c0
|
Range: 5c0
|
||||||
IonCannonPower:
|
IonCannonPower:
|
||||||
|
PauseOnCondition: disabled
|
||||||
Prerequisites: ~techlevel.superweapons
|
Prerequisites: ~techlevel.superweapons
|
||||||
Icon: ioncannon
|
Icon: ioncannon
|
||||||
Cursor: ioncannon
|
Cursor: ioncannon
|
||||||
@@ -625,6 +627,7 @@ TMPL:
|
|||||||
DetectCloaked:
|
DetectCloaked:
|
||||||
Range: 5c0
|
Range: 5c0
|
||||||
NukePower:
|
NukePower:
|
||||||
|
PauseOnCondition: disabled
|
||||||
Prerequisites: ~techlevel.superweapons
|
Prerequisites: ~techlevel.superweapons
|
||||||
Icon: abomb
|
Icon: abomb
|
||||||
Cursor: nuke
|
Cursor: nuke
|
||||||
|
|||||||
@@ -533,7 +533,7 @@ outpost:
|
|||||||
mercenary: outpost.ordos
|
mercenary: outpost.ordos
|
||||||
WithIdleOverlay@DISH:
|
WithIdleOverlay@DISH:
|
||||||
Sequence: idle-dish
|
Sequence: idle-dish
|
||||||
PauseOnLowPower: true
|
PauseOnCondition: disabled
|
||||||
RequiresCondition: !severe-damaged
|
RequiresCondition: !severe-damaged
|
||||||
GrantConditionOnDamageState@STOPDISH:
|
GrantConditionOnDamageState@STOPDISH:
|
||||||
Condition: severe-damaged
|
Condition: severe-damaged
|
||||||
@@ -960,6 +960,7 @@ palace:
|
|||||||
NukePower:
|
NukePower:
|
||||||
Cursor: nuke
|
Cursor: nuke
|
||||||
Icon: deathhand
|
Icon: deathhand
|
||||||
|
PauseOnCondition: disabled
|
||||||
Prerequisites: ~techlevel.superweapons, ~palace.nuke
|
Prerequisites: ~techlevel.superweapons, ~palace.nuke
|
||||||
ChargeTime: 300
|
ChargeTime: 300
|
||||||
Description: Death Hand
|
Description: Death Hand
|
||||||
@@ -979,6 +980,7 @@ palace:
|
|||||||
Description: Recruit Fremen
|
Description: Recruit Fremen
|
||||||
LongDesc: Elite infantry unit armed with assault rifles and rockets\n Strong vs Infantry, Vehicles\n Weak vs Artillery\n Special Ability: Invisibility
|
LongDesc: Elite infantry unit armed with assault rifles and rockets\n Strong vs Infantry, Vehicles\n Weak vs Artillery\n Special Ability: Invisibility
|
||||||
Icon: fremen
|
Icon: fremen
|
||||||
|
PauseOnCondition: disabled
|
||||||
Prerequisites: ~techlevel.superweapons, ~palace.fremen
|
Prerequisites: ~techlevel.superweapons, ~palace.fremen
|
||||||
Actors: fremen, fremen
|
Actors: fremen, fremen
|
||||||
Type: Palace
|
Type: Palace
|
||||||
@@ -990,6 +992,7 @@ palace:
|
|||||||
Description: Recruit Saboteur
|
Description: Recruit Saboteur
|
||||||
LongDesc: Sneaky infantry, armed with explosives\n Strong vs Buildings\n Weak vs Everything\n Special Ability: destroy buildings
|
LongDesc: Sneaky infantry, armed with explosives\n Strong vs Buildings\n Weak vs Everything\n Special Ability: destroy buildings
|
||||||
Icon: saboteur
|
Icon: saboteur
|
||||||
|
PauseOnCondition: disabled
|
||||||
Prerequisites: ~techlevel.superweapons, ~palace.saboteur
|
Prerequisites: ~techlevel.superweapons, ~palace.saboteur
|
||||||
Actors: saboteur
|
Actors: saboteur
|
||||||
Type: Palace
|
Type: Palace
|
||||||
|
|||||||
@@ -933,3 +933,12 @@
|
|||||||
Palette: disabled
|
Palette: disabled
|
||||||
GrantConditionOnDisabled@IDISABLE:
|
GrantConditionOnDisabled@IDISABLE:
|
||||||
Condition: disabled
|
Condition: disabled
|
||||||
|
|
||||||
|
^DisabledByPowerOutage:
|
||||||
|
AffectedByPowerOutage:
|
||||||
|
Condition: power-outage
|
||||||
|
InfiltrateForPowerOutage:
|
||||||
|
DisableOnCondition@POWER_OUTAGE:
|
||||||
|
RequiresCondition: power-outage
|
||||||
|
Power:
|
||||||
|
RequiresCondition: !power-outage
|
||||||
|
|||||||
@@ -21,6 +21,7 @@ MSLO:
|
|||||||
RevealsShroud:
|
RevealsShroud:
|
||||||
Range: 5c0
|
Range: 5c0
|
||||||
NukePower:
|
NukePower:
|
||||||
|
PauseOnCondition: disabled
|
||||||
Cursor: nuke
|
Cursor: nuke
|
||||||
Icon: abomb
|
Icon: abomb
|
||||||
ChargeTime: 540
|
ChargeTime: 540
|
||||||
@@ -318,6 +319,7 @@ IRON:
|
|||||||
Bib:
|
Bib:
|
||||||
HasMinibib: Yes
|
HasMinibib: Yes
|
||||||
GrantExternalConditionPower@IRONCURTAIN:
|
GrantExternalConditionPower@IRONCURTAIN:
|
||||||
|
PauseOnCondition: disabled
|
||||||
Icon: invuln
|
Icon: invuln
|
||||||
ChargeTime: 120
|
ChargeTime: 120
|
||||||
Description: Invulnerability
|
Description: Invulnerability
|
||||||
@@ -375,6 +377,7 @@ PDOX:
|
|||||||
Prerequisite: pdox.germany
|
Prerequisite: pdox.germany
|
||||||
ChronoshiftPower@chronoshift:
|
ChronoshiftPower@chronoshift:
|
||||||
OrderName: Chronoshift
|
OrderName: Chronoshift
|
||||||
|
PauseOnCondition: disabled
|
||||||
Prerequisites: !pdox.germany
|
Prerequisites: !pdox.germany
|
||||||
Icon: chrono
|
Icon: chrono
|
||||||
ChargeTime: 120
|
ChargeTime: 120
|
||||||
@@ -389,6 +392,7 @@ PDOX:
|
|||||||
DisplayRadarPing: True
|
DisplayRadarPing: True
|
||||||
ChronoshiftPower@advancedchronoshift:
|
ChronoshiftPower@advancedchronoshift:
|
||||||
OrderName: AdvancedChronoshift
|
OrderName: AdvancedChronoshift
|
||||||
|
PauseOnCondition: disabled
|
||||||
Prerequisites: pdox.germany
|
Prerequisites: pdox.germany
|
||||||
Icon: chrono
|
Icon: chrono
|
||||||
ChargeTime: 120
|
ChargeTime: 120
|
||||||
@@ -811,6 +815,7 @@ ATEK:
|
|||||||
Range: 6c0
|
Range: 6c0
|
||||||
Bib:
|
Bib:
|
||||||
GpsPower:
|
GpsPower:
|
||||||
|
PauseOnCondition: disabled
|
||||||
Icon: gps
|
Icon: gps
|
||||||
OneShot: yes
|
OneShot: yes
|
||||||
ChargeTime: 480
|
ChargeTime: 480
|
||||||
@@ -1304,6 +1309,7 @@ AFLD:
|
|||||||
POWR:
|
POWR:
|
||||||
Inherits: ^Building
|
Inherits: ^Building
|
||||||
Inherits@IDISABLE: ^DisabledOverlay
|
Inherits@IDISABLE: ^DisabledOverlay
|
||||||
|
Inherits@POWER_OUTAGE: ^DisabledByPowerOutage
|
||||||
Buildable:
|
Buildable:
|
||||||
Queue: Building
|
Queue: Building
|
||||||
BuildPaletteOrder: 10
|
BuildPaletteOrder: 10
|
||||||
@@ -1327,8 +1333,6 @@ POWR:
|
|||||||
Bib:
|
Bib:
|
||||||
Power:
|
Power:
|
||||||
Amount: 100
|
Amount: 100
|
||||||
InfiltrateForPowerOutage:
|
|
||||||
AffectedByPowerOutage:
|
|
||||||
Targetable:
|
Targetable:
|
||||||
TargetTypes: Ground, Structure, C4, DetonateAttack, SpyInfiltrate
|
TargetTypes: Ground, Structure, C4, DetonateAttack, SpyInfiltrate
|
||||||
ScalePowerWithHealth:
|
ScalePowerWithHealth:
|
||||||
@@ -1339,6 +1343,7 @@ POWR:
|
|||||||
APWR:
|
APWR:
|
||||||
Inherits: ^Building
|
Inherits: ^Building
|
||||||
Inherits@IDISABLE: ^DisabledOverlay
|
Inherits@IDISABLE: ^DisabledOverlay
|
||||||
|
Inherits@POWER_OUTAGE: ^DisabledByPowerOutage
|
||||||
Buildable:
|
Buildable:
|
||||||
Queue: Building
|
Queue: Building
|
||||||
BuildPaletteOrder: 110
|
BuildPaletteOrder: 110
|
||||||
@@ -1366,8 +1371,6 @@ APWR:
|
|||||||
Bib:
|
Bib:
|
||||||
Power:
|
Power:
|
||||||
Amount: 200
|
Amount: 200
|
||||||
InfiltrateForPowerOutage:
|
|
||||||
AffectedByPowerOutage:
|
|
||||||
Targetable:
|
Targetable:
|
||||||
TargetTypes: Ground, Structure, C4, DetonateAttack, SpyInfiltrate
|
TargetTypes: Ground, Structure, C4, DetonateAttack, SpyInfiltrate
|
||||||
ScalePowerWithHealth:
|
ScalePowerWithHealth:
|
||||||
|
|||||||
@@ -972,3 +972,12 @@
|
|||||||
Palette: disabled
|
Palette: disabled
|
||||||
GrantConditionOnDisabled@IDISABLE:
|
GrantConditionOnDisabled@IDISABLE:
|
||||||
Condition: disabled
|
Condition: disabled
|
||||||
|
|
||||||
|
^DisabledByPowerOutage:
|
||||||
|
AffectedByPowerOutage:
|
||||||
|
Condition: power-outage
|
||||||
|
InfiltrateForPowerOutage:
|
||||||
|
DisableOnCondition@POWER_OUTAGE:
|
||||||
|
RequiresCondition: power-outage
|
||||||
|
Power:
|
||||||
|
RequiresCondition: !power-outage
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
GAPOWR:
|
GAPOWR:
|
||||||
Inherits: ^Building
|
Inherits: ^Building
|
||||||
Inherits@IDISABLE: ^DisabledOverlay
|
Inherits@IDISABLE: ^DisabledOverlay
|
||||||
|
Inherits@POWER_OUTAGE: ^DisabledByPowerOutage
|
||||||
Buildable:
|
Buildable:
|
||||||
Queue: Building
|
Queue: Building
|
||||||
BuildPaletteOrder: 10
|
BuildPaletteOrder: 10
|
||||||
@@ -23,15 +24,15 @@ GAPOWR:
|
|||||||
Range: 4c0
|
Range: 4c0
|
||||||
MaxHeightDelta: 3
|
MaxHeightDelta: 3
|
||||||
WithIdleOverlay@LIGHTS:
|
WithIdleOverlay@LIGHTS:
|
||||||
|
RequiresCondition: !disabled
|
||||||
Sequence: idle-lights
|
Sequence: idle-lights
|
||||||
WithIdleOverlay@PLUG:
|
WithIdleOverlay@PLUG:
|
||||||
|
PauseOnCondition: disabled
|
||||||
Sequence: idle-plug
|
Sequence: idle-plug
|
||||||
Selectable:
|
Selectable:
|
||||||
Bounds: 90, 48, 0, -6
|
Bounds: 90, 48, 0, -6
|
||||||
Power:
|
Power:
|
||||||
Amount: 100
|
Amount: 100
|
||||||
InfiltrateForPowerOutage:
|
|
||||||
AffectedByPowerOutage:
|
|
||||||
PowerTooltip:
|
PowerTooltip:
|
||||||
Targetable:
|
Targetable:
|
||||||
TargetTypes: Ground, C4, DetonateAttack, SpyInfiltrate
|
TargetTypes: Ground, C4, DetonateAttack, SpyInfiltrate
|
||||||
@@ -41,10 +42,11 @@ GAPOWR:
|
|||||||
Conditions:
|
Conditions:
|
||||||
powrup: powrup.a
|
powrup: powrup.a
|
||||||
Power@pluga:
|
Power@pluga:
|
||||||
RequiresCondition: powrup.a
|
RequiresCondition: powrup.a && !power-outage
|
||||||
Amount: 50
|
Amount: 50
|
||||||
WithIdleOverlay@pluga:
|
WithIdleOverlay@pluga:
|
||||||
RequiresCondition: powrup.a
|
RequiresCondition: powrup.a
|
||||||
|
PauseOnCondition: disabled
|
||||||
Sequence: idle-powrupa
|
Sequence: idle-powrupa
|
||||||
Pluggable@plugb:
|
Pluggable@plugb:
|
||||||
Offset: 1,1
|
Offset: 1,1
|
||||||
@@ -52,9 +54,10 @@ GAPOWR:
|
|||||||
powrup: powrup.b
|
powrup: powrup.b
|
||||||
WithIdleOverlay@plugb:
|
WithIdleOverlay@plugb:
|
||||||
RequiresCondition: powrup.b
|
RequiresCondition: powrup.b
|
||||||
|
PauseOnCondition: disabled
|
||||||
Sequence: idle-powrupb
|
Sequence: idle-powrupb
|
||||||
Power@plugb:
|
Power@plugb:
|
||||||
RequiresCondition: powrup.b
|
RequiresCondition: powrup.b && !power-outage
|
||||||
Amount: 50
|
Amount: 50
|
||||||
ProvidesPrerequisite@buildingname:
|
ProvidesPrerequisite@buildingname:
|
||||||
SelectionDecorations:
|
SelectionDecorations:
|
||||||
@@ -271,8 +274,10 @@ GADEPT:
|
|||||||
WithIdleOverlay@CIRCUITS:
|
WithIdleOverlay@CIRCUITS:
|
||||||
Sequence: circuits
|
Sequence: circuits
|
||||||
WithRepairOverlay@CRANE:
|
WithRepairOverlay@CRANE:
|
||||||
|
PauseOnCondition: empdisable
|
||||||
Sequence: crane
|
Sequence: crane
|
||||||
WithRepairOverlay@PLATFORM:
|
WithRepairOverlay@PLATFORM:
|
||||||
|
RequiresCondition: !empdisable
|
||||||
Sequence: platform
|
Sequence: platform
|
||||||
WithDeathAnimation@BIB:
|
WithDeathAnimation@BIB:
|
||||||
DeathSequence: dead-ground
|
DeathSequence: dead-ground
|
||||||
@@ -290,6 +295,7 @@ GADEPT:
|
|||||||
|
|
||||||
GARADR:
|
GARADR:
|
||||||
Inherits: ^Building
|
Inherits: ^Building
|
||||||
|
Inherits@IDISABLED: ^DisabledOverlay
|
||||||
Buildable:
|
Buildable:
|
||||||
Queue: Building
|
Queue: Building
|
||||||
BuildPaletteOrder: 80
|
BuildPaletteOrder: 80
|
||||||
@@ -326,7 +332,7 @@ GARADR:
|
|||||||
MaxHeightDelta: 3
|
MaxHeightDelta: 3
|
||||||
WithIdleOverlay@DISH:
|
WithIdleOverlay@DISH:
|
||||||
Sequence: idle-dish
|
Sequence: idle-dish
|
||||||
PauseOnLowPower: yes
|
PauseOnCondition: disabled
|
||||||
Targetable:
|
Targetable:
|
||||||
TargetTypes: Ground, C4, SpyInfiltrate
|
TargetTypes: Ground, C4, SpyInfiltrate
|
||||||
Power:
|
Power:
|
||||||
@@ -334,11 +340,10 @@ GARADR:
|
|||||||
ProvidesPrerequisite@buildingname:
|
ProvidesPrerequisite@buildingname:
|
||||||
SelectionDecorations:
|
SelectionDecorations:
|
||||||
VisualBounds: 96, 118, 0, -38
|
VisualBounds: 96, 118, 0, -38
|
||||||
GrantConditionOnDisabled@IDISABLE:
|
|
||||||
Condition: disabled
|
|
||||||
|
|
||||||
GATECH:
|
GATECH:
|
||||||
Inherits: ^Building
|
Inherits: ^Building
|
||||||
|
Inherits@IDISABLE: ^DisabledOverlay
|
||||||
Buildable:
|
Buildable:
|
||||||
Queue: Building
|
Queue: Building
|
||||||
BuildPaletteOrder: 150
|
BuildPaletteOrder: 150
|
||||||
@@ -363,9 +368,11 @@ GATECH:
|
|||||||
Range: 4c0
|
Range: 4c0
|
||||||
MaxHeightDelta: 3
|
MaxHeightDelta: 3
|
||||||
WithIdleOverlay@LIGHTS:
|
WithIdleOverlay@LIGHTS:
|
||||||
|
RequiresCondition: !disabled
|
||||||
Sequence: idle-lights
|
Sequence: idle-lights
|
||||||
Power:
|
Power:
|
||||||
Amount: -150
|
Amount: -150
|
||||||
|
RequiresPower:
|
||||||
ProvidesPrerequisite@buildingname:
|
ProvidesPrerequisite@buildingname:
|
||||||
SelectionDecorations:
|
SelectionDecorations:
|
||||||
VisualBounds: 110, 60, 3, -4
|
VisualBounds: 110, 60, 3, -4
|
||||||
@@ -393,10 +400,13 @@ GAPLUG:
|
|||||||
PowerupSpeech: EnablePower
|
PowerupSpeech: EnablePower
|
||||||
PowerdownSpeech: DisablePower
|
PowerdownSpeech: DisablePower
|
||||||
WithIdleOverlay@DISH:
|
WithIdleOverlay@DISH:
|
||||||
|
PauseOnCondition: disabled
|
||||||
Sequence: idle-dish
|
Sequence: idle-dish
|
||||||
WithIdleOverlay@LIGHTS:
|
WithIdleOverlay@LIGHTS:
|
||||||
|
RequiresCondition: !disabled
|
||||||
Sequence: idle-lights
|
Sequence: idle-lights
|
||||||
WithIdleOverlay@STRIP:
|
WithIdleOverlay@STRIP:
|
||||||
|
RequiresCondition: !disabled
|
||||||
Sequence: idle-strip
|
Sequence: idle-strip
|
||||||
Health:
|
Health:
|
||||||
HP: 1000
|
HP: 1000
|
||||||
@@ -407,6 +417,7 @@ GAPLUG:
|
|||||||
MaxHeightDelta: 3
|
MaxHeightDelta: 3
|
||||||
IonCannonPower:
|
IonCannonPower:
|
||||||
Cursor: ioncannon
|
Cursor: ioncannon
|
||||||
|
PauseOnCondition: disabled || empdisable
|
||||||
RequiresCondition: plug.ioncannona || plug.ioncannonb
|
RequiresCondition: plug.ioncannona || plug.ioncannonb
|
||||||
Icon: ioncannon
|
Icon: ioncannon
|
||||||
Effect: explosion
|
Effect: explosion
|
||||||
@@ -421,6 +432,7 @@ GAPLUG:
|
|||||||
DisplayRadarPing: True
|
DisplayRadarPing: True
|
||||||
CameraActor: camera
|
CameraActor: camera
|
||||||
ProduceActorPower:
|
ProduceActorPower:
|
||||||
|
PauseOnCondition: disabled || empdisable
|
||||||
RequiresCondition: plug.hunterseekera || plug.hunterseekerb
|
RequiresCondition: plug.hunterseekera || plug.hunterseekerb
|
||||||
Description: Hunter Seeker
|
Description: Hunter Seeker
|
||||||
LongDesc: Releases a drone that will acquire and destroy an enemy target.
|
LongDesc: Releases a drone that will acquire and destroy an enemy target.
|
||||||
@@ -451,9 +463,11 @@ GAPLUG:
|
|||||||
plug.hunterseeker: !plug.hunterseekerb && !plug.ioncannona && !plug.hunterseekera
|
plug.hunterseeker: !plug.hunterseekerb && !plug.ioncannona && !plug.hunterseekera
|
||||||
WithIdleOverlay@ioncannona:
|
WithIdleOverlay@ioncannona:
|
||||||
RequiresCondition: plug.ioncannona
|
RequiresCondition: plug.ioncannona
|
||||||
|
PauseOnCondition: disabled
|
||||||
Sequence: idle-ioncannona
|
Sequence: idle-ioncannona
|
||||||
WithIdleOverlay@hunterseekera:
|
WithIdleOverlay@hunterseekera:
|
||||||
RequiresCondition: plug.hunterseekera
|
RequiresCondition: plug.hunterseekera
|
||||||
|
PauseOnCondition: disabled
|
||||||
Sequence: idle-hunterseekera
|
Sequence: idle-hunterseekera
|
||||||
Pluggable@plugb:
|
Pluggable@plugb:
|
||||||
Offset: 1,2
|
Offset: 1,2
|
||||||
@@ -465,9 +479,11 @@ GAPLUG:
|
|||||||
plug.hunterseeker: !plug.hunterseekera && !plug.ioncannonb && !plug.hunterseekerb
|
plug.hunterseeker: !plug.hunterseekera && !plug.ioncannonb && !plug.hunterseekerb
|
||||||
WithIdleOverlay@ioncannonb:
|
WithIdleOverlay@ioncannonb:
|
||||||
RequiresCondition: plug.ioncannonb
|
RequiresCondition: plug.ioncannonb
|
||||||
|
PauseOnCondition: disabled
|
||||||
Sequence: idle-ioncannonb
|
Sequence: idle-ioncannonb
|
||||||
WithIdleOverlay@hunterseekerb:
|
WithIdleOverlay@hunterseekerb:
|
||||||
RequiresCondition: plug.hunterseekerb
|
RequiresCondition: plug.hunterseekerb
|
||||||
|
PauseOnCondition: disabled
|
||||||
Sequence: idle-hunterseekerb
|
Sequence: idle-hunterseekerb
|
||||||
ProvidesPrerequisite@buildingname:
|
ProvidesPrerequisite@buildingname:
|
||||||
SelectionDecorations:
|
SelectionDecorations:
|
||||||
|
|||||||
@@ -116,6 +116,7 @@ GACTWR:
|
|||||||
WithMuzzleOverlay:
|
WithMuzzleOverlay:
|
||||||
RequiresCondition: tower.vulcan
|
RequiresCondition: tower.vulcan
|
||||||
WithIdleOverlay@LIGHTS:
|
WithIdleOverlay@LIGHTS:
|
||||||
|
RequiresCondition: !disabled
|
||||||
Sequence: idle-lights
|
Sequence: idle-lights
|
||||||
LineBuildNode:
|
LineBuildNode:
|
||||||
Types: turret
|
Types: turret
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
NAPOWR:
|
NAPOWR:
|
||||||
Inherits: ^Building
|
Inherits: ^Building
|
||||||
Inherits@IDISABLE: ^DisabledOverlay
|
Inherits@IDISABLE: ^DisabledOverlay
|
||||||
|
Inherits@POWER_OUTAGE: ^DisabledByPowerOutage
|
||||||
Buildable:
|
Buildable:
|
||||||
Queue: Building
|
Queue: Building
|
||||||
BuildPaletteOrder: 20
|
BuildPaletteOrder: 20
|
||||||
@@ -25,11 +26,10 @@ NAPOWR:
|
|||||||
Range: 4c0
|
Range: 4c0
|
||||||
MaxHeightDelta: 3
|
MaxHeightDelta: 3
|
||||||
WithIdleOverlay@LIGHTS:
|
WithIdleOverlay@LIGHTS:
|
||||||
|
RequiresCondition: !disabled
|
||||||
Sequence: idle-lights
|
Sequence: idle-lights
|
||||||
Power:
|
Power:
|
||||||
Amount: 100
|
Amount: 100
|
||||||
InfiltrateForPowerOutage:
|
|
||||||
AffectedByPowerOutage:
|
|
||||||
Targetable:
|
Targetable:
|
||||||
TargetTypes: Ground, C4, DetonateAttack, SpyInfiltrate
|
TargetTypes: Ground, C4, DetonateAttack, SpyInfiltrate
|
||||||
ScalePowerWithHealth:
|
ScalePowerWithHealth:
|
||||||
@@ -40,6 +40,7 @@ NAPOWR:
|
|||||||
NAAPWR:
|
NAAPWR:
|
||||||
Inherits: ^Building
|
Inherits: ^Building
|
||||||
Inherits@IDISABLE: ^DisabledOverlay
|
Inherits@IDISABLE: ^DisabledOverlay
|
||||||
|
Inherits@POWER_OUTAGE: ^DisabledByPowerOutage
|
||||||
Buildable:
|
Buildable:
|
||||||
Queue: Building
|
Queue: Building
|
||||||
BuildPaletteOrder: 120
|
BuildPaletteOrder: 120
|
||||||
@@ -64,11 +65,10 @@ NAAPWR:
|
|||||||
Range: 4c0
|
Range: 4c0
|
||||||
MaxHeightDelta: 3
|
MaxHeightDelta: 3
|
||||||
WithIdleOverlay@LIGHTS:
|
WithIdleOverlay@LIGHTS:
|
||||||
|
RequiresCondition: !disabled
|
||||||
Sequence: idle-lights
|
Sequence: idle-lights
|
||||||
Power:
|
Power:
|
||||||
Amount: 200
|
Amount: 200
|
||||||
InfiltrateForPowerOutage:
|
|
||||||
AffectedByPowerOutage:
|
|
||||||
Targetable:
|
Targetable:
|
||||||
TargetTypes: Ground, C4, DetonateAttack, SpyInfiltrate
|
TargetTypes: Ground, C4, DetonateAttack, SpyInfiltrate
|
||||||
ScalePowerWithHealth:
|
ScalePowerWithHealth:
|
||||||
@@ -249,6 +249,7 @@ NAHPAD:
|
|||||||
|
|
||||||
NARADR:
|
NARADR:
|
||||||
Inherits: ^Building
|
Inherits: ^Building
|
||||||
|
Inherits@IDISABLED: ^DisabledOverlay
|
||||||
Buildable:
|
Buildable:
|
||||||
Queue: Building
|
Queue: Building
|
||||||
BuildPaletteOrder: 90
|
BuildPaletteOrder: 90
|
||||||
@@ -285,7 +286,7 @@ NARADR:
|
|||||||
MaxHeightDelta: 3
|
MaxHeightDelta: 3
|
||||||
WithIdleOverlay@DISH:
|
WithIdleOverlay@DISH:
|
||||||
Sequence: idle-dish
|
Sequence: idle-dish
|
||||||
PauseOnLowPower: true
|
PauseOnCondition: disabled
|
||||||
Targetable:
|
Targetable:
|
||||||
TargetTypes: Ground, C4, SpyInfiltrate
|
TargetTypes: Ground, C4, SpyInfiltrate
|
||||||
Power:
|
Power:
|
||||||
@@ -293,11 +294,10 @@ NARADR:
|
|||||||
ProvidesPrerequisite@buildingname:
|
ProvidesPrerequisite@buildingname:
|
||||||
SelectionDecorations:
|
SelectionDecorations:
|
||||||
VisualBounds: 96, 72, 0, -12
|
VisualBounds: 96, 72, 0, -12
|
||||||
GrantConditionOnDisabled@IDISABLE:
|
|
||||||
Condition: disabled
|
|
||||||
|
|
||||||
NATECH:
|
NATECH:
|
||||||
Inherits: ^Building
|
Inherits: ^Building
|
||||||
|
Inherits@IDISABLED: ^DisabledOverlay
|
||||||
Buildable:
|
Buildable:
|
||||||
Queue: Building
|
Queue: Building
|
||||||
BuildPaletteOrder: 160
|
BuildPaletteOrder: 160
|
||||||
@@ -322,15 +322,18 @@ NATECH:
|
|||||||
Range: 4c0
|
Range: 4c0
|
||||||
MaxHeightDelta: 3
|
MaxHeightDelta: 3
|
||||||
WithIdleOverlay@LIGHTS:
|
WithIdleOverlay@LIGHTS:
|
||||||
|
RequiresCondition: !disabled
|
||||||
Sequence: idle-lights
|
Sequence: idle-lights
|
||||||
Power:
|
Power:
|
||||||
Amount: -150
|
Amount: -150
|
||||||
|
RequiresPower:
|
||||||
ProvidesPrerequisite@buildingname:
|
ProvidesPrerequisite@buildingname:
|
||||||
SelectionDecorations:
|
SelectionDecorations:
|
||||||
VisualBounds: 86, 58, 0, -4
|
VisualBounds: 86, 58, 0, -4
|
||||||
|
|
||||||
NATMPL:
|
NATMPL:
|
||||||
Inherits: ^Building
|
Inherits: ^Building
|
||||||
|
Inherits@IDISABLED: ^DisabledOverlay
|
||||||
Buildable:
|
Buildable:
|
||||||
Queue: Building
|
Queue: Building
|
||||||
BuildPaletteOrder: 180
|
BuildPaletteOrder: 180
|
||||||
@@ -356,9 +359,12 @@ NATMPL:
|
|||||||
MaxHeightDelta: 3
|
MaxHeightDelta: 3
|
||||||
Power:
|
Power:
|
||||||
Amount: -200
|
Amount: -200
|
||||||
|
RequiresPower:
|
||||||
WithIdleOverlay@LIGHTS:
|
WithIdleOverlay@LIGHTS:
|
||||||
|
RequiresCondition: !disabled
|
||||||
Sequence: idle-lights
|
Sequence: idle-lights
|
||||||
ProduceActorPower:
|
ProduceActorPower:
|
||||||
|
PauseOnCondition: empdisable
|
||||||
Description: Hunter Seeker
|
Description: Hunter Seeker
|
||||||
LongDesc: Releases a drone that will acquire and destroy an enemy target.
|
LongDesc: Releases a drone that will acquire and destroy an enemy target.
|
||||||
Prerequisites: ~techlevel.superweapons
|
Prerequisites: ~techlevel.superweapons
|
||||||
|
|||||||
@@ -43,6 +43,7 @@ NAGATE_B:
|
|||||||
|
|
||||||
NAPOST:
|
NAPOST:
|
||||||
Inherits: ^Building
|
Inherits: ^Building
|
||||||
|
Inherits@IDISABLED: ^DisabledOverlay
|
||||||
Buildable:
|
Buildable:
|
||||||
Queue: Defense
|
Queue: Defense
|
||||||
BuildPaletteOrder: 150
|
BuildPaletteOrder: 150
|
||||||
@@ -82,8 +83,6 @@ NAPOST:
|
|||||||
PowerupSpeech: EnablePower
|
PowerupSpeech: EnablePower
|
||||||
PowerdownSpeech: DisablePower
|
PowerdownSpeech: DisablePower
|
||||||
RequiresPower:
|
RequiresPower:
|
||||||
GrantConditionOnDisabled:
|
|
||||||
Condition: disabled
|
|
||||||
LineBuildSegmentExternalCondition:
|
LineBuildSegmentExternalCondition:
|
||||||
RequiresCondition: !disabled && !make-animation-playing
|
RequiresCondition: !disabled && !make-animation-playing
|
||||||
Condition: active-posts
|
Condition: active-posts
|
||||||
@@ -224,6 +223,7 @@ NAOBEL:
|
|||||||
Palette: player
|
Palette: player
|
||||||
IsPlayerPalette: true
|
IsPlayerPalette: true
|
||||||
WithIdleOverlay@LIGHTS:
|
WithIdleOverlay@LIGHTS:
|
||||||
|
RequiresCondition: !disabled
|
||||||
Sequence: idle-lights
|
Sequence: idle-lights
|
||||||
Power:
|
Power:
|
||||||
Amount: -150
|
Amount: -150
|
||||||
@@ -269,6 +269,7 @@ NASAM:
|
|||||||
|
|
||||||
NASTLH:
|
NASTLH:
|
||||||
Inherits: ^Building
|
Inherits: ^Building
|
||||||
|
Inherits@IDISABLED: ^DisabledOverlay
|
||||||
Valued:
|
Valued:
|
||||||
Cost: 2500
|
Cost: 2500
|
||||||
Tooltip:
|
Tooltip:
|
||||||
@@ -290,7 +291,7 @@ NASTLH:
|
|||||||
MaxHeightDelta: 3
|
MaxHeightDelta: 3
|
||||||
WithIdleOverlay@pulse:
|
WithIdleOverlay@pulse:
|
||||||
Sequence: pulse
|
Sequence: pulse
|
||||||
PauseOnLowPower: true
|
RequiresCondition: !disabled
|
||||||
WithRangeCircle:
|
WithRangeCircle:
|
||||||
Range: 12c0
|
Range: 12c0
|
||||||
Type: cloakgenerator
|
Type: cloakgenerator
|
||||||
@@ -301,8 +302,6 @@ NASTLH:
|
|||||||
PowerupSpeech: EnablePower
|
PowerupSpeech: EnablePower
|
||||||
PowerdownSpeech: DisablePower
|
PowerdownSpeech: DisablePower
|
||||||
IndicatorPalette: mouse
|
IndicatorPalette: mouse
|
||||||
GrantConditionOnDisabled:
|
|
||||||
Condition: disabled
|
|
||||||
ProximityExternalCondition:
|
ProximityExternalCondition:
|
||||||
RequiresCondition: !disabled
|
RequiresCondition: !disabled
|
||||||
Condition: cloakgenerator
|
Condition: cloakgenerator
|
||||||
@@ -342,6 +341,7 @@ NAMISL:
|
|||||||
RevealsShroud:
|
RevealsShroud:
|
||||||
Range: 4c0
|
Range: 4c0
|
||||||
WithIdleOverlay@LIGHTS:
|
WithIdleOverlay@LIGHTS:
|
||||||
|
RequiresCondition: !disabled
|
||||||
Sequence: idle-lights
|
Sequence: idle-lights
|
||||||
Power:
|
Power:
|
||||||
Amount: -50
|
Amount: -50
|
||||||
@@ -353,6 +353,7 @@ NAMISL:
|
|||||||
ProvidesPrerequisite@buildingname:
|
ProvidesPrerequisite@buildingname:
|
||||||
SupportPowerChargeBar:
|
SupportPowerChargeBar:
|
||||||
NukePower:
|
NukePower:
|
||||||
|
PauseOnCondition: disabled
|
||||||
Cursor: nuke
|
Cursor: nuke
|
||||||
Icon: clustermissile
|
Icon: clustermissile
|
||||||
ChargeTime: 540
|
ChargeTime: 540
|
||||||
|
|||||||
@@ -45,6 +45,7 @@ NAPULS:
|
|||||||
ProvidesPrerequisite@gdi:
|
ProvidesPrerequisite@gdi:
|
||||||
ResetOnOwnerChange: true
|
ResetOnOwnerChange: true
|
||||||
AttackOrderPower:
|
AttackOrderPower:
|
||||||
|
PauseOnCondition: empdisable || disabled
|
||||||
Cursor: emp
|
Cursor: emp
|
||||||
Icon: emp
|
Icon: emp
|
||||||
ChargeTime: 135
|
ChargeTime: 135
|
||||||
|
|||||||
Reference in New Issue
Block a user