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


C# CraftItem.RetainsColorFrom方法代码示例

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


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

示例1: OnCraft

		public int OnCraft( int quality, bool makersMark, Mobile from, CraftSystem craftSystem, Type typeRes, BaseTool tool, CraftItem craftItem, int resHue )
		{
			Quality = (ArmorQuality)quality;

			if ( makersMark )
				Crafter = from;

			Type resourceType = typeRes;

            if (resourceType != null)
            {
                if (!craftItem.RetainsColorFrom(craftSystem, resourceType)) //Taran: When crafting armor which does not retain the color, it should not retain the resource type either
                    resourceType = null;
            }

		    if ( resourceType == null )
				resourceType = craftItem.Resources.GetAt( 0 ).ItemType;

			Resource = CraftResources.GetFromType( resourceType );
			PlayerConstructed = true;

            CraftContext context = craftSystem.GetContext(from);

            if (context != null && context.DoNotColor)
                Hue = 0;

            if (Quality == ArmorQuality.Exceptional)
            {
                DistributeBonuses((tool is BaseRunicTool ? 6 : Core.SE ? 15 : 14)); // Not sure since when, but right now 15 points are added, not 14.

                if (Core.ML && !(this is BaseShield))
                {
                    int bonus = (int)(from.Skills.ArmsLore.Value / 20);

                    for (int i = 0; i < bonus; i++)
                    {
                        switch (Utility.Random(5))
                        {
                            case 0: m_PhysicalBonus++; break;
                            case 1: m_FireBonus++; break;
                            case 2: m_ColdBonus++; break;
                            case 3: m_EnergyBonus++; break;
                            case 4: m_PoisonBonus++; break;
                        }
                    }

                    from.CheckSkill(SkillName.ArmsLore, 0, 100);
                }
            }

			if ( Core.AOS && tool is BaseRunicTool )
				((BaseRunicTool)tool).ApplyAttributesTo( this );

			return quality;
		}
开发者ID:FreeReign,项目名称:imaginenation,代码行数:55,代码来源:BaseArmor.cs

示例2: CraftGumpItem


//.........这里部分代码省略.........
                int amount = craftResource.Amount;

                // Resource Mutation
                if ( _type == res.ResType && resIndex > -1 )
                {
                    CraftSubRes subResource = res.GetAt( resIndex );

                    _type = subResource.ItemType;

                    nameString = subResource.NameString;
                    nameNumber = subResource.GenericNameNumber;

                    if ( nameNumber <= 0 )
                        nameNumber = subResource.NameNumber;
                }
                // ******************

                if ( m_CraftItem.NameNumber == 1044458 ) // cut-up cloth
                {
                    amount = 0;

                    AddHtmlLocalized( 170, 302 + ( m_OtherCount++ * 20 ), 360, 18, 1044460, LabelColor, false, false ); // Cut bolts of cloth into pieces of ready cloth.
                    AddHtmlLocalized( 170, 302 + ( m_OtherCount++ * 20 ), 310, 18, 1048176, LabelColor, false, false ); // Makes as many as possible at once
                }

                if ( m_CraftItem.NameNumber == 1044459 ) //combine cloth
                {
                    amount = 0;

                    AddHtmlLocalized( 170, 302 + ( m_OtherCount++ * 20 ), 360, 18, 1044461, LabelColor, false, false ); // Combine available cloth into piles by color.
                    AddHtmlLocalized( 170, 302 + ( m_OtherCount++ * 20 ), 310, 18, 1048176, LabelColor, false, false ); // Makes as many as possible at once
                }

                if ( !retainedColor && m_CraftItem.RetainsColorFrom( m_CraftSystem, _type ) )
                {
                    retainedColor = true;
                    AddHtmlLocalized( 170, 302 + ( m_OtherCount++ * 20 ), 310, 18, 1044152, LabelColor, false, false ); // * The item retains the color of this material
                    AddLabel( 500, 219 + ( i * 20 ), LabelHue, "*" );
                }

                if ( nameNumber > 0 )
                    AddHtmlLocalized( 170, 219 + ( i * 20 ), 310, 18, nameNumber, LabelColor, false, false );
                else
                    AddLabel( 170, 219 + ( i * 20 ), LabelHue, nameString );

                AddHtml( 430, 219 + ( i * 20 ), 40, 20, String.Format( "<basefont color=#FFFFFF><div align=right>{0}</basefont></div>", amount.ToString() ), false, false );
            }

            if ( m_CraftItem.NameNumber == 1041267 ) // runebook
            {
                AddHtmlLocalized( 170, 219 + ( m_CraftItem.Ressources.Count * 20 ), 310, 18, 1044447, LabelColor, false, false );
                AddHtml( 430, 219 + ( m_CraftItem.Ressources.Count * 20 ), 40, 20, String.Format( "<basefont color=#FFFFFF><div align=right>{0}</basefont></div>", "1" ), false, false );
            }
            // ***********************************

            if ( craftItem.UseAllRes )
            {
                // Makes as many as possible at once
                AddHtmlLocalized( 170, 302 + ( m_OtherCount++ * 20 ), 310, 18, 1048176, LabelColor, false, false );
            }

            if ( craftItem.RequiresSE )
            {
                // * Requires the "Samurai Empire" expansion
                AddHtmlLocalized( 170, 302 + ( m_OtherCount++ * 20 ), 310, 18, 1063363, LabelColor, false, false );
            }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:67,代码来源:CraftGumpItem.cs


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