Esempio n. 1
0
		public void DeactivateGate( GateComponent source, GateComponent destination, StargateAddon target )
		{
			if ( source != null )
				source.Delete();
			if ( destination != null )
				destination.Delete();

			foreach( SymbolComponent s in m_ActiveSymbols )
				s.PlaySymbolEffect( false );
			m_ActiveSymbols.Clear();
			m_InUse = false;
			m_CurrentCombo = null;

			if ( target != null )
			{
				foreach( SymbolComponent s in target.Components )
					s.PlaySymbolEffect( false );
				target.ActiveSymbols.Clear();
				target.InUse = false;
				target.CurrentCombo = null;
			}
		}
Esempio n. 2
0
		public void ActivateGate( Mobile from, StargateAddon gate )
		{
			if ( gate == this )
			{
				from.SendMessage( "The stargate cannot dial to itself." );
				DeactivateGate( null, null, null );
			}
			else if ( gate.InUse )
			{
				from.SendMessage( "The stargate could not reach the destination." );
				DeactivateGate( null, null, null );

				if ( gate.Expire != null )
				{
					gate.Expire.Stop();
					gate.Expire = null;
				}
			}
			else
			{
				from.SendMessage( "The stargate activates with a gate to {0}.", gate.GateDesign.Area );

				GateComponent gatesource = new GateComponent( gate );
				gatesource.Hue = m_GateDesign.GateHue;
				gatesource.MoveToWorld( Location, Map );

				GateComponent gatedest = new GateComponent();
				gatedest.Name = String.Format( "Stargate from {0}", m_GateDesign.Area );
				gatedest.Hue = gate.GateDesign.GateHue;
				gatedest.MoveToWorld( gate.Location, gate.Map );

				m_InUse = gate.InUse = true;
				foreach( SymbolComponent s in gate.Components )
					s.PlaySymbolEffect( true );
				Timer.DelayCall( TimeSpan.FromSeconds( 45.0 ), new TimerStateCallback( DeactivateCallBack ), new object[]{ this, gatesource, gatedest, gate } );
				return;
			}
		}