made parabombs work

This commit is contained in:
Chris Forbes
2010-04-12 19:11:57 +12:00
parent 906c0ac67e
commit 28412cd1b6
10 changed files with 71 additions and 30 deletions

View File

@@ -43,6 +43,9 @@ namespace OpenRA.Effects
altitude = args.srcAltitude; altitude = args.srcAltitude;
anim = new Animation(info.Image); anim = new Animation(info.Image);
if (anim.HasSequence("open"))
anim.PlayThen("open", () => anim.PlayRepeating("idle"));
else
anim.PlayRepeating("idle"); anim.PlayRepeating("idle");
} }

View File

@@ -45,8 +45,6 @@
<Reference Include="System.Xml" /> <Reference Include="System.Xml" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="AirstrikePower.cs" />
<Compile Include="CarpetBomb.cs" />
<Compile Include="CriticalBuildingState.cs" /> <Compile Include="CriticalBuildingState.cs" />
<Compile Include="Effects\IonCannon.cs" /> <Compile Include="Effects\IonCannon.cs" />
<Compile Include="IonCannonPower.cs" /> <Compile Include="IonCannonPower.cs" />

View File

@@ -22,10 +22,11 @@ using OpenRA.Orders;
using OpenRA.Traits; using OpenRA.Traits;
using OpenRA.Traits.Activities; using OpenRA.Traits.Activities;
namespace OpenRA.Mods.Cnc namespace OpenRA.Mods.RA
{ {
class AirstrikePowerInfo : SupportPowerInfo class AirstrikePowerInfo : SupportPowerInfo
{ {
public readonly string UnitType = "badr.bomber";
public override object Create(Actor self) { return new AirstrikePower(self, this); } public override object Create(Actor self) { return new AirstrikePower(self, this); }
} }
@@ -46,7 +47,7 @@ namespace OpenRA.Mods.Cnc
Owner.World.AddFrameEndTask(w => Owner.World.AddFrameEndTask(w =>
{ {
var a = w.CreateActor("a10", startPos, Owner); var a = w.CreateActor((Info as AirstrikePowerInfo).UnitType, startPos, Owner);
a.traits.Get<Unit>().Facing = Util.GetFacing(order.TargetLocation - startPos, 0); a.traits.Get<Unit>().Facing = Util.GetFacing(order.TargetLocation - startPos, 0);
a.traits.Get<Unit>().Altitude = a.Info.Traits.Get<PlaneInfo>().CruiseAltitude; a.traits.Get<Unit>().Altitude = a.Info.Traits.Get<PlaneInfo>().CruiseAltitude;
a.traits.Get<CarpetBomb>().SetTarget(order.TargetLocation); a.traits.Get<CarpetBomb>().SetTarget(order.TargetLocation);

View File

@@ -21,7 +21,7 @@
using OpenRA.GameRules; using OpenRA.GameRules;
using OpenRA.Traits; using OpenRA.Traits;
namespace OpenRA.Mods.Cnc namespace OpenRA.Mods.RA
{ {
class CarpetBombInfo : ITraitInfo class CarpetBombInfo : ITraitInfo
{ {
@@ -68,6 +68,9 @@ namespace OpenRA.Mods.Cnc
}; };
self.World.Add(args.weapon.Projectile.Create(args)); self.World.Add(args.weapon.Projectile.Create(args));
if (!string.IsNullOrEmpty(args.weapon.Report))
Sound.Play(args.weapon.Report + ".aud");
} }
} }
} }

View File

@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="3.5" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup> <PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> <Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
@@ -53,7 +53,9 @@
<Compile Include="Activities\LayMine.cs" /> <Compile Include="Activities\LayMine.cs" />
<Compile Include="Activities\Steal.cs" /> <Compile Include="Activities\Steal.cs" />
<Compile Include="Activities\Teleport.cs" /> <Compile Include="Activities\Teleport.cs" />
<Compile Include="AirstrikePower.cs" />
<Compile Include="C4Demolition.cs" /> <Compile Include="C4Demolition.cs" />
<Compile Include="CarpetBomb.cs" />
<Compile Include="Chronoshiftable.cs" /> <Compile Include="Chronoshiftable.cs" />
<Compile Include="Effects\NukeLaunch.cs" /> <Compile Include="Effects\NukeLaunch.cs" />
<Compile Include="Activities\Harvest.cs" /> <Compile Include="Activities\Harvest.cs" />

View File

@@ -35,6 +35,7 @@ Player:
TechLevel: 8 TechLevel: 8
EndChargeSound: airredy1.aud EndChargeSound: airredy1.aud
SelectTargetSound: select1.aud SelectTargetSound: select1.aud
UnitType: a10
World: World:
GlobalDefaults: GlobalDefaults:

View File

@@ -911,4 +911,8 @@
<sequence name="die5" start="0" length="14" src="electro" /> <sequence name="die5" start="0" length="14" src="electro" />
<sequence name="run" start="56" length="6" facings="8" /> <sequence name="run" start="56" length="6" facings="8" />
</unit> </unit>
<unit name="parabomb">
<sequence name="open" start="0" length="8" />
<sequence name="idle" start="8" length="5" />
</unit>
</sequences> </sequences>

View File

@@ -66,6 +66,18 @@ Player:
TechLevel: 5 TechLevel: 5
GivenAuto: no GivenAuto: no
OneShot: yes OneShot: yes
AirstrikePower:
Image: pbmbicon
ChargeTime: .2
Description: Parabombs
LongDesc: A Badger drops a load of parachuted bombs on your target.
TechLevel: 5
Prerequisites: POWR
# GivenAuto: no
# OneShot: yes
UnitType: badr.bomber
SelectTargetSound: slcttgt1.aud
World: World:
GlobalDefaults: GlobalDefaults:

View File

@@ -62,6 +62,26 @@ BADR:
Passengers: 10 Passengers: 10
-Selectable: -Selectable:
BADR.bomber:
CarpetBomb:
Range: 3
Weapon: ParaBomb
Inherits: ^Plane
Unit:
HP: 60
Armor: light
ROT: 5
Sight: 0
Speed: 16
Plane:
LimitedAmmo:
Ammo: 7
RenderUnit:
Image: badr
WithShadow:
IronCurtainable:
-Selectable:
V2RL: V2RL:
Inherits: ^Vehicle Inherits: ^Vehicle
Buildable: Buildable:

View File

@@ -556,24 +556,21 @@ DepthCharge:
Damage: 80 Damage: 80
ParaBomb: ParaBomb:
ROF: 4 ROF: 10
Range: 4.5 Range: 4.5
Report: CHUTE1 Report: CHUTE1
Bullet: GravityBomb:
Arm: 24
RangeLimit: 24
High: true
Image: PARABOMB Image: PARABOMB
Speed: 5
Warhead: Warhead:
Spread: 3 Spread: 3
Wall: true Wall: true
Wood: true Wood: true
Verses: 30%,75%,75%,100%,50% Verses: 30%,75%,75%,100%,50%
Explosion: 4 Explosion: 8
InfDeath: 3 InfDeath: 3
SmudgeType: Crater SmudgeType: Crater
Damage: 300 Damage: 500
ImpactSound: kaboom15
DogJaw: DogJaw:
ROF: 10 ROF: 10