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


C# Item.Delete方法代码示例

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


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

示例1: Target

		public void Target( Item item )
		{
			Type t = item.GetType();

			if ( !Caster.CanSee( item ) )
			{
				Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
			}
			else if ( !t.IsDefined( typeof( DispellableFieldAttribute ), false ) )
			{
				Caster.SendLocalizedMessage( 1005049 ); // That cannot be dispelled.
			}
			else if ( item is Moongate && !((Moongate)item).Dispellable )
			{
				Caster.SendLocalizedMessage( 1005047 ); // That magic is too chaotic
			}
			else if ( CheckSequence() )
			{
                // Scriptiz : Si pas joueur, on ne perd pas de karma
                if (!(Caster is PlayerMobile)) Caster.Mana += 14;

				SpellHelper.Turn( Caster, item );

				Effects.SendLocationParticles( EffectItem.Create( item.Location, item.Map, EffectItem.DefaultDuration ), 0x376A, 9, 20, 5042 );
				Effects.PlaySound( item.GetWorldLocation(), item.Map, 0x201 );

				item.Delete();
			}

			FinishSequence();
		}
开发者ID:greeduomacro,项目名称:vivre-uo,代码行数:31,代码来源:DispelField.cs

示例2: Target

		public void Target( Item item )
		{
			Type t = item.GetType();

			if ( !Caster.CanSee( item ) )
				Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
			else if ( !t.IsDefined( typeof( DispellableFieldAttribute ), false ) )
				Caster.SendLocalizedMessage( 1005049 ); // That cannot be dispelled.
			else if ( item is Moongate && !((Moongate)item).Dispellable )
				Caster.SendLocalizedMessage( 1005047 ); // That magic is too chaotic
			else if ( CheckSequence() )
			{
				SpellHelper.Turn( Caster, item );

				if ( item is ILinkDispel )
				{
					Item second = ((ILinkDispel)item).Link;
					Effects.SendLocationParticles( EffectItem.Create( second.Location, second.Map, EffectItem.DefaultDuration ), 0x376A, 9, 20, 5042 );
					Effects.PlaySound( second.GetWorldLocation(), second.Map, 0x201 );

					second.Delete();
				}

				Effects.SendLocationParticles( EffectItem.Create( item.Location, item.Map, EffectItem.DefaultDuration ), 0x376A, 9, 20, 5042 );
				Effects.PlaySound( item.GetWorldLocation(), item.Map, 0x201 );

				item.Delete();
			}

			FinishSequence();
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:31,代码来源:DispelField.cs

示例3: OnDragDrop

		public override bool OnDragDrop( Mobile from, Item item )
		{

			if ( item.LootType == LootType.Newbied || item.LootType == LootType.Blessed )
			{
                from.LocalOverheadMessage(MessageType.Regular, 906, true, "You cannot trash blessed or newbied items");
                return false;
			}
            if (!base.OnDragDrop(from, item))
                return false;

            
            if (TotalItems >= 50)
            {
                Empty(501478); // The trash is full!  Emptying!
            }
            
            else
            {
                /*
                from.LocalOverheadMessage(MessageType.Regular, 906, true, string.Format("The item will be deleted in 20 seconds"));
                
                if (m_Timer != null)
                    m_Timer.Stop();
                else
                    m_Timer = new EmptyTimer(this);

                m_Timer.Start();
                */
                from.LocalOverheadMessage(MessageType.Regular, 906, true, "You trash the item");
                item.Delete();

			}
            return true;
		}
开发者ID:FreeReign,项目名称:imaginenation,代码行数:35,代码来源:MiniTrashCan.cs

示例4: OnDragDrop

		public override bool OnDragDrop( Mobile from, Item dropped )
		{
			
			if ( dropped is PowerScroll )
			{
				PowerScroll deed = (PowerScroll)dropped;
				i_PSReward = 0; //default value
				if ( deed.Value == 120.0 )
					i_PSReward = 1000;
				else if ( deed.Value == 115.0 )
					i_PSReward = 500;
				else if ( deed.Value == 110.0 )
					i_PSReward = 50;
				else if ( deed.Value == 105.0 )
					i_PSReward = 10;		
			}
			
			
			
			else i_PSReward = 0;
			
			
			dropped.Delete();
			
			if ( i_PSReward > 0 )
			{
				from.AddToBackpack( new PSCredits(i_PSReward) );
				from.SendMessage( 1173, "You were rewarded {0} Powerscroll Credits for this scroll.", i_PSReward );
			}
			
			else if (i_PSReward == 0 ) from.SendMessage( 1173, "This was not a Powerscroll, but it was deleted anyways." );
			
			return true;
		
		}
开发者ID:greeduomacro,项目名称:cov-shard-svn-1,代码行数:35,代码来源:PowerScrollExchange.cs

示例5: Target

		public void Target( Item item )
		{
			Type t = item.GetType();

			if ( !Caster.CanSee( item ) )
			{
				Caster.SendLocalizedMessage( 500237 ); // Target can not be seen.
			}
			else if ( !t.IsDefined( typeof( DispellableFieldAttribute ), false ) )
			{
				Caster.SendLocalizedMessage( 1005049 ); // That cannot be dispelled.
			}
			else if ( item is Moongate && !((Moongate)item).Dispellable )
			{
				Caster.SendLocalizedMessage( 1005047 ); // That magic is too chaotic
			}
            else if (SphereSpellTarget is BaseWand)
            {
                BaseWand bw = SphereSpellTarget as BaseWand;
                bw.RechargeWand(Caster, this);
            }
			else if ( CheckSequence() )
			{

				//Effects.SendLocationParticles( EffectItem.Create( item.Location, item.Map, EffectItem.DefaultDuration ), 0x376A, 9, 20, 5042 );
				Effects.PlaySound( item.GetWorldLocation(), item.Map, Sound );

				item.Delete();
			}

			FinishSequence();
		}
开发者ID:FreeReign,项目名称:imaginenation,代码行数:32,代码来源:DispelField.cs

示例6: OnDragDrop

        public override bool OnDragDrop( Mobile from, Item dropped )
        {
            Mobile m = from;
            PlayerMobile mobile = m as PlayerMobile;

            if ( mobile != null)
            {
                if( dropped is blueapple )
             		{
             			if(dropped.Amount!=1)
             			{
                    this.PrivateOverheadMessage( MessageType.Regular, 1153, false, "ahhh my apple!", mobile.NetState );
             				return false;
             			}

                    dropped.Delete();

                    mobile.AddToBackpack( new ArrianasClips() );
                    mobile.SendMessage( "The Piece is now yours, now join them and bring it back to arriana!" );

                    return true;
             		}
                else if ( dropped is blueapple )
                {
                this.PrivateOverheadMessage( MessageType.Regular, 1153, 1054071, mobile.NetState );
             			return false;
                }
             		else
             		{
                    this.PrivateOverheadMessage( MessageType.Regular, 1153, false, "Why on earth would I want to have that?", mobile.NetState );
             			}
            }
            return false;
        }
开发者ID:Ziden,项目名称:ServUO-EC-Test-Fork,代码行数:34,代码来源:AuntieJune.cs

示例7: Target

        public void Target( Item item )
        {
            Type t = item.GetType();

            if ( !Caster.CanSee( item ) )
            {
                Caster.SendAsciiMessage("Target can not be seen."); // Target can not be seen.
            }
            else if ( !t.IsDefined( typeof( DispellableFieldAttribute ), false ) )
            {
                Caster.SendAsciiMessage("That cannot be dispelled."); // That cannot be dispelled.
            }
            /*else if ( item is Moongate && !((Moongate)item).Dispellable )
            {
                Caster.SendLocalizedMessage( 1005047 ); // That magic is too chaotic
            }*/
            else if ( CheckSequence() )
            {
                SpellHelper.Turn( Caster, item );

                Effects.SendLocationParticles( EffectItem.Create( item.Location, item.Map, EffectItem.DefaultDuration ), 0x376A, 9, 20, 5042 );
                Effects.PlaySound( item.GetWorldLocation(), item.Map, 0x201 );

                item.Delete();
            }

            FinishSequence();
        }
开发者ID:Godkong,项目名称:Origins,代码行数:28,代码来源:DispelField.cs

示例8: OnDragDrop

        public override bool OnDragDrop(Mobile from, Item dropped)
        {

            Mobile m = from;

            PlayerMobile mobile = m as PlayerMobile;

            if (mobile != null)
            {
                if (dropped is GibberHead)
                {
                    dropped.Delete();
                    //   mobile.AddToBackpack(new GibberToken());
                    mobile.AddToBackpack(new RAD());
                    mobile.AddToBackpack(new BankCheck(5000));
                    this.PrivateOverheadMessage(MessageType.Regular, 1153, false, "Thank you. As I said here is a reward.", mobile.NetState);
                }
                else
                {
                    this.PrivateOverheadMessage(MessageType.Regular, 1153, false, "I have no need for this...", mobile.NetState); return true;
                }


            }

            return false;
        }
开发者ID:Tukaramdas,项目名称:ServUO-EC-Test-Fork,代码行数:27,代码来源:GibberlingHunter.cs

示例9: DropItem

		public override void DropItem( Item dropped )
		{
            if (AcceptsItem(dropped))
                base.DropItem(dropped);
            else
                dropped.Delete();
		}
开发者ID:FreeReign,项目名称:imaginenation,代码行数:7,代码来源:EventItemContainer.cs

示例10: OnDragDrop

        public override bool OnDragDrop( Mobile from, Item dropped )
        {
            if ( dropped is Key )
            {
                if ( m_Keys.Count < 16 )
                {
                    Key key = (Key)dropped;

                    if ( key.KeyValue != 0 )
                    {
                        m_Keys.Add( new KeyringEntry( key.KeyValue, key.Link, key.MaxRange, key.ItemID, key.LootType, key.Description ) );

                        dropped.Delete();

                        //from.Send( new PlaySound( 0x42, GetWorldLocation() ) );

                        this.Weight = this.Weight + 1;

                        switch( m_Keys.Count )
                        {
                            case 0:
                            {
                                this.ItemID = 0x1011;
                                break;
                            }
                            case 1:
                            {
                                this.ItemID = 0x1769;
                                break;
                            }
                            case 3:
                            {
                                this.ItemID = 0x176A;
                                break;
                            }
                            case 5:
                            {
                                this.ItemID = 0x176B;
                                break;
                            }
                        }

                        return true;
                    }
                    else
                    {
                        from.SendAsciiMessage( "This key is blank." );
                        return false;
                    }
                }
                else
                {
                    from.SendAsciiMessage( "This key ring is full" );
                    return false;
                }
            }
            return false;
        }
开发者ID:cynricthehun,项目名称:UOLegends,代码行数:58,代码来源:Keyring.cs

示例11: NewPackItem

        public void NewPackItem(Item item)
        {
            Container pack = m.Backpack;

            if (pack != null)
                pack.DropItem(item);
            else
                item.Delete();
        }
开发者ID:greeduomacro,项目名称:last-wish,代码行数:9,代码来源:BaseRegentPlant.cs

示例12: OnDragDrop

        public override bool OnDragDrop( Mobile from, Item dropped )
        {
            if ( !base.OnDragDrop( from, dropped ) )
                return false;

            PublicOverheadMessage( Network.MessageType.Regular, 0x3B2, Utility.Random( 1042891, 8 ) );
            dropped.Delete();

            return true;
        }
开发者ID:justdanofficial,项目名称:khaeros,代码行数:10,代码来源:TrashChest.cs

示例13: OnDragDropInto

        public override bool OnDragDropInto( Mobile from, Item item, Point3D p )
        {
            if ( !base.OnDragDropInto( from, item, p ) )
                return false;

            PublicOverheadMessage( Network.MessageType.Regular, 0x3B2, Utility.Random( 1042891, 8 ) );
            item.Delete();

            return true;
        }
开发者ID:justdanofficial,项目名称:khaeros,代码行数:10,代码来源:TrashChest.cs

示例14: OnItemRemoved

		public override void OnItemRemoved( Item item ) 
		{ 
			if (m_LastTrash <= DateTime.Now)
			{
				item.Delete();
				Empty();
			}
			else 
				base.OnItemRemoved( item );
			//TotalWeight = 0;
		} 
开发者ID:greeduomacro,项目名称:cov-shard-svn-1,代码行数:11,代码来源:Safe+Trash+4+Tokens+Backpack.cs

示例15: OnDragDrop

public override bool OnDragDrop( Mobile from, Item dropped ){               Mobile m = from;PlayerMobile mobile = m as PlayerMobile;
if ( mobile != null){
/////////////////////////////////////////////////////////// item to be dropped
if( dropped is HellKey2 ){if(dropped.Amount!=1)
{this.PrivateOverheadMessage( MessageType.Regular, 1153, false, "There's not the right amount here!", mobile.NetState );return false;}
dropped.Delete(); 
///////////////the reward
mobile.AddToBackpack( new Gold( 1200 ) );
mobile.AddToBackpack( new HellSword( ) );
////////////////////////////////////////////////////////// thanksmessage
this.PrivateOverheadMessage( MessageType.Regular, 1153, false, "Excelent Dude! Now Hurry and Save Ted!", mobile.NetState );
return true;}else if ( dropped is Whip){this.PrivateOverheadMessage( MessageType.Regular, 1153, 1054071, mobile.NetState );return false;}else{this.PrivateOverheadMessage( MessageType.Regular, 1153, false,"I have no need for this...", mobile.NetState );}}return false;}}}
开发者ID:greeduomacro,项目名称:unknown-shard-1,代码行数:12,代码来源:TedlQuest.cs


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