Remove some crap from Cloak.
This commit is contained in:
@@ -18,21 +18,10 @@ namespace OpenRA.Mods.RA
|
||||
{
|
||||
public class CloakInfo : ITraitInfo
|
||||
{
|
||||
public readonly float InitialDelay = .4f; // seconds
|
||||
public readonly float CloakDelay = 1.2f; // Seconds
|
||||
public readonly string CloakSound = "subshow1.aud";
|
||||
public readonly string UncloakSound = "subshow1.aud";
|
||||
|
||||
public CloakInfo() { } /* only because we have other ctors */
|
||||
|
||||
/* for CloakCrateAction */
|
||||
public CloakInfo(float initialDelay, float cloakDelay, string cloakSound, string uncloakSound)
|
||||
{
|
||||
InitialDelay = initialDelay;
|
||||
CloakDelay = cloakDelay;
|
||||
CloakSound = cloakSound;
|
||||
UncloakSound = uncloakSound;
|
||||
}
|
||||
public int InitialDelay = 10; // Ticks
|
||||
public int CloakDelay = 30; // Ticks
|
||||
public string CloakSound = "subshow1.aud";
|
||||
public string UncloakSound = "subshow1.aud";
|
||||
|
||||
public object Create(ActorInitializer init) { return new Cloak(init.self, this); }
|
||||
}
|
||||
@@ -51,7 +40,7 @@ namespace OpenRA.Mods.RA
|
||||
this.info = info;
|
||||
this.self = self;
|
||||
|
||||
remainingTime = (int)(info.InitialDelay * 25);
|
||||
remainingTime = info.InitialDelay;
|
||||
}
|
||||
|
||||
void DoUncloak()
|
||||
@@ -59,7 +48,7 @@ namespace OpenRA.Mods.RA
|
||||
if (remainingTime <= 0)
|
||||
OnCloak();
|
||||
|
||||
remainingTime = Math.Max(remainingTime, (int)(info.CloakDelay * 25));
|
||||
remainingTime = Math.Max(remainingTime, info.CloakDelay);
|
||||
}
|
||||
|
||||
public void Attacking(Actor self, Target target) { DoUncloak(); }
|
||||
|
||||
@@ -10,20 +10,21 @@
|
||||
|
||||
using OpenRA.FileFormats;
|
||||
using OpenRA.Mods.RA;
|
||||
using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.RA.Crates
|
||||
{
|
||||
class CloakCrateActionInfo : CrateActionInfo
|
||||
public class CloakCrateActionInfo : CrateActionInfo
|
||||
{
|
||||
public readonly float InitialDelay = .4f;
|
||||
public readonly float CloakDelay = 1.2f;
|
||||
public readonly int InitialDelay = 10;
|
||||
public readonly int CloakDelay = 30;
|
||||
public readonly string CloakSound = "subshow1.aud";
|
||||
public readonly string UncloakSound = "subshow1.aud";
|
||||
|
||||
public override object Create(ActorInitializer init) { return new CloakCrateAction(init.self, this); }
|
||||
}
|
||||
|
||||
class CloakCrateAction : CrateAction
|
||||
public class CloakCrateAction : CrateAction
|
||||
{
|
||||
CloakCrateActionInfo Info;
|
||||
public CloakCrateAction(Actor self, CloakCrateActionInfo info)
|
||||
@@ -37,10 +38,14 @@ namespace OpenRA.Mods.RA.Crates
|
||||
|
||||
public override void Activate(Actor collector)
|
||||
{
|
||||
var cloakInfo = new CloakInfo(Info.InitialDelay, Info.CloakDelay,
|
||||
Info.CloakSound, Info.UncloakSound);
|
||||
|
||||
var cloak = cloakInfo.Create(new ActorInitializer(collector, new TypeDictionary() ));
|
||||
var cloakInfo = new CloakInfo()
|
||||
{
|
||||
InitialDelay = Info.InitialDelay,
|
||||
CloakDelay = Info.CloakDelay,
|
||||
CloakSound = Info.CloakSound,
|
||||
UncloakSound = Info.UncloakSound
|
||||
};
|
||||
var cloak = new Cloak(collector, cloakInfo);
|
||||
|
||||
collector.World.AddFrameEndTask(w =>
|
||||
{
|
||||
|
||||
@@ -179,8 +179,8 @@ CRATE:
|
||||
SelectionShares: 5
|
||||
CloakCrateAction:
|
||||
SelectionShares: 5
|
||||
InitialDelay: 5
|
||||
CloakDelay: 5
|
||||
InitialDelay: 125
|
||||
CloakDelay: 125
|
||||
CloakSound: appear1.aud
|
||||
UncloakSound: appear1.aud
|
||||
Effect: stealth
|
||||
|
||||
@@ -459,8 +459,8 @@ STNK:
|
||||
RevealsShroud:
|
||||
Range: 4
|
||||
Cloak:
|
||||
InitialDelay: 5
|
||||
CloakDelay: 5
|
||||
InitialDelay: 125
|
||||
CloakDelay: 125
|
||||
CloakSound: appear1.aud
|
||||
UncloakSound: appear1.aud
|
||||
AttackFrontal:
|
||||
|
||||
@@ -27,7 +27,7 @@ SS:
|
||||
RenderUnit:
|
||||
Cloak:
|
||||
InitialDelay: 0
|
||||
CloakDelay: 2.0
|
||||
CloakDelay: 50
|
||||
CloakSound: subshow1.aud
|
||||
UncloakSound: subshow1.aud
|
||||
AttackFrontal:
|
||||
@@ -72,7 +72,7 @@ MSUB:
|
||||
CloakedTargetTypes: Underwater
|
||||
Cloak:
|
||||
InitialDelay: 0
|
||||
CloakDelay: 2.0
|
||||
CloakDelay: 50
|
||||
CloakSound: subshow1.aud
|
||||
UncloakSound: subshow1.aud
|
||||
AttackFrontal:
|
||||
|
||||
Reference in New Issue
Block a user