move Combat, AttackBase, and associates into mod

This commit is contained in:
Bob
2010-07-08 16:32:25 +12:00
parent bd74b29ea3
commit 281d013c3b
20 changed files with 95 additions and 91 deletions

View File

@@ -21,9 +21,8 @@
using System;
using System.Collections.Generic;
using System.Linq;
using OpenRA.GameRules;
using OpenRA.Traits;
using OpenRA.Support;
using OpenRA.Traits;
namespace OpenRA
{
@@ -45,28 +44,6 @@ namespace OpenRA
return xs.Aggregate(1f, (a, x) => a * x);
}
public static WeaponInfo GetPrimaryWeapon(this Actor self)
{
var info = self.Info.Traits.GetOrDefault<AttackBaseInfo>();
if (info == null) return null;
var weapon = info.PrimaryWeapon;
if (weapon == null) return null;
return Rules.Weapons[weapon.ToLowerInvariant()];
}
public static WeaponInfo GetSecondaryWeapon(this Actor self)
{
var info = self.Info.Traits.GetOrDefault<AttackBaseInfo>();
if (info == null) return null;
var weapon = info.SecondaryWeapon;
if (weapon == null) return null;
return Rules.Weapons[weapon.ToLowerInvariant()];
}
public static int GetMaxHP(this Actor self)
{
var oai = self.Info.Traits.GetOrDefault<OwnedActorInfo>();