Remove (INotify)BuildComplete from Attack*
This commit is contained in:
@@ -43,7 +43,7 @@ namespace OpenRA.Mods.Cnc.Traits
|
|||||||
public override object Create(ActorInitializer init) { return new AttackPopupTurreted(init, this); }
|
public override object Create(ActorInitializer init) { return new AttackPopupTurreted(init, this); }
|
||||||
}
|
}
|
||||||
|
|
||||||
class AttackPopupTurreted : AttackTurreted, INotifyBuildComplete, INotifyIdle, IDamageModifier
|
class AttackPopupTurreted : AttackTurreted, INotifyIdle, IDamageModifier
|
||||||
{
|
{
|
||||||
enum PopupState { Open, Rotating, Transitioning, Closed }
|
enum PopupState { Open, Rotating, Transitioning, Closed }
|
||||||
|
|
||||||
@@ -64,9 +64,22 @@ namespace OpenRA.Mods.Cnc.Traits
|
|||||||
skippedMakeAnimation = init.Contains<SkipMakeAnimsInit>();
|
skippedMakeAnimation = init.Contains<SkipMakeAnimsInit>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
protected override void Created(Actor self)
|
||||||
|
{
|
||||||
|
base.Created(self);
|
||||||
|
|
||||||
|
// Map placed actors are created in the closed state
|
||||||
|
if (skippedMakeAnimation)
|
||||||
|
{
|
||||||
|
state = PopupState.Closed;
|
||||||
|
wsb.PlayCustomAnimationRepeating(self, info.ClosedIdleSequence);
|
||||||
|
turret.DesiredFacing = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
protected override bool CanAttack(Actor self, Target target)
|
protected override bool CanAttack(Actor self, Target target)
|
||||||
{
|
{
|
||||||
if (state == PopupState.Transitioning || !building.BuildComplete)
|
if (state == PopupState.Transitioning)
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
if (!base.CanAttack(self, target))
|
if (!base.CanAttack(self, target))
|
||||||
@@ -106,16 +119,6 @@ namespace OpenRA.Mods.Cnc.Traits
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void INotifyBuildComplete.BuildingComplete(Actor self)
|
|
||||||
{
|
|
||||||
if (skippedMakeAnimation)
|
|
||||||
{
|
|
||||||
state = PopupState.Closed;
|
|
||||||
wsb.PlayCustomAnimationRepeating(self, info.ClosedIdleSequence);
|
|
||||||
turret.DesiredFacing = null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int IDamageModifier.GetDamageModifier(Actor attacker, Damage damage)
|
int IDamageModifier.GetDamageModifier(Actor attacker, Damage damage)
|
||||||
{
|
{
|
||||||
return state == PopupState.Closed ? info.ClosedDamageMultiplier : 100;
|
return state == PopupState.Closed ? info.ClosedDamageMultiplier : 100;
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
public override abstract object Create(ActorInitializer init);
|
public override abstract object Create(ActorInitializer init);
|
||||||
}
|
}
|
||||||
|
|
||||||
public abstract class AttackBase : PausableConditionalTrait<AttackBaseInfo>, INotifyCreated, ITick, IIssueOrder, IResolveOrder, IOrderVoice, ISync
|
public abstract class AttackBase : PausableConditionalTrait<AttackBaseInfo>, ITick, IIssueOrder, IResolveOrder, IOrderVoice, ISync
|
||||||
{
|
{
|
||||||
readonly string attackOrderName = "Attack";
|
readonly string attackOrderName = "Attack";
|
||||||
readonly string forceAttackOrderName = "ForceAttack";
|
readonly string forceAttackOrderName = "ForceAttack";
|
||||||
@@ -48,7 +48,6 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
public IEnumerable<Armament> Armaments { get { return getArmaments(); } }
|
public IEnumerable<Armament> Armaments { get { return getArmaments(); } }
|
||||||
|
|
||||||
protected IFacing facing;
|
protected IFacing facing;
|
||||||
protected Building building;
|
|
||||||
protected IPositionable positionable;
|
protected IPositionable positionable;
|
||||||
protected INotifyAiming[] notifyAiming;
|
protected INotifyAiming[] notifyAiming;
|
||||||
protected Func<IEnumerable<Armament>> getArmaments;
|
protected Func<IEnumerable<Armament>> getArmaments;
|
||||||
@@ -66,7 +65,6 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
protected override void Created(Actor self)
|
protected override void Created(Actor self)
|
||||||
{
|
{
|
||||||
facing = self.TraitOrDefault<IFacing>();
|
facing = self.TraitOrDefault<IFacing>();
|
||||||
building = self.TraitOrDefault<Building>();
|
|
||||||
positionable = self.TraitOrDefault<IPositionable>();
|
positionable = self.TraitOrDefault<IPositionable>();
|
||||||
notifyAiming = self.TraitsImplementing<INotifyAiming>().ToArray();
|
notifyAiming = self.TraitsImplementing<INotifyAiming>().ToArray();
|
||||||
|
|
||||||
@@ -115,10 +113,6 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
if (mobile != null && !mobile.CanInteractWithGroundLayer(self))
|
if (mobile != null && !mobile.CanInteractWithGroundLayer(self))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
// Building is under construction or is being sold
|
|
||||||
if (building != null && !building.BuildComplete)
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if (Armaments.All(a => a.IsReloading))
|
if (Armaments.All(a => a.IsReloading))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
|
|||||||
@@ -22,8 +22,8 @@ namespace OpenRA.Mods.Common.UpdateRules.Rules
|
|||||||
get
|
get
|
||||||
{
|
{
|
||||||
return "Traits are no longer force-disabled while the WithMakeAnimation trait is active.\n" +
|
return "Traits are no longer force-disabled while the WithMakeAnimation trait is active.\n" +
|
||||||
"This affects the With*Animation, With*Overlay, *Production, Transforms, Sellable,\n" +
|
"This affects the With*Animation, With*Overlay, *Production, Attack*,\n" +
|
||||||
"Gate, ToggleConditionOnOrder, and ConyardChronoReturn traits.\n" +
|
"Transforms, Sellable, Gate, ToggleConditionOnOrder, and ConyardChronoReturn traits.\n" +
|
||||||
"The AnnounceOnBuild trait has been replaced with a new VoiceAnnouncement trait.\n" +
|
"The AnnounceOnBuild trait has been replaced with a new VoiceAnnouncement trait.\n" +
|
||||||
"Affected actors are listed so that conditions may be manually defined.";
|
"Affected actors are listed so that conditions may be manually defined.";
|
||||||
}
|
}
|
||||||
@@ -57,6 +57,13 @@ namespace OpenRA.Mods.Common.UpdateRules.Rules
|
|||||||
"ProductionAirdrop",
|
"ProductionAirdrop",
|
||||||
"ProductionFromMapEdge",
|
"ProductionFromMapEdge",
|
||||||
"ProductionParadrop",
|
"ProductionParadrop",
|
||||||
|
"AttackFrontal",
|
||||||
|
"AttackFollow",
|
||||||
|
"AttackTurreted",
|
||||||
|
"AttackOmni",
|
||||||
|
"AttackBomber",
|
||||||
|
"AttackPopupTurreted",
|
||||||
|
"AttackTesla",
|
||||||
"Transforms",
|
"Transforms",
|
||||||
"Sellable",
|
"Sellable",
|
||||||
"Gate",
|
"Gate",
|
||||||
|
|||||||
@@ -830,6 +830,7 @@ GUN:
|
|||||||
LocalOffset: 512,0,112
|
LocalOffset: 512,0,112
|
||||||
MuzzleSequence: muzzle
|
MuzzleSequence: muzzle
|
||||||
AttackTurreted:
|
AttackTurreted:
|
||||||
|
RequiresCondition: !build-incomplete
|
||||||
WithMuzzleOverlay:
|
WithMuzzleOverlay:
|
||||||
-WithDeathAnimation:
|
-WithDeathAnimation:
|
||||||
DetectCloaked:
|
DetectCloaked:
|
||||||
@@ -880,6 +881,7 @@ SAM:
|
|||||||
Weapon: Dragon
|
Weapon: Dragon
|
||||||
MuzzleSequence: muzzle
|
MuzzleSequence: muzzle
|
||||||
AttackPopupTurreted:
|
AttackPopupTurreted:
|
||||||
|
RequiresCondition: !build-incomplete
|
||||||
PauseOnCondition: lowpower
|
PauseOnCondition: lowpower
|
||||||
WithMuzzleOverlay:
|
WithMuzzleOverlay:
|
||||||
-RenderDetectionCircle:
|
-RenderDetectionCircle:
|
||||||
@@ -921,6 +923,7 @@ OBLI:
|
|||||||
Weapon: Laser
|
Weapon: Laser
|
||||||
LocalOffset: 0,-85,1280
|
LocalOffset: 0,-85,1280
|
||||||
AttackCharges:
|
AttackCharges:
|
||||||
|
RequiresCondition: !build-incomplete
|
||||||
PauseOnCondition: lowpower
|
PauseOnCondition: lowpower
|
||||||
ChargeLevel: 50
|
ChargeLevel: 50
|
||||||
ChargingCondition: charging
|
ChargingCondition: charging
|
||||||
@@ -963,6 +966,7 @@ GTWR:
|
|||||||
LocalOffset: 256,0,256
|
LocalOffset: 256,0,256
|
||||||
MuzzleSequence: muzzle
|
MuzzleSequence: muzzle
|
||||||
AttackTurreted:
|
AttackTurreted:
|
||||||
|
RequiresCondition: !build-incomplete
|
||||||
BodyOrientation:
|
BodyOrientation:
|
||||||
QuantizedFacings: 8
|
QuantizedFacings: 8
|
||||||
DetectCloaked:
|
DetectCloaked:
|
||||||
@@ -1012,6 +1016,7 @@ ATWR:
|
|||||||
LocalOffset: 256,128,0, 256,-128,0
|
LocalOffset: 256,128,0, 256,-128,0
|
||||||
LocalYaw: -100,100
|
LocalYaw: -100,100
|
||||||
AttackTurreted:
|
AttackTurreted:
|
||||||
|
RequiresCondition: !build-incomplete
|
||||||
PauseOnCondition: lowpower
|
PauseOnCondition: lowpower
|
||||||
BodyOrientation:
|
BodyOrientation:
|
||||||
QuantizedFacings: 8
|
QuantizedFacings: 8
|
||||||
|
|||||||
@@ -35,8 +35,6 @@ FTUR:
|
|||||||
-Sellable:
|
-Sellable:
|
||||||
Demolishable:
|
Demolishable:
|
||||||
-Condition:
|
-Condition:
|
||||||
WithMakeAnimation:
|
|
||||||
-Condition:
|
|
||||||
|
|
||||||
PBOX:
|
PBOX:
|
||||||
-AutoTarget:
|
-AutoTarget:
|
||||||
|
|||||||
@@ -552,6 +552,7 @@ TSLA:
|
|||||||
Weapon: TeslaZap
|
Weapon: TeslaZap
|
||||||
LocalOffset: 0,0,896
|
LocalOffset: 0,0,896
|
||||||
AttackTesla:
|
AttackTesla:
|
||||||
|
RequiresCondition: !build-incomplete
|
||||||
PauseOnCondition: disabled
|
PauseOnCondition: disabled
|
||||||
ChargeAudio: tslachg2.aud
|
ChargeAudio: tslachg2.aud
|
||||||
MaxCharges: 3
|
MaxCharges: 3
|
||||||
@@ -601,6 +602,7 @@ AGUN:
|
|||||||
LocalOffset: 520,100,450, 520,-150,450
|
LocalOffset: 520,100,450, 520,-150,450
|
||||||
MuzzleSequence: muzzle
|
MuzzleSequence: muzzle
|
||||||
AttackTurreted:
|
AttackTurreted:
|
||||||
|
RequiresCondition: !build-incomplete
|
||||||
PauseOnCondition: disabled
|
PauseOnCondition: disabled
|
||||||
WithMuzzleOverlay:
|
WithMuzzleOverlay:
|
||||||
RenderRangeCircle:
|
RenderRangeCircle:
|
||||||
@@ -701,6 +703,7 @@ PBOX:
|
|||||||
InitialUnits: e1
|
InitialUnits: e1
|
||||||
-SpawnActorsOnSell:
|
-SpawnActorsOnSell:
|
||||||
AttackGarrisoned:
|
AttackGarrisoned:
|
||||||
|
RequiresCondition: !build-incomplete
|
||||||
Armaments: garrisoned
|
Armaments: garrisoned
|
||||||
PortOffsets: 384,0,128, 224,-341,128, -224,-341,128, -384,0,128, -224,341,128, 224,341,128
|
PortOffsets: 384,0,128, 224,-341,128, -224,-341,128, -384,0,128, -224,341,128, 224,341,128
|
||||||
PortYaws: 0, 176, 341, 512, 682, 853
|
PortYaws: 0, 176, 341, 512, 682, 853
|
||||||
@@ -760,6 +763,7 @@ HBOX:
|
|||||||
RenderRangeCircle:
|
RenderRangeCircle:
|
||||||
FallbackRange: 6c0
|
FallbackRange: 6c0
|
||||||
AttackGarrisoned:
|
AttackGarrisoned:
|
||||||
|
RequiresCondition: !build-incomplete
|
||||||
Armaments: garrisoned
|
Armaments: garrisoned
|
||||||
PortOffsets: 384,0,128, 224,-341,128, -224,-341,128, -384,0,128, -224,341,128, 224,341,128
|
PortOffsets: 384,0,128, 224,-341,128, -224,-341,128, -384,0,128, -224,341,128, 224,341,128
|
||||||
PortYaws: 0, 176, 341, 512, 682, 853
|
PortYaws: 0, 176, 341, 512, 682, 853
|
||||||
@@ -802,6 +806,7 @@ GUN:
|
|||||||
LocalOffset: 512,0,112
|
LocalOffset: 512,0,112
|
||||||
MuzzleSequence: muzzle
|
MuzzleSequence: muzzle
|
||||||
AttackTurreted:
|
AttackTurreted:
|
||||||
|
RequiresCondition: !build-incomplete
|
||||||
WithMuzzleOverlay:
|
WithMuzzleOverlay:
|
||||||
Power:
|
Power:
|
||||||
Amount: -40
|
Amount: -40
|
||||||
@@ -841,6 +846,7 @@ FTUR:
|
|||||||
Weapon: FireballLauncher
|
Weapon: FireballLauncher
|
||||||
LocalOffset: 512,0,0
|
LocalOffset: 512,0,0
|
||||||
AttackTurreted:
|
AttackTurreted:
|
||||||
|
RequiresCondition: !build-incomplete
|
||||||
-QuantizeFacingsFromSequence:
|
-QuantizeFacingsFromSequence:
|
||||||
BodyOrientation:
|
BodyOrientation:
|
||||||
QuantizedFacings: 8
|
QuantizedFacings: 8
|
||||||
@@ -897,6 +903,7 @@ SAM:
|
|||||||
LocalOffset: 0,0,320
|
LocalOffset: 0,0,320
|
||||||
MuzzleSequence: muzzle
|
MuzzleSequence: muzzle
|
||||||
AttackTurreted:
|
AttackTurreted:
|
||||||
|
RequiresCondition: !build-incomplete
|
||||||
PauseOnCondition: disabled
|
PauseOnCondition: disabled
|
||||||
WithMuzzleOverlay:
|
WithMuzzleOverlay:
|
||||||
RenderRangeCircle:
|
RenderRangeCircle:
|
||||||
|
|||||||
@@ -74,7 +74,7 @@ GACTWR:
|
|||||||
TurnSpeed: 10
|
TurnSpeed: 10
|
||||||
InitialFacing: 224
|
InitialFacing: 224
|
||||||
AttackTurreted:
|
AttackTurreted:
|
||||||
RequiresCondition: tower.vulcan || tower.rocket || tower.sam
|
RequiresCondition: !build-incomplete && (tower.vulcan || tower.rocket || tower.sam)
|
||||||
PauseOnCondition: empdisable || disabled
|
PauseOnCondition: empdisable || disabled
|
||||||
WithSpriteTurret@VULC:
|
WithSpriteTurret@VULC:
|
||||||
RequiresCondition: !build-incomplete && tower.vulcan
|
RequiresCondition: !build-incomplete && tower.vulcan
|
||||||
|
|||||||
@@ -169,6 +169,7 @@ NALASR:
|
|||||||
InitialFacing: 224
|
InitialFacing: 224
|
||||||
Offset: 298,-171,288
|
Offset: 298,-171,288
|
||||||
AttackTurreted:
|
AttackTurreted:
|
||||||
|
RequiresCondition: !build-incomplete
|
||||||
PauseOnCondition: empdisable || disabled
|
PauseOnCondition: empdisable || disabled
|
||||||
Armament:
|
Armament:
|
||||||
Weapon: TurretLaserFire
|
Weapon: TurretLaserFire
|
||||||
@@ -212,6 +213,7 @@ NAOBEL:
|
|||||||
Weapon: ObeliskLaserFire
|
Weapon: ObeliskLaserFire
|
||||||
LocalOffset: 1980,297,1131
|
LocalOffset: 1980,297,1131
|
||||||
AttackCharges:
|
AttackCharges:
|
||||||
|
RequiresCondition: !build-incomplete
|
||||||
PauseOnCondition: empdisable || disabled
|
PauseOnCondition: empdisable || disabled
|
||||||
ChargeLevel: 65
|
ChargeLevel: 65
|
||||||
ChargingCondition: charging
|
ChargingCondition: charging
|
||||||
@@ -258,6 +260,7 @@ NASAM:
|
|||||||
TurnSpeed: 10
|
TurnSpeed: 10
|
||||||
InitialFacing: 224
|
InitialFacing: 224
|
||||||
AttackTurreted:
|
AttackTurreted:
|
||||||
|
RequiresCondition: !build-incomplete
|
||||||
PauseOnCondition: empdisable || disabled
|
PauseOnCondition: empdisable || disabled
|
||||||
WithSpriteTurret:
|
WithSpriteTurret:
|
||||||
RequiresCondition: !build-incomplete
|
RequiresCondition: !build-incomplete
|
||||||
|
|||||||
@@ -27,7 +27,7 @@ NAPULS:
|
|||||||
TurnSpeed: 10
|
TurnSpeed: 10
|
||||||
InitialFacing: 224
|
InitialFacing: 224
|
||||||
AttackTurreted:
|
AttackTurreted:
|
||||||
RequiresCondition: !empdisable && !disabled
|
RequiresCondition: !build-incomplete && !empdisable && !disabled
|
||||||
Armament:
|
Armament:
|
||||||
Weapon: EMPulseCannon
|
Weapon: EMPulseCannon
|
||||||
LocalOffset: 212,0,1768
|
LocalOffset: 212,0,1768
|
||||||
|
|||||||
Reference in New Issue
Block a user