Пример #1
0
        public UltimaMoongate_Frame(UltimaMoongate gate, MoongateFrame frame = MoongateFrame.Frame8, bool reverse = false, int itemid = 0x0F6C) : base(itemid)
        {
            m_baseGate             = gate;
            m_Frame                = frame;
            m_baseGate.currentGate = this;
            m_reverse              = reverse;

            Movable = false;
            Visible = true;
            Light   = LightType.Circle300;

            if (m_Frame == MoongateFrame.Frame8)
            {
                m_baseGate.gateOpened = true;

                if (gate.OpenTime > 0)
                {
                    GateTimer = new TransitionTimer(gate, this, true, gate.OpenTime);
                    GateTimer.Start();
                }
            }
            else
            {
                GateTimer = new TransitionTimer(gate, this, reverse);
                GateTimer.Start();
            }
        }
Пример #2
0
 public MoongateTransitionTimer(UltimaMoongate gate, UltimaMoongate_Frame thisgate, bool reverse = false, double opentime = 0.25) : base(TimeSpan.FromSeconds(opentime))
 {
     m_Gate     = gate;
     m_thisGate = thisgate;
     m_reverse  = reverse;
     Priority   = TimerPriority.TwentyFiveMS;
 }
Пример #3
0
            protected override void OnTick()
            {
                if (Gate.ReturnGate)
                {
                    UltimaMoongate returnGate = new UltimaMoongate(Gate.GetWorldLocation(), Gate.Map, Gate.OpenTime, Gate.Colour, Gate.Dispellable, Gate.StockTravelRestrictions, false);
                    returnGate.MoveToWorld(Gate.Target, Gate.TargetMap);
                }

                UltimaMoongate_Frame nextGate = new UltimaMoongate_Frame(Gate, MoongateFrame.Frame0, false, GetMoongateFrameID(Gate.Colour, MoongateFrame.Frame0));

                nextGate.MoveToWorld(Gate.GetWorldLocation(), Gate.Map);
            }
Пример #4
0
 public MoongateTransitionTimer(UltimaMoongate gate, bool reverse = false) : base(TimeSpan.FromSeconds(0.25))
 {
     m_Gate    = gate;
     m_reverse = reverse;
     Priority  = TimerPriority.TwentyFiveMS;
 }
Пример #5
0
            protected override void OnTick()
            {
                UltimaMoongate_Frame nextGate = null;

                int nextFrame = (int)ThisGate.Frame + 1;
                int prevFrame = (int)ThisGate.Frame - 1;

                // If this is frame 0, continue opening or delete, depending on reverse
                if (ThisGate.Frame == MoongateFrame.Frame0)
                {
                    if (!Reverse)
                    {
                        nextGate = new UltimaMoongate_Frame(Gate, (MoongateFrame)nextFrame, false, UltimaMoongate.GetMoongateFrameID(Gate.Colour, (MoongateFrame)nextFrame));
                        nextGate.MoveToWorld(Gate.GetWorldLocation(), Gate.Map);
                        ThisGate.Delete();
                    }
                    else
                    {
                        Gate.Delete();
                        ThisGate.Delete();
                    }
                }

                // If this is frame 8, begin reversing the animation.
                else if (ThisGate.Frame == MoongateFrame.Frame8)
                {
                    Gate.gateOpened = false;
                    nextGate        = new UltimaMoongate_Frame(Gate, (MoongateFrame)prevFrame, true, UltimaMoongate.GetMoongateFrameID(Gate.Colour, (MoongateFrame)prevFrame));
                    nextGate.MoveToWorld(Gate.GetWorldLocation(), Gate.Map);
                    ThisGate.Delete();
                }

                // Otherwise, advance or retreat through animation sequence
                else
                {
                    if (!Reverse)
                    {
                        nextGate = new UltimaMoongate_Frame(Gate, (MoongateFrame)nextFrame, false, UltimaMoongate.GetMoongateFrameID(Gate.Colour, (MoongateFrame)nextFrame));
                    }
                    else
                    {
                        nextGate = new UltimaMoongate_Frame(Gate, (MoongateFrame)prevFrame, true, UltimaMoongate.GetMoongateFrameID(Gate.Colour, (MoongateFrame)prevFrame));
                    }

                    nextGate.MoveToWorld(Gate.GetWorldLocation(), Gate.Map);
                    ThisGate.Delete();
                }
            }
Пример #6
0
 public TransitionTimer(UltimaMoongate gate, UltimaMoongate_Frame thisgate, bool reverse = false, double opentime = 0.25) : base(gate, thisgate, reverse, opentime)
 {
 }
Пример #7
0
 public TransitionTimer(UltimaMoongate gate) : base(gate)
 {
 }
Пример #8
0
 public DelayTimer(Mobile from, UltimaMoongate gate, int range) : base(TimeSpan.FromSeconds(1.0))
 {
     m_From  = from;
     m_Gate  = gate;
     m_Range = range;
 }
            protected override void OnTick()
            {
                UltimaMoongate_Frame nextGate = new UltimaMoongate_Frame(Gate, MoongateFrame.Frame0, false, UltimaMoongate.GetMoongateFrameID(Gate.Colour, MoongateFrame.Frame0));

                nextGate.MoveToWorld(Gate.GetWorldLocation(), Gate.Map);
            }