Merge pull request #5974 from pchote/cratefix
Fix unit collection crates and drop-zone maps.
This commit is contained in:
@@ -19,9 +19,15 @@ namespace OpenRA.Mods.RA.Crates
|
|||||||
class GiveUnitCrateActionInfo : CrateActionInfo
|
class GiveUnitCrateActionInfo : CrateActionInfo
|
||||||
{
|
{
|
||||||
[ActorReference]
|
[ActorReference]
|
||||||
|
[Desc("Unit to give")]
|
||||||
public readonly string Unit = null;
|
public readonly string Unit = null;
|
||||||
|
|
||||||
|
[Desc("Override the owner of the newly spawned unit: e.g Creeps or Neutral")]
|
||||||
public readonly string Owner = null;
|
public readonly string Owner = null;
|
||||||
|
|
||||||
|
[Desc("Races that are allowed to trigger this action")]
|
||||||
|
public readonly string[] Race = null;
|
||||||
|
|
||||||
public override object Create(ActorInitializer init) { return new GiveUnitCrateAction(init.self, this); }
|
public override object Create(ActorInitializer init) { return new GiveUnitCrateAction(init.self, this); }
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -34,14 +40,12 @@ namespace OpenRA.Mods.RA.Crates
|
|||||||
|
|
||||||
public bool CanGiveTo(Actor collector)
|
public bool CanGiveTo(Actor collector)
|
||||||
{
|
{
|
||||||
var bi = self.World.Map.Rules.Actors[Info.Unit].Traits.GetOrDefault<BuildableInfo>();
|
if (Info.Race != null && !Info.Race.Contains(collector.Owner.Country.Race))
|
||||||
|
return false;
|
||||||
// this unit is not buildable by the collector's country, so
|
|
||||||
// don't give them free ones either.
|
|
||||||
if (Info.Owner == null && bi != null && !bi.Owner.Contains(collector.Owner.Country.Race)) return false;
|
|
||||||
|
|
||||||
// avoid dumping tanks in the sea, and ships on dry land.
|
// avoid dumping tanks in the sea, and ships on dry land.
|
||||||
if (!GetSuitableCells(collector.Location).Any()) return false;
|
if (!GetSuitableCells(collector.Location).Any())
|
||||||
|
return false;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -321,6 +321,15 @@ Rules:
|
|||||||
GiveUnitCrateAction@dog:
|
GiveUnitCrateAction@dog:
|
||||||
SelectionShares: 1
|
SelectionShares: 1
|
||||||
Unit: dog
|
Unit: dog
|
||||||
|
^Infantry:
|
||||||
|
GivesBounty:
|
||||||
|
Percentage: 0
|
||||||
|
^Tank:
|
||||||
|
GivesBounty:
|
||||||
|
Percentage: 0
|
||||||
|
^Vehicle:
|
||||||
|
GivesBounty:
|
||||||
|
Percentage: 0
|
||||||
APC:
|
APC:
|
||||||
Health:
|
Health:
|
||||||
HP: 1000
|
HP: 1000
|
||||||
@@ -336,7 +345,8 @@ Rules:
|
|||||||
HP: 100
|
HP: 100
|
||||||
Explodes:
|
Explodes:
|
||||||
Weapon: CrateNuke
|
Weapon: CrateNuke
|
||||||
EmptyWeapon:
|
EmptyWeapon: CrateNuke
|
||||||
|
DemoTruck:
|
||||||
SHOK:
|
SHOK:
|
||||||
Health:
|
Health:
|
||||||
HP: 800
|
HP: 800
|
||||||
|
|||||||
@@ -216,6 +216,15 @@ Rules:
|
|||||||
GiveUnitCrateAction@dog:
|
GiveUnitCrateAction@dog:
|
||||||
SelectionShares: 1
|
SelectionShares: 1
|
||||||
Unit: dog
|
Unit: dog
|
||||||
|
^Infantry:
|
||||||
|
GivesBounty:
|
||||||
|
Percentage: 0
|
||||||
|
^Tank:
|
||||||
|
GivesBounty:
|
||||||
|
Percentage: 0
|
||||||
|
^Vehicle:
|
||||||
|
GivesBounty:
|
||||||
|
Percentage: 0
|
||||||
APC:
|
APC:
|
||||||
Health:
|
Health:
|
||||||
HP: 1000
|
HP: 1000
|
||||||
@@ -231,7 +240,8 @@ Rules:
|
|||||||
HP: 100
|
HP: 100
|
||||||
Explodes:
|
Explodes:
|
||||||
Weapon: CrateNuke
|
Weapon: CrateNuke
|
||||||
EmptyWeapon:
|
EmptyWeapon: CrateNuke
|
||||||
|
DemoTruck:
|
||||||
SHOK:
|
SHOK:
|
||||||
Health:
|
Health:
|
||||||
HP: 800
|
HP: 800
|
||||||
|
|||||||
Reference in New Issue
Block a user