Merge pull request #5941 from reaperrr/spread-upgrade
Added MaxSpread for more control over maximum area of damage
This commit is contained in:
@@ -19,6 +19,8 @@ namespace OpenRA.GameRules
|
|||||||
{
|
{
|
||||||
[Desc("Distance from the explosion center at which damage is 1/2.")]
|
[Desc("Distance from the explosion center at which damage is 1/2.")]
|
||||||
public readonly WRange Spread = new WRange(43);
|
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")]
|
[FieldLoader.LoadUsing("LoadVersus")]
|
||||||
[Desc("Damage vs each armortype. 0% = can't target.")]
|
[Desc("Damage vs each armortype. 0% = can't target.")]
|
||||||
public readonly Dictionary<string, float> Versus;
|
public readonly Dictionary<string, float> Versus;
|
||||||
|
|||||||
@@ -122,7 +122,10 @@ namespace OpenRA.Mods.RA
|
|||||||
{
|
{
|
||||||
case DamageModel.Normal:
|
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);
|
var hitActors = world.FindActorsInCircle(pos, maxSpread);
|
||||||
|
|
||||||
foreach (var victim in hitActors)
|
foreach (var victim in hitActors)
|
||||||
|
|||||||
@@ -117,8 +117,10 @@ Atomic:
|
|||||||
IonCannon:
|
IonCannon:
|
||||||
ValidTargets: Ground, Air
|
ValidTargets: Ground, Air
|
||||||
Warhead@impact:
|
Warhead@impact:
|
||||||
Damage: 900
|
Damage: 1000
|
||||||
Spread: 853
|
SmudgeType: Scorch
|
||||||
|
Spread: 1c0
|
||||||
|
MaxSpread: 3c640
|
||||||
DestroyResources: true
|
DestroyResources: true
|
||||||
InfDeath: 5
|
InfDeath: 5
|
||||||
Warhead@area:
|
Warhead@area:
|
||||||
@@ -129,6 +131,14 @@ IonCannon:
|
|||||||
DestroyResources: true
|
DestroyResources: true
|
||||||
Delay: 3
|
Delay: 3
|
||||||
InfDeath: 5
|
InfDeath: 5
|
||||||
|
Warhead@area2:
|
||||||
|
DamageModel: PerCell
|
||||||
|
Damage: 0
|
||||||
|
SmudgeType: Scorch
|
||||||
|
Size: 1
|
||||||
|
DestroyResources: true
|
||||||
|
Delay: 3
|
||||||
|
InfDeath: 5
|
||||||
|
|
||||||
Sniper:
|
Sniper:
|
||||||
Report: RAMGUN2.AUD
|
Report: RAMGUN2.AUD
|
||||||
|
|||||||
Reference in New Issue
Block a user