当前位置: 首页>>代码示例>>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;未经允许,请勿转载。