Rename LegacyCapture related traits to Capture

This commit is contained in:
Curtis Shmyr
2013-10-27 17:01:01 -06:00
parent c1e5be380e
commit 2229bbf985
9 changed files with 37 additions and 37 deletions

View File

@@ -15,11 +15,11 @@ using OpenRA.Traits;
namespace OpenRA.Mods.RA.Activities
{
class LegacyCaptureActor : Activity
class CaptureActor : Activity
{
Target target;
public LegacyCaptureActor(Target target) { this.target = target; }
public CaptureActor(Target target) { this.target = target; }
public override Activity Tick(Actor self)
{
@@ -34,8 +34,8 @@ namespace OpenRA.Mods.RA.Activities
if (b != null && b.Locked)
return NextActivity;
var capturesInfo = self.Info.Traits.Get<LegacyCapturesInfo>();
var capturableInfo = actor.Info.Traits.Get<LegacyCapturableInfo>();
var capturesInfo = self.Info.Traits.Get<CapturesInfo>();
var capturableInfo = actor.Info.Traits.Get<CapturableInfo>();
var health = actor.Trait<Health>();

View File

@@ -14,10 +14,10 @@ using OpenRA.FileFormats;
namespace OpenRA.Mods.RA
{
[Desc("This actor can be captured by a unit with LegacyCaptures: trait.")]
class LegacyCapturableInfo : TraitInfo<LegacyCapturable>
[Desc("This actor can be captured by a unit with Captures: trait.")]
class CapturableInfo : TraitInfo<Capturable>
{
[Desc("Type of actor (the LegacyCaptures: trait defines what Types it can capture).")]
[Desc("Type of actor (the Captures: trait defines what Types it can capture).")]
public readonly string Type = "building";
public readonly bool AllowAllies = false;
public readonly bool AllowNeutral = true;
@@ -27,7 +27,7 @@ namespace OpenRA.Mods.RA
public bool CanBeTargetedBy(Actor captor, Player owner)
{
var c = captor.TraitOrDefault<LegacyCaptures>();
var c = captor.TraitOrDefault<Captures>();
if (c == null)
return false;
@@ -48,5 +48,5 @@ namespace OpenRA.Mods.RA
}
}
class LegacyCapturable { }
class Capturable { }
}

View File

@@ -20,24 +20,24 @@ using OpenRA.Traits;
namespace OpenRA.Mods.RA
{
[Desc("This actor can capture other actors which have the LegacyCapturable: trait.")]
class LegacyCapturesInfo : ITraitInfo
[Desc("This actor can capture other actors which have the Capturable: trait.")]
class CapturesInfo : ITraitInfo
{
[Desc("Types of actors that it can capture, as long as the type also exists in the LegacyCapturable Type: trait.")]
[Desc("Types of actors that it can capture, as long as the type also exists in the Capturable Type: trait.")]
public readonly string[] CaptureTypes = { "building" };
[Desc("Unit will do damage to the actor instead of capturing it. Unit is destroyed when sabotaging.")]
public readonly bool Sabotage = true;
[Desc("Only used if Sabotage=true. Sabotage damage expressed as a percentage of enemy health removed.")]
public readonly float SabotageHPRemoval = 0.5f;
public object Create(ActorInitializer init) { return new LegacyCaptures(init.self, this); }
public object Create(ActorInitializer init) { return new Captures(init.self, this); }
}
class LegacyCaptures : IIssueOrder, IResolveOrder, IOrderVoice
class Captures : IIssueOrder, IResolveOrder, IOrderVoice
{
public readonly LegacyCapturesInfo Info;
public readonly CapturesInfo Info;
public LegacyCaptures(Actor self, LegacyCapturesInfo info)
public Captures(Actor self, CapturesInfo info)
{
Info = info;
}
@@ -46,13 +46,13 @@ namespace OpenRA.Mods.RA
{
get
{
yield return new LegacyCaptureOrderTargeter(Info.Sabotage);
yield return new CaptureOrderTargeter(Info.Sabotage);
}
}
public Order IssueOrder(Actor self, IOrderTargeter order, Target target, bool queued)
{
if (order.OrderID != "LegacyCaptureActor")
if (order.OrderID != "CaptureActor")
return null;
if (target.Type == TargetType.FrozenActor)
@@ -63,12 +63,12 @@ namespace OpenRA.Mods.RA
public string VoicePhraseForOrder(Actor self, Order order)
{
return order.OrderString == "LegacyCaptureActor" ? "Attack" : null;
return order.OrderString == "CaptureActor" ? "Attack" : null;
}
public void ResolveOrder(Actor self, Order order)
{
if (order.OrderString != "LegacyCaptureActor")
if (order.OrderString != "CaptureActor")
return;
var target = self.ResolveFrozenActorOrder(order, Color.Red);
@@ -79,22 +79,22 @@ namespace OpenRA.Mods.RA
self.CancelActivity();
self.SetTargetLine(target, Color.Red);
self.QueueActivity(new Enter(target.Actor, new LegacyCaptureActor(target)));
self.QueueActivity(new Enter(target.Actor, new CaptureActor(target)));
}
class LegacyCaptureOrderTargeter : UnitOrderTargeter
class CaptureOrderTargeter : UnitOrderTargeter
{
readonly bool sabotage;
public LegacyCaptureOrderTargeter(bool sabotage)
: base("LegacyCaptureActor", 6, "enter", true, true)
public CaptureOrderTargeter(bool sabotage)
: base("CaptureActor", 6, "enter", true, true)
{
this.sabotage = sabotage;
}
public override bool CanTargetActor(Actor self, Actor target, TargetModifiers modifiers, ref string cursor)
{
var c = target.Info.Traits.GetOrDefault<LegacyCapturableInfo>();
var c = target.Info.Traits.GetOrDefault<CapturableInfo>();
if (c == null || !c.CanBeTargetedBy(self, target.Owner))
{
cursor = "enter-blocked";
@@ -111,7 +111,7 @@ namespace OpenRA.Mods.RA
public override bool CanTargetFrozenActor(Actor self, FrozenActor target, TargetModifiers modifiers, ref string cursor)
{
var c = target.Info.Traits.GetOrDefault<LegacyCapturableInfo>();
var c = target.Info.Traits.GetOrDefault<CapturableInfo>();
if (c == null || !c.CanBeTargetedBy(self, target.Owner))
{
cursor = "enter-blocked";

View File

@@ -80,7 +80,7 @@
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Activities\LegacyCaptureActor.cs" />
<Compile Include="Activities\CaptureActor.cs" />
<Compile Include="AI\AttackOrFleeFuzzy.cs" />
<Compile Include="AI\BaseBuilder.cs" />
<Compile Include="AI\HackyAI.cs" />
@@ -176,7 +176,7 @@
<Compile Include="C4Demolition.cs" />
<Compile Include="ExternalCapturable.cs" />
<Compile Include="ExternalCapturableBar.cs" />
<Compile Include="LegacyCapturable.cs" />
<Compile Include="Capturable.cs" />
<Compile Include="ExternalCaptures.cs" />
<Compile Include="Cargo.cs" />
<Compile Include="CarpetBomb.cs" />
@@ -244,7 +244,7 @@
<Compile Include="IronCurtainable.cs" />
<Compile Include="JamsMissiles.cs" />
<Compile Include="LeavesHusk.cs" />
<Compile Include="LegacyCaptures.cs" />
<Compile Include="Captures.cs" />
<Compile Include="LightPaletteRotator.cs" />
<Compile Include="LimitedAmmo.cs" />
<Compile Include="Lint\CheckActorReferences.cs" />

View File

@@ -328,7 +328,7 @@
RelativeToTopLeft: yes
ShakeOnDeath:
Sellable:
LegacyCapturable:
Capturable:
CombatDebugOverlay:
Guardable:
Range: 3
@@ -351,7 +351,7 @@
RenderBuilding:
WithBuildingExplosion:
-RepairableBuilding:
-LegacyCapturable:
-Capturable:
-Sellable:
Tooltip:
Name: Civilian Building
@@ -374,7 +374,7 @@
^TechBuilding:
Inherits: ^CivBuilding
LegacyCapturable:
Capturable:
RepairableBuilding:
EngineerRepairable:
RevealsShroud:

View File

@@ -166,7 +166,7 @@ E6:
PipType: Yellow
EngineerRepair:
RepairsBridges:
LegacyCaptures:
Captures:
CaptureTypes: building, husk
-AutoTarget:
AttackMove:

View File

@@ -101,7 +101,7 @@ V01:
TransformOnCapture:
IntoActor: v01.sniper
SkipMakeAnims: true
LegacyCapturable:
Capturable:
Type: CivilianBuilding
CaptureThreshold: 1
EditorTilesetFilter:
@@ -129,7 +129,7 @@ V01.SNIPER:
OnExit: v01
SkipMakeAnims: true
BecomeNeutral: true
-LegacyCapturable:
-Capturable:
EditorTilesetFilter:
ExcludeTilesets: DESERT

View File

@@ -489,7 +489,7 @@ SNIPER:
CloakSound:
UncloakSound:
UncloakOnMove: yes
LegacyCaptures:
Captures:
CaptureTypes: CivilianBuilding
Sabotage: no
SabotageHPRemoval: 0

View File

@@ -163,7 +163,7 @@ ENGINEER:
PipType: Yellow
EngineerRepair:
RepairsBridges:
LegacyCaptures:
Captures:
CaptureTypes: building
-AutoTarget:
AttackMove: