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


C# Item.MoveToWorld方法代码示例

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


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

示例1: AddItem

        public virtual void AddItem(Item item, int xOffset, int yOffset, int zOffset)
        {
            this.m_Items.Add(item);

            int zavg = this.Map.GetAverageZ(this.X + xOffset, this.Y + yOffset);
            item.MoveToWorld(new Point3D(this.X + xOffset, this.Y + yOffset, zavg + zOffset), this.Map);
        }
开发者ID:FreeReign,项目名称:forkuo,代码行数:7,代码来源:BaseCamp.cs

示例2: AddItem

		public virtual void AddItem( Item item, int xOffset, int yOffset, int zOffset )
		{
			m_Items.Add( item );

			int zavg = Map.GetAverageZ(X + xOffset, Y + yOffset);
			item.MoveToWorld( new Point3D( X + xOffset, Y + yOffset, zavg + zOffset ), Map );
		}
开发者ID:greeduomacro,项目名称:last-wish,代码行数:7,代码来源:BaseCamp.cs

示例3: AddMarker

		private static void AddMarker(int x, int y, Map map, bool north)
		{
			int z = map.GetAverageZ(x, y);
			Item item = new Item(north ? 0x3975 : 0x3987);
			item.Visible = false;
			item.MoveToWorld(new Point3D(x, y, z), map);
			m_Markers.Add(item);
		}
开发者ID:Tukaramdas,项目名称:ServUO-EC-Test-Fork,代码行数:8,代码来源:TestRadiusCommand.cs

示例4: PeachTree

		public PeachTree( Point3D pnt, Map map ) : base( Utility.RandomList( 0xD9E, 0xDA2 ) ) // leaves
		{
			Movable = false;
			MoveToWorld( pnt, map );

			int trunkID = ((Item)this).ItemID - 2;

			i_trunk = new TreeTrunk( trunkID, this );
			i_trunk.MoveToWorld( pnt, map );

			init( this, false );
		}
开发者ID:greeduomacro,项目名称:dragonknights-uo,代码行数:12,代码来源:PeachTree.cs

示例5: GreenSquashCrop

        public GreenSquashCrop( Point3D pnt, Map map )
            : base(Utility.RandomList( 0xC5F, 0xC60 ))
        {
            Movable = false;
            MoveToWorld( pnt, map );
            Name = "Green Squash Plant";

            int trunkID = 0xC66;

            i_trunk = new TreeTrunk( trunkID, this );
            i_trunk.MoveToWorld( pnt, map );

            init( this, false );
        }
开发者ID:justdanofficial,项目名称:khaeros,代码行数:14,代码来源:GreenSquashCrop.cs

示例6: HoneydewMelonCrop

        public HoneydewMelonCrop( Point3D pnt, Map map )
            : base(Utility.RandomList( 0xC5F, 0xC60 ))
        {
            Movable = false;
            MoveToWorld( pnt, map );
            Name = " Honeydew Melon Plant";

            int trunkID = 0xC75;

            i_trunk = new TreeTrunk( trunkID, this );
            i_trunk.MoveToWorld( pnt, map );

            init( this, false );
        }
开发者ID:justdanofficial,项目名称:khaeros,代码行数:14,代码来源:HoneydewMelonCrop.cs

示例7: CucumberCrop

        public CucumberCrop( Point3D pnt, Map map )
            : base(0xC69)
        {
            Movable = false;
            MoveToWorld( pnt, map );
            Name = "Cucumber Plant";

            int trunkID = 0xC60;

            i_trunk = new TreeTrunk( trunkID, this );
            i_trunk.MoveToWorld( pnt, map );

            init( this, false );
        }
开发者ID:justdanofficial,项目名称:khaeros,代码行数:14,代码来源:CucumberCrop.cs

示例8: ExplodeHorn

        private void ExplodeHorn( Mobile target )
        {
            target.SendMessage("One of the eryon's horns seems to glow, erupting violently in a flash!");

            this.FixedEffect(0x36B0, 10, 1);
            target.BoltEffect(0);
            target.BoltEffect(0);

            target.Freeze(TimeSpan.FromSeconds(5));

            this.Direction = this.GetDirectionTo(target.Location);
            this.DoHarmful(target, true);
            target.Damage(Utility.RandomMinMax(15, 45), this);

            Item hornShard = new Item(0x9D1); //grape bunch itemID
            hornShard.Hue = 1109;
            hornShard.Name = "a piece of eryon horn";
            hornShard.MoveToWorld(target.Location, target.Map);
        }
开发者ID:greeduomacro,项目名称:hubroot,代码行数:19,代码来源:Eryon.cs

示例9: TryCreateItem

        public static Item TryCreateItem(int x, int y, int z, Item srcItem)
        {
            IPooledEnumerable eable = Map.Felucca.GetItemsInBounds(new Rectangle2D(x, y, 1, 1));

            foreach (Item item in eable)
            {
                if (item.GetType() == srcItem.GetType())
                {
                    eable.Free();
                    srcItem.Delete();
                    return item;
                }
            }

            eable.Free();
            srcItem.MoveToWorld(new Point3D(x, y, z), Map.Felucca);
            m_Count++;
			
            return srcItem;
        }
开发者ID:Crome696,项目名称:ServUO,代码行数:20,代码来源:KhaldunGen.cs

示例10: AddTable_Callback

        public static void AddTable_Callback(Mobile m, Map map, Point3D start, Point3D end, object state)
        {
            int height = end.Y - start.Y + 1;
            int width = end.X - start.X + 1;

            Item item;

            for (int x = 0; x < width; x++)
            {
                int xcord = start.X + x;

                for (int y = 0; y < height; y++)
                {
                    int ycord = start.Y + y;

                    item = new Item();

                    if (xcord == end.X)
                    {
                        if (ycord == start.Y)
                            item.ItemID = 0xB72;
                        else if (ycord == end.Y)
                            item.ItemID = 0xB71;
                        else
                            item.ItemID = 0xB73;
                    }
                    else if (ycord == end.Y)
                    {
                        if (xcord == start.X)
                            item.ItemID = 0xB70;
                        else
                            item.ItemID = 0xB74;
                    }
                    else
                        item.ItemID = 0xB73;

                    item.Movable = false;
                    item.MoveToWorld(new Point3D(xcord, ycord, start.Z), map);
                }
            }
        }
开发者ID:greeduomacro,项目名称:last-wish,代码行数:41,代码来源:AddTable.cs

示例11: AddFixture

		public void AddFixture( Item item, MultiTileEntry mte )
		{
			m_Fixtures.Add( item );
			item.MoveToWorld( new Point3D( X + mte.m_OffsetX, Y + mte.m_OffsetY, Z + mte.m_OffsetZ ), Map );
		}
开发者ID:greeduomacro,项目名称:last-wish,代码行数:5,代码来源:HouseFoundation.cs

示例12: AddItem

		private void AddItem( int x, int y, int z, Item item )
		{
			item.MoveToWorld( new Point3D( this.Location.X + x, this.Location.Y + y, this.Location.Z + z ), this.Map );

			m_Components.Add( item );
		}
开发者ID:jackuoll,项目名称:Pre-AOS-RunUO,代码行数:6,代码来源:HolidayTree.cs

示例13: CocoaTree

		public CocoaTree( Point3D pnt, Map map ) : base( 0xCFF ) // leaves
		{
			Movable = false;
			MoveToWorld( pnt, map );
			Name = "Cocoa Tree";

			int trunkID = 0xCCB;

			i_trunk = new TreeTrunk( trunkID, this );
			i_trunk.MoveToWorld( pnt, map );

			init( this, false );
		}
开发者ID:greeduomacro,项目名称:cov-shard-svn-1,代码行数:13,代码来源:CocoaTree.cs

示例14: AvocadoTree

		public AvocadoTree( Point3D pnt, Map map ) : base( 0xDA9 ) // leaves
		{
			Movable = false;
			MoveToWorld( pnt, map );
			Name = "Avocado Tree";

			int trunkID = 0xDA8;

			i_trunk = new TreeTrunk( trunkID, this );
			i_trunk.MoveToWorld( pnt, map );

			init( this, false );
		}
开发者ID:greeduomacro,项目名称:cov-shard-svn-1,代码行数:13,代码来源:AvocadoCrop.cs

示例15: AddSpawnItem

        public static void AddSpawnItem(XmlSpawner spawner, object invoker, XmlSpawner.SpawnObject theSpawn, Item item, Point3D location, Map map, Mobile trigmob, bool requiresurface,
            List<XmlSpawner.SpawnPositionInfo> spawnpositioning, string propertyString, bool smartspawn, out string status_str)
        {
            status_str = null;
            if (item == null || theSpawn == null)
                return;

            // add the item to the spawned list
            theSpawn.SpawnedObjects.Add(item);

            item.Spawner = spawner;

            if (spawner != null)
            {
                // this is being called by a spawner so use spawner information for placement
                if (!spawner.Deleted)
                {
                    // set the item amount
                    if (spawner.StackAmount > 1 && item.Stackable)
                    {
                        item.Amount = spawner.StackAmount;
                    }
                    // if this is in any container such as a pack then add to the container.
                    if (spawner.Parent is Container)
                    {
                        Container c = (Container)spawner.Parent;

                        Point3D loc = spawner.Location;

                        if (!smartspawn)
                        {
                            item.OnBeforeSpawn(loc, map);
                        }

                        item.Location = loc;

                        // check to see whether we drop or add the item based on the spawnrange
                        // this will distribute multiple items around the spawn point, and allow precise
                        // placement of single spawns at the spawn point
                        if (spawner.SpawnRange > 0)
                            c.DropItem(item);
                        else
                            c.AddItem(item);
                    }
                    else
                    {
                        // if the spawn entry is in a subgroup and has a packrange, then get the packcoord
                        Point3D packcoord = Point3D.Zero;
                        if (theSpawn.PackRange >= 0 && theSpawn.SubGroup > 0)
                        {
                            packcoord = spawner.GetPackCoord(theSpawn.SubGroup);
                        }
                        Point3D loc = spawner.GetSpawnPosition(requiresurface, theSpawn.PackRange, packcoord, spawnpositioning);

                        if (!smartspawn)
                        {
                            item.OnBeforeSpawn(loc, map);
                        }

                        // standard placement for all items in the world
                        item.MoveToWorld(loc, map);
                    }
                }
                else
                {
                    // if the spawner has already been deleted then delete the item since it cannot be cleaned up by spawner deletion any longer
                    item.Delete();
                    return;
                }
            }
            else
            {
                if (!smartspawn)
                {
                    item.OnBeforeSpawn(location, map);
                }
                // use the location and map info passed in
                // this allows AddSpawnItem to be called by objects other than spawners as long as they pass in a valid SpawnObject
                item.MoveToWorld(location, map);
            }

            // clear the taken flag on all newly spawned items
            ItemFlags.SetTaken(item, false);

            if (!smartspawn)
            {
                item.OnAfterSpawn();
            }

            // apply the parsed arguments from the typestring using setcommand
            // be sure to do this after setting map and location so that errors dont place the mob on the internal map
            BaseXmlSpawner.ApplyObjectStringProperties(spawner, propertyString, item, trigmob, spawner, out status_str);
            // if the object has an OnAfterSpawnAndModify method, then invoke it
            //InvokeOnAfterSpawnAndModify(item);
        }
开发者ID:m309,项目名称:ForkUO,代码行数:95,代码来源:BaseXmlSpawner.cs


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