diff --git a/OpenRA.Mods.RA/Cloak.cs b/OpenRA.Mods.RA/Cloak.cs index 55bda677dc..fa1507970c 100644 --- a/OpenRA.Mods.RA/Cloak.cs +++ b/OpenRA.Mods.RA/Cloak.cs @@ -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(); } diff --git a/OpenRA.Mods.RA/Crates/CloakCrateAction.cs b/OpenRA.Mods.RA/Crates/CloakCrateAction.cs index 62a338f2d7..2b92dd3127 100644 --- a/OpenRA.Mods.RA/Crates/CloakCrateAction.cs +++ b/OpenRA.Mods.RA/Crates/CloakCrateAction.cs @@ -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 => { diff --git a/mods/cnc/rules/system.yaml b/mods/cnc/rules/system.yaml index d093180c4d..7e3ff222d8 100644 --- a/mods/cnc/rules/system.yaml +++ b/mods/cnc/rules/system.yaml @@ -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 diff --git a/mods/cnc/rules/vehicles.yaml b/mods/cnc/rules/vehicles.yaml index 0a4cdd0125..f30af2c9b8 100644 --- a/mods/cnc/rules/vehicles.yaml +++ b/mods/cnc/rules/vehicles.yaml @@ -459,8 +459,8 @@ STNK: RevealsShroud: Range: 4 Cloak: - InitialDelay: 5 - CloakDelay: 5 + InitialDelay: 125 + CloakDelay: 125 CloakSound: appear1.aud UncloakSound: appear1.aud AttackFrontal: diff --git a/mods/ra/rules/ships.yaml b/mods/ra/rules/ships.yaml index dcee12d9a5..287c16b0ea 100644 --- a/mods/ra/rules/ships.yaml +++ b/mods/ra/rules/ships.yaml @@ -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: