当前位置: 首页>>代码示例>>C#>>正文


C# Character.CanSee方法代码示例

本文整理汇总了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);
		}
开发者ID:WCellFR,项目名称:WCellFR,代码行数:54,代码来源:GameObjectHandler.cs

示例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;
        }
开发者ID:ebakkedahl,项目名称:WCell,代码行数:39,代码来源:NPC.cs

示例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;
		}
开发者ID:WCellFR,项目名称:WCellFR,代码行数:35,代码来源:NPC.cs


注:本文中的WCell.RealmServer.Entities.Character.CanSee方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。