implement Ordos nerve gas missiles as warheads

closes #2838
This commit is contained in:
Matthias Mailänder
2014-10-05 17:04:04 +02:00
parent 611e3038b2
commit 9e650adef8
8 changed files with 142 additions and 49 deletions

View File

@@ -1,45 +0,0 @@
#region Copyright & License Information
/*
* Copyright 2007-2014 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 System.Linq;
using OpenRA.Traits;
namespace OpenRA.Mods.RA
{
public class AttackLoyaltyInfo : AttackFrontalInfo
{
public override object Create(ActorInitializer init) { return new AttackLoyalty(init.self, this); }
}
public class AttackLoyalty : AttackFrontal
{
public AttackLoyalty(Actor self, AttackLoyaltyInfo info)
: base(self, info) { }
public override void DoAttack(Actor self, Target target)
{
if (!CanAttack(self, target))
return;
var arm = Armaments.FirstOrDefault();
if (arm == null)
return;
if (!target.IsInRange(self.CenterPosition, arm.Weapon.Range))
return;
foreach (var a in Armaments)
a.CheckFire(self, facing.Value, target);
if (target.Actor != null)
target.Actor.ChangeOwner(self.Owner);
}
}
}

View File

@@ -146,7 +146,6 @@
<Compile Include="Attack\AttackBase.cs" />
<Compile Include="Attack\AttackFrontal.cs" />
<Compile Include="Attack\AttackLeap.cs" />
<Compile Include="Attack\AttackLoyalty.cs" />
<Compile Include="Attack\AttackMedic.cs" />
<Compile Include="Attack\AttackOmni.cs" />
<Compile Include="Attack\AttackPopupTurreted.cs" />