remove AttackDefault; use AttackFrontal instead

This commit is contained in:
Bob
2010-10-25 09:51:14 +13:00
parent c338d28d35
commit f5fe1013ee
9 changed files with 55 additions and 53 deletions

View File

@@ -282,14 +282,4 @@ namespace OpenRA.Mods.RA
}
}
}
public class AttackDefaultInfo : AttackBaseInfo
{
public override object Create( ActorInitializer init ) { return new AttackDefault( init.self ); }
}
public class AttackDefault : AttackBase
{
public AttackDefault( Actor self ) : base( self ) { }
}
}

View File

@@ -13,12 +13,18 @@ using OpenRA.Traits;
namespace OpenRA.Mods.RA
{
abstract class AttackFrontal : AttackBase
public class AttackFrontalInfo : AttackBaseInfo
{
public AttackFrontal(Actor self, int facingTolerance)
: base(self) { FacingTolerance = facingTolerance; }
public readonly int FacingTolerance = 1;
readonly int FacingTolerance;
public override object Create( ActorInitializer init ) { return new AttackFrontal( init.self, this ); }
}
public class AttackFrontal : AttackBase
{
readonly AttackFrontalInfo info;
public AttackFrontal(Actor self, AttackFrontalInfo info)
: base( self ) { this.info = info; }
protected override bool CanAttack( Actor self )
{
@@ -28,7 +34,7 @@ namespace OpenRA.Mods.RA
var facing = self.Trait<IFacing>().Facing;
var facingToTarget = Util.GetFacing(target.CenterLocation - self.CenterLocation, facing);
if( Math.Abs( facingToTarget - facing ) % 256 >= FacingTolerance )
if( Math.Abs( facingToTarget - facing ) % 256 > info.FacingTolerance )
return false;
return true;

View File

@@ -13,14 +13,14 @@ using OpenRA.Traits;
namespace OpenRA.Mods.RA
{
class AttackHeliInfo : AttackBaseInfo
class AttackHeliInfo : AttackFrontalInfo
{
public override object Create(ActorInitializer init) { return new AttackHeli(init.self); }
public override object Create(ActorInitializer init) { return new AttackHeli(init.self, this); }
}
class AttackHeli : AttackFrontal
{
public AttackHeli(Actor self) : base(self, 20) { }
public AttackHeli(Actor self, AttackHeliInfo info) : base(self, info) { }
protected override void QueueAttack(Actor self, Target newTarget)
{

View File

@@ -13,14 +13,14 @@ using OpenRA.Traits;
namespace OpenRA.Mods.RA
{
class AttackPlaneInfo : AttackBaseInfo
class AttackPlaneInfo : AttackFrontalInfo
{
public override object Create(ActorInitializer init) { return new AttackPlane(init.self); }
public override object Create(ActorInitializer init) { return new AttackPlane(init.self, this); }
}
class AttackPlane : AttackFrontal
{
public AttackPlane(Actor self) : base(self, 20) { }
public AttackPlane(Actor self, AttackPlaneInfo info) : base(self, info) { }
protected override void QueueAttack(Actor self, Target newTarget)
{

View File

@@ -135,7 +135,7 @@
HP: 20
RevealsShroud:
Range: 2
AttackDefault:
AttackFrontal:
PrimaryWeapon: Pistol
# ActorLostNotification:
# Notification: civdead1.aud
@@ -302,4 +302,4 @@
DamagedSound: xplos.aud
DestroyedSound: xplobig4.aud
Footprint: ______ ______ ______ ______
Dimensions: 6,4
Dimensions: 6,4

View File

@@ -15,7 +15,7 @@ E1:
Speed: 4
Health:
HP: 50
AttackDefault:
AttackFrontal:
PrimaryWeapon: M16
TakeCover:
IdleAnimation:
@@ -38,7 +38,7 @@ E2:
Speed: 4
Health:
HP: 50
AttackDefault:
AttackFrontal:
PrimaryWeapon: Grenade
PrimaryOffset: 0,0,0,-10
FireDelay: 15
@@ -63,7 +63,7 @@ E3:
Speed: 3
Health:
HP: 45
AttackDefault:
AttackFrontal:
PrimaryWeapon: Rockets
PrimaryOffset: 0,0,0,-10
FireDelay: 5
@@ -89,7 +89,7 @@ E4:
Speed: 4
Health:
HP: 90
AttackDefault:
AttackFrontal:
PrimaryWeapon: Flamethrower
PrimaryOffset: 0,0,0,-5
FireDelay: 3
@@ -118,7 +118,7 @@ E5:
Speed: 4
Health:
HP: 90
AttackDefault:
AttackFrontal:
PrimaryWeapon: Chemspray
PrimaryOffset: 0,0,0,-5
FireDelay: 3
@@ -179,10 +179,10 @@ RMBO:
HP: 200
RevealsShroud:
Range: 5
AttackDefault:
AttackFrontal:
PrimaryWeapon: Sniper
TakeCover:
C4Demolition:
C4Delay: .03
IdleAnimation:
Animations: idle1,idle2,idle3
Animations: idle1,idle2,idle3

View File

@@ -83,7 +83,7 @@ APC:
Type: Heavy
RevealsShroud:
Range: 5
AttackDefault:
AttackFrontal:
PrimaryWeapon: MachineGun
PrimaryOffset: 0,0,0,-4
MuzzleFlash: yes
@@ -116,7 +116,7 @@ ARTY:
Type: Light
RevealsShroud:
Range: 6
AttackDefault:
AttackFrontal:
PrimaryWeapon: Ballistic
RenderUnit:
Explodes:
@@ -143,7 +143,7 @@ FTNK:
Type: Heavy
RevealsShroud:
Range: 4
AttackDefault:
AttackFrontal:
PrimaryWeapon: BigFlamer
PrimaryOffset: 2,-8,0,-2
SecondaryWeapon: BigFlamer
@@ -202,7 +202,7 @@ BIKE:
Armor: none
RevealsShroud:
Range: 7
AttackDefault:
AttackFrontal:
PrimaryWeapon: Rockets.Bike
PrimaryOffset: 0,0,0,-2
PrimaryLocalOffset: -4,0,25,4,0,-25
@@ -442,7 +442,7 @@ STNK:
CloakDelay: 2.0
CloakSound: appear1.aud
UncloakSound: appear1.aud
AttackDefault:
AttackFrontal:
PrimaryWeapon: 227mm
RenderUnit:
AutoTarget:
@@ -507,6 +507,7 @@ HELI:
SecondaryWeapon: HighV
PrimaryOffset: -5,0,0,2
SecondaryOffset: 5,0,0,2
FacingTolerance: 20
RenderUnitRotor:
PrimaryOffset: 0,0,0,-2
WithShadow:
@@ -539,6 +540,7 @@ ORCA:
SecondaryWeapon: Rockets.Orca
PrimaryOffset: -5,0,0,2
SecondaryOffset: 5,0,0,2
FacingTolerance: 20
RenderUnit:
WithShadow:
FallsToEarth:
@@ -717,4 +719,4 @@ MLRS.Husk:
Anim: turret
Spread: 3,3
Speed: 6
AnimKey: turret
AnimKey: turret

View File

@@ -45,7 +45,7 @@ E1:
HP: 50
Mobile:
Speed: 4
AttackDefault:
AttackFrontal:
PrimaryWeapon: M1Carbine
TakeCover:
IdleAnimation:
@@ -70,7 +70,7 @@ E2:
HP: 50
Mobile:
Speed: 5
AttackDefault:
AttackFrontal:
PrimaryWeapon: Grenade
PrimaryOffset: 0,0,0,-13
FireDelay: 15
@@ -97,7 +97,7 @@ E3:
HP: 45
Mobile:
Speed: 3
AttackDefault:
AttackFrontal:
PrimaryWeapon: RedEye
SecondaryWeapon: Dragon
PrimaryOffset: 0,0,0,-13
@@ -124,7 +124,7 @@ E4:
HP: 40
Mobile:
Speed: 3
AttackDefault:
AttackFrontal:
PrimaryWeapon: Flamer
PrimaryOffset: 0,0,0,-7
FireDelay: 8
@@ -221,7 +221,7 @@ E7:
Range: 6
C4Demolition:
C4Delay: .03
AttackDefault:
AttackFrontal:
PrimaryWeapon: Colt45
SecondaryWeapon: Colt45
TakeCover:
@@ -253,7 +253,7 @@ MEDI:
Passenger:
PipType: Yellow
AutoHeal:
AttackDefault:
AttackFrontal:
PrimaryWeapon: Heal
TakeCover:
-AutoTarget:
@@ -277,7 +277,7 @@ C1:
Speed: 4
RevealsShroud:
Range: 2
AttackDefault:
AttackFrontal:
PrimaryWeapon: Pistol
C2:
@@ -295,7 +295,7 @@ C2:
Speed: 4
RevealsShroud:
Range: 2
AttackDefault:
AttackFrontal:
PrimaryWeapon: Pistol
SHOK:
@@ -318,8 +318,8 @@ SHOK:
Speed: 3
RevealsShroud:
Range: 4
AttackDefault:
AttackFrontal:
PrimaryWeapon: PortaTesla
TakeCover:
IdleAnimation:
Animations: idle1,idle2
Animations: idle1,idle2

View File

@@ -71,7 +71,7 @@ V2RL:
Speed: 7
RevealsShroud:
Range: 5
AttackDefault:
AttackFrontal:
PrimaryWeapon: SCUD
RenderUnitReload:
AutoTarget:
@@ -245,7 +245,7 @@ ARTY:
Speed: 6
RevealsShroud:
Range: 5
AttackDefault:
AttackFrontal:
PrimaryWeapon: 155mm
RenderUnit:
Explodes:
@@ -364,7 +364,7 @@ APC:
Speed: 10
RevealsShroud:
Range: 5
AttackDefault:
AttackFrontal:
PrimaryWeapon: M60mg
PrimaryOffset: 0,0,0,-4
MuzzleFlash: yes
@@ -482,7 +482,7 @@ SS:
CloakDelay: 2.0
CloakSound: subshow1.aud
UncloakSound: subshow1.aud
AttackDefault:
AttackFrontal:
PrimaryWeapon: TorpTube
PrimaryLocalOffset: -4,0,0,4,0,0
FireDelay: 2
@@ -524,7 +524,7 @@ MSUB:
CloakDelay: 2.0
CloakSound: subshow1.aud
UncloakSound: subshow1.aud
AttackDefault:
AttackFrontal:
PrimaryWeapon: SubMissile
FireDelay: 2
Selectable:
@@ -702,6 +702,7 @@ MIG:
SecondaryWeapon: Maverick
PrimaryLocalOffset: -15,0,-10,-12,0,6
SecondaryLocalOffset: 15,0,10,12,0,6
FacingTolerance: 20
Plane:
InitialFacing: 192
ROT: 5
@@ -744,6 +745,7 @@ YAK:
SecondaryWeapon: ChainGun.Yak
PrimaryOffset: -5,-6,0,0
SecondaryOffset: 5,-6,0,0
FacingTolerance: 20
Plane:
RearmBuildings: afld
InitialFacing: 192
@@ -790,7 +792,7 @@ TRAN:
WithShadow:
Cargo:
Types: Infantry
Passengers: 5
Passengers: 5
IronCurtainable:
FallsToEarth:
@@ -818,6 +820,7 @@ HELI:
SecondaryWeapon: Hellfire
PrimaryOffset: -5,0,0,2
SecondaryOffset: 5,0,0,2
FacingTolerance: 20
Helicopter:
RearmBuildings: hpad
LandWhenIdle: false
@@ -856,6 +859,7 @@ HIND:
SecondaryWeapon: ChainGun
PrimaryOffset: -5,-2,0,2
SecondaryOffset: 5,-2,0,2
FacingTolerance: 20
Helicopter:
RearmBuildings: hpad
LandWhenIdle: false
@@ -959,7 +963,7 @@ TTNK:
Speed: 8
RevealsShroud:
Range: 7
AttackDefault:
AttackFrontal:
PrimaryWeapon: TTankZap
RenderUnitSpinner:
Selectable: