add ability to emit a muzzleflash from multiple weapons; make ftnk somewhat nicer
This commit is contained in:
@@ -8,6 +8,7 @@
|
|||||||
*/
|
*/
|
||||||
#endregion
|
#endregion
|
||||||
|
|
||||||
|
using System.Collections.Generic;
|
||||||
using OpenRA.Graphics;
|
using OpenRA.Graphics;
|
||||||
using OpenRA.Traits;
|
using OpenRA.Traits;
|
||||||
|
|
||||||
@@ -20,27 +21,36 @@ namespace OpenRA.Mods.RA
|
|||||||
|
|
||||||
class WithMuzzleFlash : INotifyAttack
|
class WithMuzzleFlash : INotifyAttack
|
||||||
{
|
{
|
||||||
Animation muzzleFlash;
|
List<Animation> muzzleFlashes = new List<Animation>();
|
||||||
bool isShowing;
|
bool isShowing;
|
||||||
|
|
||||||
public WithMuzzleFlash(Actor self)
|
public WithMuzzleFlash(Actor self)
|
||||||
{
|
{
|
||||||
var attackInfo = self.Info.Traits.Get<AttackBaseInfo>();
|
var attackInfo = self.Info.Traits.Get<AttackBaseInfo>();
|
||||||
|
var attack = self.Trait<AttackBase>();
|
||||||
var render = self.Trait<RenderSimple>();
|
var render = self.Trait<RenderSimple>();
|
||||||
|
var facing = self.Trait<IFacing>();
|
||||||
|
|
||||||
muzzleFlash = new Animation(render.GetImage(self), () => self.Trait<IFacing>().Facing);
|
foreach (var t in attack.Turrets)
|
||||||
muzzleFlash.Play("muzzle");
|
{
|
||||||
|
var turret = t;
|
||||||
|
var muzzleFlash = new Animation(render.GetImage(self), () => self.Trait<IFacing>().Facing);
|
||||||
|
muzzleFlash.Play("muzzle");
|
||||||
|
|
||||||
render.anims.Add("muzzle", new RenderSimple.AnimationWithOffset(
|
render.anims.Add("muzzle{0}".F(muzzleFlashes.Count), new RenderSimple.AnimationWithOffset(
|
||||||
muzzleFlash,
|
muzzleFlash,
|
||||||
() => attackInfo.PrimaryOffset.AbsOffset(),
|
() => Combat.GetTurretPosition(self, facing, turret),
|
||||||
() => !isShowing));
|
() => !isShowing));
|
||||||
|
|
||||||
|
muzzleFlashes.Add(muzzleFlash);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void Attacking(Actor self)
|
public void Attacking(Actor self)
|
||||||
{
|
{
|
||||||
isShowing = true;
|
isShowing = true;
|
||||||
muzzleFlash.PlayThen("muzzle", () => isShowing = false);
|
foreach( var mf in muzzleFlashes )
|
||||||
|
mf.PlayThen("muzzle", () => isShowing = false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -67,7 +67,8 @@
|
|||||||
</unit>
|
</unit>
|
||||||
<!-- Flame Tank -->
|
<!-- Flame Tank -->
|
||||||
<unit name="ftnk">
|
<unit name="ftnk">
|
||||||
<sequence name="idle" start="0" facings="32" />
|
<sequence name="idle" start="0" length="1" facings="32" />
|
||||||
|
<sequence name="muzzle" start="0" length="13" facings="8" src="flame" />
|
||||||
</unit>
|
</unit>
|
||||||
<!-- Mobile HQ -->
|
<!-- Mobile HQ -->
|
||||||
<unit name="mhq">
|
<unit name="mhq">
|
||||||
@@ -78,8 +79,9 @@
|
|||||||
<unit name="msam">
|
<unit name="msam">
|
||||||
<sequence name="idle" start="0" facings="32" />
|
<sequence name="idle" start="0" facings="32" />
|
||||||
<sequence name="turret" start="32" facings="32" />
|
<sequence name="turret" start="32" facings="32" />
|
||||||
<sequence name="aim" start="64" facings="32" /> <!-- hack -->
|
<sequence name="aim" start="64" facings="32" />
|
||||||
<sequence name="turret-3" start="64" facings="32" />
|
<!-- hack -->
|
||||||
|
<sequence name="turret-3" start="64" facings="32" />
|
||||||
</unit>
|
</unit>
|
||||||
<!-- SSM Launcher -->
|
<!-- SSM Launcher -->
|
||||||
<unit name="mlrs">
|
<unit name="mlrs">
|
||||||
|
|||||||
@@ -136,10 +136,12 @@ FTNK:
|
|||||||
Range: 4
|
Range: 4
|
||||||
AttackBase:
|
AttackBase:
|
||||||
PrimaryWeapon: BigFlamer
|
PrimaryWeapon: BigFlamer
|
||||||
PrimaryOffset: 0,0,0,-2
|
PrimaryOffset: 2,-8,0,-2
|
||||||
MuzzleFlash: yes
|
SecondaryWeapon: BigFlamer
|
||||||
|
SecondaryOffset: -2,-8,0,-2
|
||||||
RenderUnit:
|
RenderUnit:
|
||||||
AutoTarget:
|
AutoTarget:
|
||||||
|
WithMuzzleFlash:
|
||||||
|
|
||||||
BGGY:
|
BGGY:
|
||||||
Inherits: ^Vehicle
|
Inherits: ^Vehicle
|
||||||
|
|||||||
@@ -170,10 +170,10 @@ Flamethrower:
|
|||||||
|
|
||||||
BigFlamer:
|
BigFlamer:
|
||||||
ROF: 50
|
ROF: 50
|
||||||
Range: 2
|
Range: 3.5
|
||||||
Report: FLAMER2
|
Report: FLAMER2
|
||||||
Projectile: Bullet
|
Projectile: Bullet
|
||||||
Speed: 100
|
Speed: 20
|
||||||
Warhead:
|
Warhead:
|
||||||
Spread: 8
|
Spread: 8
|
||||||
Verses: 90%,100%,60%,25%,50%
|
Verses: 90%,100%,60%,25%,50%
|
||||||
@@ -181,7 +181,7 @@ BigFlamer:
|
|||||||
Explosion: 3
|
Explosion: 3
|
||||||
ImpactSound: flamer2
|
ImpactSound: flamer2
|
||||||
SmudgeType: Scorch
|
SmudgeType: Scorch
|
||||||
Damage: 50
|
Damage: 40
|
||||||
|
|
||||||
Chemspray:
|
Chemspray:
|
||||||
ROF: 70
|
ROF: 70
|
||||||
|
|||||||
Reference in New Issue
Block a user