Merge pull request #9888 from reaperrr/d2k-spiceblooms2

Improve D2k spiceblooms
This commit is contained in:
Matthias Mailänder
2015-11-07 18:28:11 +01:00
3 changed files with 51 additions and 23 deletions

View File

@@ -30,7 +30,7 @@ namespace OpenRA.Mods.D2k.Traits
public readonly int[] RespawnDelay = { 1500, 2500 };
[Desc("The range of time (in ticks) that the spicebloom will take to grow.")]
public readonly int[] GrowthDelay = { 1000, 1500 };
public readonly int[] GrowthDelay = { 1000, 3000 };
public readonly string ResourceType = "Spice";
@@ -39,7 +39,7 @@ namespace OpenRA.Mods.D2k.Traits
public readonly string Weapon = "SpiceExplosion";
[Desc("The amount of spice to expel.")]
public readonly int[] Pieces = { 3, 10 };
public readonly int[] Pieces = { 2, 12 };
[Desc("The maximum distance in cells that spice may be expelled.")]
public readonly int Range = 5;
@@ -91,22 +91,10 @@ namespace OpenRA.Mods.D2k.Traits
public void Killed(Actor self, AttackInfo e)
{
var args = new ProjectileArgs
{
Weapon = self.World.Map.Rules.Weapons[info.Weapon.ToLowerInvariant()],
Facing = 0,
DamageModifiers = self.TraitsImplementing<IFirepowerModifier>()
.Select(a => a.GetFirepowerModifier()).ToArray(),
InaccuracyModifiers = self.TraitsImplementing<IInaccuracyModifier>()
.Select(a => a.GetInaccuracyModifier()).ToArray(),
Source = self.CenterPosition,
SourceActor = self,
};
var pieces = self.World.SharedRandom.Next(info.Pieces[0], info.Pieces[1]) * ticks / growTicks;
if (pieces < info.Pieces[0])
pieces = info.Pieces[0];
for (var i = 0; pieces > i; i++)
{
var cells = OpenRA.Traits.Util.RandomWalk(self.Location, self.World.SharedRandom);
@@ -114,7 +102,21 @@ namespace OpenRA.Mods.D2k.Traits
if (cell == null)
cell = cells.Take(info.Range).Random(self.World.SharedRandom);
args.PassiveTarget = self.World.Map.CenterOfCell(cell.Value);
var args = new ProjectileArgs
{
Weapon = self.World.Map.Rules.Weapons[info.Weapon.ToLowerInvariant()],
Facing = 0,
DamageModifiers = self.TraitsImplementing<IFirepowerModifier>()
.Select(a => a.GetFirepowerModifier()).ToArray(),
InaccuracyModifiers = self.TraitsImplementing<IInaccuracyModifier>()
.Select(a => a.GetInaccuracyModifier()).ToArray(),
Source = self.CenterPosition,
SourceActor = self,
PassiveTarget = self.World.Map.CenterOfCell(cell.Value)
};
self.World.AddFrameEndTask(_ =>
{

View File

@@ -10,6 +10,9 @@ spicebloom:
Name: Spice Bloom
SpiceBloom:
Weapon: SpiceExplosion
Explodes:
Weapon: BloomExplosion
EmptyWeapon: BloomExplosion
Crushable:
CrushClasses: spicebloom
CrushedByFriendlies: true

View File

@@ -768,13 +768,12 @@ SardDeath:
ImpactSound: EXPLSML2.WAV
SpiceExplosion:
Report: EXPLMD1.WAV
Projectile: Bullet
Speed: 50, 75
High: true
Angle: 91, 264
Blockable: false
Angle: 60, 90
Trail: large_trail
Image: null
Image: 120mm
Warhead@1Dam: SpreadDamage
Spread: 320
Falloff: 100, 60, 30, 15, 0
@@ -793,7 +792,31 @@ SpiceExplosion:
AffectsParent: true
Warhead@2Res: CreateResource
AddsResourceType: Spice
Size: 2,2
Size: 1
Warhead@3Eff: CreateEffect
Explosion: med_explosion
BloomExplosion:
Report: EXPLMD1.WAV
Range: 0c8
Projectile: Bullet
Speed: 1c0
Blockable: false
Image: null
Warhead@1Dam: SpreadDamage
Spread: 320
Falloff: 100, 60, 30, 15, 0
Damage: 750
Versus:
none: 90
wall: 5
building: 65
wood: 50
light: 40
heavy: 30
invulnerable: 0
cy: 20
harvester: 25
DamageTypes: Prone50Percent, TriggerProne, ExplosionDeath
AffectsParent: true