move Combat, AttackBase, and associates into mod
This commit is contained in:
@@ -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>();
|
||||
|
||||
Reference in New Issue
Block a user