Oil Derricks spurt fire when dead.
This commit is contained in:
@@ -65,6 +65,7 @@
|
|||||||
<Compile Include="CncLoadScreen.cs" />
|
<Compile Include="CncLoadScreen.cs" />
|
||||||
<Compile Include="WithRoof.cs" />
|
<Compile Include="WithRoof.cs" />
|
||||||
<Compile Include="Missions\CncShellmapScript.cs" />
|
<Compile Include="Missions\CncShellmapScript.cs" />
|
||||||
|
<Compile Include="WithFire.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<ProjectReference Include="..\OpenRA.FileFormats\OpenRA.FileFormats.csproj">
|
<ProjectReference Include="..\OpenRA.FileFormats\OpenRA.FileFormats.csproj">
|
||||||
|
|||||||
33
OpenRA.Mods.Cnc/WithFire.cs
Normal file
33
OpenRA.Mods.Cnc/WithFire.cs
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
#region Copyright & License Information
|
||||||
|
/*
|
||||||
|
* Copyright 2007-2010 The OpenRA Developers (see AUTHORS)
|
||||||
|
* This file is part of OpenRA, which is free software. It is made
|
||||||
|
* available to you under the terms of the GNU General Public License
|
||||||
|
* as published by the Free Software Foundation. For more information,
|
||||||
|
* see LICENSE.
|
||||||
|
*/
|
||||||
|
#endregion
|
||||||
|
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using OpenRA.Traits;
|
||||||
|
using OpenRA.Graphics;
|
||||||
|
|
||||||
|
namespace OpenRA.Mods.Cnc
|
||||||
|
{
|
||||||
|
class WithFireInfo : ITraitInfo
|
||||||
|
{
|
||||||
|
public object Create(ActorInitializer init) { return new WithFire(init.self); }
|
||||||
|
}
|
||||||
|
|
||||||
|
class WithFire
|
||||||
|
{
|
||||||
|
public WithFire(Actor self)
|
||||||
|
{
|
||||||
|
var rs = self.Trait<RenderSimple>();
|
||||||
|
var roof = new Animation(rs.GetImage(self));
|
||||||
|
roof.PlayThen("fire-start", () => roof.PlayRepeating("fire-loop"));
|
||||||
|
rs.anims.Add( "fire", new RenderSimple.AnimationWithOffset( roof, () => new float2(7,-15), null ) { ZOffset = 24 } );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -27,14 +27,17 @@ namespace OpenRA.Mods.RA
|
|||||||
self.World.AddFrameEndTask(w =>
|
self.World.AddFrameEndTask(w =>
|
||||||
{
|
{
|
||||||
var info = self.Info.Traits.Get<LeavesHuskInfo>();
|
var info = self.Info.Traits.Get<LeavesHuskInfo>();
|
||||||
|
var td = new TypeDictionary
|
||||||
var husk = w.CreateActor(info.HuskActor, new TypeDictionary
|
|
||||||
{
|
{
|
||||||
new LocationInit( self.Location ),
|
new LocationInit( self.Location ),
|
||||||
new OwnerInit( self.Owner ),
|
new OwnerInit( self.Owner ),
|
||||||
new FacingInit( self.Trait<IFacing>().Facing ),
|
new SkipMakeAnimsInit()
|
||||||
});
|
};
|
||||||
|
|
||||||
|
if (self.HasTrait<IFacing>())
|
||||||
|
td.Add(new FacingInit( self.Trait<IFacing>().Facing ));
|
||||||
|
|
||||||
|
var husk = w.CreateActor(info.HuskActor, td);
|
||||||
var turreted = self.TraitOrDefault<Turreted>();
|
var turreted = self.TraitOrDefault<Turreted>();
|
||||||
if (turreted != null)
|
if (turreted != null)
|
||||||
foreach (var p in husk.TraitsImplementing<ThrowsParticle>())
|
foreach (var p in husk.TraitsImplementing<ThrowsParticle>())
|
||||||
|
|||||||
@@ -2,6 +2,21 @@
|
|||||||
V19:
|
V19:
|
||||||
Inherits: ^CivBuilding
|
Inherits: ^CivBuilding
|
||||||
RenderBuilding:
|
RenderBuilding:
|
||||||
|
Building:
|
||||||
|
Footprint: x
|
||||||
|
Dimensions: 1,1
|
||||||
|
-DeadBuildingState:
|
||||||
|
Tooltip:
|
||||||
|
Name: Oil Derrick
|
||||||
|
LeavesHusk:
|
||||||
|
HuskActor: V19.Husk
|
||||||
|
|
||||||
|
V19.Husk:
|
||||||
|
Inherits: ^CivBuilding
|
||||||
|
-DeadBuildingState:
|
||||||
|
-Health:
|
||||||
|
RenderBuilding:
|
||||||
|
WithFire:
|
||||||
Building:
|
Building:
|
||||||
Footprint: x
|
Footprint: x
|
||||||
Dimensions: 1,1
|
Dimensions: 1,1
|
||||||
|
|||||||
@@ -495,6 +495,15 @@ v19:
|
|||||||
dead:
|
dead:
|
||||||
Start: 28
|
Start: 28
|
||||||
|
|
||||||
|
v19.husk:
|
||||||
|
idle: v19
|
||||||
|
Start: 28
|
||||||
|
fire-start: flmspt
|
||||||
|
Start: 0
|
||||||
|
Length: *
|
||||||
|
fire-loop: flmspt
|
||||||
|
Start: 50
|
||||||
|
Length: *
|
||||||
arco:
|
arco:
|
||||||
idle:
|
idle:
|
||||||
Start: 0
|
Start: 0
|
||||||
|
|||||||
Reference in New Issue
Block a user