本文整理汇总了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);
}
}
示例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)
}
示例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
}
}
}
}
示例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();
}
}