예제 #1
0
		/// <summary>
		/// Tries to use this Object and returns whether the user succeeded using it.
		/// </summary>
		public bool TryUse(Character user)
		{
			if (!CanBeUsedBy(user))
			{
				return false;
			}

			// can't use objects that are in use
			if (m_go.Flags.HasFlag(GameObjectFlags.InUse))
			{
				return false;
			}

			if (!m_go.Entry.AllowMounted)
			{
				user.Dismount();
			}

			var lck = m_go.Entry.Lock;
			if (lck != null)
			{
				if (lck.RequiresAttack)
				{
					// TODO: Attack Swing
				}
				else if (lck.RequiresKneeling)
				{
					user.StandState = StandState.Kneeling;
				}
			}
			return m_go.TryOpen(user) && DoUse(user);
		}