sniper can go into pillbox and garrision church

This commit is contained in:
Matthias Mailänder
2012-07-27 23:28:00 +02:00
committed by Chris Forbes
parent 02f28f54c7
commit 45fbecbcd0
5 changed files with 83 additions and 10 deletions

View File

@@ -29,10 +29,12 @@ namespace OpenRA.Mods.RA
public void OnCapture(Actor self, Actor captor, Player oldOwner, Player newOwner) public void OnCapture(Actor self, Actor captor, Player oldOwner, Player newOwner)
{ {
self.QueueActivity(new Transform(self, Info.IntoActor) { var facing = self.TraitOrDefault<IFacing>();
ForceHealthPercentage = Info.ForceHealthPercentage, var transform = new Transform(self, Info.IntoActor) { ForceHealthPercentage = Info.ForceHealthPercentage };
Facing = self.Trait<IFacing>().Facing if (facing != null) transform.Facing = facing.Facing;
}); transform.SkipMakeAnims = true;
self.CancelActivity();
self.QueueActivity(transform);
} }
} }
} }

View File

@@ -21,6 +21,7 @@ namespace OpenRA.Mods.RA
[ActorReference] public readonly string OnEnter = null; [ActorReference] public readonly string OnEnter = null;
[ActorReference] public readonly string OnExit = null; [ActorReference] public readonly string OnExit = null;
public readonly bool SkipMakeAnims = false; public readonly bool SkipMakeAnims = false;
public readonly bool BecomeNeutral = false;
public object Create(ActorInitializer init) { return new TransformOnPassenger(this); } public object Create(ActorInitializer init) { return new TransformOnPassenger(this); }
} }
@@ -43,6 +44,7 @@ namespace OpenRA.Mods.RA
self.CancelActivity(); self.CancelActivity();
self.QueueActivity(transform); self.QueueActivity(transform);
if (info.BecomeNeutral) self.ChangeOwner(self.World.WorldActor.Owner);
}); });
} }
} }

View File

@@ -28,6 +28,37 @@ V01:
Dimensions: 2,2 Dimensions: 2,2
Tooltip: Tooltip:
Name: Church Name: Church
RevealsShroud:
Range: 10
TransformOnCapture:
IntoActor: v01.sniper
Capturable:
Type: civilianbuilding
CaptureCompleteTime: 0
V01.SNIPER:
Inherits: V01
RenderBuilding:
Image: V01
RenderRangeCircle:
AutoTarget:
Turreted:
ROT: 255
AttackTurreted:
PrimaryWeapon: Sniper
PrimaryLocalOffset: 0,-11,0,0,0
Cargo:
InitialUnits: sniper
Types: Infantry
MaxWeight: 1
PipCount: 1
TransformOnPassenger@Sniper:
PassengerTypes: sniper
OnExit: v01
SkipMakeAnims: true
BecomeNeutral: true
-Capturable:
V02: V02:
Inherits: ^CivBuilding Inherits: ^CivBuilding
Building: Building:

View File

@@ -411,6 +411,7 @@ SNIPER:
RevealsShroud: RevealsShroud:
Range: 6 Range: 6
-AutoTarget: -AutoTarget:
-AttackMove:
AttackFrontal: AttackFrontal:
PrimaryWeapon: Sniper PrimaryWeapon: Sniper
TakeCover: TakeCover:
@@ -421,4 +422,7 @@ SNIPER:
InitialDelay: 250 InitialDelay: 250
CloakDelay: 120 CloakDelay: 120
CloakSound: appear1.aud CloakSound: appear1.aud
UncloakSound: appear1.aud UncloakSound: appear1.aud
Captures:
CaptureTypes: civilianbuilding
AllowAllies: true

View File

@@ -409,12 +409,17 @@ PBOX:
TransformOnPassenger@e7: TransformOnPassenger@e7:
PassengerTypes: e7 PassengerTypes: e7
OnEnter: pbox.e7 OnEnter: pbox.e7
OnExit: pbox OnExit: pbox
SkipMakeAnims: true SkipMakeAnims: true
TransformOnPassenger@SHOK: TransformOnPassenger@SHOK:
PassengerTypes: shok PassengerTypes: shok
OnEnter: pbox.shok OnEnter: pbox.shok
OnExit: pbox OnExit: pbox
SkipMakeAnims: true
TransformOnPassenger@Sniper:
PassengerTypes: sniper
OnEnter: pbox.sniper
OnExit: pbox
SkipMakeAnims: true SkipMakeAnims: true
PBOX.E1: PBOX.E1:
@@ -495,6 +500,18 @@ PBOX.SHOK:
PrimaryWeapon: PortaTesla PrimaryWeapon: PortaTesla
PrimaryLocalOffset: 0,-11,0,0,0 PrimaryLocalOffset: 0,-11,0,0,0
PBOX.SNIPER:
Inherits: PBOX
Tooltip:
Name: Pillbox (Sniper)
RenderBuilding:
Image: PBOX
RenderRangeCircle:
AutoTarget:
AttackTurreted:
PrimaryWeapon: Sniper
PrimaryLocalOffset: 0,-11,0,0,0
HBOX: HBOX:
Inherits: ^Building Inherits: ^Building
Tooltip: Tooltip:
@@ -548,12 +565,17 @@ HBOX:
TransformOnPassenger@e7: TransformOnPassenger@e7:
PassengerTypes: e7 PassengerTypes: e7
OnEnter: HBOX.e7 OnEnter: HBOX.e7
OnExit: HBOX OnExit: HBOX
SkipMakeAnims: true SkipMakeAnims: true
TransformOnPassenger@SHOK: TransformOnPassenger@SHOK:
PassengerTypes: shok PassengerTypes: shok
OnEnter: HBOX.shok OnEnter: HBOX.shok
OnExit: HBOX OnExit: HBOX
SkipMakeAnims: true
TransformOnPassenger@Sniper:
PassengerTypes: sniper
OnEnter: HBOX.sniper
OnExit: HBOX
SkipMakeAnims: true SkipMakeAnims: true
HBOX.E1: HBOX.E1:
@@ -632,7 +654,19 @@ HBOX.SHOK:
AutoTarget: AutoTarget:
AttackTurreted: AttackTurreted:
PrimaryWeapon: PortaTesla PrimaryWeapon: PortaTesla
PrimaryLocalOffset: 0,-11,0,0,0 PrimaryLocalOffset: 0,-11,0,0,0
HBOX.SNIPER:
Inherits: HBOX
Tooltip:
Name: Camo Pillbox (Sniper)
RenderBuilding:
Image: HBOX
RenderRangeCircle:
AutoTarget:
AttackTurreted:
PrimaryWeapon: Sniper
PrimaryLocalOffset: 0,-11,0,0,0
GUN: GUN:
Inherits: ^Building Inherits: ^Building