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


C# Harvest.HarvestBank类代码示例

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


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


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