CrateSpawner - combine DeliverByAircraft and DeliveryAircraft properties
This commit is contained in:
@@ -32,10 +32,8 @@ namespace OpenRA.Mods.RA
|
|||||||
public readonly string[] ValidWater = { "Water" };
|
public readonly string[] ValidWater = { "Water" };
|
||||||
[Desc("Chance of generating a water crate instead of a land crate")]
|
[Desc("Chance of generating a water crate instead of a land crate")]
|
||||||
public readonly float WaterChance = .2f;
|
public readonly float WaterChance = .2f;
|
||||||
[Desc("Airdrop crates via DeliveryAircraft: or instantly spawn them on the ground")]
|
[Desc("If a DeliveryAircraft: is specified, then this actor will deliver crates"), ActorReference]
|
||||||
public readonly bool DeliverByAircraft = false;
|
public readonly string DeliveryAircraft = null;
|
||||||
[Desc("If DeliverByAircraft: yes, this actor will deliver crates"), ActorReference]
|
|
||||||
public readonly string DeliveryAircraft = "badr";
|
|
||||||
[Desc("Crate actors to drop"), ActorReference]
|
[Desc("Crate actors to drop"), ActorReference]
|
||||||
public readonly string[] CrateActors = { "crate" };
|
public readonly string[] CrateActors = { "crate" };
|
||||||
[Desc("Chance of each crate actor spawning")]
|
[Desc("Chance of each crate actor spawning")]
|
||||||
@@ -90,7 +88,7 @@ namespace OpenRA.Mods.RA
|
|||||||
|
|
||||||
self.World.AddFrameEndTask(w =>
|
self.World.AddFrameEndTask(w =>
|
||||||
{
|
{
|
||||||
if (Info.DeliverByAircraft)
|
if (Info.DeliveryAircraft != null)
|
||||||
{
|
{
|
||||||
var crate = w.CreateActor(false, crateActor, new TypeDictionary { new OwnerInit(w.WorldActor.Owner) });
|
var crate = w.CreateActor(false, crateActor, new TypeDictionary { new OwnerInit(w.WorldActor.Owner) });
|
||||||
crates.Add(crate);
|
crates.Add(crate);
|
||||||
|
|||||||
Reference in New Issue
Block a user