Add invisible spice bloom spawn

When real spiceblooms explode, they spawn an invisible
spicebloom.spawnpoint actor, which only 'grows' when the cell is of
GrowthTerrainType. When 'exploding', it then displays the animation of
blowing spice up into the air, and spawns a real spicebloom.

This replicates the original behavior where spice blooms would only grow
on sand cells that had been harvested and free of spice.
This commit is contained in:
reaperrr
2015-11-04 23:34:13 +01:00
parent a175f53ba7
commit c4ca5d6497
4 changed files with 45 additions and 1 deletions

View File

@@ -23,6 +23,9 @@ namespace OpenRA.Mods.D2k.Traits
[Desc("Seeds resources by explosive eruptions after accumulation times.")]
public class SpiceBloomInfo : ITraitInfo, Requires<RenderSpritesInfo>
{
[ActorReference]
public readonly string SpawnActor = "spicebloom.spawnpoint";
[SequenceReference]
public readonly string[] GrowthSequences = { "grow1", "grow2", "grow3" };
@@ -159,7 +162,7 @@ namespace OpenRA.Mods.D2k.Traits
new FactionInit(self.Owner.Faction.InternalName),
new SkipMakeAnimsInit()
};
self.World.CreateActor(self.Info.Name, td);
self.World.CreateActor(info.SpawnActor, td);
})));
}
}

View File

@@ -1,3 +1,25 @@
spicebloom.spawnpoint:
HiddenUnderShroud:
Type: CenterPosition
BodyOrientation:
QuantizedFacings: 1
RenderSprites:
Image: spicebloom
SpiceBloom:
GrowthTerrainTypes: Sand
SpawnActor: spicebloom
GrowthSequences: grow0
GrowthDelay: 250, 750
RespawnDelay: 1, 2
Explodes:
Weapon: BloomSpawn
EmptyWeapon: BloomSpawn
Health:
HP: 9999
Radius: 1
Immobile:
OccupiesSpace: false
spicebloom:
HiddenUnderShroud:
BodyOrientation:

View File

@@ -46,6 +46,11 @@ explosion:
BlendMode: Alpha
Offset: 12, -10
Tick: 120
bloomspawn: DATA.R8
Start: 3980
Length: 8
Tick: 120
Offset: 0, -16
corpse: DATA.R8
Start: 430
Length: 12
@@ -328,6 +333,11 @@ crate:
Offset: -16,-16
spicebloom:
grow0: DATA.R8
Start: 106
Length: 1
ZOffset: -1023
Offset: -16,-16
grow1: DATA.R8
Start: 107
Length: 1

View File

@@ -820,3 +820,12 @@ BloomExplosion:
DamageTypes: Prone50Percent, TriggerProne, ExplosionDeath
AffectsParent: true
BloomSpawn:
Range: 0c1
Projectile: Bullet
Speed: 1c0
Blockable: false
Image: null
Warhead@1Eff: CreateEffect
Explosion: bloomspawn