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); }
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(); } }
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); }