tesla charges
This commit is contained in:
@@ -95,6 +95,8 @@ namespace OpenRa.Game.Graphics
|
||||
Tick( 40 ); // tick one frame
|
||||
}
|
||||
|
||||
public bool HasSequence(string seq) { return SequenceProvider.HasSequence( name, seq ); }
|
||||
|
||||
public void Tick( int t )
|
||||
{
|
||||
if( tickAlways )
|
||||
|
||||
@@ -65,6 +65,11 @@ namespace OpenRa.Game.Graphics
|
||||
}
|
||||
}
|
||||
|
||||
public static bool HasSequence(string unit, string seq)
|
||||
{
|
||||
return units[unit].ContainsKey(seq);
|
||||
}
|
||||
|
||||
public static CursorSequence GetCursorSequence(string cursor)
|
||||
{
|
||||
return cursors[cursor];
|
||||
|
||||
@@ -163,6 +163,7 @@
|
||||
<Compile Include="Traits\Harvester.cs" />
|
||||
<Compile Include="Traits\Helicopter.cs" />
|
||||
<Compile Include="Traits\ProductionQueue.cs" />
|
||||
<Compile Include="Traits\RenderBuildingCharge.cs" />
|
||||
<Compile Include="Traits\RenderInfantry.cs" />
|
||||
<Compile Include="Traits\McvDeploy.cs" />
|
||||
<Compile Include="Traits\Mobile.cs" />
|
||||
|
||||
@@ -106,6 +106,7 @@ namespace OpenRa.Game.Traits
|
||||
|
||||
var firePos = self.CenterLocation.ToInt2() + Util.GetTurretPosition(self, unit, offset, 0f).ToInt2();
|
||||
var thisTarget = target;
|
||||
|
||||
ScheduleDelayedAction(self.Info.FireDelay, () =>
|
||||
{
|
||||
if( weapon.RenderAsTesla )
|
||||
|
||||
23
OpenRa.Game/Traits/RenderBuildingCharge.cs
Normal file
23
OpenRa.Game/Traits/RenderBuildingCharge.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace OpenRa.Game.Traits
|
||||
{
|
||||
/* used for tesla */
|
||||
class RenderBuildingCharge : RenderBuilding, INotifyAttack
|
||||
{
|
||||
public RenderBuildingCharge(Actor self)
|
||||
: base(self)
|
||||
{
|
||||
}
|
||||
|
||||
public void Attacking(Actor self)
|
||||
{
|
||||
var prev = anim.CurrentSequence.Name;
|
||||
Sound.Play("tslachg2.aud");
|
||||
anim.PlayThen("active", () => anim.PlayRepeating(prev));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -200,10 +200,11 @@ Footprint=x
|
||||
SelectionPriority=3
|
||||
[TSLA]
|
||||
Description=Tesla Coil
|
||||
Traits=Building, Turreted, RenderBuilding, AttackTurreted, AutoTarget
|
||||
Traits=Building, Turreted, RenderBuildingCharge, AttackTurreted, AutoTarget
|
||||
Dimensions=1,2
|
||||
Footprint=_ x
|
||||
SelectionPriority=3
|
||||
FireDelay=8
|
||||
[GUN]
|
||||
Description=Turret
|
||||
Traits=Building, Turreted, RenderBuildingTurreted, AttackTurreted, AutoTarget
|
||||
|
||||
Reference in New Issue
Block a user