Merge pull request #12955 from atlimit8/RemoveIDisable-part1
Remove IDisable - part 1
This commit is contained in:
@@ -10,6 +10,7 @@
|
||||
#endregion
|
||||
|
||||
using System;
|
||||
using System.Linq;
|
||||
using OpenRA.Activities;
|
||||
using OpenRA.Mods.Common.Traits;
|
||||
using OpenRA.Traits;
|
||||
@@ -18,7 +19,7 @@ namespace OpenRA.Mods.Common.Activities
|
||||
{
|
||||
public class Repair : Activity
|
||||
{
|
||||
readonly RepairsUnitsInfo repairsUnits;
|
||||
readonly RepairsUnits[] allRepairsUnits;
|
||||
readonly Target host;
|
||||
readonly WDist closeEnough;
|
||||
|
||||
@@ -33,7 +34,7 @@ namespace OpenRA.Mods.Common.Activities
|
||||
{
|
||||
this.host = Target.FromActor(host);
|
||||
this.closeEnough = closeEnough;
|
||||
repairsUnits = host.Info.TraitInfo<RepairsUnitsInfo>();
|
||||
allRepairsUnits = host.TraitsImplementing<RepairsUnits>().ToArray();
|
||||
health = self.TraitOrDefault<Health>();
|
||||
}
|
||||
|
||||
@@ -47,6 +48,26 @@ namespace OpenRA.Mods.Common.Activities
|
||||
return this;
|
||||
}
|
||||
|
||||
// First active.
|
||||
RepairsUnits repairsUnits = null;
|
||||
var paused = false;
|
||||
foreach (var r in allRepairsUnits)
|
||||
{
|
||||
if (!r.IsTraitDisabled)
|
||||
{
|
||||
if (r.IsTraitPaused)
|
||||
paused = true;
|
||||
else
|
||||
{
|
||||
repairsUnits = r;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (repairsUnits == null)
|
||||
return paused ? this : NextActivity;
|
||||
|
||||
if (host.Type == TargetType.Invalid || health == null)
|
||||
return NextActivity;
|
||||
|
||||
@@ -59,23 +80,23 @@ namespace OpenRA.Mods.Common.Activities
|
||||
{
|
||||
var exp = host.Actor.Owner.PlayerActor.TraitOrDefault<PlayerExperience>();
|
||||
if (exp != null)
|
||||
exp.GiveExperience(repairsUnits.PlayerExperience);
|
||||
exp.GiveExperience(repairsUnits.Info.PlayerExperience);
|
||||
}
|
||||
|
||||
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", repairsUnits.FinishRepairingNotification, self.Owner.Faction.InternalName);
|
||||
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", repairsUnits.Info.FinishRepairingNotification, self.Owner.Faction.InternalName);
|
||||
return NextActivity;
|
||||
}
|
||||
|
||||
if (remainingTicks == 0)
|
||||
{
|
||||
var unitCost = self.Info.TraitInfo<ValuedInfo>().Cost;
|
||||
var hpToRepair = repairsUnits.HpPerStep;
|
||||
var cost = Math.Max(1, (hpToRepair * unitCost * repairsUnits.ValuePercentage) / (health.MaxHP * 100));
|
||||
var hpToRepair = repairsUnits.Info.HpPerStep;
|
||||
var cost = Math.Max(1, (hpToRepair * unitCost * repairsUnits.Info.ValuePercentage) / (health.MaxHP * 100));
|
||||
|
||||
if (!played)
|
||||
{
|
||||
played = true;
|
||||
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", repairsUnits.StartRepairingNotification, self.Owner.Faction.InternalName);
|
||||
Game.Sound.PlayNotification(self.World.Map.Rules, self.Owner, "Speech", repairsUnits.Info.StartRepairingNotification, self.Owner.Faction.InternalName);
|
||||
}
|
||||
|
||||
if (!self.Owner.PlayerActor.Trait<PlayerResources>().TakeCash(cost, true))
|
||||
@@ -89,7 +110,7 @@ namespace OpenRA.Mods.Common.Activities
|
||||
foreach (var depot in host.Actor.TraitsImplementing<INotifyRepair>())
|
||||
depot.Repairing(host.Actor, self);
|
||||
|
||||
remainingTicks = repairsUnits.Interval;
|
||||
remainingTicks = repairsUnits.Info.Interval;
|
||||
}
|
||||
else
|
||||
--remainingTicks;
|
||||
|
||||
@@ -349,7 +349,6 @@
|
||||
<Compile Include="Traits\KillsSelf.cs" />
|
||||
<Compile Include="Traits\AmmoPool.cs" />
|
||||
<Compile Include="Traits\Mobile.cs" />
|
||||
<Compile Include="Traits\Modifiers\DisabledOverlay.cs" />
|
||||
<Compile Include="Traits\Modifiers\FrozenUnderFog.cs" />
|
||||
<Compile Include="Traits\Modifiers\HiddenUnderFog.cs" />
|
||||
<Compile Include="Traits\Modifiers\WithColoredOverlay.cs" />
|
||||
@@ -496,6 +495,7 @@
|
||||
<Compile Include="Traits\Conditions\GrantConditionOnDeploy.cs" />
|
||||
<Compile Include="Traits\Conditions\DisableOnCondition.cs" />
|
||||
<Compile Include="Traits\Conditions\ConditionalTrait.cs" />
|
||||
<Compile Include="Traits\Conditions\PausableConditionalTrait.cs" />
|
||||
<Compile Include="Traits\Conditions\ProximityExternalCondition.cs" />
|
||||
<Compile Include="Traits\Conditions\GrantConditionOnDamageState.cs" />
|
||||
<Compile Include="Traits\Conditions\GrantConditionOnTerrain.cs" />
|
||||
|
||||
@@ -9,11 +9,9 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using OpenRA.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.")]
|
||||
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.")]
|
||||
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) { }
|
||||
}
|
||||
}
|
||||
|
||||
@@ -15,10 +15,10 @@ using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
/// <summary>Use as base class for *Info to subclass of UpgradableTrait. (See UpgradableTrait.)</summary>
|
||||
/// <summary>Use as base class for *Info to subclass of ConditionalTrait. (See ConditionalTrait.)</summary>
|
||||
public abstract class ConditionalTraitInfo : IObservesVariablesInfo, IRulesetLoaded
|
||||
{
|
||||
static readonly IReadOnlyDictionary<string, int> NoConditions = new ReadOnlyDictionary<string, int>(new Dictionary<string, int>());
|
||||
protected static readonly IReadOnlyDictionary<string, int> NoConditions = new ReadOnlyDictionary<string, int>(new Dictionary<string, int>());
|
||||
|
||||
[ConsumedConditionReference]
|
||||
[Desc("Boolean expression defining the condition to enable this trait.")]
|
||||
@@ -39,7 +39,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
/// <summary>
|
||||
/// Abstract base for enabling and disabling trait using conditions.
|
||||
/// Requires basing *Info on UpgradableTraitInfo and using base(info) constructor.
|
||||
/// Requires basing *Info on ConditionalTraitInfo and using base(info) constructor.
|
||||
/// TraitEnabled will be called at creation if the trait starts enabled or does not use conditions.
|
||||
/// </summary>
|
||||
public abstract class ConditionalTrait<InfoType> : IObservesVariables, IDisabledTrait, INotifyCreated, ISync where InfoType : ConditionalTraitInfo
|
||||
|
||||
@@ -0,0 +1,81 @@
|
||||
#region Copyright & License Information
|
||||
/*
|
||||
* Copyright 2007-2017 The OpenRA Developers (see AUTHORS)
|
||||
* This file is part of OpenRA, which is free software. It is made
|
||||
* available to you under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation, either version 3 of
|
||||
* the License, or (at your option) any later version. For more
|
||||
* information, see COPYING.
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System.Collections.Generic;
|
||||
using OpenRA.Primitives;
|
||||
using OpenRA.Support;
|
||||
using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
/// <summary>Use as base class for *Info to subclass of PausableConditionalTrait. (See PausableConditionalTrait.)</summary>
|
||||
public abstract class PausableConditionalTraitInfo : ConditionalTraitInfo
|
||||
{
|
||||
[ConsumedConditionReference]
|
||||
[Desc("Boolean expression defining the condition to pause this trait.")]
|
||||
public readonly BooleanExpression PauseOnCondition = null;
|
||||
|
||||
public bool PausedByDefault { get; private set; }
|
||||
|
||||
public override void RulesetLoaded(Ruleset rules, ActorInfo ai)
|
||||
{
|
||||
base.RulesetLoaded(rules, ai);
|
||||
PausedByDefault = PauseOnCondition != null && PauseOnCondition.Evaluate(NoConditions);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Abstract base for enabling and disabling trait using conditions.
|
||||
/// Requires basing *Info on PausableConditionalTraitInfo and using base(info) constructor.
|
||||
/// TraitResumed will be called at creation if the trait starts not paused or does not have a pause condition.
|
||||
/// </summary>
|
||||
public abstract class PausableConditionalTrait<InfoType> : ConditionalTrait<InfoType> where InfoType : PausableConditionalTraitInfo
|
||||
{
|
||||
[Sync] public bool IsTraitPaused { get; private set; }
|
||||
|
||||
protected PausableConditionalTrait(InfoType info) : base(info) { IsTraitPaused = info.PausedByDefault; }
|
||||
|
||||
protected override void Created(Actor self)
|
||||
{
|
||||
base.Created(self);
|
||||
if (Info.PauseOnCondition == null)
|
||||
TraitResumed(self);
|
||||
}
|
||||
|
||||
// Overrides must call `base.GetVariableObservers()` to avoid breaking RequiresCondition or PauseOnCondition.
|
||||
public override IEnumerable<VariableObserver> GetVariableObservers()
|
||||
{
|
||||
foreach (var observer in base.GetVariableObservers())
|
||||
yield return observer;
|
||||
|
||||
if (Info.PauseOnCondition != null)
|
||||
yield return new VariableObserver(PauseConditionsChanged, Info.PauseOnCondition.Variables);
|
||||
}
|
||||
|
||||
void PauseConditionsChanged(Actor self, IReadOnlyDictionary<string, int> conditions)
|
||||
{
|
||||
var wasPaused = IsTraitPaused;
|
||||
IsTraitPaused = Info.PauseOnCondition.Evaluate(conditions);
|
||||
|
||||
if (IsTraitPaused != wasPaused)
|
||||
{
|
||||
if (wasPaused)
|
||||
TraitResumed(self);
|
||||
else
|
||||
TraitPaused(self);
|
||||
}
|
||||
}
|
||||
|
||||
// Subclasses can add pause support by querying IsTraitPaused and/or overriding these methods.
|
||||
protected virtual void TraitResumed(Actor self) { }
|
||||
protected virtual void TraitPaused(Actor self) { }
|
||||
}
|
||||
}
|
||||
@@ -16,7 +16,7 @@ using OpenRA.Traits;
|
||||
namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
[Desc("Applies a condition to actors within a specified range.")]
|
||||
public class ProximityExternalConditionInfo : ITraitInfo
|
||||
public class ProximityExternalConditionInfo : ConditionalTraitInfo
|
||||
{
|
||||
[FieldLoader.Require]
|
||||
[Desc("The condition to apply. Must be included in the target actor's ExternalConditions list.")]
|
||||
@@ -38,12 +38,11 @@ namespace OpenRA.Mods.Common.Traits
|
||||
public readonly string EnableSound = null;
|
||||
public readonly string DisableSound = null;
|
||||
|
||||
public object Create(ActorInitializer init) { return new ProximityExternalCondition(init.Self, this); }
|
||||
public override object Create(ActorInitializer init) { return new ProximityExternalCondition(init.Self, this); }
|
||||
}
|
||||
|
||||
public class ProximityExternalCondition : ITick, INotifyAddedToWorld, INotifyRemovedFromWorld, INotifyOtherProduction
|
||||
public class ProximityExternalCondition : ConditionalTrait<ProximityExternalConditionInfo>, ITick, INotifyAddedToWorld, INotifyRemovedFromWorld, INotifyOtherProduction
|
||||
{
|
||||
readonly ProximityExternalConditionInfo info;
|
||||
readonly Actor self;
|
||||
|
||||
readonly Dictionary<Actor, int> tokens = new Dictionary<Actor, int>();
|
||||
@@ -55,14 +54,12 @@ namespace OpenRA.Mods.Common.Traits
|
||||
WDist cachedVRange;
|
||||
WDist desiredVRange;
|
||||
|
||||
bool cachedDisabled = true;
|
||||
|
||||
public ProximityExternalCondition(Actor self, ProximityExternalConditionInfo info)
|
||||
: base(info)
|
||||
{
|
||||
this.info = info;
|
||||
this.self = self;
|
||||
cachedRange = info.Range;
|
||||
cachedVRange = info.MaximumVerticalOffset;
|
||||
cachedRange = WDist.Zero;
|
||||
cachedVRange = WDist.Zero;
|
||||
}
|
||||
|
||||
public void AddedToWorld(Actor self)
|
||||
@@ -76,18 +73,22 @@ namespace OpenRA.Mods.Common.Traits
|
||||
self.World.ActorMap.RemoveProximityTrigger(proximityTrigger);
|
||||
}
|
||||
|
||||
protected override void TraitEnabled(Actor self)
|
||||
{
|
||||
Game.Sound.Play(SoundType.World, Info.EnableSound, self.CenterPosition);
|
||||
desiredRange = Info.Range;
|
||||
desiredVRange = Info.MaximumVerticalOffset;
|
||||
}
|
||||
|
||||
protected override void TraitDisabled(Actor self)
|
||||
{
|
||||
Game.Sound.Play(SoundType.World, Info.DisableSound, self.CenterPosition);
|
||||
desiredRange = WDist.Zero;
|
||||
desiredVRange = WDist.Zero;
|
||||
}
|
||||
|
||||
public void Tick(Actor self)
|
||||
{
|
||||
var disabled = self.IsDisabled();
|
||||
|
||||
if (cachedDisabled != disabled)
|
||||
{
|
||||
Game.Sound.Play(SoundType.World, disabled ? info.DisableSound : info.EnableSound, self.CenterPosition);
|
||||
desiredRange = disabled ? WDist.Zero : info.Range;
|
||||
desiredVRange = disabled ? WDist.Zero : info.MaximumVerticalOffset;
|
||||
cachedDisabled = disabled;
|
||||
}
|
||||
|
||||
if (self.CenterPosition != cachedPosition || desiredRange != cachedRange || desiredVRange != cachedVRange)
|
||||
{
|
||||
cachedPosition = self.CenterPosition;
|
||||
@@ -102,18 +103,18 @@ namespace OpenRA.Mods.Common.Traits
|
||||
if (a.Disposed || self.Disposed)
|
||||
return;
|
||||
|
||||
if (a == self && !info.AffectsParent)
|
||||
if (a == self && !Info.AffectsParent)
|
||||
return;
|
||||
|
||||
if (tokens.ContainsKey(a))
|
||||
return;
|
||||
|
||||
var stance = self.Owner.Stances[a.Owner];
|
||||
if (!info.ValidStances.HasStance(stance))
|
||||
if (!Info.ValidStances.HasStance(stance))
|
||||
return;
|
||||
|
||||
var external = a.TraitsImplementing<ExternalCondition>()
|
||||
.FirstOrDefault(t => t.Info.Condition == info.Condition && t.CanGrantCondition(a, self));
|
||||
.FirstOrDefault(t => t.Info.Condition == Info.Condition && t.CanGrantCondition(a, self));
|
||||
|
||||
if (external != null)
|
||||
tokens[a] = external.GrantCondition(a, self);
|
||||
@@ -126,18 +127,18 @@ namespace OpenRA.Mods.Common.Traits
|
||||
return;
|
||||
|
||||
// We don't grant conditions when disabled
|
||||
if (self.IsDisabled())
|
||||
if (IsTraitDisabled)
|
||||
return;
|
||||
|
||||
// Work around for actors produced within the region not triggering until the second tick
|
||||
if ((produced.CenterPosition - self.CenterPosition).HorizontalLengthSquared <= info.Range.LengthSquared)
|
||||
if ((produced.CenterPosition - self.CenterPosition).HorizontalLengthSquared <= Info.Range.LengthSquared)
|
||||
{
|
||||
var stance = self.Owner.Stances[produced.Owner];
|
||||
if (!info.ValidStances.HasStance(stance))
|
||||
if (!Info.ValidStances.HasStance(stance))
|
||||
return;
|
||||
|
||||
var external = produced.TraitsImplementing<ExternalCondition>()
|
||||
.FirstOrDefault(t => t.Info.Condition == info.Condition && t.CanGrantCondition(produced, self));
|
||||
.FirstOrDefault(t => t.Info.Condition == Info.Condition && t.CanGrantCondition(produced, self));
|
||||
|
||||
if (external != null)
|
||||
tokens[produced] = external.GrantCondition(produced, self);
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
bool IOccupySpaceInfo.SharesCell { get { return false; } }
|
||||
}
|
||||
|
||||
public class Husk : IPositionable, IFacing, ISync, INotifyCreated, INotifyAddedToWorld, INotifyRemovedFromWorld, IDisable, IDeathActorInitModifier
|
||||
public class Husk : IPositionable, IFacing, ISync, INotifyCreated, INotifyAddedToWorld, INotifyRemovedFromWorld, IDeathActorInitModifier
|
||||
{
|
||||
readonly HuskInfo info;
|
||||
readonly Actor self;
|
||||
@@ -120,11 +120,6 @@ namespace OpenRA.Mods.Common.Traits
|
||||
self.World.RemoveFromMaps(self, this);
|
||||
}
|
||||
|
||||
public bool Disabled
|
||||
{
|
||||
get { return true; }
|
||||
}
|
||||
|
||||
public void ModifyDeathActorInit(Actor self, TypeDictionary init)
|
||||
{
|
||||
init.Add(new FacingInit(Facing));
|
||||
|
||||
@@ -1,44 +0,0 @@
|
||||
#region Copyright & License Information
|
||||
/*
|
||||
* Copyright 2007-2017 The OpenRA Developers (see AUTHORS)
|
||||
* This file is part of OpenRA, which is free software. It is made
|
||||
* available to you under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation, either version 3 of
|
||||
* the License, or (at your option) any later version. For more
|
||||
* information, see COPYING.
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System.Collections.Generic;
|
||||
using OpenRA.Graphics;
|
||||
using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
[Desc("Use together with CanPowerDown/RequiresPower on buildings or Husk for vehicles.")]
|
||||
public class DisabledOverlayInfo : TraitInfo<DisabledOverlay> { }
|
||||
|
||||
public class DisabledOverlay : IRenderModifier
|
||||
{
|
||||
public IEnumerable<IRenderable> ModifyRender(Actor self, WorldRenderer wr, IEnumerable<IRenderable> r)
|
||||
{
|
||||
if (!self.IsDisabled())
|
||||
return r;
|
||||
|
||||
return ModifiedRender(self, wr, r);
|
||||
}
|
||||
|
||||
IEnumerable<IRenderable> ModifiedRender(Actor self, WorldRenderer wr, IEnumerable<IRenderable> r)
|
||||
{
|
||||
foreach (var a in r)
|
||||
{
|
||||
yield return a;
|
||||
|
||||
if (!a.IsDecoration)
|
||||
yield return a.WithPalette(wr.Palette("disabled"))
|
||||
.WithZOffset(a.ZOffset + 1)
|
||||
.AsDecoration();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -105,7 +105,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
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;
|
||||
|
||||
// TODO: This is hacky, but almost every single component affected
|
||||
|
||||
@@ -830,7 +830,8 @@
|
||||
ForceHealthPercentage: 25
|
||||
Tooltip:
|
||||
GenericName: Destroyed Vehicle
|
||||
DisabledOverlay:
|
||||
WithColoredOverlay@IDISABLE:
|
||||
Palette: disabled
|
||||
ScriptTriggers:
|
||||
Explodes:
|
||||
Weapon: UnitExplodeSmall
|
||||
@@ -892,3 +893,10 @@
|
||||
-GivesBuildableArea:
|
||||
MustBeDestroyed:
|
||||
RequiredForShortGame: false
|
||||
|
||||
^DisabledOverlay:
|
||||
WithColoredOverlay@IDISABLE:
|
||||
RequiresCondition: disabled
|
||||
Palette: disabled
|
||||
GrantConditionOnDisabled@IDISABLE:
|
||||
Condition: disabled
|
||||
|
||||
@@ -441,6 +441,7 @@ HPAD:
|
||||
|
||||
HQ:
|
||||
Inherits: ^BaseBuilding
|
||||
Inherits@IDISABLE: ^DisabledOverlay
|
||||
Valued:
|
||||
Cost: 1000
|
||||
Tooltip:
|
||||
@@ -463,7 +464,6 @@ HQ:
|
||||
CanPowerDown:
|
||||
PowerupSound: EnablePower
|
||||
PowerdownSound: DisablePower
|
||||
DisabledOverlay:
|
||||
WithSpriteBody:
|
||||
PauseAnimationWhenDisabled: true
|
||||
Health:
|
||||
@@ -500,8 +500,6 @@ HQ:
|
||||
SupportPowerChargeBar:
|
||||
Power:
|
||||
Amount: -50
|
||||
GrantConditionOnDisabled@IDISABLE:
|
||||
Condition: disabled
|
||||
|
||||
FIX:
|
||||
Inherits: ^BaseBuilding
|
||||
@@ -539,6 +537,7 @@ FIX:
|
||||
|
||||
EYE:
|
||||
Inherits: ^BaseBuilding
|
||||
Inherits@IDISABLE: ^DisabledOverlay
|
||||
Valued:
|
||||
Cost: 1800
|
||||
Tooltip:
|
||||
@@ -561,7 +560,6 @@ EYE:
|
||||
CanPowerDown:
|
||||
PowerupSound: EnablePower
|
||||
PowerdownSound: DisablePower
|
||||
DisabledOverlay:
|
||||
WithSpriteBody:
|
||||
PauseAnimationWhenDisabled: true
|
||||
Health:
|
||||
@@ -592,11 +590,10 @@ EYE:
|
||||
Power:
|
||||
Amount: -200
|
||||
ProvidesPrerequisite@buildingname:
|
||||
GrantConditionOnDisabled@IDISABLE:
|
||||
Condition: disabled
|
||||
|
||||
TMPL:
|
||||
Inherits: ^BaseBuilding
|
||||
Inherits@IDISABLE: ^DisabledOverlay
|
||||
Valued:
|
||||
Cost: 2000
|
||||
Tooltip:
|
||||
@@ -619,7 +616,6 @@ TMPL:
|
||||
CanPowerDown:
|
||||
PowerupSound: EnablePower
|
||||
PowerdownSound: DisablePower
|
||||
DisabledOverlay:
|
||||
Health:
|
||||
HP: 2100
|
||||
RevealsShroud:
|
||||
@@ -697,6 +693,7 @@ GUN:
|
||||
|
||||
SAM:
|
||||
Inherits: ^Defense
|
||||
Inherits@IDISABLE: ^DisabledOverlay
|
||||
Valued:
|
||||
Cost: 650
|
||||
Tooltip:
|
||||
@@ -712,7 +709,6 @@ SAM:
|
||||
Footprint: xx
|
||||
Dimensions: 2,1
|
||||
RequiresPower:
|
||||
DisabledOverlay:
|
||||
Health:
|
||||
HP: 400
|
||||
Armor:
|
||||
@@ -739,6 +735,7 @@ SAM:
|
||||
|
||||
OBLI:
|
||||
Inherits: ^Defense
|
||||
Inherits@IDISABLE: ^DisabledOverlay
|
||||
Valued:
|
||||
Cost: 1500
|
||||
Tooltip:
|
||||
@@ -755,7 +752,6 @@ OBLI:
|
||||
SelectionDecorations:
|
||||
VisualBounds: 22,44,0,-10
|
||||
RequiresPower:
|
||||
DisabledOverlay:
|
||||
Health:
|
||||
HP: 600
|
||||
Armor:
|
||||
@@ -818,6 +814,7 @@ GTWR:
|
||||
|
||||
ATWR:
|
||||
Inherits: ^Defense
|
||||
Inherits@IDISABLE: ^DisabledOverlay
|
||||
Valued:
|
||||
Cost: 1000
|
||||
Tooltip:
|
||||
@@ -834,7 +831,6 @@ ATWR:
|
||||
SelectionDecorations:
|
||||
VisualBounds: 22,48,0,-12
|
||||
RequiresPower:
|
||||
DisabledOverlay:
|
||||
Health:
|
||||
HP: 550
|
||||
Armor:
|
||||
|
||||
@@ -199,7 +199,8 @@
|
||||
Targetable:
|
||||
TargetTypes: Ground, Vehicle
|
||||
RequiresForceFire: true
|
||||
DisabledOverlay:
|
||||
WithColoredOverlay@IDISABLE:
|
||||
Palette: disabled
|
||||
Explodes:
|
||||
Weapon: UnitExplodeMed
|
||||
EmptyWeapon: UnitExplodeMed
|
||||
@@ -394,3 +395,10 @@
|
||||
MustBeDestroyed:
|
||||
RequiredForShortGame: false
|
||||
RevealOnFire:
|
||||
|
||||
^DisabledOverlay:
|
||||
WithColoredOverlay@IDISABLE:
|
||||
RequiresCondition: disabled
|
||||
Palette: disabled
|
||||
GrantConditionOnDisabled@IDISABLE:
|
||||
Condition: disabled
|
||||
|
||||
@@ -486,11 +486,11 @@ heavy_factory:
|
||||
|
||||
outpost:
|
||||
Inherits: ^Building
|
||||
Inherits@IDISABLE: ^DisabledOverlay
|
||||
RequiresPower:
|
||||
CanPowerDown:
|
||||
PowerupSound: EnablePower
|
||||
PowerdownSound: DisablePower
|
||||
DisabledOverlay:
|
||||
Buildable:
|
||||
Prerequisites: barracks, ~techlevel.medium
|
||||
Queue: Building
|
||||
@@ -533,11 +533,10 @@ outpost:
|
||||
Power:
|
||||
Amount: -125
|
||||
ProvidesPrerequisite@buildingname:
|
||||
GrantConditionOnDisabled@IDISABLE:
|
||||
Condition: disabled
|
||||
|
||||
starport:
|
||||
Inherits: ^Building
|
||||
Inherits@IDISABLE: ^DisabledOverlay
|
||||
Tooltip:
|
||||
Name: Starport
|
||||
Buildable:
|
||||
@@ -583,7 +582,6 @@ starport:
|
||||
ProductionBar:
|
||||
PrimaryBuilding:
|
||||
PrimaryCondition: primary
|
||||
DisabledOverlay:
|
||||
ProvidesPrerequisite@atreides:
|
||||
Prerequisite: starport.atreides
|
||||
Factions: atreides
|
||||
@@ -702,6 +700,7 @@ medium_gun_turret:
|
||||
|
||||
large_gun_turret:
|
||||
Inherits: ^Defense
|
||||
Inherits@IDISABLE: ^DisabledOverlay
|
||||
Buildable:
|
||||
Queue: Building
|
||||
Prerequisites: outpost, upgrade.conyard, ~techlevel.medium
|
||||
@@ -739,7 +738,6 @@ large_gun_turret:
|
||||
CanPowerDown:
|
||||
PowerupSound: EnablePower
|
||||
PowerdownSound: DisablePower
|
||||
DisabledOverlay:
|
||||
Power:
|
||||
Amount: -60
|
||||
SelectionDecorations:
|
||||
@@ -905,6 +903,7 @@ research_centre:
|
||||
|
||||
palace:
|
||||
Inherits: ^Building
|
||||
Inherits@IDISABLE: ^DisabledOverlay
|
||||
Buildable:
|
||||
Prerequisites: research_centre, ~techlevel.high
|
||||
Queue: Building
|
||||
@@ -1002,7 +1001,6 @@ palace:
|
||||
CanPowerDown:
|
||||
PowerupSound: EnablePower
|
||||
PowerdownSound: DisablePower
|
||||
DisabledOverlay:
|
||||
RequiresPower:
|
||||
SupportPowerChargeBar:
|
||||
ProvidesPrerequisite@buildingname:
|
||||
|
||||
@@ -786,7 +786,8 @@
|
||||
CaptureThreshold: 100
|
||||
TransformOnCapture:
|
||||
ForceHealthPercentage: 25
|
||||
DisabledOverlay:
|
||||
WithColoredOverlay@IDISABLE:
|
||||
Palette: disabled
|
||||
Targetable:
|
||||
TargetTypes: Ground, Husk
|
||||
RequiresForceFire: true
|
||||
@@ -925,3 +926,10 @@
|
||||
TargetTypes: Ground
|
||||
Immobile:
|
||||
OccupiesSpace: true
|
||||
|
||||
^DisabledOverlay:
|
||||
WithColoredOverlay@IDISABLE:
|
||||
RequiresCondition: disabled
|
||||
Palette: disabled
|
||||
GrantConditionOnDisabled@IDISABLE:
|
||||
Condition: disabled
|
||||
|
||||
@@ -120,6 +120,7 @@ WEAF:
|
||||
|
||||
DOMF:
|
||||
Inherits: ^FakeBuilding
|
||||
Inherits@IDISABLE: ^DisabledOverlay
|
||||
Inherits@infiltrate: ^InfiltratableFake
|
||||
Tooltip:
|
||||
Name: Fake Radar Dome
|
||||
@@ -145,7 +146,6 @@ DOMF:
|
||||
Armor:
|
||||
Type: Wood
|
||||
RequiresPower:
|
||||
DisabledOverlay:
|
||||
|
||||
FIXF:
|
||||
Inherits: ^FakeBuilding
|
||||
@@ -207,6 +207,7 @@ FAPW:
|
||||
|
||||
ATEF:
|
||||
Inherits: ^FakeBuilding
|
||||
Inherits@IDISABLE: ^DisabledOverlay
|
||||
Tooltip:
|
||||
Name: Fake Allied Tech Center
|
||||
GenericName: Allied Tech Center
|
||||
@@ -231,10 +232,10 @@ ATEF:
|
||||
Armor:
|
||||
Type: Wood
|
||||
RequiresPower:
|
||||
DisabledOverlay:
|
||||
|
||||
PDOF:
|
||||
Inherits: ^FakeBuilding
|
||||
Inherits@IDISABLE: ^DisabledOverlay
|
||||
Tooltip:
|
||||
Name: Fake Chronosphere
|
||||
GenericName: Chronosphere
|
||||
@@ -263,10 +264,10 @@ PDOF:
|
||||
Explodes:
|
||||
DamageThreshold: 50
|
||||
RequiresPower:
|
||||
DisabledOverlay:
|
||||
|
||||
MSLF:
|
||||
Inherits: ^FakeBuilding
|
||||
Inherits@IDISABLE: ^DisabledOverlay
|
||||
Tooltip:
|
||||
Name: Fake Missile Silo
|
||||
GenericName: Missile Silo
|
||||
@@ -293,7 +294,6 @@ MSLF:
|
||||
Explodes:
|
||||
DamageThreshold: 50
|
||||
RequiresPower:
|
||||
DisabledOverlay:
|
||||
|
||||
FACF:
|
||||
Inherits: ^FakeBuilding
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
MSLO:
|
||||
Inherits: ^ScienceBuilding
|
||||
Inherits@IDISABLE: ^DisabledOverlay
|
||||
Valued:
|
||||
Cost: 2500
|
||||
Tooltip:
|
||||
@@ -45,7 +46,6 @@ MSLO:
|
||||
PowerupSound: EnablePower
|
||||
PowerdownSound: DisablePower
|
||||
RequiresPower:
|
||||
DisabledOverlay:
|
||||
SupportPowerChargeBar:
|
||||
Power:
|
||||
Amount: -150
|
||||
@@ -54,6 +54,7 @@ MSLO:
|
||||
|
||||
GAP:
|
||||
Inherits: ^ScienceBuilding
|
||||
Inherits@IDISABLE: ^DisabledOverlay
|
||||
Valued:
|
||||
Cost: 800
|
||||
Tooltip:
|
||||
@@ -71,7 +72,6 @@ GAP:
|
||||
CanPowerDown:
|
||||
PowerupSound: EnablePower
|
||||
PowerdownSound: DisablePower
|
||||
DisabledOverlay:
|
||||
WithSpriteBody:
|
||||
PauseAnimationWhenDisabled: true
|
||||
Health:
|
||||
@@ -284,6 +284,7 @@ SYRD:
|
||||
|
||||
IRON:
|
||||
Inherits: ^ScienceBuilding
|
||||
Inherits@IDISABLE: ^DisabledOverlay
|
||||
Buildable:
|
||||
Queue: Defense
|
||||
BuildPaletteOrder: 130
|
||||
@@ -301,7 +302,6 @@ IRON:
|
||||
CanPowerDown:
|
||||
PowerupSound: EnablePower
|
||||
PowerdownSound: DisablePower
|
||||
DisabledOverlay:
|
||||
Selectable:
|
||||
Bounds: 48,28,0,2
|
||||
SelectionDecorations:
|
||||
@@ -338,6 +338,7 @@ IRON:
|
||||
|
||||
PDOX:
|
||||
Inherits: ^ScienceBuilding
|
||||
Inherits@IDISABLE: ^DisabledOverlay
|
||||
Buildable:
|
||||
Queue: Defense
|
||||
BuildPaletteOrder: 120
|
||||
@@ -355,7 +356,6 @@ PDOX:
|
||||
CanPowerDown:
|
||||
PowerupSound: EnablePower
|
||||
PowerdownSound: DisablePower
|
||||
DisabledOverlay:
|
||||
Health:
|
||||
HP: 1000
|
||||
Armor:
|
||||
@@ -412,6 +412,7 @@ PDOX:
|
||||
|
||||
TSLA:
|
||||
Inherits: ^Defense
|
||||
Inherits@IDISABLE: ^DisabledOverlay
|
||||
Buildable:
|
||||
Queue: Defense
|
||||
BuildPaletteOrder: 80
|
||||
@@ -429,7 +430,6 @@ TSLA:
|
||||
CanPowerDown:
|
||||
PowerupSound: EnablePower
|
||||
PowerdownSound: DisablePower
|
||||
DisabledOverlay:
|
||||
Health:
|
||||
HP: 400
|
||||
Armor:
|
||||
@@ -457,6 +457,7 @@ TSLA:
|
||||
|
||||
AGUN:
|
||||
Inherits: ^Defense
|
||||
Inherits@IDISABLE: ^DisabledOverlay
|
||||
Buildable:
|
||||
Queue: Defense
|
||||
BuildPaletteOrder: 90
|
||||
@@ -474,7 +475,6 @@ AGUN:
|
||||
CanPowerDown:
|
||||
PowerupSound: EnablePower
|
||||
PowerdownSound: DisablePower
|
||||
DisabledOverlay:
|
||||
Health:
|
||||
HP: 400
|
||||
Armor:
|
||||
@@ -508,6 +508,7 @@ AGUN:
|
||||
|
||||
DOME:
|
||||
Inherits: ^Building
|
||||
Inherits@IDISABLE: ^DisabledOverlay
|
||||
Buildable:
|
||||
Queue: Building
|
||||
BuildPaletteOrder: 90
|
||||
@@ -526,7 +527,6 @@ DOME:
|
||||
CanPowerDown:
|
||||
PowerupSound: EnablePower
|
||||
PowerdownSound: DisablePower
|
||||
DisabledOverlay:
|
||||
Health:
|
||||
HP: 1000
|
||||
Armor:
|
||||
@@ -739,6 +739,7 @@ FTUR:
|
||||
|
||||
SAM:
|
||||
Inherits: ^Defense
|
||||
Inherits@IDISABLE: ^DisabledOverlay
|
||||
Buildable:
|
||||
Queue: Defense
|
||||
BuildPaletteOrder: 100
|
||||
@@ -755,7 +756,6 @@ SAM:
|
||||
CanPowerDown:
|
||||
PowerupSound: EnablePower
|
||||
PowerdownSound: DisablePower
|
||||
DisabledOverlay:
|
||||
Health:
|
||||
HP: 400
|
||||
Armor:
|
||||
@@ -785,6 +785,7 @@ SAM:
|
||||
|
||||
ATEK:
|
||||
Inherits: ^ScienceBuilding
|
||||
Inherits@IDISABLE: ^DisabledOverlay
|
||||
Buildable:
|
||||
Queue: Building
|
||||
BuildPaletteOrder: 140
|
||||
@@ -820,7 +821,6 @@ ATEK:
|
||||
DisplayTimerStances: Ally, Neutral, Enemy
|
||||
SupportPowerChargeBar:
|
||||
RequiresPower:
|
||||
DisabledOverlay:
|
||||
Power:
|
||||
Amount: -200
|
||||
ProvidesPrerequisite@buildingname:
|
||||
@@ -1303,6 +1303,7 @@ AFLD:
|
||||
|
||||
POWR:
|
||||
Inherits: ^Building
|
||||
Inherits@IDISABLE: ^DisabledOverlay
|
||||
Buildable:
|
||||
Queue: Building
|
||||
BuildPaletteOrder: 10
|
||||
@@ -1331,13 +1332,13 @@ POWR:
|
||||
Targetable:
|
||||
TargetTypes: Ground, Structure, C4, DetonateAttack, SpyInfiltrate
|
||||
ScalePowerWithHealth:
|
||||
DisabledOverlay:
|
||||
WithDeathAnimation:
|
||||
DeathSequence: dead
|
||||
UseDeathTypeSuffix: false
|
||||
|
||||
APWR:
|
||||
Inherits: ^Building
|
||||
Inherits@IDISABLE: ^DisabledOverlay
|
||||
Buildable:
|
||||
Queue: Building
|
||||
BuildPaletteOrder: 110
|
||||
@@ -1370,7 +1371,6 @@ APWR:
|
||||
Targetable:
|
||||
TargetTypes: Ground, Structure, C4, DetonateAttack, SpyInfiltrate
|
||||
ScalePowerWithHealth:
|
||||
DisabledOverlay:
|
||||
WithDeathAnimation:
|
||||
DeathSequence: dead
|
||||
UseDeathTypeSuffix: false
|
||||
|
||||
@@ -947,3 +947,10 @@
|
||||
StartDelay: -1
|
||||
SpawnAtLastPosition: false
|
||||
RequiresCondition: !inside-tunnel
|
||||
|
||||
^DisabledOverlay:
|
||||
WithColoredOverlay@IDISABLE:
|
||||
RequiresCondition: disabled
|
||||
Palette: disabled
|
||||
GrantConditionOnDisabled@IDISABLE:
|
||||
Condition: disabled
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
GAPOWR:
|
||||
Inherits: ^Building
|
||||
Inherits@IDISABLE: ^DisabledOverlay
|
||||
Buildable:
|
||||
Queue: Building
|
||||
BuildPaletteOrder: 10
|
||||
@@ -35,7 +36,6 @@ GAPOWR:
|
||||
Targetable:
|
||||
TargetTypes: Ground, C4, DetonateAttack, SpyInfiltrate
|
||||
ScalePowerWithHealth:
|
||||
DisabledOverlay:
|
||||
Pluggable@pluga:
|
||||
Offset: 0,1
|
||||
Conditions:
|
||||
@@ -211,6 +211,7 @@ GAHPAD:
|
||||
PrimaryCondition: primary
|
||||
Reservable:
|
||||
RepairsUnits:
|
||||
PauseOnCondition: empdisable
|
||||
PlayerExperience: 15
|
||||
ProductionBar:
|
||||
WithIdleOverlay@PLATFORM:
|
||||
@@ -258,6 +259,7 @@ GADEPT:
|
||||
MaxHeightDelta: 3
|
||||
Reservable:
|
||||
RepairsUnits:
|
||||
PauseOnCondition: empdisable
|
||||
PlayerExperience: 15
|
||||
RallyPoint:
|
||||
Palette: mouse
|
||||
@@ -370,6 +372,7 @@ GATECH:
|
||||
|
||||
GAPLUG:
|
||||
Inherits: ^Building
|
||||
Inherits@IDISABLE: ^DisabledOverlay
|
||||
Valued:
|
||||
Cost: 1000
|
||||
Tooltip:
|
||||
@@ -389,7 +392,6 @@ GAPLUG:
|
||||
IndicatorPalette: mouse
|
||||
PowerupSpeech: EnablePower
|
||||
PowerdownSpeech: DisablePower
|
||||
DisabledOverlay:
|
||||
WithIdleOverlay@DISH:
|
||||
Sequence: idle-dish
|
||||
WithIdleOverlay@LIGHTS:
|
||||
|
||||
@@ -43,6 +43,7 @@ GAGATE_B:
|
||||
|
||||
GACTWR:
|
||||
Inherits: ^Defense
|
||||
Inherits@IDISABLE: ^DisabledOverlay
|
||||
-WithSpriteBody:
|
||||
WithWallSpriteBody:
|
||||
Type: wall
|
||||
@@ -58,7 +59,6 @@ GACTWR:
|
||||
Building:
|
||||
Selectable:
|
||||
Bounds: 48, 36, 0, -6
|
||||
DisabledOverlay:
|
||||
Health:
|
||||
HP: 500
|
||||
Armor:
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
NAPOWR:
|
||||
Inherits: ^Building
|
||||
Inherits@IDISABLE: ^DisabledOverlay
|
||||
Buildable:
|
||||
Queue: Building
|
||||
BuildPaletteOrder: 20
|
||||
@@ -33,12 +34,12 @@ NAPOWR:
|
||||
TargetTypes: Ground, C4, DetonateAttack, SpyInfiltrate
|
||||
ScalePowerWithHealth:
|
||||
PowerTooltip:
|
||||
DisabledOverlay:
|
||||
SelectionDecorations:
|
||||
VisualBounds: 88, 80, 2, -12
|
||||
|
||||
NAAPWR:
|
||||
Inherits: ^Building
|
||||
Inherits@IDISABLE: ^DisabledOverlay
|
||||
Buildable:
|
||||
Queue: Building
|
||||
BuildPaletteOrder: 120
|
||||
@@ -71,7 +72,6 @@ NAAPWR:
|
||||
Targetable:
|
||||
TargetTypes: Ground, C4, DetonateAttack, SpyInfiltrate
|
||||
ScalePowerWithHealth:
|
||||
DisabledOverlay:
|
||||
PowerTooltip:
|
||||
SelectionDecorations:
|
||||
VisualBounds: 100, 74, 0, -12
|
||||
@@ -222,6 +222,7 @@ NAHPAD:
|
||||
PrimaryCondition: primary
|
||||
Reservable:
|
||||
RepairsUnits:
|
||||
PauseOnCondition: empdisable
|
||||
PlayerExperience: 15
|
||||
ProductionBar:
|
||||
WithIdleOverlay@PLATFORM:
|
||||
|
||||
@@ -148,6 +148,7 @@ NAFNCE:
|
||||
|
||||
NALASR:
|
||||
Inherits: ^Defense
|
||||
Inherits@IDISABLE: ^DisabledOverlay
|
||||
Valued:
|
||||
Cost: 300
|
||||
Tooltip:
|
||||
@@ -160,7 +161,6 @@ NALASR:
|
||||
Building:
|
||||
Selectable:
|
||||
Bounds: 40, 30, -8, -6
|
||||
DisabledOverlay:
|
||||
Health:
|
||||
HP: 500
|
||||
Armor:
|
||||
@@ -188,6 +188,7 @@ NALASR:
|
||||
|
||||
NAOBEL:
|
||||
Inherits: ^Defense
|
||||
Inherits@IDISABLE: ^DisabledOverlay
|
||||
Valued:
|
||||
Cost: 1500
|
||||
Tooltip:
|
||||
@@ -203,7 +204,6 @@ NAOBEL:
|
||||
Selectable:
|
||||
Bounds: 88, 42, 0, -6
|
||||
RequiresPower:
|
||||
DisabledOverlay:
|
||||
Health:
|
||||
HP: 725
|
||||
Armor:
|
||||
@@ -232,6 +232,7 @@ NAOBEL:
|
||||
|
||||
NASAM:
|
||||
Inherits: ^Defense
|
||||
Inherits@IDISABLE: ^DisabledOverlay
|
||||
Valued:
|
||||
Cost: 500
|
||||
Tooltip:
|
||||
@@ -244,7 +245,6 @@ NASAM:
|
||||
Selectable:
|
||||
Bounds: 40, 30, -3, -8
|
||||
RequiresPower:
|
||||
DisabledOverlay:
|
||||
Health:
|
||||
HP: 600
|
||||
Armor:
|
||||
@@ -301,7 +301,10 @@ NASTLH:
|
||||
PowerupSpeech: EnablePower
|
||||
PowerdownSpeech: DisablePower
|
||||
IndicatorPalette: mouse
|
||||
GrantConditionOnDisabled:
|
||||
Condition: disabled
|
||||
ProximityExternalCondition:
|
||||
RequiresCondition: !disabled
|
||||
Condition: cloakgenerator
|
||||
Range: 12c0
|
||||
EnableSound: cloak5.aud
|
||||
@@ -314,6 +317,7 @@ NASTLH:
|
||||
|
||||
NAMISL:
|
||||
Inherits: ^Building
|
||||
Inherits@IDISABLE: ^DisabledOverlay
|
||||
Buildable:
|
||||
Queue: Defense
|
||||
BuildPaletteOrder: 180
|
||||
@@ -346,7 +350,6 @@ NAMISL:
|
||||
PowerupSpeech: EnablePower
|
||||
PowerdownSpeech: DisablePower
|
||||
RequiresPower:
|
||||
DisabledOverlay:
|
||||
ProvidesPrerequisite@buildingname:
|
||||
SupportPowerChargeBar:
|
||||
NukePower:
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
NAPULS:
|
||||
Inherits: ^Defense
|
||||
Inherits@IDISABLE: ^DisabledOverlay
|
||||
Valued:
|
||||
Cost: 1000
|
||||
Tooltip:
|
||||
@@ -15,7 +16,6 @@ NAPULS:
|
||||
Selectable:
|
||||
Bounds: 78, 54, 0, -12
|
||||
RequiresPower:
|
||||
DisabledOverlay:
|
||||
Health:
|
||||
HP: 500
|
||||
Armor:
|
||||
|
||||
Reference in New Issue
Block a user