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


C# PlayerMobile.InRegion方法代码示例

本文整理汇总了C#中Server.Mobiles.PlayerMobile.InRegion方法的典型用法代码示例。如果您正苦于以下问题:C# PlayerMobile.InRegion方法的具体用法?C# PlayerMobile.InRegion怎么用?C# PlayerMobile.InRegion使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Server.Mobiles.PlayerMobile的用法示例。


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

示例1: OnTeleported

		protected virtual void OnTeleported(PlayerMobile pm, Point3D oldLocation, Map oldMap)
		{
			if (pm == null || pm.Deleted)
			{
				return;
			}

			if (State == PvPBattleState.Internal || Hidden)
			{
				return;
			}

			if ((pm.InRegion(BattleRegion) || pm.InRegion(SpectateRegion)) && (IsParticipant(pm) || IsSpectator(pm)))
			{
				Negate(pm);
			}
		}
开发者ID:rokann,项目名称:JustUO,代码行数:17,代码来源:Battle_Actions.cs

示例2: CanView

		public static bool CanView(PlayerMobile target)
		{
			return target != null && !target.Deleted // Sanity
				   && !IsCamera(target) // No Cams
				   && target.Map != null && target.Map != Map.Internal // No Invalid Maps
				   && target.IsOnline() // Online Only
				   && target.InCombat(TimeSpan.FromSeconds(60.0)) // Combat Heat Only
				   && (DateTime.UtcNow - target.LastMoveTime).TotalSeconds < 60.0 // Has Moved
				   && !target.InRegion<HouseRegion>() && !target.InRegion<Jail>() // No Houses or Jail
				   && !RegionBlackList.Any(target.InRegion); // No Blacklisted Regions (By Name)
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:11,代码来源:ActionCams.cs

示例3: AssignCams

		public static void AssignCams(PlayerMobile target, bool idleCams)
		{
			if (target == null || !CanView(target))
			{
				return;
			}

			DateTime now = DateTime.UtcNow;

			// Process battle cams and return, if they are in the pvp region.
			if (target.InRegion<PvPBattleRegion>())
			{
				const double idleSeconds = 5.0;

				foreach (KeyValuePair<PlayerMobile, DateTime> kv in DeathCamsEvents.ToArray())
				{
					PlayerMobile cam = kv.Key;
					DateTime time = kv.Value;

					if (now > time && !idleCams)
					{
						CurrentlyViewing.AddOrReplace(cam, target);
						DeathCamsEvents[cam] = now.AddSeconds(idleSeconds);
					}
					else if (now > time.AddSeconds(idleSeconds) && idleCams)
					{
						// if cam has been idling for longer than normal

						CurrentlyViewing.AddOrReplace(cam, target);
						DeathCamsEvents[cam] = now; // assign right away if primary threshhold is met
					}
				}
			}
			else
			{
				const double idleSeconds = 15.0;

				// Normal (non-battle)
				foreach (KeyValuePair<PlayerMobile, DateTime> kv in DeathCams.ToArray())
				{
					PlayerMobile cam = kv.Key;
					DateTime time = kv.Value;

					if (now > time && !idleCams)
					{
						CurrentlyViewing.AddOrReplace(cam, target);
						DeathCams[cam] = now.AddSeconds(idleSeconds);
					}
					else if (now > time.AddSeconds(idleSeconds) && idleCams)
					{
						// if cam has been idling for longer than normal

						CurrentlyViewing.AddOrReplace(cam, target);
						DeathCams[cam] = now; // assign right away if primary threshhold is met
					}
				}
			}
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:58,代码来源:ActionCams.cs

示例4: InvalidateSolidHueOverride

		public virtual void InvalidateSolidHueOverride(PlayerMobile defender)
		{
			if(Deserializing || defender == null || defender.Deleted || !IsMember(defender) || !defender.InRegion(Battle.BattleRegion))
			{
				return;
			}

			defender.SolidHueOverride = (Battle.State == PvPBattleState.Preparing || Battle.State == PvPBattleState.Running) &&
										SolidHueOverride
											? Color
											: -1;

			if(defender.QuestArrow != null)
			{
				defender.QuestArrow.Stop();
			}
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:17,代码来源:Team.cs


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