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


C# Item.IsChildOf方法代码示例

本文整理汇总了C#中Server.Items.Item.IsChildOf方法的典型用法代码示例。如果您正苦于以下问题:C# Item.IsChildOf方法的具体用法?C# Item.IsChildOf怎么用?C# Item.IsChildOf使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Server.Items.Item的用法示例。


在下文中一共展示了Item.IsChildOf方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: HasAccess

        public static bool HasAccess(Mobile mob, Item item)
        {
            if (item == mob.Backpack)
                return false;
            else if (mob.AccessLevel >= AccessLevel.GameMaster) // staff have no limits
                return true;
            else if (item.IsChildOf(mob.Backpack))
                return true;
            else if (item.IsChildOf(mob.BankBox))
                return true;
            else if (CheckHouse(mob, item))
                return true;

            return false;
        }
开发者ID:greeduomacro,项目名称:last-wish,代码行数:15,代码来源:ContainerRename.cs

示例2: DestroyFurniture

		private void DestroyFurniture( Mobile from, Item item )
		{
			if ( !from.InRange( item.GetWorldLocation(), 3 ) )
			{
				from.SendLocalizedMessage( 500446 ); // That is too far away.
				return;
			}
			else if ( !item.IsChildOf( from.Backpack ) && !item.Movable )
			{
				from.SendLocalizedMessage( 500462 ); // You can't destroy that while it is here.
				return;
			}

			from.SendLocalizedMessage( 500461 ); // You destroy the item.
			Effects.PlaySound( item.GetWorldLocation(), item.Map, 0x3B3 );

			if ( item is Container )
			{
				if ( item is TrapableContainer )
					(item as TrapableContainer).ExecuteTrap( from );

				((Container)item).Destroy();
			}
			else
			{
				item.Delete();
			}
		}
开发者ID:greeduomacro,项目名称:last-wish,代码行数:28,代码来源:HarvestTarget.cs

示例3: DismantleItem

            private void DismantleItem(Mobile from, Item item)
            {
                if (!from.InRange(item.GetWorldLocation(), 2))
                {
                    from.SendMessage("You need to be closer to it.");
                    return;
                }
                else if (!item.IsChildOf(from.Backpack) && !item.Movable)
                {
                    from.SendMessage("It can't be dismantled.");
                    return;
                }

                from.SendMessage("You dismantle the object.");
                Effects.PlaySound(item.GetWorldLocation(), item.Map, 0x3B3);

                if (item is Container)
                {
                    if (item is TrapableContainer)
                        (item as TrapableContainer).ExecuteTrap(from);

                    ((Container)item).Destroy();
                }
                else
                {
                    item.Delete();
                }
            }
开发者ID:greeduomacro,项目名称:last-wish,代码行数:28,代码来源:Dismantle.cs

示例4: DoTrash

        public static void DoTrash(Mobile from, Item target)
        {
            Item item = from.Backpack.FindItemByType(typeof (MiniRewardCan), true);

            if (!target.IsChildOf(from.Backpack))
            {
                from.SendAsciiMessage(mNotInBackpack);
            }
            else if (item == null || !(item is MiniRewardCan))
            {
                from.SendAsciiMessage(mNoTrashCan);
            }
            else
            {
                item.OnDragDrop(from, target);
            }
        }
开发者ID:FreeReign,项目名称:imaginenation,代码行数:17,代码来源:Trash.cs

示例5: DestroyFurniture

		private void DestroyFurniture( Mobile from, Item item )
		{
			if ( !from.InRange( item.GetWorldLocation(), 3 ) || !from.InLOS(item) )
			{
                from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
				return;
			}
		    if ( !item.IsChildOf( from.Backpack ) && !item.Movable )
		    {
		        from.SendLocalizedMessage( 500462 ); // You can't destroy that while it is here.
		        return;
		    }

		    from.SendLocalizedMessage( 500461 ); // You destroy the item.
			Effects.PlaySound( item.GetWorldLocation(), item.Map, 0x3B3 );

			if ( item is Container )
			{
				if ( item is TrapableContainer )
					(item as TrapableContainer).ExecuteTrap( from );

				((Container)item).Destroy();
			}
			else
			{
				item.Delete();
			}
		}
开发者ID:FreeReign,项目名称:imaginenation,代码行数:28,代码来源:HarvestTarget.cs


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