Added some trait [Desc()]s.

This commit is contained in:
Taryn Hill
2014-07-12 12:43:38 -05:00
parent a03d607878
commit da001385ae
35 changed files with 99 additions and 30 deletions

View File

@@ -14,15 +14,20 @@ using OpenRA.Traits;
namespace OpenRA.Mods.RA
{
[Desc("Charges up before being able to attack.")]
class AttackChargeInfo : AttackOmniInfo
{
public readonly int MaxCharges = 1;
[Desc("Reload time (for all charges).")]
public readonly int ReloadTime = 120;
[Desc("Delay for first charge. Needs to match FireDelay for Obelisk.")]
public readonly int InitialChargeDelay = 22;
[Desc("Delay for additional charges if MaxCharge is larger than 1.")]
public readonly int ChargeDelay = 3;
public override object Create(ActorInitializer init) { return new AttackCharge(init.self, this); }
}

View File

@@ -14,6 +14,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.RA
{
[Desc("Actor will follow units until in range to attack them.")]
public class AttackFollowInfo : AttackBaseInfo
{
public override object Create(ActorInitializer init) { return new AttackFollow(init.self, this); }

View File

@@ -24,15 +24,16 @@ namespace OpenRA.Mods.RA
public WAngle Cone;
}
[Desc("Cargo can fire their weapons out of fire ports.")]
public class AttackGarrisonedInfo : AttackFollowInfo, Requires<CargoInfo>
{
[Desc("Fire port offsets in local coordinates")]
[Desc("Fire port offsets in local coordinates.")]
public readonly WRange[] PortOffsets = {};
[Desc("Fire port yaw angles")]
[Desc("Fire port yaw angles.")]
public readonly WAngle[] PortYaws = {};
[Desc("Fire port yaw cone angle")]
[Desc("Fire port yaw cone angle.")]
public readonly WAngle[] PortCones = {};
public readonly string MuzzlePalette = "effect";
@@ -68,13 +69,13 @@ namespace OpenRA.Mods.RA
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)
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)
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>();
for (var i = 0; i < info.PortOffsets.Length / 3; i++)

View File

@@ -13,6 +13,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.RA
{
[Desc("Dogs use this attack model.")]
class AttackLeapInfo : AttackFrontalInfo
{
[Desc("Leap speed (in units/tick).")]

View File

@@ -16,8 +16,10 @@ using OpenRA.Traits;
namespace OpenRA.Mods.RA
{
[Desc("Actor's turret rises from the ground before attacking.")]
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 DefaultFacing = 0;
public float ClosedDamageMultiplier = 0.5f;

View File

@@ -13,6 +13,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.RA
{
[Desc("Actor has a visual turret used to attack.")]
class AttackTurretedInfo : AttackFollowInfo, Requires<TurretedInfo>
{
public override object Create(ActorInitializer init) { return new AttackTurreted(init.self, this); }

View File

@@ -13,6 +13,7 @@ using OpenRA.Traits;
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>
{
public readonly string Anim = "1";

View File

@@ -19,7 +19,9 @@ namespace OpenRA.Mods.RA
{
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); }
}

View File

@@ -17,6 +17,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.RA
{
[Desc("This actor can transport Passenger actors.")]
public class CargoInfo : ITraitInfo, Requires<IOccupySpaceInfo>
{
public readonly int MaxWeight = 0;

View File

@@ -17,10 +17,15 @@ using OpenRA.Traits;
namespace OpenRA.Mods.RA
{
[Desc("This unit can cloak and uncloak in specific situations.")]
public class CloakInfo : ITraitInfo
{
public readonly int InitialDelay = 10; // Ticks
public readonly int CloakDelay = 30; // Ticks
[Desc("Measured in game ticks.")]
public readonly int InitialDelay = 10;
[Desc("Measured in game ticks.")]
public readonly int CloakDelay = 30;
public readonly bool UncloakOnAttack = true;
public readonly bool UncloakOnMove = false;
public readonly bool UncloakOnUnload = false;

View File

@@ -13,6 +13,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.RA
{
[Desc("Sounds to play when killed.")]
public class DeathSoundsInfo : ITraitInfo
{
[Desc("Death notification voice.")]

View File

@@ -12,9 +12,13 @@ using OpenRA.Traits;
namespace OpenRA.Mods.RA
{
[Desc("Actor can reveal Cloak actors in a specified range.")]
class DetectCloakedInfo : TraitInfo<DetectCloaked>
{
[Desc("Specific cloak classifications I can reveal.")]
public readonly string[] CloakTypes = { "Cloak" };
[Desc("Measured in cells.")]
public readonly int Range = 5;
}

View File

@@ -16,6 +16,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.RA
{
[Desc("Overrides the default ToolTip when this actor is disguised (aids in deceiving enemy players).")]
class DisguiseToolTipInfo : TooltipInfo, Requires<DisguiseInfo>
{
public override object Create (ActorInitializer init) { return new DisguiseToolTip(init.self, this); }

View File

@@ -1,6 +1,6 @@
#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
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
@@ -15,13 +15,19 @@ using OpenRA.Traits;
namespace OpenRA.Mods.RA
{
[Desc("Draw a colored contrail behind this actor when they move.")]
class ContrailInfo : ITraitInfo, Requires<IBodyOrientationInfo>
{
[Desc("Position relative to body")]
public readonly WVec Offset = WVec.Zero;
[Desc("Measured in pixels.")]
public readonly int TrailLength = 25;
[Desc("RGB color of the contrail.")]
public readonly Color Color = Color.White;
[Desc("Use player remap color instead of a custom color?")]
public readonly bool UsePlayerColor = true;
public object Create(ActorInitializer init) { return new Contrail(init.self, this); }

View File

@@ -15,12 +15,14 @@ using OpenRA.Traits;
namespace OpenRA.Mods.RA
{
[Desc("Spawn new actors when sold.")]
class EmitInfantryOnSellInfo : TraitInfo<EmitInfantryOnSell>
{
public readonly float ValuePercent = 40;
public readonly float MinHpPercent = 30;
[ActorReference]
[Desc("Be sure to use lowercase. Default value is \"e1\".")]
public readonly string[] ActorTypes = { "e1" };
}

View File

@@ -15,6 +15,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.RA
{
[Desc("This actor's experience increases when it has killed a GivesExperience actor.")]
public class GainsExperienceInfo : ITraitInfo, Requires<ValuedInfo>
{
[Desc("XP requirements for each level, as multiples of our own cost.")]

View File

@@ -14,6 +14,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.RA
{
[Desc("This actor has properties that upgrade when a specific criteria is met.")]
public class GainsUnitUpgradesInfo : ITraitInfo
{
public readonly int FirepowerMaxLevel = 15;

View File

@@ -12,6 +12,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.RA
{
[Desc("This actor gives experience to a GainsExperience actor when they are killed.")]
class GivesExperienceInfo : TraitInfo<GivesExperience>
{
[Desc("If -1, use the value of the unit cost.")]

View File

@@ -16,9 +16,9 @@ using OpenRA.Traits;
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> { }
[Desc("The player can give this unit the order to follow and protect friendly units with the Guardable trait.")]
class Guard : IResolveOrder, IOrderVoice
{
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>
{
public readonly int Range = 2;

View File

@@ -14,6 +14,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.RA
{
[Desc("This structure can be infiltrated causing funds to be stolen.")]
class InfiltrateForCashInfo : ITraitInfo, Requires<InfiltratableInfo>
{
public readonly int Percentage = 50;

View File

@@ -13,13 +13,11 @@ using OpenRA.Traits;
namespace OpenRA.Mods.RA
{
[Desc("This unit cannot be damaged.")]
class InvulnerableInfo : TraitInfo<Invulnerable> { }
class Invulnerable : IDamageModifier
{
public float GetDamageModifier( Actor attacker, WarheadInfo warhead )
{
return 0.0f;
}
public float GetDamageModifier(Actor attacker, WarheadInfo warhead) { return 0.0f; }
}
}

View File

@@ -13,13 +13,17 @@ using OpenRA.Traits;
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 readonly int Ammo = 0;
[Desc("Defaults to value in Ammo.")]
public readonly int PipCount = 0;
public readonly PipType PipType = PipType.Green;
public readonly PipType PipTypeEmpty = PipType.Transparent;
[Desc("Time to reload measured in ticks.")]
public readonly int ReloadTicks = 25 * 2;

View File

@@ -1,6 +1,6 @@
#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
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
@@ -17,6 +17,7 @@ using OpenRA.Traits;
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 readonly bool StartsRevealed = false;

View File

@@ -17,12 +17,13 @@ using OpenRA.Traits;
namespace OpenRA.Mods.RA
{
[Desc("This unit can spawn and eject other actors while flying.")]
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);
[Desc("Sound to play when dropping")]
[Desc("Sound to play when dropping.")]
public readonly string ChuteSound = "chute1.aud";
public object Create(ActorInitializer init) { return new ParaDrop(init.self, this); }

View File

@@ -14,8 +14,10 @@ using OpenRA.Traits;
namespace OpenRA.Mods.RA
{
[Desc("Can be paradropped by a ParaDrop actor.")]
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 string GroundImpactSound = "squishy2.aud";
@@ -28,8 +30,10 @@ namespace OpenRA.Mods.RA
[Desc("Requires the sub-sequences \"open\" and \"idle\".")]
public readonly string ParachuteSequence = null;
[Desc("Optional, otherwise defaults to the palette the actor is using.")]
public readonly string ParachutePalette = null;
[Desc("Used to clone the actor with this palette and render it with a visual offset below.")]
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.")]
public readonly string ShadowSequence = null;
[Desc("Optional, otherwise defaults to the palette the actor is using.")]
public readonly string ShadowPalette = null;

View File

@@ -17,6 +17,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.RA
{
[Desc("This actor can enter Cargo actors.")]
public class PassengerInfo : ITraitInfo
{
public readonly string CargoType = null;

View File

@@ -13,6 +13,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.RA
{
[Desc("This actor provides radar.")]
public class ProvidesRadarInfo : TraitInfo<ProvidesRadar> { }
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 { }
}

View File

@@ -13,6 +13,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.RA
{
[Desc("Actor can capture ProximityCapturable actors.")]
public class ProximityCaptorInfo : ITraitInfo
{
public readonly string[] Types = {};

View File

@@ -1,6 +1,6 @@
#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
* available to you under the terms of the GNU General Public License
* as published by the Free Software Foundation. For more information,
@@ -15,6 +15,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.RA
{
[Desc("Actor can be captured by units in a specified proximity.")]
public class ProximityCapturableInfo : ITraitInfo
{
public readonly bool Permanent = false;

View File

@@ -20,6 +20,7 @@ namespace OpenRA.Mods.RA
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>
{
public readonly string RangeCircleType = null;

View File

@@ -18,6 +18,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.RA
{
[Desc("This actor can be sent to a structure for repairs.")]
class RepairableInfo : ITraitInfo, Requires<HealthInfo>
{
public readonly string[] RepairBuildings = { "fix" };

View File

@@ -13,6 +13,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.RA
{
[Desc("Used for silos.")]
class StoresResourcesInfo : ITraitInfo
{
[Desc("Number of little squares used to display how filled unit is.")]

View File

@@ -14,10 +14,16 @@ using OpenRA.Traits;
namespace OpenRA.Mods.RA
{
[Desc("This actor goes prone in an attempt to reduce damage.")]
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 WVec ProneOffset = new WVec(85, 0, -171);
public override object Create(ActorInitializer init) { return new TakeCover(init, this); }

View File

@@ -13,8 +13,10 @@ using OpenRA.Traits;
namespace OpenRA.Mods.RA
{
[Desc("Actor can be targeted.")]
public class TargetableUnitInfo : ITraitInfo, ITargetableInfo
{
[Desc("Target type. Used for filtering (in)valid targets.")]
public readonly string[] TargetTypes = { };
public string[] GetTargetTypes() { return TargetTypes; }

View File

@@ -17,6 +17,7 @@ using OpenRA.Traits;
namespace OpenRA.Mods.RA
{
[Desc("Actor becomes a specified actor type when this trait is triggered.")]
class TransformsInfo : ITraitInfo
{
[ActorReference] public readonly string IntoActor = null;