protected override void InitControl(Entities.ISceneObject me)
 {
     base.InitControl(me);
     me.SceneMgr.BeginInvoke(new Action(() =>
     {
         me.GetGeometry().Opacity = 0.5;
     }));
 }
Exemplo n.º 2
0
 protected override void InitControl(Entities.ISceneObject me)
 {
     this.obj = me.GetControlOfType <IHpControl>();
     if (this.obj == null)
     {
         throw new Exception("HpBarControl must be attached to object containing HpControl");
     }
 }
Exemplo n.º 3
0
        protected override void InitControl(Entities.ISceneObject me)
        {
            if (controlsForDisabling != null)
            {
                controlsForDisabling.ForEach(control => control.Enabled = false);
            }

            events.AddEvent(1, new Event(Time, EventType.ONE_TIME, new Action(() => { ReenableControls(); })));
        }
        protected override void InitControl(Entities.ISceneObject me)
        {
            if (me is Base)
            {
                baze = me as Base;
            }

            this.emmitors = new Stack <EmmitorGroup>();
            this.dead     = new Queue <EmmitorGroup>();
            this.rand     = me.SceneMgr.GetRandomGenerator();
        }
Exemplo n.º 5
0
        protected override void InitControl(Entities.ISceneObject me)
        {
            base.InitControl(me);

            if (!(me is ISpheric))
            {
                Logger.Error("ShrinkingControl can be attached only to object with Radius property!");
                return;
            }

            sphere = me as ISpheric;
        }
Exemplo n.º 6
0
        protected override void InitControl(Entities.ISceneObject me)
        {
            me.SceneMgr.Invoke(new Action(() =>
            {
                effect         = new PinchEffect();
                effect.Radius  = Radius;
                effect.Amount  = 0;
                effect.CenterX = Position.X / SharedDef.VIEW_PORT_SIZE.Width;
                effect.CenterY = Position.Y / SharedDef.VIEW_PORT_SIZE.Height;

                me.SceneMgr.GetCanvas().Effect = effect;
            }));
        }
Exemplo n.º 7
0
        public void ProccessDamage(int damage, Entities.ISceneObject causedBy)
        {
            if (causedBy is IDestroyable)
            {
                (causedBy as IDestroyable).TakeDamage(damage / 4, me);
                me.SceneMgr.FloatingTextMgr.AddFloatingText(damage / 4, me.Position, FloatingTextManager.TIME_LENGTH_3, FloatingTextType.DAMAGE);
            }

            if (me is MiningModule)
            {
                SendDamage(damage / 4, causedBy, me as MiningModule);
            }
        }
Exemplo n.º 8
0
        protected override void InitControl(Entities.ISceneObject me)
        {
            if (me is Line)
            {
                line = me as Line;
            }
            else
            {
                throw new Exception("MiningLineControl must be attached to SolidLine object");
            }

            events.AddEvent(1, new Event(SharedDef.SPECTATOR_ORBITS_SPAWN_TIME, EventType.REPEATABLE, new Action(() => { SpawnNewEllipse(); })));
        }
Exemplo n.º 9
0
        protected override void InitControl(Entities.ISceneObject me)
        {
            Vulnerable = true;
            hp         = MaxHp;

            if (me is MiningModule)
            {
                module = me as MiningModule;
            }
            else
            {
                throw new Exception("ModuleDamageControl must be attached to MiningModule object");
            }
        }
Exemplo n.º 10
0
 protected override void InitControl(Entities.ISceneObject me)
 {
     hp = MaxHp;
 }
Exemplo n.º 11
0
        protected override void InitControl(Entities.ISceneObject me)
        {
            me.GetControlsOfType <IDamageControl>().ForEach(control => control.Vulnerable = false);

            Vulnerable = true;
        }