Server.Mobiles.Cow.TryMilk C# (CSharp) Méthode

TryMilk() public méthode

public TryMilk ( Server.Mobile from ) : bool
from Server.Mobile
Résultat bool
		public bool TryMilk( Mobile from )
		{
			if ( !from.InLOS( this ) || !from.InRange( Location, 2 ) )
				from.SendLocalizedMessage( 1080400 ); // You can not milk the cow from this location.
			if ( Controlled && ControlMaster != from )
				from.SendLocalizedMessage( 1071182 ); // The cow nimbly escapes your attempts to milk it.
			if ( m_Milk == 0 && m_MilkedOn + TimeSpan.FromDays( 1 ) > DateTime.Now )
				from.SendLocalizedMessage( 1080198 ); // This cow can not be milked now. Please wait for some time.
			else
			{
				if ( m_Milk == 0 )
					m_Milk = 4;

				m_MilkedOn = DateTime.Now;
				m_Milk--;

				return true;
			}

			return false;
		}