Added FacingInit and AltitudeInit. Used in Mobile/Aircraft/Husks. Refactored Production, SpyPlane, Paratroopers and LeavesHusk

This commit is contained in:
alzeih
2010-08-02 00:49:26 +12:00
parent 2cc6e197fa
commit 4ea66ea309
8 changed files with 83 additions and 19 deletions

View File

@@ -9,6 +9,7 @@
#endregion
using OpenRA.Traits;
using OpenRA.FileFormats;
namespace OpenRA.Mods.RA
{
@@ -26,10 +27,14 @@ namespace OpenRA.Mods.RA
self.World.AddFrameEndTask(w =>
{
var info = self.Info.Traits.Get<LeavesHuskInfo>();
var husk = w.CreateActor(info.HuskActor, self.Location, self.Owner);
husk.CenterLocation = self.CenterLocation;
husk.traits.Get<IFacing>().Facing = self.traits.Get<IFacing>().Facing;
var husk = w.CreateActor(info.HuskActor, new TypeDictionary
{
new LocationInit( self.Location ),
new OwnerInit( self.Owner ),
new FacingInit( self.traits.Get<IFacing>().Facing ),
});
var turreted = self.traits.GetOrDefault<Turreted>();
if (turreted != null)
foreach (var p in husk.traits.WithInterface<ThrowsParticle>())