Added: Basic stances (Aggressive, Guard (Hold Ground), Hold Fire, None (dummy), Return Fire) Added: WorldCommandWidget (to be able to set said stances) Added: WorldCommandWidget to ra (cnc will follow, later on) Changed: Added support to AttackBase for firing with movement disabled + utility method ScanForTarget (used by stances) Added: AssignUnitStance (attach this to unit-producing actors, together with what stances can be picked as 'default')
21 lines
549 B
C#
21 lines
549 B
C#
using OpenRA.Traits;
|
|
|
|
namespace OpenRA.Mods.RA
|
|
{
|
|
public class UnitStanceNoneInfo : ITraitInfo
|
|
{
|
|
public readonly bool Default = false;
|
|
|
|
public object Create(ActorInitializer init) { return new UnitStanceNone(init.self, this); }
|
|
}
|
|
public class UnitStanceNone : UnitStance
|
|
{
|
|
public readonly UnitStanceNoneInfo Info;
|
|
|
|
public UnitStanceNone(Actor self, UnitStanceNoneInfo info)
|
|
{
|
|
Info = info;
|
|
Active = (self.World.LocalPlayer == self.Owner || (self.Owner.IsBot && Game.IsHost)) ? Info.Default : false;
|
|
}
|
|
}
|
|
} |