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