Merge pull request #9700 from r34ch/chronotank-extra-bar
Use support power like charge bar for Chronotank instead of pips.
This commit is contained in:
@@ -32,9 +32,6 @@ namespace OpenRA.Mods.RA.Traits
|
|||||||
[Desc("Sound to play when teleporting.")]
|
[Desc("Sound to play when teleporting.")]
|
||||||
public readonly string ChronoshiftSound = "chrotnk1.aud";
|
public readonly string ChronoshiftSound = "chrotnk1.aud";
|
||||||
|
|
||||||
[Desc("Display rectangles indicating the current charge status")]
|
|
||||||
public readonly int Pips = 2;
|
|
||||||
|
|
||||||
[Desc("Cursor to display when able to deploy the actor.")]
|
[Desc("Cursor to display when able to deploy the actor.")]
|
||||||
public readonly string DeployCursor = "deploy";
|
public readonly string DeployCursor = "deploy";
|
||||||
|
|
||||||
@@ -46,7 +43,7 @@ namespace OpenRA.Mods.RA.Traits
|
|||||||
public object Create(ActorInitializer init) { return new PortableChrono(this); }
|
public object Create(ActorInitializer init) { return new PortableChrono(this); }
|
||||||
}
|
}
|
||||||
|
|
||||||
class PortableChrono : IIssueOrder, IResolveOrder, ITick, IPips, IOrderVoice, ISync
|
class PortableChrono : IIssueOrder, IResolveOrder, ITick, ISelectionBar, IOrderVoice, ISync
|
||||||
{
|
{
|
||||||
[Sync] int chargeTick = 0;
|
[Sync] int chargeTick = 0;
|
||||||
public readonly PortableChronoInfo Info;
|
public readonly PortableChronoInfo Info;
|
||||||
@@ -108,19 +105,12 @@ namespace OpenRA.Mods.RA.Traits
|
|||||||
get { return chargeTick <= 0; }
|
get { return chargeTick <= 0; }
|
||||||
}
|
}
|
||||||
|
|
||||||
public IEnumerable<PipType> GetPips(Actor self)
|
public float GetValue()
|
||||||
{
|
{
|
||||||
for (var i = 0; i < Info.Pips; i++)
|
return (float)((chargeTick - (25 * Info.ChargeTime)) * (Info.ChargeTime * -0.0001));
|
||||||
{
|
|
||||||
if ((1 - chargeTick * 1.0f / (25 * Info.ChargeTime)) * Info.Pips < i + 1)
|
|
||||||
{
|
|
||||||
yield return PipType.Transparent;
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
yield return PipType.Blue;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Color GetColor() { return Color.Magenta; }
|
||||||
}
|
}
|
||||||
|
|
||||||
class PortableChronoOrderTargeter : IOrderTargeter
|
class PortableChronoOrderTargeter : IOrderTargeter
|
||||||
|
|||||||
Reference in New Issue
Block a user