當前位置: 首頁>>代碼示例>>C#>>正文


C# Items.BaseTool類代碼示例

本文整理匯總了C#中Server.Items.BaseTool的典型用法代碼示例。如果您正苦於以下問題:C# BaseTool類的具體用法?C# BaseTool怎麽用?C# BaseTool使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


BaseTool類屬於Server.Items命名空間,在下文中一共展示了BaseTool類的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: CanCraft

        public override int CanCraft( Mobile from, BaseTool tool, Type typeItem )
        {
            if ( tool.Deleted || tool.UsesRemaining < 0 )
                return 1044038; // You have worn out your tool!
            else if ( !BaseTool.CheckAccessible( tool, from ) )
                return 1044263; // The tool must be on your person to use.

            if ( typeItem != null )
            {
                object o = Activator.CreateInstance( typeItem );

                if ( o is SpellScroll )
                {
                    SpellScroll scroll = (SpellScroll)o;
                    Spellbook book = Spellbook.Find( from, scroll.SpellID );

                    bool hasSpell = ( book != null && book.HasSpell( scroll.SpellID ) );

                    scroll.Delete();

                    return ( hasSpell ? 0 : 1042404 ); // null : You don't have that spell!
                }
                else if ( o is Item )
                {
                    ((Item)o).Delete();
                }
            }

            return 0;
        }
開發者ID:BackupTheBerlios,項目名稱:sunuo-svn,代碼行數:30,代碼來源:DefInscription.cs

示例2: AutoCraftTimer

        public AutoCraftTimer(Mobile from, CraftSystem system, CraftItem item, BaseTool tool, int amount, TimeSpan delay, TimeSpan interval)
            : base(delay, interval)
        {
            m_From = from;
            m_CraftSystem = system;
            m_CraftItem = item;
            m_Tool = tool;
            m_Amount = amount;
            m_Ticks = 0;
            m_Success = 0;

            CraftContext context = m_CraftSystem.GetContext(m_From);

            if (context != null)
            {
                CraftSubResCol res = (m_CraftItem.UseSubRes2 ? m_CraftSystem.CraftSubRes2 : m_CraftSystem.CraftSubRes);
                int resIndex = (m_CraftItem.UseSubRes2 ? context.LastResourceIndex2 : context.LastResourceIndex);

                if (resIndex > -1)
                    m_TypeRes = res.GetAt(resIndex).ItemType;
            }

            m_AutoCraftTable[from] = this;

            this.Start();
        }
開發者ID:Ziden,項目名稱:ServUO-EC-Test-Fork,代碼行數:26,代碼來源:AutoCraft.cs

示例3: BStartGump

        //private string m_PieceName = "None";
        //private int m_PiecePage = 1;
        //private BaseIngot m_Ingot;
        public BStartGump(PlayerMobile crafter, BlackSmithingCraftState craftstate, BaseTool tool, BStartContext context)
            : base(0, 0)
        {
            m_CraftState = craftstate;
            m_Crafter = crafter;
            m_Tool = tool;

            if (context == null)
                m_Context = new BStartContext();
            else
                m_Context = context;

            this.Closable = true;
            this.Disposable = false;
            this.Dragable = true;
            this.Resizable = false;
            this.AddPage(0);

            InitialSetUp();

            if (m_Context.Ingot != null)
                AddResourceImage(m_Context.Ingot);

            switch (m_Context.Page)
            {
                case 1: InitialPiecePage(); break;
                case 2: ArmorPiecePage(); break;
                case 3: WeaponPiecePage(); break;
                case 4: AttackPiecePage(); break;
                case 5: HiltsPage(); break;
                //case 6: EmbellishmentsPage(); break;
            }
        }
開發者ID:justdanofficial,項目名稱:khaeros,代碼行數:36,代碼來源:BStartGump.cs

示例4: CanCraft

		public override int CanCraft( Mobile from, BaseTool tool, Type itemType )
		{
			if ( tool.Deleted || tool.UsesRemaining < 0 )
				return 1044038; // You have worn out your tool!

			return 0;
		}
開發者ID:greeduomacro,項目名稱:cov-shard-svn-1,代碼行數:7,代碼來源:DefToy.cs

示例5: QueryMakersMarkGump

        public QueryMakersMarkGump( bool exceptional, Mobile from, CraftItem craftItem, CraftSystem craftSystem, Type typeRes, BaseTool tool, bool questItem )
            : base(100, 200)
        {
            from.CloseGump( typeof( QueryMakersMarkGump ) );

            m_Exceptional = exceptional;
            m_From = from;
            m_CraftItem = craftItem;
            m_CraftSystem = craftSystem;
            m_TypeRes = typeRes;
            m_Tool = tool;
            m_QuestItem = questItem;

            AddPage( 0 );

            AddBackground( 0, 0, 220, 170, 5054 );
            AddBackground( 10, 10, 200, 150, 3000 );

            AddHtmlLocalized( 20, 20, 180, 80, 1018317, false, false ); // Do you wish to place your maker's mark on this item?

            AddHtmlLocalized( 55, 100, 140, 25, 1011036, false, false ); // OKAY
            AddButton( 20, 100, 4005, 4007, 2, GumpButtonType.Reply, 0 );

            AddHtmlLocalized( 55, 125, 140, 25, 1011012, false, false ); // CANCEL
            AddButton( 20, 125, 4005, 4007, 1, GumpButtonType.Reply, 0 );
        }
開發者ID:Ravenwolfe,項目名稱:xrunuo,代碼行數:26,代碼來源:QueryMakersMarkGump.cs

示例6: OnCraft

        public int OnCraft(int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool, CraftItem craftItem, int resHue)
        {
            this.ItemID = 0x14F0;
            this.Faction = Faction.Find(from);

            return 1;
        }
開發者ID:FreeReign,項目名稱:forkuo,代碼行數:7,代碼來源:BaseFactionTrapDeed.cs

示例7: OnCraft

		public override int OnCraft( int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool, CraftItem craftItem, int resHue )
		{
			double magery = from.Skills.Magery.Value - 100;
			
			if ( magery < 0 )
				magery = 0;
					
			int count = (int) Math.Round( magery * Utility.RandomDouble() / 5 );
			
			if ( count > 2 )
				count = 2;
				
			if ( Utility.RandomDouble() < 0.5 )
				count = 0;
			else
				BaseRunicTool.ApplyAttributesTo( this, false, 0, count, 70, 80 );
				
			Attributes.SpellDamage = 25;
			Attributes.LowerManaCost = 10;
			Attributes.CastSpeed = 1;
			Attributes.CastRecovery = 1;
			
			if ( makersMark )
				Crafter = from;
				
			return quality;
		}
開發者ID:PepeBiondi,項目名稱:runsa,代碼行數:27,代碼來源:ScrappersCompendium.cs

示例8: OnCraft

        public override bool OnCraft( bool exceptional, bool makersMark, Mobile from, Server.Engines.Craft.CraftSystem craftSystem, Type typeRes, BaseTool tool, Server.Engines.Craft.CraftItem craftItem, int resHue )
        {
            if ( exceptional )
                ArmorAttributes.MageArmor = 1;

            return base.OnCraft( exceptional, makersMark, from, craftSystem, typeRes, tool, craftItem, resHue );
        }
開發者ID:Ravenwolfe,項目名稱:xrunuo,代碼行數:7,代碼來源:PlateMempo.cs

示例9: Craft

        public static void Craft( Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool, CraftItem craftItem )
        {
            if ( from.Backpack == null )
            {
                from.EndAction( typeof( CraftSystem ) );
                return;
            }

            Timer.DelayCall( TimeSpan.FromSeconds( craftSystem.Delay ), new TimerCallback(
                delegate
                {
                    if ( from.Backpack.GetAmount( typeof( Bottle ) ) < 1 || from.Backpack.GetAmount( typeof( PlantClippings ) ) < 1 )
                    {
                        from.EndAction( typeof( CraftSystem ) );

                        // You don't have the components needed to make that.
                        from.SendGump( new CraftGump( from, craftSystem, tool, 1044253 ) );
                    }
                    else if ( ShouldChooseHue( from ) )
                    {
                        from.SendLocalizedMessage( 1074794 ); // Target the material to use:
                        from.Target = new ClippingsTarget( craftSystem, typeRes, tool, craftItem );
                    }
                    else
                    {
                        from.EndAction( typeof( CraftSystem ) );
                        DoCraft( from, craftSystem, typeRes, tool, craftItem, from.Backpack.FindItemByType<PlantClippings>() );
                    }
                }
            ) );
        }
開發者ID:Ravenwolfe,項目名稱:xrunuo,代碼行數:31,代碼來源:PlantPigment.cs

示例10: MakeNumberCraftPrompt

 public MakeNumberCraftPrompt(Mobile from, CraftSystem system, CraftItem item, BaseTool tool)
 {
     m_From = from;
     m_CraftSystem = system;
     m_CraftItem = item;
     m_Tool = tool;
 }
開發者ID:Crome696,項目名稱:ServUO,代碼行數:7,代碼來源:AutoCraft.cs

示例11: QueryMakersMarkGump

        public QueryMakersMarkGump(int quality, Mobile from, CraftItem craftItem, CraftSystem craftSystem, Type typeRes, BaseTool tool)
            : base(100, 200)
        {
            from.CloseGump(typeof(QueryMakersMarkGump));

            this.m_Quality = quality;
            this.m_From = from;
            this.m_CraftItem = craftItem;
            this.m_CraftSystem = craftSystem;
            this.m_TypeRes = typeRes;
            this.m_Tool = tool;

            this.AddPage(0);

            this.AddBackground(0, 0, 220, 170, 5054);
            this.AddBackground(10, 10, 200, 150, 3000);

            this.AddHtmlLocalized(20, 20, 180, 80, 1018317, false, false); // Do you wish to place your maker's mark on this item?

            this.AddHtmlLocalized(55, 100, 140, 25, 1011011, false, false); // CONTINUE
            this.AddButton(20, 100, 4005, 4007, 1, GumpButtonType.Reply, 0);

            this.AddHtmlLocalized(55, 125, 140, 25, 1011012, false, false); // CANCEL
            this.AddButton(20, 125, 4005, 4007, 0, GumpButtonType.Reply, 0);
        }
開發者ID:FreeReign,項目名稱:forkuo,代碼行數:25,代碼來源:QueryMakersMarkGump.cs

示例12: Begin

        public override bool Begin( Mobile from, BaseTool tool )
        {
            if ( from.Deleted || !from.Alive || m_Wood == null || m_Wood.Deleted )
                return false;

            if ( !base.Begin( from, tool ) )
                return false;

            if ( m_Wood.IsChildOf( from ) )
            {
                if ( ShowMenu( m_WoodMenu ) )
                {
                    return true;
                }
                else
                {
                    End();
                    return false;
                }
            }
            else
            {
                from.SendAsciiMessage( "That wood belongs to someone else." );
                End();
                return false;
            }
        }
開發者ID:FreeReign,項目名稱:Rebirth-Repack,代碼行數:27,代碼來源:Fletching.cs

示例13: Begin

 public override bool Begin( Mobile from, BaseTool tool )
 {
     if ( tool is MortarPestle )
         return base.Begin(from, tool);
     else
         return false;
 }
開發者ID:FreeReign,項目名稱:Rebirth-Repack,代碼行數:7,代碼來源:Alchemy.cs

示例14: BrewingState

 public BrewingState( Mobile brewer, BaseTool tool )
 {
     m_Brewer = brewer;
     m_Tool = tool;
     m_Type = PotionType.Drink; // default potion type
     m_Bottle = 3626;
 }
開發者ID:justdanofficial,項目名稱:khaeros,代碼行數:7,代碼來源:BrewingState.cs

示例15: AlchemyMenu

 public AlchemyMenu(Mobile m, ItemListEntry[] entries, string Is, BaseTool tool)
     : base("Choose a formula.", entries)
 {
     m_Mobile = m;
     IsFrom = Is;
     m_Tool = tool;
     m_Entries = entries;
 }
開發者ID:Godkong,項目名稱:Origins,代碼行數:8,代碼來源:AlchemyMenu.cs


注:本文中的Server.Items.BaseTool類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。