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

C# Harvest.HarvestBank类代码示例

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

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



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

示例1: GetBank

		public HarvestBank GetBank( Map map, int x, int y )
		{
			if ( map == null || map == Map.Internal )
				return null;

			x /= m_BankWidth;
			y /= m_BankHeight;

			Hashtable banks = (Hashtable)m_BanksByMap[map];

			if ( banks == null )
				m_BanksByMap[map] = banks = new Hashtable();

			Point2D key = new Point2D( x, y );
			HarvestBank bank = (HarvestBank)banks[key];

			if ( bank == null )
				banks[key] = bank = new HarvestBank( this, GetVeinAt( map, x, y ) );

			return bank;
		}
开发者ID:greeduomacro,项目名称:unknown-shard-1,代码行数:21,代码来源:HarvestDefinition.cs


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


示例3: GetBank

		public HarvestBank GetBank( Map map, int x, int y )
		{
			if ( map == null || map == Map.Internal )
				return null;

			x /= m_BankWidth;
			y /= m_BankHeight;

			Dictionary<Point2D, HarvestBank> banks = null;
			m_BanksByMap.TryGetValue( map, out banks );

			if ( banks == null )
				m_BanksByMap[map] = banks = new Dictionary<Point2D, HarvestBank>();

			Point2D key = new Point2D( x, y );
			HarvestBank bank = null;
			banks.TryGetValue( key, out bank );

			if ( bank == null )
				banks[key] = bank = new HarvestBank( this, GetVeinAt( map, x, y ) );

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


示例4: OnHarvestFinished

		public override void OnHarvestFinished( Mobile from, Item tool, HarvestDefinition def, HarvestVein vein, HarvestBank bank, HarvestResource resource, object harvested )
		{
			if ( tool is GargoylesPickaxe && def == m_OreAndStone && 0.1 > Utility.RandomDouble() )
			{
				HarvestResource res = vein.PrimaryResource;

				if ( res == resource && res.Types.Length >= 3 )
				{
					try
					{
						Map map = from.Map;

						if ( map == null )
							return;

						BaseCreature spawned = Activator.CreateInstance( res.Types[2], new object[]{ 25 } ) as BaseCreature;

						if ( spawned != null )
						{
							int offset = Utility.Random( 8 ) * 2;

							for ( int i = 0; i < m_Offsets.Length; i += 2 )
							{
								int x = from.X + m_Offsets[(offset + i) % m_Offsets.Length];
								int y = from.Y + m_Offsets[(offset + i + 1) % m_Offsets.Length];

								if ( map.CanSpawnMobile( x, y, from.Z ) )
								{
									spawned.MoveToWorld( new Point3D( x, y, from.Z ), map );
									spawned.Combatant = from;
									return;
								}
								else
								{
									int z = map.GetAverageZ( x, y );

									if ( map.CanSpawnMobile( x, y, z ) )
									{
										spawned.MoveToWorld( new Point3D( x, y, z ), map );
										spawned.Combatant = from;
										return;
									}
								}
							}

							spawned.MoveToWorld( from.Location, from.Map );
							spawned.Combatant = from;
						}
					}
					catch
					{
					}
				}
			}
		}
开发者ID:brodock,项目名称:genova-project,代码行数:55,代码来源:Mining.cs


示例5: MutateVein

		public override HarvestVein MutateVein( Mobile from, Item tool, HarvestDefinition def, HarvestBank bank, object toHarvest, HarvestVein vein )
		{
			if ( tool is GargoylesPickaxe && def == m_OreAndStone )
			{
				int veinIndex = Array.IndexOf( def.Veins, vein );

				if ( veinIndex >= 0 && veinIndex < (def.Veins.Length - 1) )
					return def.Veins[veinIndex + 1];
			}

			return base.MutateVein( from, tool, def, bank, toHarvest, vein );
		}
开发者ID:brodock,项目名称:genova-project,代码行数:12,代码来源:Mining.cs


示例6: OnHarvestFinished

                public override void OnHarvestFinished(Mobile from, Item tool, HarvestDefinition def, HarvestVein vein, HarvestBank bank, HarvestResource resource, object harvested)
                {
                    HarvestResource res = vein.PrimaryResource;

                    if (res == resource && res.Types.Length >= 3)
                    {
                        try
                        {
                            Map map = from.Map;

                            if (map == null)
                                return;
                        }
                        catch
                        {
                        }
                    }
                }
开发者ID:FreeReign,项目名称:imaginenation,代码行数:18,代码来源:ClayMining.cs


示例7: OnHarvestFinished

        public override void OnHarvestFinished(Mobile from, Item tool, HarvestDefinition def, HarvestVein vein, HarvestBank bank, HarvestResource resource, object harvested)
        {
            base.OnHarvestFinished(from, tool, def, vein, bank, resource, harvested);

            if (Core.ML)
                from.RevealingAction();
        }
开发者ID:Tukaramdas,项目名称:ServUO-EC-Test-Fork,代码行数:7,代码来源:Fishing.cs


示例8: MutateVein

 public override HarvestVein MutateVein( Mobile from, Item tool, HarvestDefinition def, HarvestBank bank, object toHarvest, HarvestVein vein )
 {
     return base.MutateVein( from, tool, def, bank, toHarvest, vein );
 }
开发者ID:jsrn,项目名称:MidnightWatchServer,代码行数:4,代码来源:Treasure.cs


示例9: OnHarvestFinished

		public override void OnHarvestFinished( Mobile from, Item tool, HarvestDefinition def, HarvestVein vein, HarvestBank bank, HarvestResource resource, object harvested )
		{
			base.OnHarvestFinished( from, tool, def, vein, bank, resource, harvested );

			if( tool is YewAxe && def == m_Definition && 0.10 >= Utility.RandomDouble() )
			{
				HarvestResource res = vein.PrimaryResource;

				if( res == resource )
				{
					try
					{
						Map map = from.Map;

						if( map == null || map == Map.Internal )
							return;

						BaseCreature spawned = Activator.CreateInstance( typeof( Reaper ) ) as BaseCreature;

						if( spawned != null )
						{
							int offset = Utility.Random( 4 ) * 2;

							for( int i = 0; i < m_Offsets.Length; i++ )
							{
								int x = from.X + m_Offsets[(offset + i) % m_Offsets.Length];
								int y = from.Y + m_Offsets[(offset + i + 1) % m_Offsets.Length];
								int z = (map.CanSpawnMobile( x, y, from.Z ) ? from.Z : map.GetAverageZ( x, y ));

								if( !map.CanSpawnMobile( x, y, z ) )
								{
									x = from.X;
									y = from.Y;
									z = from.Z;
								}

								if( map.CanSpawnMobile( x, y, z ) )
								{
									spawned.OnBeforeSpawn( new Point3D( x, y, z ), map );
									spawned.MoveToWorld( new Point3D( x, y, z ), map );
									spawned.Combatant = from;

									from.SendMessage( "You have awoken a spirit tree!" );
									break;
								}
							}
						}
					}
					catch { }
				}
			}
		}
开发者ID:greeduomacro,项目名称:hubroot,代码行数:52,代码来源:Lumberjacking.cs


示例10: HasBeenChecked

        public static bool HasBeenChecked(HarvestBank bank)
        {
            if (m_BankTable.ContainsKey(bank) && m_BankTable[bank] < DateTime.UtcNow)
                m_BankTable.Remove(bank);

            return m_BankTable.ContainsKey(bank);
        }
开发者ID:Crome696,项目名称:ServUO,代码行数:7,代码来源:Niter.cs


示例11: OnHarvestFinished

		public override void OnHarvestFinished( Mobile from, Item tool, HarvestDefinition def, HarvestVein vein, HarvestBank bank, HarvestResource resource, object harvested )
		{
			if ( tool is GargoylesPickaxe && def == m_OreAndStone && 0.1 > Utility.RandomDouble() )
			{
				HarvestResource res = vein.PrimaryResource;

				if ( res == resource && res.Types.Length >= 3 )
				{
					try
					{
						Map map = from.Map;

						if ( map == null )
							return;

						BaseCreature spawned = Activator.CreateInstance( res.Types[2], new object[]{ 25 } ) as BaseCreature;

						if ( spawned != null )
						{
							int offset = Utility.Random( 8 ) * 2;

							for ( int i = 0; i < m_Offsets.Length; i += 2 )
							{
								int x = from.X + m_Offsets[(offset + i) % m_Offsets.Length];
								int y = from.Y + m_Offsets[(offset + i + 1) % m_Offsets.Length];

								if ( map.CanSpawnMobile( x, y, from.Z ) )
								{
                                    spawned.OnBeforeSpawn(new Point3D(x, y, from.Z), map);
									spawned.MoveToWorld( new Point3D( x, y, from.Z ), map );
									spawned.Combatant = from;
									return;
								}
								else
								{
									int z = map.GetAverageZ( x, y );

									if ( map.CanSpawnMobile( x, y, z ) )
									{
                                        spawned.OnBeforeSpawn(new Point3D(x, y, z), map);
										spawned.MoveToWorld( new Point3D( x, y, z ), map );
										spawned.Combatant = from;
										return;
									}
								}
							}
                            spawned.OnBeforeSpawn(from.Location, from.Map);
							spawned.MoveToWorld( from.Location, from.Map );
							spawned.Combatant = from;
						}
					}
					catch
					{
					}
				}
			}

            if (bank != null && bank.Vein != null && bank.Vein.PrimaryResource != null)
            {
                int bankAmount = bank.Current;
                double skillReq = bank.Vein.PrimaryResource.ReqSkill;

                if (skillReq >= 99.0 && bankAmount <= 13)
                    bank.Consume(def, bankAmount, from);
                else if (skillReq >= 98.0 && bankAmount <= 12)
                    bank.Consume(def, bankAmount, from);
                else if (skillReq >= 97.0 && bankAmount <= 10)
                    bank.Consume(def, bankAmount, from);
                else if (skillReq >= 90.0 && bankAmount <= 8)
                    bank.Consume(def, bankAmount, from);
                else if (skillReq >= 75.0 && bankAmount <= 6)
                    bank.Consume(def, bankAmount, from);
                else if (skillReq >= 65.0 && bankAmount <= 4)
                    bank.Consume(def, bankAmount, from);
            }
		}
开发者ID:FreeReign,项目名称:imaginenation,代码行数:76,代码来源:Mining.cs


示例12: OnHarvestFinished

        public override void OnHarvestFinished(Mobile from, Item tool, HarvestDefinition def, HarvestVein vein, HarvestBank bank, HarvestResource resource, object harvested)
        {
            if (tool is DeepSeaFishingPole)
                ((DeepSeaFishingPole)tool).Charges--;

            base.OnHarvestFinished(from, tool, def, vein, bank, resource, harvested);

            if (Core.ML)
                from.RevealingAction();
        }
开发者ID:FreeReign,项目名称:imaginenation,代码行数:10,代码来源:Fishing.cs


示例13: CheckMutateVein

        public void CheckMutateVein(Mobile from, HarvestDefinition def, HarvestBank bank, HarvestVein vein)
        {
            if (vein.PrimaryResource.ReqSkill > from.Skills[def.Skill].Base)
            {
                vein = def.Veins[0];
                bank.Vein = vein;
            }

            //while (vein.PrimaryResource.ReqSkill > from.Skills[def.Skill].Base)
            //{
            //    int maxVal = (int)(def.Veins[0].PrimaryResource.ReqSkill*100);
            //    int minVal = (int)(def.Veins[def.Veins.Length - 1].PrimaryResource.ReqSkill * 100);

            //    double spawnChance = Utility.RandomMinMax(minVal, maxVal);
                
            //    //Convert the random number into percent
            //    spawnChance /= 100;

            //    for (int i = def.Veins.Length - 1; i >= 0; i--)
            //    {
            //        if (def.Veins[i].VeinChance >= spawnChance)
            //        {
            //            vein = def.Veins[i];
            //            bank.Vein = vein;
            //            break;
            //        }
            //    }
            //}
        }
开发者ID:FreeReign,项目名称:imaginenation,代码行数:29,代码来源:HarvestSystem.cs


示例14: InternalTimer

 public InternalTimer(Mobile from, HarvestBank bank, int maxCount)
     : base(TimeSpan.Zero, TimeSpan.FromSeconds(1.0), maxCount)
 {
     m_From = from;
     m_Bank = bank;
     m_Count = 0;
     m_MaxCount = maxCount;
 }
开发者ID:FreeReign,项目名称:imaginenation,代码行数:8,代码来源:BladedItemTarget.cs


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


示例16: MutateVein

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


示例17: AddBank

        public static void AddBank(HarvestBank bank)
        {
            if (bank == null)
                return;

            m_BankTable[bank] = DateTime.UtcNow + TimeSpan.FromMinutes(5);
        }
开发者ID:Crome696,项目名称:ServUO,代码行数:7,代码来源:Niter.cs



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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