本文整理汇总了C#中Server.Mobiles.BaseAI类的典型用法代码示例。如果您正苦于以下问题:C# BaseAI类的具体用法?C# BaseAI怎么用?C# BaseAI使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BaseAI类属于Server.Mobiles命名空间,在下文中一共展示了BaseAI类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: AIControlMobileTarget
public AIControlMobileTarget( BaseAI ai, OrderType order ) : base( -1, false, TargetFlags.None )
{
m_List = new ArrayList();
m_Order = order;
AddAI( ai );
}
示例2: AIControlMobileTarget
public AIControlMobileTarget( BaseAI ai, OrderType order ) : base( -1, false, ( order == OrderType.Attack ? TargetFlags.Harmful : TargetFlags.None ) )
{
m_List = new List<BaseAI>();
m_Order = order;
AddAI( ai );
}
示例3: AddAI
public void AddAI( BaseAI ai )
{
if ( !m_List.Contains( ai ) )
{
m_List.Add( ai );
}
}
示例4: ResponseTimer
public ResponseTimer(BaseCreature mobile, SpeechEventArgs p, BaseAI ai)
: base(TimeSpan.FromSeconds(1))
{
e = p;
m_Mobile = mobile;
m_AI = ai;
Priority = TimerPriority.OneSecond;
}
示例5: InteractTimer
public InteractTimer(BaseCreature mobile, BaseAI ai, Mobile from)
: base(TimeSpan.FromSeconds(30.0))
{
m_Mobile = mobile;
m_AI = ai;
m_From = from;
Priority = TimerPriority.OneSecond;
}
示例6: InternalTimer
public InternalTimer(BaseAI b, TimeSpan delay )
: base(delay)
{
m_b = b;
m_End = DateTime.Now + delay;
Priority = TimerPriority.OneSecond;
}
示例7: InternalEntry
public InternalEntry(Mobile from, int number, int range, BaseCreature mobile, BaseAI ai, OrderType order)
: base(number, range)
{
m_From = from;
m_Mobile = mobile;
m_AI = ai;
m_Order = order;
if (mobile.IsDeadPet &&
(order == OrderType.Guard || order == OrderType.Attack || order == OrderType.Transfer || order == OrderType.Drop))
{
Enabled = false;
}
}
示例8: CombatTarget
public CombatTarget( BaseAI ai, BaseCreature bc )
: base( 10, false, TargetFlags.None )
{
m_AI = ai;
creature = bc;
}
示例9: AddAI
public void AddAI(BaseAI ai)
{
if (!this.m_List.Contains(ai))
this.m_List.Add(ai);
}
示例10: AITimer
public AITimer( BaseAI owner )
: base(TimeSpan.FromSeconds( Utility.RandomDouble() ), TimeSpan.FromSeconds( Math.Max( 0.0, owner.m_Mobile.CurrentSpeed ) ))
{
m_Owner = owner;
if ( Delay > m_Owner.m_Mobile.ReaquireDelay )
Delay = m_Owner.m_Mobile.ReaquireDelay;
if ( m_Owner.m_Mobile.CurrentSpeed > 0.5 )
Priority = TimerPriority.FiftyMS;
else if ( m_Owner.m_Mobile.CurrentSpeed > 0.25 )
Priority = TimerPriority.TwentyFiveMS;
else
Priority = TimerPriority.TenMS;
}
示例11: InternalEntry
public InternalEntry(Mobile from, int number, int range, BaseCreature mobile, BaseAI ai, OrderType order)
: base(number, range)
{
m_From = from;
m_Mobile = mobile;
m_AI = ai;
m_Order = order;
}
示例12: OnTarget
protected override void OnTarget( Mobile from, object target )
{
if( target is BaseCreature )
{
BaseCreature pet = (BaseCreature)target;
m_ai = pet.AIObject;
if( pet.Body.IsHuman )
from.SendMessage("The person looks at you in disgust.");
else if( pet.ControlMaster != from )
from.SendMessage("That is not your pet.");
else if( pet.Combatant != null && pet.InRange(pet.Combatant, 12) )
from.SendMessage("You cannot do that while your pet is fighting.");
else if( pet.Controlled == true && pet.ControlMaster == from )
{
if( Utility.Random(15) == 1 )
{
m_ai.DoMove(Direction.South);
m_ai.DoMove(Direction.South);
m_ai.DoMove(Direction.East);
m_ai.DoMove(Direction.South);
m_ai.NextMove = DateTime.Now;
from.SendMessage("Your pet shies away from the rope.");
pet.PlaySound(pet.GetAngerSound());
}
else
{
if( pet.Blessed == false )
{
pet.Blessed = true;
pet.CantWalk = true;
pet.ControlOrder = OrderType.Stay;
pet.Combatant = null;
pet.Loyalty = 85;
from.LocalOverheadMessage(MessageType.Regular, from.EmoteHue, false, "*attaches the rope to the animal*");
from.Backpack.ConsumeTotal(typeof(HitchingRope), 1);
from.SendMessage("Your pet has been hitched to the post.");
}
}
}
}
}
示例13: ChangeAIType
public void ChangeAIType( AIType NewAI )
{
if ( m_AI != null )
m_AI.m_Timer.Stop();
if( ForcedAI != null )
{
m_AI = ForcedAI;
return;
}
m_AI = null;
switch ( NewAI )
{
case AIType.AI_Melee:
m_AI = new MeleeAI(this);
break;
case AIType.AI_Animal:
m_AI = new AnimalAI(this);
break;
case AIType.AI_Berserk:
m_AI = new BerserkAI(this);
break;
case AIType.AI_Archer:
m_AI = new ArcherAI(this);
break;
case AIType.AI_Healer:
m_AI = new HealerAI(this);
break;
case AIType.AI_Vendor:
m_AI = new VendorAI(this);
break;
case AIType.AI_Mage:
m_AI = new MageAI(this);
break;
case AIType.AI_Predator:
//m_AI = new PredatorAI(this);
m_AI = new MeleeAI(this);
break;
case AIType.AI_Thief:
m_AI = new ThiefAI(this);
break;
}
}
示例14: ChangeAIType
public virtual void ChangeAIType(AIType NewAI)
{
if ( m_AI != null )
m_AI.m_Timer.Stop();
m_AI = null;
if ( this is BaseFactionGuard )
{
m_AI = new FactionGuardAI( (BaseFactionGuard) this );
return;
}
switch (NewAI)
{
case AIType.AI_Melee:
m_AI = new MeleeAI(this);
break;
case AIType.AI_Animal:
m_AI = new AnimalAI(this);
break;
case AIType.AI_Berserk:
m_AI = new BerserkAI(this);
break;
case AIType.AI_Archer:
m_AI = new ArcherAI(this);
break;
case AIType.AI_Healer:
m_AI = new HealerAI(this);
break;
case AIType.AI_Vendor:
m_AI = new VendorAI(this);
break;
case AIType.AI_Mage:
m_AI = new MageAI(this);
break;
case AIType.AI_Predator:
//m_AI = new PredatorAI(this);
m_AI = new MeleeAI(this);
break;
case AIType.AI_Thief:
m_AI = new ThiefAI(this);
break;
}
}
示例15: InitAI
private void InitAI()
{
switch ( AI )
{
case AIType.AI_Melee:
m_ForcedAI = new EvoMeleeAI( this, m_CanAttackPlayers );
break;
case AIType.AI_Berserk:
m_ForcedAI = new EvoBerserkAI( this, m_CanAttackPlayers );
break;
case AIType.AI_Archer:
m_ForcedAI = new EvoArcherAI( this, m_CanAttackPlayers );
break;
case AIType.AI_Mage:
m_ForcedAI = new EvoMageAI( this, m_CanAttackPlayers );
break;
default:
m_ForcedAI = null;
break;
}
ChangeAIType( AI );
}