Ejemplo n.º 1
0
		/// <summary>
		/// Raises the start event.
		/// </summary>
		/// <param name="context">Context.</param>
		public override void 			OnStart(AIContext context)
		{
			base.OnStart (context);

			AIEntityContext ec = context as AIEntityContext;
			if (ec.Owner && ec.Target)
			{
				// get owner character ctrl machine
				Machine = ec.Owner.GetMachine();
				if (!Machine)
					throw new System.NullReferenceException();

				if (!Machine.IsCurrentState(AITypeID.AI_BATTLE))
					Machine.ChangeState(AITypeID.AI_BATTLE);
			}
		}
Ejemplo n.º 2
0
		/// <summary>
		/// Raises the start event.
		/// </summary>
		/// <param name="context">Context.</param>
		public override void 			OnStart(AIContext context)
		{
			base.OnStart (context);
			
			AIEntityContext ec = context as AIEntityContext;
			if (!ec.Owner)
				throw new System.NullReferenceException ();
			
			Machine = ec.Owner.GetMachine ();
			if (!Machine)
				throw new System.NullReferenceException();

			if (!ec.Target)
			{
				FreePatrol(ec);
			}
		}
Ejemplo n.º 3
0
		/// <summary>
		/// Raises the start event.
		/// </summary>
		/// <param name="context">Context.</param>
		public override void 			OnStart(AIContext context)
		{
			base.OnStart (context);
			
			AIEntityContext ec = context as AIEntityContext;
			if (ec.Owner && ec.Target)
			{
				// save current machine ref
				Machine = ec.Owner.GetMachine();
				if (!Machine)
					throw new System.NullReferenceException();

				float fDistance = Vector3.Distance(ec.Owner.GetPosition(), ec.Target.GetPosition());
				if (fDistance > MaxDistance)
				{
					PuesueTarget(ec.Target.GetPosition(), MaxDistance);
				}
			}
		}
Ejemplo n.º 4
0
		/// <summary>
		/// Raises the start event.
		/// </summary>
		/// <param name="context">Context.</param>
		public override void 			OnStart(AIContext context)
		{
			base.OnStart (context);
			
			AIEntityContext ec = context as AIEntityContext;
			if (!ec.Owner)
				throw new System.NullReferenceException ();
			
			Machine = ec.Owner.GetMachine ();
			if (!Machine)
				throw new System.NullReferenceException();
	
			// follow target
			if (ec.Leader)
				FollowTarget(ec);
		}
Ejemplo n.º 5
0
Archivo: IEntity.cs Proyecto: oathx/Six
	/// <summary>
	/// Sets the machine.
	/// </summary>
	/// <param name="machine">Machine.</param>
	public void 			SetMachine(IAIMachine machine)
	{
		m_Machine = machine;
	}
Ejemplo n.º 6
0
	/// <summary>
	/// Install this instance.
	/// </summary>
	public override void 			Install()
	{
		m_Machine = new IAIMachine ();
		if (!m_Machine)
			throw new System.NullReferenceException ();
		
		m_Machine.RegisterState (new CameraNormal (this));
	}