nuke damage generalized (DamageModel=PerCell)
This commit is contained in:
@@ -61,12 +61,30 @@ namespace OpenRA
|
||||
.Select(a => a.GetFirepowerModifier())
|
||||
.Product();
|
||||
|
||||
switch (warhead.DamageModel)
|
||||
{
|
||||
case DamageModel.Normal:
|
||||
{
|
||||
var maxSpread = warhead.Spread * (float)Math.Log(Math.Abs(warhead.Damage), 2);
|
||||
var hitActors = world.FindUnitsInCircle(args.dest, maxSpread);
|
||||
|
||||
foreach (var victim in hitActors)
|
||||
victim.InflictDamage(args.firedBy,
|
||||
(int)GetDamageToInflict(victim, args, warhead, firepowerModifier), warhead);
|
||||
} break;
|
||||
|
||||
case DamageModel.PerCell:
|
||||
{
|
||||
foreach (var t in world.FindTilesInCircle(targetTile, warhead.SmudgeSize[0]))
|
||||
{
|
||||
var x = Util.CenterOfCell(t);
|
||||
foreach (var unit in world.FindUnits(x, x))
|
||||
unit.InflictDamage(args.firedBy,
|
||||
(int)(warhead.Damage * warhead.EffectivenessAgainst(
|
||||
unit.Info.Traits.Get<OwnedActorInfo>().Armor)), warhead);
|
||||
}
|
||||
} break;
|
||||
}
|
||||
}
|
||||
|
||||
public static void DoImpacts(ProjectileArgs args, int2 visualLocation)
|
||||
|
||||
@@ -76,8 +76,7 @@ namespace OpenRA.Effects
|
||||
void Explode(World world)
|
||||
{
|
||||
world.AddFrameEndTask(w => w.Remove(this));
|
||||
//var warhead = Rules.WarheadInfo[weapon.Warhead];
|
||||
//Combat.DoImpact(pos.ToInt2(), pos.ToInt2(), weapon, Rules.ProjectileInfo[weapon.Projectile], warhead, silo, true);
|
||||
Combat.DoExplosion(silo, "Atomic", pos.ToInt2(), 0);
|
||||
world.WorldActor.traits.Get<ScreenShaker>().AddEffect(20, pos, 5);
|
||||
}
|
||||
|
||||
|
||||
@@ -27,19 +27,20 @@ namespace OpenRA.GameRules
|
||||
{
|
||||
public class WarheadInfo
|
||||
{
|
||||
public readonly int Spread = 1;
|
||||
public readonly float[] Verses = { 1, 1, 1, 1, 1 };
|
||||
public readonly bool Wall = false;
|
||||
public readonly bool Wood = false;
|
||||
public readonly bool Ore = false;
|
||||
public readonly int Explosion = 0;
|
||||
public readonly SmudgeType SmudgeType = SmudgeType.None;
|
||||
public readonly int[] SmudgeSize = { 0, 0 };
|
||||
public readonly int InfDeath = 0;
|
||||
public readonly string ImpactSound = null;
|
||||
public readonly string WaterImpactSound = null;
|
||||
public readonly int Damage = 0; // for new weapons infrastructure
|
||||
public readonly int Delay = 0; // delay in ticks before dealing the damage. 0=instant
|
||||
public readonly int Spread = 1; // distance (in pixels) from the explosion center at which damage is 1/2.
|
||||
public readonly float[] Verses = { 1, 1, 1, 1, 1 }; // damage vs each armortype
|
||||
public readonly bool Wall = false; // can this damage walls?
|
||||
public readonly bool Wood = false; // can this damage wood?
|
||||
public readonly bool Ore = false; // can this damage ore?
|
||||
public readonly int Explosion = 0; // explosion effect to use
|
||||
public readonly SmudgeType SmudgeType = SmudgeType.None; // type of smudge to apply
|
||||
public readonly int[] SmudgeSize = { 0, 0 }; // bounds of the smudge. first value is the outer radius; second value is the inner radius.
|
||||
public readonly int InfDeath = 0; // infantry death animation to use
|
||||
public readonly string ImpactSound = null; // sound to play on impact
|
||||
public readonly string WaterImpactSound = null; // sound to play on impact with water
|
||||
public readonly int Damage = 0; // how much (raw) damage to deal
|
||||
public readonly int Delay = 0; // delay in ticks before dealing the damage. 0=instant (old model)
|
||||
public readonly DamageModel DamageModel = DamageModel.Normal; //
|
||||
|
||||
public float EffectivenessAgainst(ArmorType at) { return Verses[(int)at]; }
|
||||
}
|
||||
@@ -60,6 +61,12 @@ namespace OpenRA.GameRules
|
||||
Scorch = 2,
|
||||
}
|
||||
|
||||
public enum DamageModel
|
||||
{
|
||||
Normal, // classic RA damage model: point actors, distance-based falloff
|
||||
PerCell, // like RA's "nuke damage"
|
||||
}
|
||||
|
||||
public class ProjectileArgs
|
||||
{
|
||||
public WeaponInfo weapon;
|
||||
|
||||
@@ -47,7 +47,7 @@ Incoming=10 ; If an incoming projectile is as slow or slower than th
|
||||
; parachute bombs have this characteristic.
|
||||
|
||||
; income and production
|
||||
BuildSpeed=.4 ; general build speed [time (in minutes) to produce a 1000 credit cost item]
|
||||
BuildSpeed=.01 ; general build speed [time (in minutes) to produce a 1000 credit cost item]
|
||||
BuildupTime=.06 ; average minutes that building build-up animation runs
|
||||
OreTruckRate=1 ; speed that harvester truck manages ore [larger means slower]
|
||||
SeparateAircraft=no ; Is first helicopter to be purchased separately from helipad?
|
||||
|
||||
@@ -46,7 +46,7 @@ Player:
|
||||
DropItems: E1,E1,E1,E3,E3
|
||||
NukePower:
|
||||
Image: atomicon
|
||||
ChargeTime: 13
|
||||
ChargeTime: .1
|
||||
Description: Atom Bomb
|
||||
LongDesc: Launches a nuclear missile at a target location.
|
||||
Prerequisites: MSLO
|
||||
@@ -429,7 +429,7 @@ MSLO:
|
||||
Inherits: ^Building
|
||||
Buildable:
|
||||
TechLevel: 13
|
||||
Prerequisites: @Tech Center
|
||||
Prerequisites: powr
|
||||
Owner: soviet,allies
|
||||
Cost: 2500
|
||||
Description: Missile Silo
|
||||
|
||||
@@ -628,7 +628,7 @@ SCUD:
|
||||
Atomic:
|
||||
Nuke:
|
||||
Image: Nuke
|
||||
Warhead:
|
||||
Warhead@impact:
|
||||
Damage: 1000
|
||||
Spread: 6
|
||||
Wall: true
|
||||
@@ -637,8 +637,29 @@ Atomic:
|
||||
Verses: 90%,100%,60%,25%,50%
|
||||
Explosion: 6
|
||||
InfDeath: 4
|
||||
Warhead@inner-nuke:
|
||||
DamageModel: PerCell
|
||||
Damage: 150
|
||||
SmudgeType: Scorch
|
||||
SmudgeSize: 3,2
|
||||
Wall: true
|
||||
Wood: true
|
||||
Ore: true
|
||||
Verses: 90%,100%,60%,25%,50%
|
||||
Delay: 3
|
||||
InfDeath: 4
|
||||
Warhead@outer-nuke:
|
||||
DamageModel: PerCell
|
||||
Damage: 150
|
||||
SmudgeType: Scorch
|
||||
SmudgeSize: 5,4
|
||||
Wall: true
|
||||
Wood: true
|
||||
Ore: true
|
||||
Verses: 90%,100%,60%,25%,50%
|
||||
Delay: 3
|
||||
InfDeath: 4
|
||||
|
||||
|
||||
UnitExplode:
|
||||
Warhead:
|
||||
|
||||
Reference in New Issue
Block a user