Merge pull request #5941 from reaperrr/spread-upgrade

Added MaxSpread for more control over maximum area of damage
This commit is contained in:
Matthias Mailänder
2014-07-24 22:18:03 +02:00
3 changed files with 18 additions and 3 deletions

View File

@@ -19,6 +19,8 @@ namespace OpenRA.GameRules
{
[Desc("Distance from the explosion center at which damage is 1/2.")]
public readonly WRange Spread = new WRange(43);
[Desc("Maximum Spread. If a value >= Spread is set, this sets a fixed maximum area of damage.")]
public readonly WRange MaxSpread = new WRange(0);
[FieldLoader.LoadUsing("LoadVersus")]
[Desc("Damage vs each armortype. 0% = can't target.")]
public readonly Dictionary<string, float> Versus;

View File

@@ -122,7 +122,10 @@ namespace OpenRA.Mods.RA
{
case DamageModel.Normal:
{
var maxSpread = new WRange((int)(warhead.Spread.Range * (float)Math.Log(Math.Abs(warhead.Damage), 2)));
var spreadMax = warhead.MaxSpread.Range;
var maxSpreadCalculation = spreadMax >= warhead.Spread.Range ? spreadMax : (warhead.Spread.Range * (float)Math.Log(Math.Abs(warhead.Damage), 2));
var maxSpread = new WRange((int)(maxSpreadCalculation));
var hitActors = world.FindActorsInCircle(pos, maxSpread);
foreach (var victim in hitActors)

View File

@@ -117,8 +117,10 @@ Atomic:
IonCannon:
ValidTargets: Ground, Air
Warhead@impact:
Damage: 900
Spread: 853
Damage: 1000
SmudgeType: Scorch
Spread: 1c0
MaxSpread: 3c640
DestroyResources: true
InfDeath: 5
Warhead@area:
@@ -129,6 +131,14 @@ IonCannon:
DestroyResources: true
Delay: 3
InfDeath: 5
Warhead@area2:
DamageModel: PerCell
Damage: 0
SmudgeType: Scorch
Size: 1
DestroyResources: true
Delay: 3
InfDeath: 5
Sniper:
Report: RAMGUN2.AUD