Make Attack*Info plumbing consistent.
This commit is contained in:
@@ -33,7 +33,7 @@ namespace OpenRA.Mods.RA
|
||||
Lazy<IEnumerable<Armament>> armaments;
|
||||
protected IEnumerable<Armament> Armaments { get { return armaments.Value; } }
|
||||
|
||||
public AttackBase(Actor self)
|
||||
public AttackBase(Actor self, AttackBaseInfo info)
|
||||
{
|
||||
this.self = self;
|
||||
armaments = Lazy.New(() => self.TraitsImplementing<Armament>());
|
||||
|
||||
@@ -24,7 +24,7 @@ namespace OpenRA.Mods.RA
|
||||
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); }
|
||||
public override object Create(ActorInitializer init) { return new AttackCharge(init.self, this); }
|
||||
}
|
||||
|
||||
class AttackCharge : AttackOmni, ITick, INotifyAttack, ISync
|
||||
@@ -34,8 +34,8 @@ namespace OpenRA.Mods.RA
|
||||
[Sync] int charges;
|
||||
[Sync] int timeToRecharge;
|
||||
|
||||
public AttackCharge(Actor self)
|
||||
: base(self)
|
||||
public AttackCharge(Actor self, AttackChargeInfo info)
|
||||
: base(self, info)
|
||||
{
|
||||
aci = self.Info.Traits.Get<AttackChargeInfo>();
|
||||
charges = aci.MaxCharges;
|
||||
|
||||
@@ -27,7 +27,7 @@ namespace OpenRA.Mods.RA
|
||||
readonly AttackFrontalInfo info;
|
||||
|
||||
public AttackFrontal(Actor self, AttackFrontalInfo info)
|
||||
: base(self)
|
||||
: base(self, info)
|
||||
{
|
||||
this.info = info;
|
||||
}
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace OpenRA.Mods.RA
|
||||
{
|
||||
class AttackOmniInfo : AttackBaseInfo
|
||||
{
|
||||
public override object Create(ActorInitializer init) { return new AttackOmni(init.self); }
|
||||
public override object Create(ActorInitializer init) { return new AttackOmni(init.self, this); }
|
||||
}
|
||||
|
||||
class AttackOmni : AttackBase, INotifyBuildComplete, ISync
|
||||
@@ -23,8 +23,8 @@ namespace OpenRA.Mods.RA
|
||||
[Sync] bool buildComplete = false;
|
||||
public void BuildingComplete(Actor self) { buildComplete = true; }
|
||||
|
||||
public AttackOmni(Actor self)
|
||||
: base(self) { }
|
||||
public AttackOmni(Actor self, AttackOmniInfo info)
|
||||
: base(self, info) { }
|
||||
|
||||
protected override bool CanAttack(Actor self, Target target)
|
||||
{
|
||||
|
||||
@@ -37,7 +37,7 @@ namespace OpenRA.Mods.RA
|
||||
Turreted turret;
|
||||
|
||||
public AttackPopupTurreted(ActorInitializer init, AttackPopupTurretedInfo info)
|
||||
: base(init.self)
|
||||
: base(init.self, info)
|
||||
{
|
||||
this.info = info;
|
||||
buildComplete = init.Contains<SkipMakeAnimsInit>();
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace OpenRA.Mods.RA
|
||||
{
|
||||
class AttackTurretedInfo : AttackBaseInfo, Requires<TurretedInfo>
|
||||
{
|
||||
public override object Create(ActorInitializer init) { return new AttackTurreted(init.self); }
|
||||
public override object Create(ActorInitializer init) { return new AttackTurreted(init.self, this); }
|
||||
}
|
||||
|
||||
class AttackTurreted : AttackBase, INotifyBuildComplete, ISync
|
||||
@@ -28,8 +28,8 @@ namespace OpenRA.Mods.RA
|
||||
protected IEnumerable<Turreted> turrets;
|
||||
[Sync] protected bool buildComplete;
|
||||
|
||||
public AttackTurreted(Actor self)
|
||||
: base(self)
|
||||
public AttackTurreted(Actor self, AttackTurretedInfo info)
|
||||
: base(self, info)
|
||||
{
|
||||
turrets = self.TraitsImplementing<Turreted>();
|
||||
}
|
||||
|
||||
@@ -35,7 +35,7 @@ namespace OpenRA.Mods.RA
|
||||
[Sync] Target target;
|
||||
|
||||
public AttackBomber(Actor self, AttackBomberInfo info)
|
||||
: base(self)
|
||||
: base(self, info)
|
||||
{
|
||||
this.info = info;
|
||||
this.camera = null;
|
||||
|
||||
Reference in New Issue
Block a user