• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

C# Craft.CraftItem类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中Server.Engines.Craft.CraftItem的典型用法代码示例。如果您正苦于以下问题:C# CraftItem类的具体用法?C# CraftItem怎么用?C# CraftItem使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



CraftItem类属于Server.Engines.Craft命名空间,在下文中一共展示了CraftItem类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: PlayEndingEffect

        public override int PlayEndingEffect(Mobile from, bool failed, bool lostMaterial, bool toolBroken, int quality, bool makersMark, CraftItem item)
        {
            if (toolBroken)
                from.SendLocalizedMessage(1044038); // You have worn out your tool

            if (failed)
            {
                if (lostMaterial)
                    return 1044043; // You failed to create the item, and some of your materials are lost.
                else
                    return 1044157; // You failed to create the item, but no materials were lost.
            }
            else
            {
                from.PlaySound(0x41); // glass breaking

                if (quality == 0)
                    return 502785; // You were barely able to make this item.  It's quality is below average.
                else if (makersMark && quality == 2)
                    return 1044156; // You create an exceptional quality item and affix your maker's mark.
                else if (quality == 2)
                    return 1044155; // You create an exceptional quality item.
                else
                    return 1044154; // You create the item.
            }
        }
开发者ID:Crome696,项目名称:ServUO,代码行数:26,代码来源:DefGlassblowing.cs


示例2: OnCraft

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

            return base.OnCraft( exceptional, makersMark, from, craftSystem, typeRes, tool, craftItem, resHue );
        }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:7,代码来源:SmallPlateJingasa.cs


示例3: RetainsColorFrom

		public override bool RetainsColorFrom( CraftItem item, Type type )
		{
			if ( type != typeof( Cloth ) && type != typeof( UncutCloth ) )
				return false;

			return true;
		}
开发者ID:Grimoric,项目名称:RunUO.T2A,代码行数:7,代码来源:DefTailoring.cs


示例4: PlayEndingEffect

		public override int PlayEndingEffect( Mobile from, bool failed, bool lostMaterial, bool toolBroken, int quality, bool makersMark, CraftItem item )
		{
			if ( toolBroken )
				from.SendLocalizedMessage( 1044038 ); // You have worn out your tool

            // erl: handle special dyes differently

			if( item.ItemType == typeof( SpecialDyeTub ) || item.ItemType == typeof( SpecialDye ) )
			{
				if( failed )
					from.SendMessage("You fail to mix the dye correctly.");

				return 0;
			}

			if ( failed )
			{
				from.AddToBackpack( new Bottle() );

				return 500287; // You fail to create a useful potion.
			}
			else
			{
				from.PlaySound( 0x240 ); // Sound of a filling bottle

				if ( quality == -1 )
					return 1048136; // You create the potion and pour it into a keg.
				else
					return 500279; // You pour the potion into a bottle...
			}
		}
开发者ID:zerodowned,项目名称:angelisland,代码行数:31,代码来源:DefAlchemy.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: 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


示例7: GetDelay

 public static int GetDelay(CraftItem toCraft)
 {
     if (toCraft != null)
         return toCraft.Resources.GetAt(0).Amount+1;
     else
         return 2;
 }
开发者ID:FreeReign,项目名称:imaginenation,代码行数:7,代码来源:DefAlchemy.cs


示例8: 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


示例9: 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


示例10: GetChanceAtMin

		public override double GetChanceAtMin( CraftItem item )
		{
			if( item.ItemType == typeof( HollowPrism ) )
				return 0.5; // 50%

			return 0.0; // 0%
		}
开发者ID:greeduomacro,项目名称:last-wish,代码行数:7,代码来源:DefGlassblowing.cs


示例11: 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


示例12: OnMade

		public void OnMade( Mobile m, CraftItem item )
		{
			CraftContext c = GetContext( m );

			if ( c != null )
				c.OnMade( item );
		}
开发者ID:Godkong,项目名称:Origins,代码行数:7,代码来源:CraftSystem.cs


示例13: PlayEndingEffect

        public override int PlayEndingEffect(Mobile from, bool failed, bool lostMaterial, bool toolBroken, int quality, bool makersMark, CraftItem item)
        {
            if (toolBroken)
                from.SendLocalizedMessage(1044038); // You have worn out your tool

            if (!typeofSpellScroll.IsAssignableFrom(item.ItemType)) //  not a scroll
            {
                if (failed)
                {
                    if (lostMaterial)
                        return 1044043; // You failed to create the item, and some of your materials are lost.
                    else
                        return 1044157; // You failed to create the item, but no materials were lost.
                }
                else
                {
                    if (quality == 0)
                        return 502785; // You were barely able to make this item.  It's quality is below average.
                    else if (makersMark && quality == 2)
                        return 1044156; // You create an exceptional quality item and affix your maker's mark.
                    else if (quality == 2)
                        return 1044155; // You create an exceptional quality item.
                    else
                        return 1044154; // You create the item.
                }
            }
            else
            {
                if (failed)
                    return 501630; // You fail to inscribe the scroll, and the scroll is ruined.
                else
                    return 501629; // You inscribe the spell and put the scroll in your backpack.
            }
        }
开发者ID:Ziden,项目名称:ServUO-EC-Test-Fork,代码行数:34,代码来源:DefInscription.cs


示例14: PlayEndingEffect

        public override int PlayEndingEffect(Mobile from, bool failed, bool lostMaterial, bool toolBroken, int quality, bool makersMark, CraftItem item)
        {
            if (toolBroken)
                from.SendLocalizedMessage(1044038); // You have worn out your tool

            if (failed)
            {
                if (IsPotion(item.ItemType))
                {
                    from.AddToBackpack(new Bottle());
                    return 500287; // You fail to create a useful potion.
                }
                else
                {
                    return 1044043; // You failed to create the item, and some of your materials are lost.
                }
            }
            else
            {
                from.PlaySound(0x240); // Sound of a filling bottle

                if (IsPotion(item.ItemType))
                {
                    if (quality == -1)
                        return 1048136; // You create the potion and pour it into a keg.
                    else
                        return 500279; // You pour the potion into a bottle...
                }
                else
                {
                    return 1044154; // You create the item.
                }
            }
        }
开发者ID:jasegiffin,项目名称:JustUO,代码行数:34,代码来源:DefAlchemy.cs


示例15: GetChanceAtMin

		public override double GetChanceAtMin( CraftItem item )
		{
			if ( item.NameNumber == 1044258 ) // potion keg
				return 0.5; // 50%

			return 0.0; // 0%
		}
开发者ID:zerodowned,项目名称:angelisland,代码行数:7,代码来源:DefTinkering.cs


示例16: 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


示例17: GetChanceAtMin

		public override double GetChanceAtMin( CraftItem item )
		{
			if ( item.NameNumber == 1044258 || item.NameNumber == 1046445 ) // potion keg and faction trap removal kit
				return 0.5; // 50%

			return 0.0; // 0%
		}
开发者ID:kamronbatman,项目名称:DefianceUO-Pre1.10,代码行数:7,代码来源:DefTinkering.cs


示例18: PlayEndingEffect

        public override int PlayEndingEffect( Mobile from, bool failed, bool lostMaterial, bool toolBroken, int quality, bool makersMark, CraftItem item )
        {
            /*if ( toolBroken )
                from.SendLocalizedMessage( 1044038 ); // You have worn out your tool*/

            if ( failed )
            {
                //from.Send(new AsciiMessage(Serial, ItemID, MessageType.Regular, 0, 3, "", "Text."));
                from.SendAsciiMessage("Thy trembling hand results in an unusable map.");
                return 0;
                if ( lostMaterial )
                    return 1044043; // You failed to create the item, and some of your materials are lost.
                else
                    return 1044157; // You failed to create the item, but no materials were lost.
            }
            else
            {
                from.SendAsciiMessage("With great care, thou dost make a chart of the geography.");
                //from.SendAsciiMessage("You create the item and put it in your backpack.");
                return 0;
                if ( quality == 0 )
                    return 502785; // You were barely able to make this item.  It's quality is below average.
                else if ( makersMark && quality == 2 )
                    return 1044156; // You create an exceptional quality item and affix your maker's mark.
                else if ( quality == 2 )
                    return 1044155; // You create an exceptional quality item.
                else
                    return 1044154; // You create the item.
            }
        }
开发者ID:Godkong,项目名称:Origins,代码行数:30,代码来源:DefCartography.cs


示例19: PlayEndingEffect

		public override int PlayEndingEffect( Mobile from, bool failed, bool lostMaterial, bool toolBroken, int quality, bool makersMark, CraftItem item )
		{
			if ( toolBroken )
				from.SendLocalizedMessage( 1044038 );

			if ( failed )
			{
				if ( lostMaterial )
					return 1044043;
				else
					return 1044157;
			}
			else
			{
				from.PlaySound( 0x1c6 );

				if ( quality == 0 )
					return 502785;
				else if ( makersMark && quality == 2 )
					return 1044156;
				else if ( quality == 2 )
					return 1044155;
				else
					return 1044154;
			}
		}
开发者ID:ITLongwell,项目名称:aedilis2server,代码行数:26,代码来源:DefWoodCarving.cs


示例20: 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



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Craft.CraftSubRes类代码示例发布时间:2022-05-26
下一篇:
C# Chat.ChatUser类代码示例发布时间:2022-05-26
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap