much simpler rules loader

This commit is contained in:
Chris Forbes
2010-04-01 21:31:15 +13:00
parent c5fdda9141
commit 38605faecf
16 changed files with 110 additions and 120 deletions

View File

@@ -27,7 +27,7 @@ using OpenRA.FileFormats;
namespace OpenRA
{
static class Combat /* some utility bits that are shared between various things */
public static class Combat /* some utility bits that are shared between various things */
{
static string GetImpactSound(WarheadInfo warhead, bool isWater)
{
@@ -82,6 +82,23 @@ namespace OpenRA
}
}
public static void DoExplosion(Actor attacker, string weapontype, int2 location, int altitude)
{
var args = new ProjectileArgs
{
src = location,
dest = location,
srcAltitude = altitude,
destAltitude = altitude,
firedBy = attacker,
target = null,
weapon = Rules.Weapons[ weapontype.ToLowerInvariant() ],
facing = 0
};
DoImpacts(args, location);
}
static float GetDamageToInflict(Actor target, ProjectileArgs args, WarheadInfo warhead, float modifier)
{
var distance = (target.CenterLocation - args.dest).Length;