當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。