Added some trait [Desc()]s.
This commit is contained in:
@@ -14,15 +14,20 @@ using OpenRA.Traits;
|
|||||||
|
|
||||||
namespace OpenRA.Mods.RA
|
namespace OpenRA.Mods.RA
|
||||||
{
|
{
|
||||||
|
[Desc("Charges up before being able to attack.")]
|
||||||
class AttackChargeInfo : AttackOmniInfo
|
class AttackChargeInfo : AttackOmniInfo
|
||||||
{
|
{
|
||||||
public readonly int MaxCharges = 1;
|
public readonly int MaxCharges = 1;
|
||||||
|
|
||||||
[Desc("Reload time (for all charges).")]
|
[Desc("Reload time (for all charges).")]
|
||||||
public readonly int ReloadTime = 120;
|
public readonly int ReloadTime = 120;
|
||||||
|
|
||||||
[Desc("Delay for first charge. Needs to match FireDelay for Obelisk.")]
|
[Desc("Delay for first charge. Needs to match FireDelay for Obelisk.")]
|
||||||
public readonly int InitialChargeDelay = 22;
|
public readonly int InitialChargeDelay = 22;
|
||||||
|
|
||||||
[Desc("Delay for additional charges if MaxCharge is larger than 1.")]
|
[Desc("Delay for additional charges if MaxCharge is larger than 1.")]
|
||||||
public readonly int ChargeDelay = 3;
|
public readonly int ChargeDelay = 3;
|
||||||
|
|
||||||
public override object Create(ActorInitializer init) { return new AttackCharge(init.self, this); }
|
public override object Create(ActorInitializer init) { return new AttackCharge(init.self, this); }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ using OpenRA.Traits;
|
|||||||
|
|
||||||
namespace OpenRA.Mods.RA
|
namespace OpenRA.Mods.RA
|
||||||
{
|
{
|
||||||
|
[Desc("Actor will follow units until in range to attack them.")]
|
||||||
public class AttackFollowInfo : AttackBaseInfo
|
public class AttackFollowInfo : AttackBaseInfo
|
||||||
{
|
{
|
||||||
public override object Create(ActorInitializer init) { return new AttackFollow(init.self, this); }
|
public override object Create(ActorInitializer init) { return new AttackFollow(init.self, this); }
|
||||||
|
|||||||
@@ -24,15 +24,16 @@ namespace OpenRA.Mods.RA
|
|||||||
public WAngle Cone;
|
public WAngle Cone;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Desc("Cargo can fire their weapons out of fire ports.")]
|
||||||
public class AttackGarrisonedInfo : AttackFollowInfo, Requires<CargoInfo>
|
public class AttackGarrisonedInfo : AttackFollowInfo, Requires<CargoInfo>
|
||||||
{
|
{
|
||||||
[Desc("Fire port offsets in local coordinates")]
|
[Desc("Fire port offsets in local coordinates.")]
|
||||||
public readonly WRange[] PortOffsets = {};
|
public readonly WRange[] PortOffsets = {};
|
||||||
|
|
||||||
[Desc("Fire port yaw angles")]
|
[Desc("Fire port yaw angles.")]
|
||||||
public readonly WAngle[] PortYaws = {};
|
public readonly WAngle[] PortYaws = {};
|
||||||
|
|
||||||
[Desc("Fire port yaw cone angle")]
|
[Desc("Fire port yaw cone angle.")]
|
||||||
public readonly WAngle[] PortCones = {};
|
public readonly WAngle[] PortCones = {};
|
||||||
|
|
||||||
public readonly string MuzzlePalette = "effect";
|
public readonly string MuzzlePalette = "effect";
|
||||||
@@ -68,13 +69,13 @@ namespace OpenRA.Mods.RA
|
|||||||
|
|
||||||
|
|
||||||
if (info.PortOffsets.Length % 3 != 0 || info.PortOffsets.Length == 0)
|
if (info.PortOffsets.Length % 3 != 0 || info.PortOffsets.Length == 0)
|
||||||
throw new InvalidOperationException("PortOffsets array length must be a multiple of three");
|
throw new InvalidOperationException("PortOffsets array length must be a multiple of three.");
|
||||||
|
|
||||||
if (info.PortYaws.Length * 3 != info.PortOffsets.Length)
|
if (info.PortYaws.Length * 3 != info.PortOffsets.Length)
|
||||||
throw new InvalidOperationException("PortYaws must define an angle for each port");
|
throw new InvalidOperationException("PortYaws must define an angle for each port.");
|
||||||
|
|
||||||
if (info.PortCones.Length * 3 != info.PortOffsets.Length)
|
if (info.PortCones.Length * 3 != info.PortOffsets.Length)
|
||||||
throw new InvalidOperationException("PortCones must define an angle for each port");
|
throw new InvalidOperationException("PortCones must define an angle for each port.");
|
||||||
|
|
||||||
var p = new List<FirePort>();
|
var p = new List<FirePort>();
|
||||||
for (var i = 0; i < info.PortOffsets.Length / 3; i++)
|
for (var i = 0; i < info.PortOffsets.Length / 3; i++)
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ using OpenRA.Traits;
|
|||||||
|
|
||||||
namespace OpenRA.Mods.RA
|
namespace OpenRA.Mods.RA
|
||||||
{
|
{
|
||||||
|
[Desc("Dogs use this attack model.")]
|
||||||
class AttackLeapInfo : AttackFrontalInfo
|
class AttackLeapInfo : AttackFrontalInfo
|
||||||
{
|
{
|
||||||
[Desc("Leap speed (in units/tick).")]
|
[Desc("Leap speed (in units/tick).")]
|
||||||
|
|||||||
@@ -16,8 +16,10 @@ using OpenRA.Traits;
|
|||||||
|
|
||||||
namespace OpenRA.Mods.RA
|
namespace OpenRA.Mods.RA
|
||||||
{
|
{
|
||||||
|
[Desc("Actor's turret rises from the ground before attacking.")]
|
||||||
class AttackPopupTurretedInfo : AttackTurretedInfo, Requires<BuildingInfo>, Requires<RenderBuildingInfo>
|
class AttackPopupTurretedInfo : AttackTurretedInfo, Requires<BuildingInfo>, Requires<RenderBuildingInfo>
|
||||||
{
|
{
|
||||||
|
[Desc("How many game ticks should pass before closing the actor's turret.")]
|
||||||
public int CloseDelay = 125;
|
public int CloseDelay = 125;
|
||||||
public int DefaultFacing = 0;
|
public int DefaultFacing = 0;
|
||||||
public float ClosedDamageMultiplier = 0.5f;
|
public float ClosedDamageMultiplier = 0.5f;
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ using OpenRA.Traits;
|
|||||||
|
|
||||||
namespace OpenRA.Mods.RA
|
namespace OpenRA.Mods.RA
|
||||||
{
|
{
|
||||||
|
[Desc("Actor has a visual turret used to attack.")]
|
||||||
class AttackTurretedInfo : AttackFollowInfo, Requires<TurretedInfo>
|
class AttackTurretedInfo : AttackFollowInfo, Requires<TurretedInfo>
|
||||||
{
|
{
|
||||||
public override object Create(ActorInitializer init) { return new AttackTurreted(init.self, this); }
|
public override object Create(ActorInitializer init) { return new AttackTurreted(init.self, this); }
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ using OpenRA.Traits;
|
|||||||
|
|
||||||
namespace OpenRA.Mods.RA
|
namespace OpenRA.Mods.RA
|
||||||
{
|
{
|
||||||
|
[Desc("This actor will play a fire animation over its body and take damage over time.")]
|
||||||
class BurnsInfo : ITraitInfo, Requires<RenderSpritesInfo>
|
class BurnsInfo : ITraitInfo, Requires<RenderSpritesInfo>
|
||||||
{
|
{
|
||||||
public readonly string Anim = "1";
|
public readonly string Anim = "1";
|
||||||
|
|||||||
@@ -19,7 +19,9 @@ namespace OpenRA.Mods.RA
|
|||||||
{
|
{
|
||||||
class C4DemolitionInfo : ITraitInfo
|
class C4DemolitionInfo : ITraitInfo
|
||||||
{
|
{
|
||||||
public readonly int C4Delay = 45; // 1.8 seconds
|
[Desc("Delay to demolish the target once the C4 is planted." +
|
||||||
|
"Measured in game ticks. Default is 1.8 seconds.")]
|
||||||
|
public readonly int C4Delay = 45;
|
||||||
|
|
||||||
public object Create(ActorInitializer init) { return new C4Demolition(this); }
|
public object Create(ActorInitializer init) { return new C4Demolition(this); }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ using OpenRA.Traits;
|
|||||||
|
|
||||||
namespace OpenRA.Mods.RA
|
namespace OpenRA.Mods.RA
|
||||||
{
|
{
|
||||||
|
[Desc("This actor can transport Passenger actors.")]
|
||||||
public class CargoInfo : ITraitInfo, Requires<IOccupySpaceInfo>
|
public class CargoInfo : ITraitInfo, Requires<IOccupySpaceInfo>
|
||||||
{
|
{
|
||||||
public readonly int MaxWeight = 0;
|
public readonly int MaxWeight = 0;
|
||||||
|
|||||||
@@ -17,10 +17,15 @@ using OpenRA.Traits;
|
|||||||
|
|
||||||
namespace OpenRA.Mods.RA
|
namespace OpenRA.Mods.RA
|
||||||
{
|
{
|
||||||
|
[Desc("This unit can cloak and uncloak in specific situations.")]
|
||||||
public class CloakInfo : ITraitInfo
|
public class CloakInfo : ITraitInfo
|
||||||
{
|
{
|
||||||
public readonly int InitialDelay = 10; // Ticks
|
[Desc("Measured in game ticks.")]
|
||||||
public readonly int CloakDelay = 30; // Ticks
|
public readonly int InitialDelay = 10;
|
||||||
|
|
||||||
|
[Desc("Measured in game ticks.")]
|
||||||
|
public readonly int CloakDelay = 30;
|
||||||
|
|
||||||
public readonly bool UncloakOnAttack = true;
|
public readonly bool UncloakOnAttack = true;
|
||||||
public readonly bool UncloakOnMove = false;
|
public readonly bool UncloakOnMove = false;
|
||||||
public readonly bool UncloakOnUnload = false;
|
public readonly bool UncloakOnUnload = false;
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ using OpenRA.Traits;
|
|||||||
|
|
||||||
namespace OpenRA.Mods.RA
|
namespace OpenRA.Mods.RA
|
||||||
{
|
{
|
||||||
|
[Desc("Sounds to play when killed.")]
|
||||||
public class DeathSoundsInfo : ITraitInfo
|
public class DeathSoundsInfo : ITraitInfo
|
||||||
{
|
{
|
||||||
[Desc("Death notification voice.")]
|
[Desc("Death notification voice.")]
|
||||||
|
|||||||
@@ -12,9 +12,13 @@ using OpenRA.Traits;
|
|||||||
|
|
||||||
namespace OpenRA.Mods.RA
|
namespace OpenRA.Mods.RA
|
||||||
{
|
{
|
||||||
|
[Desc("Actor can reveal Cloak actors in a specified range.")]
|
||||||
class DetectCloakedInfo : TraitInfo<DetectCloaked>
|
class DetectCloakedInfo : TraitInfo<DetectCloaked>
|
||||||
{
|
{
|
||||||
|
[Desc("Specific cloak classifications I can reveal.")]
|
||||||
public readonly string[] CloakTypes = { "Cloak" };
|
public readonly string[] CloakTypes = { "Cloak" };
|
||||||
|
|
||||||
|
[Desc("Measured in cells.")]
|
||||||
public readonly int Range = 5;
|
public readonly int Range = 5;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -16,6 +16,7 @@ using OpenRA.Traits;
|
|||||||
|
|
||||||
namespace OpenRA.Mods.RA
|
namespace OpenRA.Mods.RA
|
||||||
{
|
{
|
||||||
|
[Desc("Overrides the default ToolTip when this actor is disguised (aids in deceiving enemy players).")]
|
||||||
class DisguiseToolTipInfo : TooltipInfo, Requires<DisguiseInfo>
|
class DisguiseToolTipInfo : TooltipInfo, Requires<DisguiseInfo>
|
||||||
{
|
{
|
||||||
public override object Create (ActorInitializer init) { return new DisguiseToolTip(init.self, this); }
|
public override object Create (ActorInitializer init) { return new DisguiseToolTip(init.self, this); }
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#region Copyright & License Information
|
#region Copyright & License Information
|
||||||
/*
|
/*
|
||||||
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
|
* Copyright 2007-2014 The OpenRA Developers (see AUTHORS)
|
||||||
* This file is part of OpenRA, which is free software. It is made
|
* 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
|
* available to you under the terms of the GNU General Public License
|
||||||
* as published by the Free Software Foundation. For more information,
|
* as published by the Free Software Foundation. For more information,
|
||||||
@@ -15,13 +15,19 @@ using OpenRA.Traits;
|
|||||||
|
|
||||||
namespace OpenRA.Mods.RA
|
namespace OpenRA.Mods.RA
|
||||||
{
|
{
|
||||||
|
[Desc("Draw a colored contrail behind this actor when they move.")]
|
||||||
class ContrailInfo : ITraitInfo, Requires<IBodyOrientationInfo>
|
class ContrailInfo : ITraitInfo, Requires<IBodyOrientationInfo>
|
||||||
{
|
{
|
||||||
[Desc("Position relative to body")]
|
[Desc("Position relative to body")]
|
||||||
public readonly WVec Offset = WVec.Zero;
|
public readonly WVec Offset = WVec.Zero;
|
||||||
|
|
||||||
|
[Desc("Measured in pixels.")]
|
||||||
public readonly int TrailLength = 25;
|
public readonly int TrailLength = 25;
|
||||||
|
|
||||||
|
[Desc("RGB color of the contrail.")]
|
||||||
public readonly Color Color = Color.White;
|
public readonly Color Color = Color.White;
|
||||||
|
|
||||||
|
[Desc("Use player remap color instead of a custom color?")]
|
||||||
public readonly bool UsePlayerColor = true;
|
public readonly bool UsePlayerColor = true;
|
||||||
|
|
||||||
public object Create(ActorInitializer init) { return new Contrail(init.self, this); }
|
public object Create(ActorInitializer init) { return new Contrail(init.self, this); }
|
||||||
|
|||||||
@@ -15,12 +15,14 @@ using OpenRA.Traits;
|
|||||||
|
|
||||||
namespace OpenRA.Mods.RA
|
namespace OpenRA.Mods.RA
|
||||||
{
|
{
|
||||||
|
[Desc("Spawn new actors when sold.")]
|
||||||
class EmitInfantryOnSellInfo : TraitInfo<EmitInfantryOnSell>
|
class EmitInfantryOnSellInfo : TraitInfo<EmitInfantryOnSell>
|
||||||
{
|
{
|
||||||
public readonly float ValuePercent = 40;
|
public readonly float ValuePercent = 40;
|
||||||
public readonly float MinHpPercent = 30;
|
public readonly float MinHpPercent = 30;
|
||||||
|
|
||||||
[ActorReference]
|
[ActorReference]
|
||||||
|
[Desc("Be sure to use lowercase. Default value is \"e1\".")]
|
||||||
public readonly string[] ActorTypes = { "e1" };
|
public readonly string[] ActorTypes = { "e1" };
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ using OpenRA.Traits;
|
|||||||
|
|
||||||
namespace OpenRA.Mods.RA
|
namespace OpenRA.Mods.RA
|
||||||
{
|
{
|
||||||
|
[Desc("This actor's experience increases when it has killed a GivesExperience actor.")]
|
||||||
public class GainsExperienceInfo : ITraitInfo, Requires<ValuedInfo>
|
public class GainsExperienceInfo : ITraitInfo, Requires<ValuedInfo>
|
||||||
{
|
{
|
||||||
[Desc("XP requirements for each level, as multiples of our own cost.")]
|
[Desc("XP requirements for each level, as multiples of our own cost.")]
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ using OpenRA.Traits;
|
|||||||
|
|
||||||
namespace OpenRA.Mods.RA
|
namespace OpenRA.Mods.RA
|
||||||
{
|
{
|
||||||
|
[Desc("This actor has properties that upgrade when a specific criteria is met.")]
|
||||||
public class GainsUnitUpgradesInfo : ITraitInfo
|
public class GainsUnitUpgradesInfo : ITraitInfo
|
||||||
{
|
{
|
||||||
public readonly int FirepowerMaxLevel = 15;
|
public readonly int FirepowerMaxLevel = 15;
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ using OpenRA.Traits;
|
|||||||
|
|
||||||
namespace OpenRA.Mods.RA
|
namespace OpenRA.Mods.RA
|
||||||
{
|
{
|
||||||
|
[Desc("This actor gives experience to a GainsExperience actor when they are killed.")]
|
||||||
class GivesExperienceInfo : TraitInfo<GivesExperience>
|
class GivesExperienceInfo : TraitInfo<GivesExperience>
|
||||||
{
|
{
|
||||||
[Desc("If -1, use the value of the unit cost.")]
|
[Desc("If -1, use the value of the unit cost.")]
|
||||||
@@ -23,7 +24,7 @@ namespace OpenRA.Mods.RA
|
|||||||
public void Killed(Actor self, AttackInfo e)
|
public void Killed(Actor self, AttackInfo e)
|
||||||
{
|
{
|
||||||
// Prevent TK from giving exp
|
// Prevent TK from giving exp
|
||||||
if (e.Attacker == null || e.Attacker.Destroyed || e.Attacker.Owner.Stances[ self.Owner ] == Stance.Ally )
|
if (e.Attacker == null || e.Attacker.Destroyed || e.Attacker.Owner.Stances[self.Owner] == Stance.Ally)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
var info = self.Info.Traits.Get<GivesExperienceInfo>();
|
var info = self.Info.Traits.Get<GivesExperienceInfo>();
|
||||||
|
|||||||
@@ -16,9 +16,9 @@ using OpenRA.Traits;
|
|||||||
|
|
||||||
namespace OpenRA.Mods.RA
|
namespace OpenRA.Mods.RA
|
||||||
{
|
{
|
||||||
|
[Desc("The player can give this unit the order to follow and protect friendly units with the Guardable trait.")]
|
||||||
class GuardInfo : TraitInfo<Guard> { }
|
class GuardInfo : TraitInfo<Guard> { }
|
||||||
|
|
||||||
[Desc("The player can give this unit the order to follow and protect friendly units with the Guardable trait.")]
|
|
||||||
class Guard : IResolveOrder, IOrderVoice
|
class Guard : IResolveOrder, IOrderVoice
|
||||||
{
|
{
|
||||||
public void ResolveOrder(Actor self, Order order)
|
public void ResolveOrder(Actor self, Order order)
|
||||||
@@ -102,6 +102,7 @@ namespace OpenRA.Mods.RA
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Desc("This unit can be guarded (followed and protected) by a Guard unit.")]
|
||||||
class GuardableInfo : TraitInfo<Guardable>
|
class GuardableInfo : TraitInfo<Guardable>
|
||||||
{
|
{
|
||||||
public readonly int Range = 2;
|
public readonly int Range = 2;
|
||||||
|
|||||||
@@ -14,6 +14,7 @@ using OpenRA.Traits;
|
|||||||
|
|
||||||
namespace OpenRA.Mods.RA
|
namespace OpenRA.Mods.RA
|
||||||
{
|
{
|
||||||
|
[Desc("This structure can be infiltrated causing funds to be stolen.")]
|
||||||
class InfiltrateForCashInfo : ITraitInfo, Requires<InfiltratableInfo>
|
class InfiltrateForCashInfo : ITraitInfo, Requires<InfiltratableInfo>
|
||||||
{
|
{
|
||||||
public readonly int Percentage = 50;
|
public readonly int Percentage = 50;
|
||||||
|
|||||||
@@ -13,13 +13,11 @@ using OpenRA.Traits;
|
|||||||
|
|
||||||
namespace OpenRA.Mods.RA
|
namespace OpenRA.Mods.RA
|
||||||
{
|
{
|
||||||
class InvulnerableInfo : TraitInfo<Invulnerable> {}
|
[Desc("This unit cannot be damaged.")]
|
||||||
|
class InvulnerableInfo : TraitInfo<Invulnerable> { }
|
||||||
|
|
||||||
class Invulnerable : IDamageModifier
|
class Invulnerable : IDamageModifier
|
||||||
{
|
{
|
||||||
public float GetDamageModifier( Actor attacker, WarheadInfo warhead )
|
public float GetDamageModifier(Actor attacker, WarheadInfo warhead) { return 0.0f; }
|
||||||
{
|
|
||||||
return 0.0f;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,13 +13,17 @@ using OpenRA.Traits;
|
|||||||
|
|
||||||
namespace OpenRA.Mods.RA
|
namespace OpenRA.Mods.RA
|
||||||
{
|
{
|
||||||
|
[Desc("Actor has a limited amount of ammo, after using it all the actor must reload in some way.")]
|
||||||
public class LimitedAmmoInfo : ITraitInfo
|
public class LimitedAmmoInfo : ITraitInfo
|
||||||
{
|
{
|
||||||
public readonly int Ammo = 0;
|
public readonly int Ammo = 0;
|
||||||
|
|
||||||
[Desc("Defaults to value in Ammo.")]
|
[Desc("Defaults to value in Ammo.")]
|
||||||
public readonly int PipCount = 0;
|
public readonly int PipCount = 0;
|
||||||
|
|
||||||
public readonly PipType PipType = PipType.Green;
|
public readonly PipType PipType = PipType.Green;
|
||||||
public readonly PipType PipTypeEmpty = PipType.Transparent;
|
public readonly PipType PipTypeEmpty = PipType.Transparent;
|
||||||
|
|
||||||
[Desc("Time to reload measured in ticks.")]
|
[Desc("Time to reload measured in ticks.")]
|
||||||
public readonly int ReloadTicks = 25 * 2;
|
public readonly int ReloadTicks = 25 * 2;
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#region Copyright & License Information
|
#region Copyright & License Information
|
||||||
/*
|
/*
|
||||||
* Copyright 2007-2013 The OpenRA Developers (see AUTHORS)
|
* Copyright 2007-2014 The OpenRA Developers (see AUTHORS)
|
||||||
* This file is part of OpenRA, which is free software. It is made
|
* 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
|
* available to you under the terms of the GNU General Public License
|
||||||
* as published by the Free Software Foundation. For more information,
|
* as published by the Free Software Foundation. For more information,
|
||||||
@@ -17,6 +17,7 @@ using OpenRA.Traits;
|
|||||||
|
|
||||||
namespace OpenRA.Mods.RA
|
namespace OpenRA.Mods.RA
|
||||||
{
|
{
|
||||||
|
[Desc("This actor will remain visible (but not updated visually) under fog, once discovered.")]
|
||||||
public class FrozenUnderFogInfo : ITraitInfo, Requires<BuildingInfo>, Requires<RenderSpritesInfo>
|
public class FrozenUnderFogInfo : ITraitInfo, Requires<BuildingInfo>, Requires<RenderSpritesInfo>
|
||||||
{
|
{
|
||||||
public readonly bool StartsRevealed = false;
|
public readonly bool StartsRevealed = false;
|
||||||
|
|||||||
@@ -17,12 +17,13 @@ using OpenRA.Traits;
|
|||||||
|
|
||||||
namespace OpenRA.Mods.RA
|
namespace OpenRA.Mods.RA
|
||||||
{
|
{
|
||||||
|
[Desc("This unit can spawn and eject other actors while flying.")]
|
||||||
public class ParaDropInfo : ITraitInfo, Requires<CargoInfo>
|
public class ParaDropInfo : ITraitInfo, Requires<CargoInfo>
|
||||||
{
|
{
|
||||||
[Desc("Distance around the drop-point to unload troops")]
|
[Desc("Distance around the drop-point to unload troops.")]
|
||||||
public readonly WRange DropRange = WRange.FromCells(4);
|
public readonly WRange DropRange = WRange.FromCells(4);
|
||||||
|
|
||||||
[Desc("Sound to play when dropping")]
|
[Desc("Sound to play when dropping.")]
|
||||||
public readonly string ChuteSound = "chute1.aud";
|
public readonly string ChuteSound = "chute1.aud";
|
||||||
|
|
||||||
public object Create(ActorInitializer init) { return new ParaDrop(init.self, this); }
|
public object Create(ActorInitializer init) { return new ParaDrop(init.self, this); }
|
||||||
|
|||||||
@@ -14,8 +14,10 @@ using OpenRA.Traits;
|
|||||||
|
|
||||||
namespace OpenRA.Mods.RA
|
namespace OpenRA.Mods.RA
|
||||||
{
|
{
|
||||||
|
[Desc("Can be paradropped by a ParaDrop actor.")]
|
||||||
class ParachutableInfo : ITraitInfo
|
class ParachutableInfo : ITraitInfo
|
||||||
{
|
{
|
||||||
|
[Desc("If we land on invalid terrain for my actor type should we be killed?")]
|
||||||
public readonly bool KilledOnImpassableTerrain = true;
|
public readonly bool KilledOnImpassableTerrain = true;
|
||||||
|
|
||||||
public readonly string GroundImpactSound = "squishy2.aud";
|
public readonly string GroundImpactSound = "squishy2.aud";
|
||||||
@@ -28,8 +30,10 @@ namespace OpenRA.Mods.RA
|
|||||||
|
|
||||||
[Desc("Requires the sub-sequences \"open\" and \"idle\".")]
|
[Desc("Requires the sub-sequences \"open\" and \"idle\".")]
|
||||||
public readonly string ParachuteSequence = null;
|
public readonly string ParachuteSequence = null;
|
||||||
|
|
||||||
[Desc("Optional, otherwise defaults to the palette the actor is using.")]
|
[Desc("Optional, otherwise defaults to the palette the actor is using.")]
|
||||||
public readonly string ParachutePalette = null;
|
public readonly string ParachutePalette = null;
|
||||||
|
|
||||||
[Desc("Used to clone the actor with this palette and render it with a visual offset below.")]
|
[Desc("Used to clone the actor with this palette and render it with a visual offset below.")]
|
||||||
public readonly string ParachuteShadowPalette = "shadow";
|
public readonly string ParachuteShadowPalette = "shadow";
|
||||||
|
|
||||||
@@ -39,6 +43,7 @@ namespace OpenRA.Mods.RA
|
|||||||
|
|
||||||
[Desc("Alternative to ParachuteShadowPalette which disables it and allows to set a custom sprite sequence instead.")]
|
[Desc("Alternative to ParachuteShadowPalette which disables it and allows to set a custom sprite sequence instead.")]
|
||||||
public readonly string ShadowSequence = null;
|
public readonly string ShadowSequence = null;
|
||||||
|
|
||||||
[Desc("Optional, otherwise defaults to the palette the actor is using.")]
|
[Desc("Optional, otherwise defaults to the palette the actor is using.")]
|
||||||
public readonly string ShadowPalette = null;
|
public readonly string ShadowPalette = null;
|
||||||
|
|
||||||
|
|||||||
@@ -17,19 +17,20 @@ using OpenRA.Traits;
|
|||||||
|
|
||||||
namespace OpenRA.Mods.RA
|
namespace OpenRA.Mods.RA
|
||||||
{
|
{
|
||||||
|
[Desc("This actor can enter Cargo actors.")]
|
||||||
public class PassengerInfo : ITraitInfo
|
public class PassengerInfo : ITraitInfo
|
||||||
{
|
{
|
||||||
public readonly string CargoType = null;
|
public readonly string CargoType = null;
|
||||||
public readonly PipType PipType = PipType.Green;
|
public readonly PipType PipType = PipType.Green;
|
||||||
public int Weight = 1;
|
public int Weight = 1;
|
||||||
|
|
||||||
public object Create( ActorInitializer init ) { return new Passenger( this ); }
|
public object Create(ActorInitializer init) { return new Passenger(this); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class Passenger : IIssueOrder, IResolveOrder, IOrderVoice
|
public class Passenger : IIssueOrder, IResolveOrder, IOrderVoice
|
||||||
{
|
{
|
||||||
public readonly PassengerInfo info;
|
public readonly PassengerInfo info;
|
||||||
public Passenger( PassengerInfo info ) { this.info = info; }
|
public Passenger(PassengerInfo info) { this.info = info; }
|
||||||
public Actor Transport;
|
public Actor Transport;
|
||||||
|
|
||||||
public IEnumerable<IOrderTargeter> Orders
|
public IEnumerable<IOrderTargeter> Orders
|
||||||
@@ -41,21 +42,21 @@ namespace OpenRA.Mods.RA
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Order IssueOrder( Actor self, IOrderTargeter order, Target target, bool queued )
|
public Order IssueOrder(Actor self, IOrderTargeter order, Target target, bool queued)
|
||||||
{
|
{
|
||||||
if( order.OrderID == "EnterTransport" )
|
if (order.OrderID == "EnterTransport")
|
||||||
return new Order(order.OrderID, self, queued) { TargetActor = target.Actor };
|
return new Order(order.OrderID, self, queued) { TargetActor = target.Actor };
|
||||||
|
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool IsCorrectCargoType( Actor target )
|
bool IsCorrectCargoType(Actor target)
|
||||||
{
|
{
|
||||||
var ci = target.Info.Traits.Get<CargoInfo>();
|
var ci = target.Info.Traits.Get<CargoInfo>();
|
||||||
return ci.Types.Contains( info.CargoType );
|
return ci.Types.Contains(info.CargoType);
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CanEnter( Actor target )
|
bool CanEnter(Actor target)
|
||||||
{
|
{
|
||||||
var cargo = target.TraitOrDefault<Cargo>();
|
var cargo = target.TraitOrDefault<Cargo>();
|
||||||
return cargo != null && cargo.HasSpace(info.Weight);
|
return cargo != null && cargo.HasSpace(info.Weight);
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ using OpenRA.Traits;
|
|||||||
|
|
||||||
namespace OpenRA.Mods.RA
|
namespace OpenRA.Mods.RA
|
||||||
{
|
{
|
||||||
|
[Desc("This actor provides radar.")]
|
||||||
public class ProvidesRadarInfo : TraitInfo<ProvidesRadar> { }
|
public class ProvidesRadarInfo : TraitInfo<ProvidesRadar> { }
|
||||||
|
|
||||||
public class ProvidesRadar : ITick
|
public class ProvidesRadar : ITick
|
||||||
@@ -33,7 +34,12 @@ namespace OpenRA.Mods.RA
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
class JamsRadarInfo : TraitInfo<JamsRadar> { public readonly int Range = 0; }
|
[Desc("Jams radar signal.")]
|
||||||
|
class JamsRadarInfo : TraitInfo<JamsRadar>
|
||||||
|
{
|
||||||
|
[Desc("Range for jamming.")]
|
||||||
|
public readonly int Range = 0;
|
||||||
|
}
|
||||||
|
|
||||||
class JamsRadar { }
|
class JamsRadar { }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ using OpenRA.Traits;
|
|||||||
|
|
||||||
namespace OpenRA.Mods.RA
|
namespace OpenRA.Mods.RA
|
||||||
{
|
{
|
||||||
|
[Desc("Actor can capture ProximityCapturable actors.")]
|
||||||
public class ProximityCaptorInfo : ITraitInfo
|
public class ProximityCaptorInfo : ITraitInfo
|
||||||
{
|
{
|
||||||
public readonly string[] Types = {};
|
public readonly string[] Types = {};
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
#region Copyright & License Information
|
#region Copyright & License Information
|
||||||
/*
|
/*
|
||||||
* Copyright 2007-2011 The OpenRA Developers (see AUTHORS)
|
* Copyright 2007-2014 The OpenRA Developers (see AUTHORS)
|
||||||
* This file is part of OpenRA, which is free software. It is made
|
* 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
|
* available to you under the terms of the GNU General Public License
|
||||||
* as published by the Free Software Foundation. For more information,
|
* as published by the Free Software Foundation. For more information,
|
||||||
@@ -15,6 +15,7 @@ using OpenRA.Traits;
|
|||||||
|
|
||||||
namespace OpenRA.Mods.RA
|
namespace OpenRA.Mods.RA
|
||||||
{
|
{
|
||||||
|
[Desc("Actor can be captured by units in a specified proximity.")]
|
||||||
public class ProximityCapturableInfo : ITraitInfo
|
public class ProximityCapturableInfo : ITraitInfo
|
||||||
{
|
{
|
||||||
public readonly bool Permanent = false;
|
public readonly bool Permanent = false;
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ namespace OpenRA.Mods.RA
|
|||||||
void Render(WorldRenderer wr, World w, ActorInfo ai, WPos centerPosition);
|
void Render(WorldRenderer wr, World w, ActorInfo ai, WPos centerPosition);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
[Desc("Draw a circle indicating my weapon's range.")]
|
||||||
class RenderRangeCircleInfo : ITraitInfo, IPlaceBuildingDecoration, Requires<AttackBaseInfo>
|
class RenderRangeCircleInfo : ITraitInfo, IPlaceBuildingDecoration, Requires<AttackBaseInfo>
|
||||||
{
|
{
|
||||||
public readonly string RangeCircleType = null;
|
public readonly string RangeCircleType = null;
|
||||||
|
|||||||
@@ -18,6 +18,7 @@ using OpenRA.Traits;
|
|||||||
|
|
||||||
namespace OpenRA.Mods.RA
|
namespace OpenRA.Mods.RA
|
||||||
{
|
{
|
||||||
|
[Desc("This actor can be sent to a structure for repairs.")]
|
||||||
class RepairableInfo : ITraitInfo, Requires<HealthInfo>
|
class RepairableInfo : ITraitInfo, Requires<HealthInfo>
|
||||||
{
|
{
|
||||||
public readonly string[] RepairBuildings = { "fix" };
|
public readonly string[] RepairBuildings = { "fix" };
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ using OpenRA.Traits;
|
|||||||
|
|
||||||
namespace OpenRA.Mods.RA
|
namespace OpenRA.Mods.RA
|
||||||
{
|
{
|
||||||
|
[Desc("Used for silos.")]
|
||||||
class StoresResourcesInfo : ITraitInfo
|
class StoresResourcesInfo : ITraitInfo
|
||||||
{
|
{
|
||||||
[Desc("Number of little squares used to display how filled unit is.")]
|
[Desc("Number of little squares used to display how filled unit is.")]
|
||||||
|
|||||||
@@ -14,10 +14,16 @@ using OpenRA.Traits;
|
|||||||
|
|
||||||
namespace OpenRA.Mods.RA
|
namespace OpenRA.Mods.RA
|
||||||
{
|
{
|
||||||
|
[Desc("This actor goes prone in an attempt to reduce damage.")]
|
||||||
public class TakeCoverInfo : TurretedInfo
|
public class TakeCoverInfo : TurretedInfo
|
||||||
{
|
{
|
||||||
public readonly int ProneTime = 100; /* ticks, =4s */
|
[Desc("How long should we remain in the prone position?" +
|
||||||
|
"Measured in game ticks. Default is 4 seconds.")]
|
||||||
|
public readonly int ProneTime = 100;
|
||||||
|
|
||||||
|
[Desc("How quickly we should go from standing to prone.")]
|
||||||
public readonly decimal ProneSpeed = .5m;
|
public readonly decimal ProneSpeed = .5m;
|
||||||
|
|
||||||
public readonly WVec ProneOffset = new WVec(85, 0, -171);
|
public readonly WVec ProneOffset = new WVec(85, 0, -171);
|
||||||
|
|
||||||
public override object Create(ActorInitializer init) { return new TakeCover(init, this); }
|
public override object Create(ActorInitializer init) { return new TakeCover(init, this); }
|
||||||
|
|||||||
@@ -13,8 +13,10 @@ using OpenRA.Traits;
|
|||||||
|
|
||||||
namespace OpenRA.Mods.RA
|
namespace OpenRA.Mods.RA
|
||||||
{
|
{
|
||||||
|
[Desc("Actor can be targeted.")]
|
||||||
public class TargetableUnitInfo : ITraitInfo, ITargetableInfo
|
public class TargetableUnitInfo : ITraitInfo, ITargetableInfo
|
||||||
{
|
{
|
||||||
|
[Desc("Target type. Used for filtering (in)valid targets.")]
|
||||||
public readonly string[] TargetTypes = { };
|
public readonly string[] TargetTypes = { };
|
||||||
public string[] GetTargetTypes() { return TargetTypes; }
|
public string[] GetTargetTypes() { return TargetTypes; }
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ using OpenRA.Traits;
|
|||||||
|
|
||||||
namespace OpenRA.Mods.RA
|
namespace OpenRA.Mods.RA
|
||||||
{
|
{
|
||||||
|
[Desc("Actor becomes a specified actor type when this trait is triggered.")]
|
||||||
class TransformsInfo : ITraitInfo
|
class TransformsInfo : ITraitInfo
|
||||||
{
|
{
|
||||||
[ActorReference] public readonly string IntoActor = null;
|
[ActorReference] public readonly string IntoActor = null;
|
||||||
|
|||||||
Reference in New Issue
Block a user