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


C# Harvest.HarvestResource类代码示例

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


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

示例1: HarvestVein

		public HarvestVein( double veinChance, double chanceToFallback, HarvestResource primaryResource, HarvestResource fallbackResource )
		{
			m_VeinChance = veinChance;
			m_ChanceToFallback = chanceToFallback;
			m_PrimaryResource = primaryResource;
			m_FallbackResource = fallbackResource;
		}
开发者ID:Godkong,项目名称:RunUO,代码行数:7,代码来源:HarvestVein.cs

示例2: HarvestVein

		public HarvestVein(Expansion reqExpansion, double veinChance, double chanceToFallback, HarvestResource primaryResource, HarvestResource fallbackResource )
		{
			ReqExpansion = reqExpansion;
			VeinChance = veinChance;
			ChanceToFallback = chanceToFallback;
			PrimaryResource = primaryResource;
			FallbackResource = fallbackResource;
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:8,代码来源:HarvestVein.cs

示例3: OnHarvestFinished

		public override void OnHarvestFinished( Mobile from, Item tool, HarvestDefinition def, HarvestVein vein, HarvestBank bank, HarvestResource resource, object harvested)
		{
/* include this part for rare extras
			// modded by greywolf for random items coming in

			double skillvaluelj = killerguy.Skills[SkillName.Magery].Base;
			int i_itemid = (int)(killerguy.Skills[SkillName.ItemID].Base/10);

			if ((Utility.RandomMinMax( 1, 1500 ) <= (1 + i_itemid)) && (skillvaluelj >= 70.1))
			{
				switch (Utility.RandomMinMax( 0, 10 ))
				{
					case 1 : default:  from.AddToBackpack(new Kindling()); from.SendMessage ("you find something wedged in the tree, a weird peice of wood ");break;
					case 2 : from.AddToBackpack(new BarkFragment()); from.SendMessage ("you find something wedged in the tree, a peice of bark ");break;
					case 3 : from.AddToBackpack(new LuminescentFungi()); from.SendMessage ("you find something wedged in the tree, some fungi ");break;
					case 4 : from.AddToBackpack(new ParasiticPlant()); from.SendMessage ("you find something wedged in the tree, a weird looking plant");break;
					case 5 : from.AddToBackpack(new DiseasedBark()); from.SendMessage ("you find something wedged in the tree, some weird looking bark ");break;
				}
			}
*/
		}
开发者ID:ITLongwell,项目名称:aedilis2server,代码行数:21,代码来源:NecroReagentGathering.cs

示例4: GetResourceType

		public virtual Type GetResourceType( Mobile from, Item tool, HarvestDefinition def, Map map, Point3D loc, HarvestResource resource )
		{
			if ( resource.Types.Length > 0 )
				return resource.Types[Utility.Random( resource.Types.Length )];

			return null;
		}
开发者ID:greeduomacro,项目名称:annox,代码行数:7,代码来源:HarvestSystem.cs

示例5: SendPackFullTo

		public virtual void SendPackFullTo( Mobile from, Item item, HarvestDefinition def, HarvestResource resource )
		{
			def.SendMessageTo( from, def.PackFullMessage );
		}
开发者ID:greeduomacro,项目名称:annox,代码行数:4,代码来源:HarvestSystem.cs

示例6: OnHarvestFinished

		public virtual void OnHarvestFinished( Mobile from, Item tool, HarvestDefinition def, HarvestVein vein, HarvestBank bank, HarvestResource resource, object harvested )
		{
		}
开发者ID:greeduomacro,项目名称:annox,代码行数:3,代码来源:HarvestSystem.cs

示例7: Mining

		private Mining()
		{
			HarvestResource[] res;
			HarvestVein[] veins;

			#region Mining for ore and stone
			HarvestDefinition oreAndStone = m_OreAndStone = new HarvestDefinition();

			// Resource banks are every 8x8 tiles
			oreAndStone.BankWidth = 8;
			oreAndStone.BankHeight = 8;

			// Every bank holds from 10 to 34 ore
			oreAndStone.MinTotal = 10;
			oreAndStone.MaxTotal = 34;

			// A resource bank will respawn its content every 10 to 20 minutes
			oreAndStone.MinRespawn = TimeSpan.FromMinutes( 10.0 );
			oreAndStone.MaxRespawn = TimeSpan.FromMinutes( 20.0 );

			// Skill checking is done on the Mining skill
			oreAndStone.Skill = SkillName.Mining;

			// Set the list of harvestable tiles
			oreAndStone.Tiles = m_MountainAndCaveTiles;

			// Players must be within 2 tiles to harvest
			oreAndStone.MaxRange = 2;

			// One ore per harvest action
			oreAndStone.ConsumedPerHarvest = 1;
			oreAndStone.ConsumedPerFeluccaHarvest = 2;

			// The digging effect
			oreAndStone.EffectActions = new int[]{ 11 };
			oreAndStone.EffectSounds = new int[]{ 0x125, 0x126 };
			oreAndStone.EffectCounts = new int[]{ 1 };
			oreAndStone.EffectDelay = TimeSpan.FromSeconds( 1.6 );
			oreAndStone.EffectSoundDelay = TimeSpan.FromSeconds( 0.9 );

			oreAndStone.NoResourcesMessage = 503040; // There is no metal here to mine.
			oreAndStone.DoubleHarvestMessage = 503042; // Someone has gotten to the metal before you.
			oreAndStone.TimedOutOfRangeMessage = 503041; // You have moved too far away to continue mining.
			oreAndStone.OutOfRangeMessage = 500446; // That is too far away.
			oreAndStone.FailMessage = 503043; // You loosen some rocks but fail to find any useable ore.
			oreAndStone.PackFullMessage = 1010481; // Your backpack is full, so the ore you mined is lost.
			oreAndStone.ToolBrokeMessage = 1044038; // You have worn out your tool!

			res = new HarvestResource[]
				{
					new HarvestResource( 00.0, 00.0, 100.0, 1007072, typeof( IronOre ),			typeof( Granite ) ),
					new HarvestResource( 65.0, 25.0, 105.0, 1007073, typeof( DullCopperOre ),	typeof( DullCopperGranite ),	typeof( DullCopperElemental ) ),
					new HarvestResource( 70.0, 30.0, 110.0, 1007074, typeof( ShadowIronOre ),	typeof( ShadowIronGranite ),	typeof( ShadowIronElemental ) ),
					new HarvestResource( 75.0, 35.0, 115.0, 1007075, typeof( CopperOre ),		typeof( CopperGranite ),		typeof( CopperElemental ) ),
					new HarvestResource( 80.0, 40.0, 120.0, 1007076, typeof( BronzeOre ),		typeof( BronzeGranite ),		typeof( BronzeElemental ) ),
					new HarvestResource( 85.0, 45.0, 125.0, 1007077, typeof( GoldOre ),			typeof( GoldGranite ),			typeof( GoldenElemental ) ),
					new HarvestResource( 90.0, 50.0, 130.0, 1007078, typeof( AgapiteOre ),		typeof( AgapiteGranite ),		typeof( AgapiteElemental ) ),
					new HarvestResource( 95.0, 55.0, 135.0, 1007079, typeof( VeriteOre ),		typeof( VeriteGranite ),		typeof( VeriteElemental ) ),
					new HarvestResource( 99.0, 59.0, 139.0, 1007080, typeof( ValoriteOre ),		typeof( ValoriteGranite ),		typeof( ValoriteElemental ) )
				};

			veins = new HarvestVein[]
				{
					new HarvestVein( 49.6, 0.0, res[0], null   ), // Iron
					new HarvestVein( 11.2, 0.5, res[1], res[0] ), // Dull Copper
					new HarvestVein( 09.8, 0.5, res[2], res[0] ), // Shadow Iron
					new HarvestVein( 08.4, 0.5, res[3], res[0] ), // Copper
					new HarvestVein( 07.0, 0.5, res[4], res[0] ), // Bronze
					new HarvestVein( 05.6, 0.5, res[5], res[0] ), // Gold
					new HarvestVein( 04.2, 0.5, res[6], res[0] ), // Agapite
					new HarvestVein( 02.8, 0.5, res[7], res[0] ), // Verite
					new HarvestVein( 01.4, 0.5, res[8], res[0] )  // Valorite
				};

			oreAndStone.Resources = res;
			oreAndStone.Veins = veins;

			if ( Core.ML )
			{
				oreAndStone.BonusResources = new BonusHarvestResource[]
				{
					new BonusHarvestResource( 0, 99.8998, null, null ),	//Nothing	//Note: Rounded the below to .0167 instead of 1/6th of a %.  Close enough
					new BonusHarvestResource( 100, .0167, 1072562, typeof( BlueDiamond ) ),
					new BonusHarvestResource( 100, .0167, 1072567, typeof( DarkSapphire ) ),
					new BonusHarvestResource( 100, .0167, 1072570, typeof( EcruCitrine ) ),
					new BonusHarvestResource( 100, .0167, 1072564, typeof( FireRuby ) ),
					new BonusHarvestResource( 100, .0167, 1072566, typeof( PerfectEmerald ) ),
					new BonusHarvestResource( 100, .0167, 1072568, typeof( Turquoise ) )
				};
			}

			oreAndStone.RaceBonus = Core.ML;
			oreAndStone.RandomizeVeins = Core.ML;

			Definitions.Add( oreAndStone );
			#endregion

			#region Mining for sand
			HarvestDefinition sand = m_Sand = new HarvestDefinition();

//.........这里部分代码省略.........
开发者ID:brodock,项目名称:genova-project,代码行数:101,代码来源:Mining.cs

示例8: SendSuccessTo

		public override void SendSuccessTo( Mobile from, Item item, HarvestResource resource )
		{
			if ( item is BaseGranite )
				from.SendLocalizedMessage( 1044606 ); // You carefully extract some workable stone from the ore vein!
			else
				base.SendSuccessTo( from, item, resource );
		}
开发者ID:brodock,项目名称:genova-project,代码行数:7,代码来源:Mining.cs

示例9: ClayMining

        private ClayMining()
		{
			HarvestResource[] res;
			HarvestVein[] veins;

            #region Mining for Clay
            HarvestDefinition Clay = m_Clay = new HarvestDefinition();

            // Resource banks are every 8x8 tiles
            Clay.BankWidth = 8;
            Clay.BankHeight = 8;

            // Every bank holds from 6 to 12 Clay
            Clay.MinTotal = 5;
            Clay.MaxTotal = 8;

            // A resource bank will respawn its content every 10 to 20 minutes
            Clay.MinRespawn = TimeSpan.FromMinutes(10.0);
            Clay.MaxRespawn = TimeSpan.FromMinutes(20.0);

            // Skill checking is done on the Mining skill
            Clay.Skill = SkillName.Mining;

            // Set the list of harvestable tiles
            Clay.Tiles = m_SwampTiles;

            // Players must be within 2 tiles to harvest
            Clay.MaxRange = 2;

            // One Clay per harvest action
            Clay.ConsumedPerHarvest = 1;
            Clay.ConsumedPerFeluccaHarvest = 1;

            // The digging effect
            Clay.EffectActions = new int[] { 11 };
            Clay.EffectSounds = new int[] { 0x125, 0x126 };
            Clay.EffectCounts = new int[] { 1 };
            Clay.EffectDelay = TimeSpan.FromSeconds(1.6);
            Clay.EffectSoundDelay = TimeSpan.FromSeconds(0.9);

            Clay.NoResourcesMessage = "There is no Clay here to mine."; // There is no Clay here to mine.
            Clay.DoubleHarvestMessage = "There is no Clay here to mine."; // There is no Clay here to mine.
            Clay.TimedOutOfRangeMessage = "You have moved too far away to continue mining."; // You have moved too far away to continue mining.
            Clay.OutOfRangeMessage = "That is too far away."; // That is too far away.
            Clay.FailMessage = "You dig for a while but fail to find any Clay."; // You dig for a while but fail to find any Clay.
            Clay.PackFullMessage = "Your backpack can't hold the Clay, and it is lost!"; // Your backpack can't hold the Clay, and it is lost!
            Clay.ToolBrokeMessage = 1044038; // You have worn out your tool!

            res = new HarvestResource[]
				{
                    new HarvestResource( 100.0, 85.0, 400.0, "You dig some Clay and put it in your backpack", typeof (Clay)),
				
				};

            veins = new HarvestVein[]
				{
                    new HarvestVein( 100.0, 0.0, res[0], null   ),//Clay
				};

            Clay.Resources = res;
            Clay.Veins = veins;

            Definitions.Add(Clay);
            #endregion
		}
开发者ID:FreeReign,项目名称:imaginenation,代码行数:65,代码来源:ClayMining.cs

示例10: ExoticFishing

		private ExoticFishing()
		{
			HarvestResource[] res;
			HarvestVein[] veins;

			#region ExoticFishing
			HarvestDefinition fish = new HarvestDefinition();

			// Resource banks are every 8x8 tiles
			fish.BankWidth = 1;
			fish.BankHeight = 1;

			// Every bank holds from 1 to 2 fish
			fish.MinTotal = 1;
			fish.MaxTotal = 2;

			// A resource bank will respawn its content every 10 to 20 minutes
			fish.MinRespawn = TimeSpan.FromMinutes( 10.0 );
			fish.MaxRespawn = TimeSpan.FromMinutes( 20.0 );

			// Skill checking is done on the Fishing skill
			fish.Skill = SkillName.Fishing;

			// Set the list of harvestable tiles
			fish.Tiles = m_WaterTiles;
			fish.RangedTiles = true;

			// Players must be within 6 tiles to harvest
			fish.MaxRange = 6;

			// One fish per harvest action
			fish.ConsumedPerHarvest = 1;
			fish.ConsumedPerFeluccaHarvest = 1;

			// The ExoticFishing
			fish.EffectActions = new int[]{ 12 };
			fish.EffectSounds = new int[0];
			fish.EffectCounts = new int[]{ 1 };
			fish.EffectDelay = TimeSpan.Zero;
			fish.EffectSoundDelay = TimeSpan.FromSeconds( 4.0 );

			fish.NoResourcesMessage = 503172; // The fish don't seem to be biting here.
			fish.FailMessage = 503171; // You fish a while, but fail to catch anything.
			fish.TimedOutOfRangeMessage = 500976; // You need to be closer to the water to fish!
			fish.OutOfRangeMessage = 500976; // You need to be closer to the water to fish!
			fish.PackFullMessage = 503176; // You do not have room in your backpack for a fish.
			fish.ToolBrokeMessage = 503174; // You broke your ExoticFishing pole.

			res = new HarvestResource[]
				{
					new HarvestResource( 00.0, 00.0, 100.0, 1043297, typeof( Fish ) ),
                    new HarvestResource(90.0, 10.1, 101.0, "You pull up a butterfly fish!", typeof( Butterflyfish ) ),
                    new HarvestResource(80.0, 20.1, 101.0, "You pull up a baroness butterfly fish!", typeof( BaronessButterflyfish ) ),
                    new HarvestResource(70.0, 80.1, 101.0, "You pull up a copperbanded butterfly fish!", typeof( CopperbandedButterflyfish ) ),
                    new HarvestResource(100.0, 80.1, 101.0, "You pull up an albino angel fish!", typeof( AlbinoAngelfish ) ),
                    new HarvestResource(100.0, 90.0, 101.0, "You pull up an angel fish!", typeof( Angelfish ) )
				};

			veins = new HarvestVein[]
				{
					new HarvestVein( 20.0, 0.0, res[0], null ),
                    new HarvestVein( 20.0, 0.0, res[1], null ), //butterfly 
                    new HarvestVein( 20.0, 0.0, res[2], null ), //baroness
                    new HarvestVein( 20.0, 0.0, res[3], null ), //copper
                    new HarvestVein( 10.0, 0.0, res[4], null ), //albino
                    new HarvestVein( 10.0, 0.0, res[5], null ) //angel
				};

			fish.Resources = res;
			fish.Veins = veins;

			m_Definition = fish;
			Definitions.Add( fish );
			#endregion
		}
开发者ID:FreeReign,项目名称:imaginenation,代码行数:75,代码来源:ExoticFishing.cs

示例11: SendSuccessTo

		public override void SendSuccessTo( Mobile from, Item item, HarvestResource resource )
		{
			if ( item is BigFish )
			{
				from.SendLocalizedMessage( 1042635 ); // Your fishing pole bends as you pull a big fish from the depths!

				((BigFish)item).Fisher = from;
			}
			else
			{
				int number;
				string name;

				if ( item is Fish )
				{
					number = 1008124;
					name = "a fish";
				}
				else if ( item is BaseShoes )
				{
					number = 1008124;
					name = "a piece of junk";
				}

				else
				{
					number = 1043297;

					if ( (item.ItemData.Flags & TileFlag.ArticleA) != 0 )
						name = "a " + item.ItemData.Name;
					else if ( (item.ItemData.Flags & TileFlag.ArticleAn) != 0 )
						name = "an " + item.ItemData.Name;
					else
						name = item.ItemData.Name;
				}

				if ( number == 1043297 )
					from.SendLocalizedMessage( number, name );
				else
					from.SendLocalizedMessage( number, true, name );
			}
		}
开发者ID:FreeReign,项目名称:imaginenation,代码行数:42,代码来源:ExoticFishing.cs

示例12: MutateType

		public override Type MutateType( Type type, Mobile from, Item tool, HarvestDefinition def, Map map, Point3D loc, HarvestResource resource )
		{
			bool deepWater = SpecialFishingNet.FullValidation( map, loc.X, loc.Y );

			double skillBase = from.Skills[SkillName.Fishing].Base;
			double skillValue = from.Skills[SkillName.Fishing].Value;

			for ( int i = 0; i < m_MutateTable.Length; ++i )
			{
				MutateEntry entry = m_MutateTable[i];

				if ( !deepWater && entry.m_DeepWater )
					continue;

				if ( skillBase >= entry.m_ReqSkill )
				{
					double chance = (skillValue - entry.m_MinSkill) / (entry.m_MaxSkill - entry.m_MinSkill);

					if ( chance > Utility.RandomDouble() )
						return entry.m_Types[Utility.Random( entry.m_Types.Length )];
				}
			}

			return type;
		}
开发者ID:FreeReign,项目名称:imaginenation,代码行数:25,代码来源:ExoticFishing.cs

示例13: Fishing

        private Fishing()
        {
            HarvestResource[] res;
            HarvestVein[] veins;

            #region Fishing
            HarvestDefinition fish = new HarvestDefinition();

            fish.PlaceAtFeetIfFull = true;

            // Resource banks are every 8x8 tiles
            fish.BankWidth = 8;
            fish.BankHeight = 8;

            fish.MinTotal = 0;
            fish.MaxTotal = 10;

            fish.MinRespawn = TimeSpan.FromMinutes( 10.0 );
            fish.MaxRespawn = TimeSpan.FromMinutes( 20.0 );

            // Skill checking is done on the Fishing skill
            fish.Skill = SkillName.Fishing;

            // Set the list of harvestable tiles
            fish.Tiles = m_WaterTiles;
            fish.RangedTiles = true;

            // Players must be within 4 tiles to harvest
            fish.MaxRange = 5;

            // One fish per harvest action
            fish.ConsumedPerHarvest = 1;
            fish.ConsumedPerFeluccaHarvest = 1;

            // The fishing
            fish.EffectActions = new int[]{ 12 };
            fish.EffectSounds = new int[0];
            fish.EffectCounts = new int[]{ 1 };
            fish.EffectDelay = TimeSpan.Zero;
            fish.EffectSoundDelay = TimeSpan.FromSeconds( 8.0 );

            fish.NoResourcesMessage = 503172; // The fish don't seem to be biting here.
            fish.FailMessage = 503171; // You fish a while, but fail to catch anything.
            fish.TimedOutOfRangeMessage = 500976; // You need to be closer to the water to fish!
            fish.OutOfRangeMessage = 500976; // You need to be closer to the water to fish!
            //fish.PackFullMessage = 503176; // You do not have room in your backpack for a fish.
            fish.ToolBrokeMessage = 503174; // You broke your fishing pole.

            res = new HarvestResource[]
                {
                    new HarvestResource( 00.0, 00.0, 100.0, 1043297, typeof( Fish ) )
                };

            veins = new HarvestVein[]
                {
                    new HarvestVein( 100.0, 0.0, res[0], null )
                };

            fish.Resources = res;
            fish.Veins = veins;

            m_Definition = fish;
            Definitions.Add( fish );
            #endregion
        }
开发者ID:FreeReign,项目名称:Rebirth-Repack,代码行数:65,代码来源:Fishing.cs

示例14: GetResourceType

        public override Type GetResourceType(Mobile from, Item tool, HarvestDefinition def, Map map, Point3D loc, HarvestResource resource)
        {
            if (def == this.m_OreAndStone)
            {
                #region Void Pool Items
                HarvestMap hmap = HarvestMap.CheckMapOnHarvest(from, loc, def);

                if (hmap != null && hmap.Resource >= CraftResource.Iron && hmap.Resource <= CraftResource.Valorite)
                {
                    hmap.UsesRemaining--;
                    hmap.InvalidateProperties();

                    CraftResourceInfo info = CraftResources.GetInfo(hmap.Resource);

                    if (info != null)
                        return info.ResourceTypes[1];
                }
                #endregion

                PlayerMobile pm = from as PlayerMobile;

                if (pm != null && pm.GemMining && pm.ToggleMiningGem && from.Skills[SkillName.Mining].Base >= 100.0 && 0.1 > Utility.RandomDouble())
                    return Loot.RandomGem().GetType();

                if (pm != null && pm.StoneMining && pm.ToggleMiningStone && from.Skills[SkillName.Mining].Base >= 100.0 && 0.15 > Utility.RandomDouble())
                    return resource.Types[1];

                return resource.Types[0];
            }

            return base.GetResourceType(from, tool, def, map, loc, resource);
        }
开发者ID:Crome696,项目名称:ServUO,代码行数:32,代码来源:Mining.cs

示例15: MutateResource

        public virtual HarvestResource MutateResource( Mobile from, Item tool, HarvestDefinition def, Map map, Point3D loc, HarvestVein vein, HarvestResource primary, HarvestResource fallback )
        {
            if ( vein.ChanceToFallback > Utility.RandomDouble() )
                return fallback;

            double skillValue = from.Skills[def.Skill].Value;

            if ( fallback != null && (skillValue < primary.ReqSkill || skillValue < primary.MinSkill) )
                return fallback;

            return primary;
        }
开发者ID:justdanofficial,项目名称:khaeros,代码行数:12,代码来源:HarvestSystem.cs


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