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

C# Harvest.HarvestDefinition类代码示例

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

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



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

示例1: Consume

        public void Consume(HarvestDefinition def, int amount, Mobile from)
        {
            CheckRespawn();

            if (m_Current == m_Maximum)
            {
                double min = def.MinRespawn.TotalMinutes;
                double max = def.MaxRespawn.TotalMinutes;
                double rnd = Utility.RandomDouble();

                m_Current = m_Maximum - amount;

                double minutes = min + (rnd * (max - min));
                if (def.RaceBonus && from.Race == Race.Elf)	//def.RaceBonus = Core.ML
                    minutes *= .75;	//25% off the time.  

                m_NextRespawn = DateTime.Now + TimeSpan.FromMinutes(minutes);
            }
            else
            {
                m_Current -= amount;
            }

            if (m_Current < 0)
                m_Current = 0;
        }
开发者ID:FreeReign,项目名称:imaginenation,代码行数:26,代码来源:HarvestBank.cs


示例2: HarvestBank

 public HarvestBank( HarvestDefinition def, HarvestVein defaultVein )
 {
     m_Maximum = Utility.RandomMinMax( def.MinTotal, def.MaxTotal );
     m_Current = m_Maximum;
     m_DefaultVein = defaultVein;
     m_Vein = m_DefaultVein;
 }
开发者ID:BackupTheBerlios,项目名称:sunuo-svn,代码行数:7,代码来源:HarvestBank.cs


示例3: CheckRange

		public virtual bool CheckRange( Mobile from, Item tool, HarvestDefinition def, Map map, Point3D loc, bool timed )
		{
			bool inRange = ( from.Map == map && from.InRange( loc, def.MaxRange ) );

			if ( !inRange )
				def.SendMessageTo( from, timed ? def.TimedOutOfRangeMessage : def.OutOfRangeMessage );

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


示例4: Fishing

		private Fishing()
		{
			#region Fishing
			var fish = new HarvestDefinition
			{
				// Resource banks are every 8x8 tiles
				BankWidth = 8,
				BankHeight = 8,
				// Every bank holds from 5 to 15 fish
				MinTotal = 5,
				MaxTotal = 15,
				// A resource bank will respawn its content every 15 to 25 minutes
				MinRespawn = TimeSpan.FromMinutes(15.0),
				MaxRespawn = TimeSpan.FromMinutes(25.0),
				// Skill checking is done on the Fishing skill
				Skill = SkillName.Fishing,
				// Set the list of harvestable tiles
				Tiles = m_WaterTiles,
				// Players must be within N tiles to harvest
				RangedTiles = true,
				MaxRange = 3,
				// One fish per harvest action
				ConsumedPerHarvest = 1,
				ConsumedPerFeluccaHarvest = 1,
				// The fishing
				EffectActions = new[] {12},
				EffectSounds = new int[0],
				EffectCounts = new[] {1},
				EffectDelay = TimeSpan.Zero,
				EffectSoundDelay = TimeSpan.FromSeconds(8.0),
				NoResourcesMessage = 503172,
				FailMessage = 503171,
				TimedOutOfRangeMessage = 500976,
				OutOfRangeMessage = 500976,
				PackFullMessage = 503176,
				ToolBrokeMessage = 503174
			};

			var res = new[] {new HarvestResource(Expansion.None, 00.0, 00.0, 120.0, 1043297, typeof(Fish))};

			var veins = new[] {new HarvestVein(Expansion.None, 120.0, 0.0, res[0], null)};

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

			fish.PlaceAtFeetIfFull = true;

			fish.BonusResources = new[]
			{
				new BonusHarvestResource(Expansion.ML, 0, 99.4, null, null), //set to same chance as mining ml gems
				new BonusHarvestResource(Expansion.ML, 80.0, 0.6, 1072597, typeof(WhitePearl))
			};

			Fish = fish;
			Definitions.Add(Fish);
			#endregion
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:57,代码来源:Fishing.cs


示例5: HarvestSoundTimer

		public HarvestSoundTimer( Mobile from, Item tool, HarvestSystem system, HarvestDefinition def, object toHarvest, object locked, bool last ) : base( def.EffectSoundDelay )
		{
			m_From = from;
			m_Tool = tool;
			m_System = system;
			m_Definition = def;
			m_ToHarvest = toHarvest;
			m_Locked = locked;
			m_Last = last;
		}
开发者ID:Godkong,项目名称:RunUO,代码行数:10,代码来源:HarvestSoundTimer.cs


示例6: HarvestTimer

		public HarvestTimer( Mobile from, Item tool, HarvestSystem system, HarvestDefinition def, object toHarvest, object locked ) : base( TimeSpan.Zero, def.EffectDelay )
		{
			m_From = from;
			m_Tool = tool;
			m_System = system;
			m_Definition = def;
			m_ToHarvest = toHarvest;
			m_Locked = locked;
			m_Count = Utility.RandomList( def.EffectCounts );
		}
开发者ID:zerodowned,项目名称:angelisland,代码行数:10,代码来源:HarvestTimer.cs


示例7: HarvestBank

        public HarvestBank( HarvestDefinition def, HarvestVein defaultVein, double chanceToFallback )
        {
            m_Maximum = Utility.RandomMinMax( def.MinTotal, def.MaxTotal );
            m_Current = m_Maximum;
            m_DefaultVein = defaultVein;
            m_Vein = m_DefaultVein;
            m_ChanceToFallback = chanceToFallback;

            m_Definition = def;
        }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:10,代码来源:HarvestBank.cs


示例8: CheckResources

		public virtual bool CheckResources( Mobile from, Item tool, HarvestDefinition def, Map map, Point3D loc, bool timed )
		{
			HarvestBank bank = def.GetBank( map, loc.X, loc.Y );
			bool available = ( bank != null && bank.Current >= def.ConsumedPerHarvest );

			if ( !available )
				def.SendMessageTo( from, timed ? def.DoubleHarvestMessage : def.NoResourcesMessage );

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


示例9: GetLock

 public virtual object GetLock(Mobile from, Item tool, HarvestDefinition def, object toHarvest)
 {
     /* Here we prevent multiple harvesting.
     * 
     * Some options:
     *  - 'return tool;' : This will allow the player to harvest more than once concurrently, but only if they use multiple tools. This seems to be as OSI.
     *  - 'return GetType();' : This will disallow multiple harvesting of the same type. That is, we couldn't mine more than once concurrently, but we could be both mining and lumberjacking.
     *  - 'return typeof( HarvestSystem );' : This will completely restrict concurrent harvesting.
     */
     return tool;
 }
开发者ID:mcarriere,项目名称:ServUO,代码行数:11,代码来源:HarvestSystem.cs


示例10: HarvestTimer

        public HarvestTimer(Mobile from, Item tool, HarvestSystem system, HarvestDefinition def, object toHarvest, object locked)
            : base(TimeSpan.Zero, def.EffectDelay)
        {
            m_From = from;
            m_Tool = tool;
            m_System = system;
            m_Definition = def;
            m_ToHarvest = toHarvest;
            m_Locked = locked;
            //m_Count = Utility.RandomList( def.EffectCounts );
            m_Count = 1 + Utility.Random(1, 5);

            //Update the action
            if (from is PlayerMobile)
                ((PlayerMobile)from).ResetPlayerAction(this);
        }
开发者ID:FreeReign,项目名称:imaginenation,代码行数:16,代码来源:HarvestTimer.cs


示例11: Consume

        public void Consume( HarvestDefinition def, int amount )
        {
            CheckRespawn();

            if ( m_Current == m_Maximum )
            {
                int min = (int)def.MinRespawn.TotalSeconds;
                int max = (int)def.MaxRespawn.TotalSeconds;

                m_Current = m_Maximum - amount;
                m_NextRespawn = DateTime.Now + TimeSpan.FromSeconds( Utility.RandomMinMax( min, max ) );
            }
            else
            {
                m_Current -= amount;
            }

            if ( m_Current < 0 )
                m_Current = 0;
        }
开发者ID:FreeReign,项目名称:Rebirth-Repack,代码行数:20,代码来源:HarvestBank.cs


示例12: Consume

		public void Consume( HarvestDefinition def, int amount )
		{
			CheckRespawn();

			if ( m_Current == m_Maximum )
			{
				double min = def.MinRespawn.TotalMinutes;
				double max = def.MaxRespawn.TotalMinutes;
				double rnd = Utility.RandomDouble();

				m_Current = m_Maximum - amount;
				m_NextRespawn = DateTime.Now + TimeSpan.FromMinutes( min + (rnd * (max - min)) );
			}
			else
			{
				m_Current -= amount;
			}

			if ( m_Current < 0 )
				m_Current = 0;
		}
开发者ID:zerodowned,项目名称:angelisland,代码行数:21,代码来源:HarvestBank.cs


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


示例14: DoHarvestingEffect

		public virtual void DoHarvestingEffect( Mobile from, Item tool, HarvestDefinition def, Map map, Point3D loc )
		{
			from.Direction = from.GetDirectionTo( loc );

			if ( !from.Mounted )
				from.Animate( Utility.RandomList( def.EffectActions ), 5, 1, true, false, 0 );
		}
开发者ID:greeduomacro,项目名称:annox,代码行数:7,代码来源:HarvestSystem.cs


示例15: Lumberjacking

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

            #region Lumberjacking
            HarvestDefinition lumber = new HarvestDefinition();

            // Resource banks are every 4x3 tiles
            lumber.BankWidth = 4;
            lumber.BankHeight = 3;

            // Every bank holds from 20 to 45 logs
            lumber.MinTotal = 20;
            lumber.MaxTotal = 45;

            // A resource bank will respawn its content every 20 to 30 minutes
            lumber.MinRespawn = TimeSpan.FromMinutes(20.0);
            lumber.MaxRespawn = TimeSpan.FromMinutes(30.0);

            // Skill checking is done on the Lumberjacking skill
            lumber.Skill = SkillName.Lumberjacking;

            // Set the list of harvestable tiles
            lumber.Tiles = m_TreeTiles;

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

            // Ten logs per harvest action
            lumber.ConsumedPerHarvest = 10;
            lumber.ConsumedPerFeluccaHarvest = 20;

            // The chopping effect
            lumber.EffectActions = new int[] { 13 };
            lumber.EffectSounds = new int[] { 0x13E };
            lumber.EffectCounts = (Core.AOS ? new int[] { 1 } : new int[] { 1, 2, 2, 2, 3 });
            lumber.EffectDelay = TimeSpan.FromSeconds(1.6);
            lumber.EffectSoundDelay = TimeSpan.FromSeconds(0.9);

            lumber.NoResourcesMessage = 500493; // There's not enough wood here to harvest.
            lumber.FailMessage = 500495; // You hack at the tree for a while, but fail to produce any useable wood.
            lumber.OutOfRangeMessage = 500446; // That is too far away.
            lumber.PackFullMessage = 500497; // You can't place any wood into your backpack!
            lumber.ToolBrokeMessage = 500499; // You broke your axe.

            if (Core.ML)
            {
                res = new HarvestResource[]
                {
                    new HarvestResource(00.0, 00.0, 100.0, 1072540, typeof(Log)),
                    new HarvestResource(65.0, 25.0, 105.0, 1072541, typeof(OakLog)),
                    new HarvestResource(80.0, 40.0, 120.0, 1072542, typeof(AshLog)),
                    new HarvestResource(95.0, 55.0, 135.0, 1072543, typeof(YewLog)),
                    new HarvestResource(100.0, 60.0, 140.0, 1072544, typeof(HeartwoodLog)),
                    new HarvestResource(100.0, 60.0, 140.0, 1072545, typeof(BloodwoodLog)),
                    new HarvestResource(100.0, 60.0, 140.0, 1072546, typeof(FrostwoodLog)),
                };

                veins = new HarvestVein[]
                {
                    new HarvestVein(49.0, 0.0, res[0], null), // Ordinary Logs
                    new HarvestVein(30.0, 0.5, res[1], res[0]), // Oak
                    new HarvestVein(10.0, 0.5, res[2], res[0]), // Ash
                    new HarvestVein(05.0, 0.5, res[3], res[0]), // Yew
                    new HarvestVein(03.0, 0.5, res[4], res[0]), // Heartwood
                    new HarvestVein(02.0, 0.5, res[5], res[0]), // Bloodwood
                    new HarvestVein(01.0, 0.5, res[6], res[0]), // Frostwood
                };

                lumber.BonusResources = new BonusHarvestResource[]
                {
                    new BonusHarvestResource(0, 83.9, null, null), //Nothing
                    new BonusHarvestResource(100, 10.0, 1072548, typeof(BarkFragment)),
                    new BonusHarvestResource(100, 03.0, 1072550, typeof(LuminescentFungi)),
                    new BonusHarvestResource(100, 02.0, 1072547, typeof(SwitchItem)),
                    new BonusHarvestResource(100, 01.0, 1072549, typeof(ParasiticPlant)),
                    new BonusHarvestResource(100, 00.1, 1072551, typeof(BrilliantAmber))
                };
            }
            else
            {
                res = new HarvestResource[]
                {
                    new HarvestResource(00.0, 00.0, 100.0, 500498, typeof(Log))
                };

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

            lumber.Resources = res;
            lumber.Veins = veins;

            lumber.RaceBonus = Core.ML;
            lumber.RandomizeVeins = Core.ML;

            this.m_Definition = lumber;
//.........这里部分代码省略.........
开发者ID:FreeReign,项目名称:forkuo,代码行数:101,代码来源:Lumberjacking.cs


示例16: CheckHarvest

		public virtual bool CheckHarvest( Mobile from, Item tool, HarvestDefinition def, object toHarvest )
		{
			return CheckTool( from, tool );
		}
开发者ID:greeduomacro,项目名称:annox,代码行数:4,代码来源:HarvestSystem.cs


示例17: DoHarvestingSound

		public virtual void DoHarvestingSound( Mobile from, Item tool, HarvestDefinition def, object toHarvest )
		{
			if ( def.EffectSounds.Length > 0 )
				from.PlaySound( Utility.RandomList( def.EffectSounds ) );
		}
开发者ID:greeduomacro,项目名称:annox,代码行数:5,代码来源:HarvestSystem.cs


示例18: MutateResource

		public virtual HarvestResource MutateResource( Mobile from, Item tool, HarvestDefinition def, Map map, Point3D loc, HarvestVein vein, HarvestResource primary, HarvestResource fallback )
		{
			bool racialBonus = (def.RaceBonus && from.Race == Race.Elf );

			if( vein.ChanceToFallback > (Utility.RandomDouble() + (racialBonus ? .20 : 0)) )
				return fallback;

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

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

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


示例19: OnHarvesting

		public virtual bool OnHarvesting( Mobile from, Item tool, HarvestDefinition def, object toHarvest, object locked, bool last )
		{
			if ( !CheckHarvest( from, tool ) )
			{
				from.EndAction( locked );
				return false;
			}

			int tileID;
			Map map;
			Point3D loc;

			if ( !GetHarvestDetails( from, tool, toHarvest, out tileID, out map, out loc ) )
			{
				from.EndAction( locked );
				OnBadHarvestTarget( from, tool, toHarvest );
				return false;
			}
			else if ( !def.Validate( tileID ) )
			{
				from.EndAction( locked );
				OnBadHarvestTarget( from, tool, toHarvest );
				return false;
			}
			else if ( !CheckRange( from, tool, def, map, loc, true ) )
			{
				from.EndAction( locked );
				return false;
			}
			else if ( !CheckResources( from, tool, def, map, loc, true ) )
			{
				from.EndAction( locked );
				return false;
			}
			else if ( !CheckHarvest( from, tool, def, toHarvest ) )
			{
				from.EndAction( locked );
				return false;
			}

			DoHarvestingEffect( from, tool, def, map, loc );

			new HarvestSoundTimer( from, tool, this, def, toHarvest, locked, last ).Start();

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


示例20: MutateType

		public virtual Type MutateType( Type type, Mobile from, Item tool, HarvestDefinition def, Map map, Point3D loc, HarvestResource resource )
		{
			return from.Region.GetResource( type );
		}
开发者ID:greeduomacro,项目名称:annox,代码行数:4,代码来源:HarvestSystem.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
C# Harvest.HarvestResource类代码示例发布时间:2022-05-26
下一篇:
C# Harvest.HarvestBank类代码示例发布时间: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