예제 #1
0
        public Cloak(Actor self, CloakInfo info)
        {
            this.info = info;
            this.self = self;

            remainingTime = info.InitialDelay;
        }
예제 #2
0
        public Cloak(Actor self, CloakInfo info)
        {
            this.info = info;
            this.self = self;

            remainingTime = info.InitialDelay;
            crateDisabled = info.RequiresCrate;
        }
예제 #3
0
        public Cloak(Actor self, CloakInfo info)
        {
            this.self = self;
            Info      = info;

            remainingTime = info.InitialDelay;

            // Disable if an upgrade is required
            disabled = info.RequiresUpgrade != null;
        }
예제 #4
0
        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() ));

            collector.World.AddFrameEndTask(w =>
                {
                    w.Remove(collector);

                    collector.AddTrait(cloak);
                    if (collector.HasTrait<TargetableUnit<TargetableUnitInfo>>())
                        collector.Trait<TargetableUnit<TargetableUnitInfo>>().RecievedCloak(collector);

                    w.Add(collector);
                });

            base.Activate(collector);
        }