v0.0.1-Alpha (#42)
This commit is contained in:
parent
d30f93c454
commit
a36796c2c1
3552 changed files with 2476 additions and 15223 deletions
35
Projects/Scripts/Mobiles/AI/AIControlMobileTarget.cs
Normal file
35
Projects/Scripts/Mobiles/AI/AIControlMobileTarget.cs
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
using System.Collections.Generic;
|
||||
using Server.Mobiles;
|
||||
using Server.Targeting;
|
||||
|
||||
namespace Server.Targets
|
||||
{
|
||||
public class AIControlMobileTarget : Target
|
||||
{
|
||||
private List<BaseAI> m_List;
|
||||
|
||||
public AIControlMobileTarget(BaseAI ai, OrderType order) : base(-1, false,
|
||||
order == OrderType.Attack ? TargetFlags.Harmful : TargetFlags.None)
|
||||
{
|
||||
m_List = new List<BaseAI>();
|
||||
Order = order;
|
||||
|
||||
AddAI(ai);
|
||||
}
|
||||
|
||||
public OrderType Order{ get; }
|
||||
|
||||
public void AddAI(BaseAI ai)
|
||||
{
|
||||
if (!m_List.Contains(ai))
|
||||
m_List.Add(ai);
|
||||
}
|
||||
|
||||
protected override void OnTarget(Mobile from, object o)
|
||||
{
|
||||
if (o is Mobile m)
|
||||
for (int i = 0; i < m_List.Count; ++i)
|
||||
m_List[i].EndPickTarget(from, m, Order);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue