Renormalize line endings and fix copyright headers again.
This commit is contained in:
@@ -48,45 +48,45 @@ namespace OpenRA.Mods.RA
|
||||
for (var n = 0; n < toSpawn; n++)
|
||||
SpawnCrate(self, info);
|
||||
}
|
||||
}
|
||||
|
||||
void SpawnCrate(Actor self, CrateDropInfo info)
|
||||
{
|
||||
var threshold = 100;
|
||||
var inWater = self.World.SharedRandom.NextDouble() < info.WaterChance;
|
||||
|
||||
for (var n = 0; n < threshold; n++)
|
||||
{
|
||||
var p = self.World.ChooseRandomCell(self.World.SharedRandom);
|
||||
|
||||
// Is this valid terrain?
|
||||
var terrainType = self.World.GetTerrainType(p);
|
||||
if (!(inWater ? info.ValidWater : info.ValidGround).Contains(terrainType)) continue;
|
||||
|
||||
// Don't drop on any actors
|
||||
if (self.World.WorldActor.Trait<BuildingInfluence>().GetBuildingAt(p) != null) continue;
|
||||
if (self.World.WorldActor.Trait<UnitInfluence>().GetUnitsAt(p).Any()) continue;
|
||||
|
||||
self.World.AddFrameEndTask(w =>
|
||||
{
|
||||
var crate = w.CreateActor(false, "crate", new TypeDictionary { new OwnerInit(w.WorldActor.Owner) });
|
||||
crates.Add(crate);
|
||||
|
||||
var startPos = w.ChooseRandomEdgeCell();
|
||||
}
|
||||
|
||||
void SpawnCrate(Actor self, CrateDropInfo info)
|
||||
{
|
||||
var threshold = 100;
|
||||
var inWater = self.World.SharedRandom.NextDouble() < info.WaterChance;
|
||||
|
||||
for (var n = 0; n < threshold; n++)
|
||||
{
|
||||
var p = self.World.ChooseRandomCell(self.World.SharedRandom);
|
||||
|
||||
// Is this valid terrain?
|
||||
var terrainType = self.World.GetTerrainType(p);
|
||||
if (!(inWater ? info.ValidWater : info.ValidGround).Contains(terrainType)) continue;
|
||||
|
||||
// Don't drop on any actors
|
||||
if (self.World.WorldActor.Trait<BuildingInfluence>().GetBuildingAt(p) != null) continue;
|
||||
if (self.World.WorldActor.Trait<UnitInfluence>().GetUnitsAt(p).Any()) continue;
|
||||
|
||||
self.World.AddFrameEndTask(w =>
|
||||
{
|
||||
var crate = w.CreateActor(false, "crate", new TypeDictionary { new OwnerInit(w.WorldActor.Owner) });
|
||||
crates.Add(crate);
|
||||
|
||||
var startPos = w.ChooseRandomEdgeCell();
|
||||
var plane = w.CreateActor("badr", new TypeDictionary
|
||||
{
|
||||
new LocationInit( startPos ),
|
||||
new OwnerInit( w.WorldActor.Owner),
|
||||
new FacingInit( Util.GetFacing(p - startPos, 0) ),
|
||||
new AltitudeInit( Rules.Info["badr"].Traits.Get<AircraftInfo>().CruiseAltitude ),
|
||||
});
|
||||
plane.CancelActivity();
|
||||
plane.QueueActivity(new FlyAttackLoop(p));
|
||||
plane.Trait<ParaDrop>().SetLZ(p);
|
||||
plane.Trait<Cargo>().Load(plane, crate);
|
||||
});
|
||||
return;
|
||||
}
|
||||
});
|
||||
plane.CancelActivity();
|
||||
plane.QueueActivity(new FlyAttackLoop(p));
|
||||
plane.Trait<ParaDrop>().SetLZ(p);
|
||||
plane.Trait<Cargo>().Load(plane, crate);
|
||||
});
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user