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


C# CraftResource类代码示例

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


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

示例1: Deserialize

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();
            m_Resource = (CraftResource)reader.ReadEncodedInt();
        }
开发者ID:greeduomacro,项目名称:vivre-uo,代码行数:7,代码来源:ForgeInacheve.cs

示例2: Deserialize

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch ( version )
            {
                case 2: // Reset from Resource System
                    this.m_Resource = this.DefaultResource;
                    reader.ReadString();
                    break;
                case 1:
                    {
                        this.m_Resource = (CraftResource)reader.ReadInt();
                        break;
                    }
                case 0:
                    {
                        OreInfo info;

                        switch ( reader.ReadInt() )
                        {
                            case 0:
                                info = OreInfo.Iron;
                                break;
                            case 1:
                                info = OreInfo.DullCopper;
                                break;
                            case 2:
                                info = OreInfo.ShadowIron;
                                break;
                            case 3:
                                info = OreInfo.Copper;
                                break;
                            case 4:
                                info = OreInfo.Bronze;
                                break;
                            case 5:
                                info = OreInfo.Gold;
                                break;
                            case 6:
                                info = OreInfo.Agapite;
                                break;
                            case 7:
                                info = OreInfo.Verite;
                                break;
                            case 8:
                                info = OreInfo.Valorite;
                                break;
                            default:
                                info = null;
                                break;
                        }

                        this.m_Resource = CraftResources.GetFromOreInfo(info);
                        break;
                    }
            }
        }
开发者ID:Ziden,项目名称:ServUO-EC-Test-Fork,代码行数:60,代码来源:Ore.cs

示例3: AddTinker

		public void AddTinker( CraftResource cr, BaseRunicTool brt, Mobile from)
		{
			if ( ht_Tinker == null )
				ht_Tinker = new Hashtable();
			int i_Have = 0;
			if ( ht_Tinker[cr] != null )
				i_Have = (int)ht_Tinker[cr];

			if ( i_Have < 60000 )
			{
				if ( i_Have + brt.UsesRemaining > 60000 )
				{
					brt.UsesRemaining = i_Have + brt.UsesRemaining - 60000;
					i_Have = 60000;
				}
				else
				{
					i_Have += brt.UsesRemaining;
					brt.Delete();
				}

				if ( ht_Tinker.ContainsKey(cr) )
					ht_Tinker[cr] = i_Have;
				else
					ht_Tinker.Add(cr, i_Have);
				
				BeginCombine( from );
				from.SendGump( new RunicHouseGump( from, this ) );
				from.SendMessage(88, "You added the runic charges.");
				return;
			}
			from.SendGump( new RunicHouseGump( from, this ) );
			from.SendMessage(33, "You can't add more charges, the limit is 60,000.");
		}
开发者ID:greeduomacro,项目名称:cov-shard-svn-1,代码行数:34,代码来源:RunicHouse.cs

示例4: RunicFletchersTools

 public RunicFletchersTools( CraftResource resource, int uses ) : base( resource, uses, 0x1022 ) 
 { 
    Weight = 2.0;
    Hue = CraftResources.GetHue( resource );
                                         
  
 } 
开发者ID:greeduomacro,项目名称:cov-shard-svn-1,代码行数:7,代码来源:RunicFletchersTools.cs

示例5: Deserialize

		public override void Deserialize( GenericReader reader )
		{
			base.Deserialize( reader );

			int version = reader.ReadInt();

			switch ( version )
			{
				case 2:
				{
					m_Resource = (CraftResource)reader.ReadInt();
					break;
				}
				/** Below is for deserialization of old logs that orignally inherited from Log or Item **/
				case 1: // For all logs
				{
					m_Resource = (CraftResource)reader.ReadInt();
					goto case 0;
				}
				case 0: // For old standard logs
				{
					m_InheritsItem = true;
					m_OldVersion = version;
					break;
				}
			}
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:27,代码来源:Log.cs

示例6: RunicSaw

 public RunicSaw( CraftResource resource, int uses ) : base( resource, uses, 0x1034 ) 
 { 
    Weight = 2.0;
    Hue = CraftResources.GetHue( resource );
                                         
  
 } 
开发者ID:greeduomacro,项目名称:cov-shard-svn-1,代码行数:7,代码来源:RunicSaw.cs

示例7: GetProgress

		protected virtual int GetProgress(ConquestState state, Item item, CraftResource res, HarvestSystem harvest)
		{
			if (item == null || harvest == null)
			{
				return 0;
			}

            if (state.User == null)
                return 0;

			if (ItemType.IsNotNull && !item.TypeEquals(ItemType, ItemChildren))
			{
				if (ItemChangeReset)
				{
					return -state.Progress;
				}

				return 0;
			}

			if (Resource != CraftResource.None && res != Resource)
			{
				return 0;
			}

			if (HarvestSystem.IsNotNull && !harvest.TypeEquals(HarvestSystem, false))
			{
				return 0;
			}

			return item.Amount;
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:32,代码来源:HarvestConquest.cs

示例8: BaseGranite

		public BaseGranite( CraftResource resource ) : base( 0x1779 )
		{
			Hue = CraftResources.GetHue( resource );
			Stackable = Core.ML;

			m_Resource = resource;
		}
开发者ID:nick12344356,项目名称:The-Basement,代码行数:7,代码来源:Granite.cs

示例9: BaseGranite

		public BaseGranite( CraftResource resource ) : base( 0x1779 )
		{
			Weight = 10.0;
			Hue = CraftResources.GetHue( resource );

			m_Resource = resource;
		}
开发者ID:kamronbatman,项目名称:DefianceUO-Pre1.10,代码行数:7,代码来源:Granite.cs

示例10: Resmelt

			private SmeltResult Resmelt( Mobile from, Item item, CraftResource resource )
			{
				try
				{
					if ( CraftResources.GetType( resource ) != CraftResourceType.Metal )
						return SmeltResult.Invalid;

					CraftResourceInfo info = CraftResources.GetInfo( resource );

					if ( info == null || info.ResourceTypes.Length == 0 )
						return SmeltResult.Invalid;

					CraftItem craftItem = m_CraftSystem.CraftItems.SearchFor( item.GetType() );

					if ( craftItem == null || craftItem.Resources.Count == 0 )
						return SmeltResult.Invalid;

					CraftRes craftResource = craftItem.Resources.GetAt( 0 );

					if ( craftResource.Amount < 2 )
						return SmeltResult.Invalid; // Not enough metal to resmelt

					double difficulty = 0.0;

					switch ( resource )
					{
						case CraftResource.DullCopper: difficulty = 65.0; break;
						case CraftResource.ShadowIron: difficulty = 70.0; break;
						case CraftResource.Copper: difficulty = 75.0; break;
						case CraftResource.Bronze: difficulty = 80.0; break;
						case CraftResource.Gold: difficulty = 85.0; break;
						case CraftResource.Agapite: difficulty = 90.0; break;
						case CraftResource.Verite: difficulty = 95.0; break;
						case CraftResource.Valorite: difficulty = 99.0; break;
					}

					if ( difficulty > from.Skills[ SkillName.Mining ].Value )
						return SmeltResult.NoSkill;

					Type resourceType = info.ResourceTypes[0];
					Item ingot = (Item)Activator.CreateInstance( resourceType );

					if ( item is DragonBardingDeed || (item is BaseArmor && ((BaseArmor)item).PlayerConstructed) || (item is BaseWeapon && ((BaseWeapon)item).PlayerConstructed) || (item is BaseClothing && ((BaseClothing)item).PlayerConstructed) )
						ingot.Amount = craftResource.Amount / 2;
					else
						ingot.Amount = 1;

					item.Delete();
					from.AddToBackpack( ingot );

					from.PlaySound( 0x2A );
					from.PlaySound( 0x240 );
					return SmeltResult.Success;
				}
				catch
				{
				}

				return SmeltResult.Invalid;
			}
开发者ID:romeov007,项目名称:imagine-uo,代码行数:60,代码来源:Resmelt.cs

示例11: CheckResourceSkill

        private static bool CheckResourceSkill( CraftResource resource, double skill )
        {
            double reqSkill = 0;

            switch ( resource )
            {
                case CraftResource.DullCopper:
                    reqSkill = 65.0;
                    break;
                case CraftResource.ShadowIron:
                    reqSkill = 70.0;
                    break;
                case CraftResource.Copper:
                    reqSkill = 75.0;
                    break;
                case CraftResource.Bronze:
                    reqSkill = 80.0;
                    break;
                case CraftResource.Gold:
                    reqSkill = 85.0;
                    break;
                case CraftResource.Agapite:
                    reqSkill = 90.0;
                    break;
                case CraftResource.Verite:
                    reqSkill = 95.0;
                    break;
                case CraftResource.Valorite:
                    reqSkill = 99.0;
                    break;
            }

            return ( skill >= reqSkill );
        }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:34,代码来源:Resmelt.cs

示例12: RunicHammer

 public RunicHammer(CraftResource resource)
     : base(resource, 0x13E3)
 {
     this.Weight = 8.0;
     this.Layer = Layer.OneHanded;
     this.Hue = CraftResources.GetHue(resource);
 }
开发者ID:Crome696,项目名称:ServUO,代码行数:7,代码来源:RunicHammer.cs

示例13: Deserialize

        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            switch ( version )
            {
                case 2: // Reset from Resource System
                    this.m_Resource = this.DefaultResource;
                    reader.ReadString();
                    break;
                case 1:
                    {
                        this.m_Resource = (CraftResource)reader.ReadInt();
                        break;
                    }
                case 0:
                    {
                        OreInfo info = new OreInfo(reader.ReadInt(), reader.ReadInt(), reader.ReadString());

                        this.m_Resource = CraftResources.GetFromOreInfo(info);
                        break;
                    }
            }
        }
开发者ID:Crome696,项目名称:ServUO,代码行数:26,代码来源:Leathers.cs

示例14: RunicHammer

 public RunicHammer( CraftResource resource, int uses )
     : base(resource, uses, 0x13E4)
 {
     Weight = 8.0;
     Layer = Layer.OneHanded;
     Hue = CraftResources.GetHue( resource );
 }
开发者ID:FreeReign,项目名称:Rebirth-Repack,代码行数:7,代码来源:RunicHammer.cs

示例15: Masterwork

        public Masterwork( GenericReader reader )
        {
            int version = reader.ReadInt();

            m_WeaponPointsLeft = reader.ReadInt();
            m_ArmourPointsLeft = reader.ReadInt();
            m_BluntResist = reader.ReadInt();
            m_SlashingResist = reader.ReadInt();
            m_PiercingResist = reader.ReadInt();
            m_WeaponDamage = reader.ReadInt();
            m_WeaponSpeed = reader.ReadInt();
            m_WeaponAccuracy = reader.ReadInt();

            if( version > 1 )
            {
               		m_WeaponResource = (CraftResource)reader.ReadInt();
               		m_MasterworkWeapon = reader.ReadBool();
               		m_HasWeaponPieces = reader.ReadBool();
               		m_ArmourResource = (CraftResource)reader.ReadInt();
               		m_MasterworkArmour = reader.ReadBool();
               		m_HasArmourPieces = reader.ReadBool();
               		m_ClothingResource = (CraftResource)reader.ReadInt();
               		m_MasterworkClothing = reader.ReadBool();
               		m_HasClothingPieces = reader.ReadBool();
            }
        }
开发者ID:justdanofficial,项目名称:khaeros,代码行数:26,代码来源:Masterwork.cs


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