Merge pull request #4090 from pchote/cnc-flame-muzzles

Use the original flame and chem muzzle flashes.
This commit is contained in:
Matthias Mailänder
2013-11-07 07:08:36 -08:00
7 changed files with 112 additions and 13 deletions

View File

@@ -26,6 +26,12 @@ namespace OpenRA.Mods.RA.Render
[Desc("Armament name")]
public readonly string Armament = "primary";
[Desc("Are the muzzle facings split into multiple shps?")]
public readonly bool SplitFacings = false;
[Desc("Number of separate facing images that are defined in the sequences.")]
public readonly int FacingCount = 8;
public object Create(ActorInitializer init) { return new WithMuzzleFlash(init.self, this); }
}
@@ -34,6 +40,7 @@ namespace OpenRA.Mods.RA.Render
readonly WithMuzzleFlashInfo info;
Dictionary<Barrel, bool> visible = new Dictionary<Barrel, bool>();
Dictionary<Barrel, AnimationWithOffset> anims = new Dictionary<Barrel, AnimationWithOffset>();
Func<int> getFacing;
public WithMuzzleFlash(Actor self, WithMuzzleFlashInfo info)
{
@@ -50,7 +57,7 @@ namespace OpenRA.Mods.RA.Render
var turreted = self.TraitsImplementing<Turreted>()
.FirstOrDefault(t => t.Name == arm.Info.Turret);
var getFacing = turreted != null ? () => turreted.turretFacing :
getFacing = turreted != null ? () => turreted.turretFacing :
facing != null ? (Func<int>)(() => facing.Facing) : () => 0;
var muzzleFlash = new Animation(render.GetImage(self), getFacing);
@@ -69,7 +76,12 @@ namespace OpenRA.Mods.RA.Render
return;
visible[barrel] = true;
anims[barrel].Animation.PlayThen(info.Sequence, () => visible[barrel] = false);
var sequence = info.Sequence;
if (info.SplitFacings)
sequence += Traits.Util.QuantizeFacing(getFacing(), info.FacingCount).ToString();
anims[barrel].Animation.PlayThen(sequence, () => visible[barrel] = false);
}
public IEnumerable<IRenderable> Render(Actor self, WorldRenderer wr)

Binary file not shown.

Binary file not shown.

View File

@@ -101,10 +101,11 @@ E4:
HP: 90
Armament:
Weapon: Flamethrower
LocalOffset: 85,0,171
LocalOffset: 341,0,256
FireDelay: 3
AttackFrontal:
WithMuzzleFlash:
SplitFacings: true
RenderInfantryProne:
IdleAnimations: idle1,idle2
StandAnimations: stand, stand2
@@ -135,10 +136,11 @@ E5:
HP: 90
Armament:
Weapon: Chemspray
LocalOffset: 85,0,384
LocalOffset: 341,0,256
FireDelay: 3
AttackFrontal:
WithMuzzleFlash:
SplitFacings: true
-PoisonedByTiberium:
RenderInfantryProne:
IdleAnimations: idle1,idle2

View File

@@ -184,6 +184,7 @@ FTNK:
RenderUnit:
AutoTarget:
WithMuzzleFlash:
SplitFacings: true
Explodes:
Weapon: FlametankExplode
EmptyWeapon: FlametankExplode

View File

@@ -382,10 +382,38 @@ e4:
Start: 16
Length: 4
Tick: 1600
muzzle: flame2
muzzle0: flame-n
Start: 0
Length: 13
Facings: 8
Length: *
Offset: 1,6
muzzle1: flame-nw
Start: 0
Length: *
Offset: 8,7
muzzle2: flame-w
Start: 0
Length: *
Offset: 8,2
muzzle3: flame-sw
Start: 0
Length: *
Offset: 7,-2
muzzle4: flame-s
Start: 0
Length: *
Offset: 1,-2
muzzle5: flame-se
Start: 0
Length: *
Offset: -5,-2
muzzle6: flame-e
Start: 0
Length: *
Offset: -7,2
muzzle7: flame-ne
Start: 0
Length: *
Offset: -7,8
icon: e4icnh
Start: 0
@@ -475,10 +503,38 @@ e5:
Start: 16
Length: 4
Tick: 1600
muzzle: chem
muzzle0: chem-n
Start: 0
Length: 13
Facings: 8
Length: *
Offset: 1,2
muzzle1: chem-nw
Start: 0
Length: *
Offset: 8,2
muzzle2: chem-w
Start: 0
Length: *
Offset: 8,-3
muzzle3: chem-sw
Start: 0
Length: *
Offset: 7,-6
muzzle4: chem-s
Start: 0
Length: *
Offset: 1,-6
muzzle5: chem-se
Start: 0
Length: *
Offset: -5,-6
muzzle6: chem-e
Start: 0
Length: *
Offset: -7,-3
muzzle7: chem-ne
Start: 0
Length: *
Offset: -3,2
icon: e5icnh
Start: 0

View File

@@ -101,10 +101,38 @@ ftnk:
idle:
Start: 0
Facings: 32
muzzle: flame2
muzzle0: flame-n
Start: 0
Length: 13
Facings: 8
Length: *
Offset: 3,8
muzzle1: flame-nw
Start: 0
Length: *
Offset: 4,6
muzzle2: flame-w
Start: 0
Length: *
Offset: 7,2
muzzle3: flame-sw
Start: 0
Length: *
Offset: 3,-2
muzzle4: flame-s
Start: 0
Length: *
Offset: 1,-2
muzzle5: flame-se
Start: 0
Length: *
Offset: -3,-1
muzzle6: flame-e
Start: 0
Length: *
Offset: -6,2
muzzle7: flame-ne
Start: 0
Length: *
Offset: -5,6
icon: ftnkicnh
Start: 0