本文整理汇总了C#中WCell.RealmServer.Entities.Character.CanSee方法的典型用法代码示例。如果您正苦于以下问题:C# Character.CanSee方法的具体用法?C# Character.CanSee怎么用?C# Character.CanSee使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WCell.RealmServer.Entities.Character
的用法示例。
在下文中一共展示了Character.CanSee方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CanBeUsedBy
/// <summary>
/// The unit who is currently using the GO
/// </summary>
//public Unit User
//{
// get
// {
// return m_user;
// }
//}
/// <summary>
/// Whether this GO can be used by the given user
/// </summary>
/// <param name="chr"></param>
/// <returns></returns>
public bool CanBeUsedBy(Character chr)
{
if (chr.GodMode)
{
return true;
}
// must be enabled
if (!chr.CanSee(m_go) || m_go.State == GameObjectState.Disabled)
{
return false;
}
// must have the right Faction (if limited to either side)
if (m_go.Faction != Faction.NullFaction && m_go.Faction.Group != chr.Faction.Group)
{
return false;
}
// Check for Group-requirements
if (m_go.Entry.IsPartyOnly && m_go.Owner != null && !m_go.Owner.IsAlliedWith(chr))
{
return false;
}
var unit = chr;
if (!unit.IsAlive)
{
return false;
}
if (!unit.CanInteract)
{
return false;
}
return m_go.IsInRadiusSq(chr, GOMgr.DefaultInteractDistanceSq);
// && m_go.IsInFrontOf(obj);
}
示例2: CheckVendorInteraction
/// <summary>
/// Also sends a message to the Character, if not valid
/// </summary>
internal bool CheckVendorInteraction(Character chr)
{
if (chr.Map != m_Map ||
!IsInRadiusSq(chr, NPCMgr.DefaultInteractionDistanceSq) ||
!chr.CanSee(this))
{
NPCHandler.SendNPCError(chr, this, VendorInventoryError.TooFarAway);
return false;
}
if (!IsAlive)
{
NPCHandler.SendNPCError(chr, this, VendorInventoryError.VendorDead);
return false;
}
if (chr.IsAlive == IsSpiritHealer)
{
NPCHandler.SendNPCError(chr, this, VendorInventoryError.YouDead);
return false;
}
if (!chr.CanInteract || !CanInteract)
{
return false;
}
var reputation = chr.Reputations.GetOrCreate(Faction.ReputationIndex);
if (reputation != null && !reputation.CanInteract)
{
NPCHandler.SendNPCError(chr, this, VendorInventoryError.BadRep);
return false;
}
return true;
}
示例3: CanInteractWith
public bool CanInteractWith(Character chr)
{
if (chr.Region != m_region ||
!IsInRadiusSq(chr, NPCMgr.DefaultInteractionDistanceSq) ||
!chr.CanSee(this))
{
NPCHandler.SendNPCError(chr, this, VendorInventoryError.TooFarAway);
return false;
}
if (chr.IsAlive == IsSpiritHealer)
{
NPCHandler.SendNPCError(chr, this, VendorInventoryError.YouDead);
return false;
}
if (chr.IsOnTaxi || m_isInCombat || IsOnTaxi)
{
return false;
}
if (!chr.CanInteract || !CanInteract)
{
return false;
}
var reputation = chr.Reputations.GetOrCreate(Faction.ReputationIndex);
if (reputation != null && !reputation.CanInteract)
{
NPCHandler.SendNPCError(chr, this, VendorInventoryError.BadRep);
return false;
}
return true;
}