have AttackPopupTurreted inherit AttackTurreted
This commit is contained in:
@@ -20,7 +20,7 @@ using OpenRA.Traits.Activities;
|
|||||||
|
|
||||||
namespace OpenRA.Mods.RA
|
namespace OpenRA.Mods.RA
|
||||||
{
|
{
|
||||||
class AttackPopupTurretedInfo : AttackBaseInfo
|
class AttackPopupTurretedInfo : AttackTurretedInfo
|
||||||
{
|
{
|
||||||
public int CloseDelay = 125;
|
public int CloseDelay = 125;
|
||||||
public int DefaultFacing = 0;
|
public int DefaultFacing = 0;
|
||||||
@@ -28,22 +28,18 @@ namespace OpenRA.Mods.RA
|
|||||||
public override object Create(ActorInitializer init) { return new AttackPopupTurreted( init, this ); }
|
public override object Create(ActorInitializer init) { return new AttackPopupTurreted( init, this ); }
|
||||||
}
|
}
|
||||||
|
|
||||||
class AttackPopupTurreted : AttackBase, INotifyBuildComplete, INotifyIdle, IDamageModifier
|
class AttackPopupTurreted : AttackTurreted, INotifyBuildComplete, INotifyIdle, IDamageModifier
|
||||||
{
|
{
|
||||||
enum PopupState { Open, Rotating, Transitioning, Closed };
|
enum PopupState { Open, Rotating, Transitioning, Closed };
|
||||||
|
|
||||||
protected Target target;
|
|
||||||
AttackPopupTurretedInfo Info;
|
AttackPopupTurretedInfo Info;
|
||||||
Turreted turret;
|
|
||||||
int IdleTicks = 0;
|
int IdleTicks = 0;
|
||||||
PopupState State = PopupState.Open;
|
PopupState State = PopupState.Open;
|
||||||
|
|
||||||
public AttackPopupTurreted(ActorInitializer init, AttackPopupTurretedInfo info) : base(init.self)
|
public AttackPopupTurreted(ActorInitializer init, AttackPopupTurretedInfo info) : base(init.self)
|
||||||
{
|
{
|
||||||
Info = info;
|
Info = info;
|
||||||
turret = init.self.Trait<Turreted>();
|
buildComplete = init.Contains<SkipMakeAnimsInit>();
|
||||||
if (init.Contains<SkipMakeAnimsInit>())
|
|
||||||
buildComplete = true;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
protected override bool CanAttack( Actor self, Target target )
|
protected override bool CanAttack( Actor self, Target target )
|
||||||
@@ -114,8 +110,7 @@ namespace OpenRA.Mods.RA
|
|||||||
target = Target.None;
|
target = Target.None;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool buildComplete = false;
|
public override void BuildingComplete(Actor self)
|
||||||
public void BuildingComplete(Actor self)
|
|
||||||
{
|
{
|
||||||
// Set true for SkipMakeAnimsInit
|
// Set true for SkipMakeAnimsInit
|
||||||
if (buildComplete)
|
if (buildComplete)
|
||||||
|
|||||||
@@ -27,6 +27,7 @@ namespace OpenRA.Mods.RA
|
|||||||
{
|
{
|
||||||
protected Target target;
|
protected Target target;
|
||||||
protected Turreted turret;
|
protected Turreted turret;
|
||||||
|
protected bool buildComplete;
|
||||||
|
|
||||||
public AttackTurreted(Actor self) : base(self)
|
public AttackTurreted(Actor self) : base(self)
|
||||||
{
|
{
|
||||||
@@ -64,8 +65,7 @@ namespace OpenRA.Mods.RA
|
|||||||
target = Target.None;
|
target = Target.None;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool buildComplete = false;
|
public virtual void BuildingComplete(Actor self) { buildComplete = true; }
|
||||||
public void BuildingComplete(Actor self) { buildComplete = true; }
|
|
||||||
|
|
||||||
class AttackActivity : Activity
|
class AttackActivity : Activity
|
||||||
{
|
{
|
||||||
|
|||||||
Reference in New Issue
Block a user