本文整理匯總了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;
}