diff --git a/OpenRA.Mods.RA/Air/HeliAttack.cs b/OpenRA.Mods.RA/Air/HeliAttack.cs index 4ce714ed9c..487328afd9 100755 --- a/OpenRA.Mods.RA/Air/HeliAttack.cs +++ b/OpenRA.Mods.RA/Air/HeliAttack.cs @@ -26,7 +26,8 @@ namespace OpenRA.Mods.RA.Air if (!target.IsValid) return NextActivity; var limitedAmmo = self.TraitOrDefault(); - if (limitedAmmo != null && !limitedAmmo.HasAmmo()) + var reloads = self.TraitOrDefault(); + if (limitedAmmo != null && !limitedAmmo.HasAmmo() && reloads == null) return Util.SequenceActivities( new HeliReturn(), NextActivity ); var aircraft = self.Trait(); diff --git a/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj b/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj index 6d472d863b..8c61f72c5c 100644 --- a/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj +++ b/OpenRA.Mods.RA/OpenRA.Mods.RA.csproj @@ -348,6 +348,7 @@ + diff --git a/OpenRA.Mods.RA/Reloads.cs b/OpenRA.Mods.RA/Reloads.cs new file mode 100644 index 0000000000..e9424f53e5 --- /dev/null +++ b/OpenRA.Mods.RA/Reloads.cs @@ -0,0 +1,47 @@ +#region Copyright & License Information +/* + * Copyright 2007-2011 The OpenRA Developers (see AUTHORS) + * This file is part of OpenRA, which is free software. It is made + * available to you under the terms of the GNU General Public License + * as published by the Free Software Foundation. For more information, + * see COPYING. + */ +#endregion + +using OpenRA.Traits; + +namespace OpenRA.Mods.RA +{ + public class ReloadsInfo : ITraitInfo, Requires + { + public readonly int Count = 0; + public readonly int Period = 50; + + public object Create(ActorInitializer init) { return new Reloads(init.self, this); } + } + + public class Reloads : ITick + { + [Sync] + int remainingTicks; + ReloadsInfo Info; + LimitedAmmo la; + + public Reloads(Actor self, ReloadsInfo info) + { + Info = info; + remainingTicks = info.Period; + la = self.Trait(); + } + + public void Tick(Actor self) + { + if (--remainingTicks == 0) + { + remainingTicks = Info.Period; + for (var i = 0; i < Info.Count; i++) + la.GiveAmmo(); + } + } + } +} diff --git a/mods/cnc/rules/aircraft.yaml b/mods/cnc/rules/aircraft.yaml index d90a84eea4..be045a4167 100644 --- a/mods/cnc/rules/aircraft.yaml +++ b/mods/cnc/rules/aircraft.yaml @@ -93,11 +93,16 @@ ORCA: RevealsShroud: Range: 8 AttackHeli: - PrimaryWeapon: Rockets.Orca - SecondaryWeapon: Rockets.Orca - PrimaryOffset: -5,0,0,2 - SecondaryOffset: 5,0,0,2 + PrimaryWeapon: OrcaMissiles + PrimaryOffset: 0,-10,0,5 + PrimaryLocalOffset: -4,0,0,4,0,0 FacingTolerance: 20 + LimitedAmmo: + Ammo: 10 + PipCount: 5 + Reloads: + Count: 2 + Period: 75 RenderUnit: WithShadow: FallsToEarth: diff --git a/mods/cnc/weapons.yaml b/mods/cnc/weapons.yaml index 4033782b69..65a529ae5d 100644 --- a/mods/cnc/weapons.yaml +++ b/mods/cnc/weapons.yaml @@ -221,10 +221,11 @@ Rockets.Bike: SmudgeType: Crater Damage: 30 -Rockets.Orca: - ROF: 300 +OrcaMissiles: + ROF: 10 + Burst: 2 + BurstDelay: 0 Range: 5 - Burst: 4 Report: BAZOOK1 ValidTargets: Ground, Air Projectile: Missile @@ -249,7 +250,7 @@ Rockets.Orca: Explosion: 4 ImpactSound: xplos SmudgeType: Crater - Damage: 30 + Damage: 20 Flamethrower: ROF: 50