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


C# TravelCheckType类代码示例

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


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

示例1: CheckTravel

        public override bool CheckTravel(Mobile traveller, Point3D p, TravelCheckType type)
        {
            switch (type)
            {
                case TravelCheckType.RecallTo:
                case TravelCheckType.GateTo:
                case TravelCheckType.Mark: return false;
            }

            return base.CheckTravel(traveller, p, type);
        }
开发者ID:Crome696,项目名称:ServUO,代码行数:11,代码来源:SeaMarket.cs

示例2: IsLampRoom

		public static bool IsLampRoom(Mobile caster, Map map, Point3D loc, TravelCheckType type)
		{
			if (map != Map.Malas)
			{
				return false;
			}

			int x = loc.X, y = loc.Y;

			return (x >= 465 && y >= 92 && x < 474 && y < 102);
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:11,代码来源:SpellHelper.cs

示例3: CheckTravel

 public static bool CheckTravel(Map map, Point3D loc, TravelCheckType type)
 {
     return CheckTravel(null, map, loc, type);
 }
开发者ID:jasegiffin,项目名称:JustUO,代码行数:4,代码来源:SpellHelper.cs

示例4: SendInvalidMessage

 public static void SendInvalidMessage(Mobile caster, TravelCheckType type)
 {
     if (type == TravelCheckType.RecallTo || type == TravelCheckType.GateTo)
         caster.SendLocalizedMessage(1019004); // You are not allowed to travel there.
     else if (type == TravelCheckType.TeleportTo)
         caster.SendLocalizedMessage(501035); // You cannot teleport from here to the destination.
     else
         caster.SendLocalizedMessage(501802); // Thy spell doth not appear to work...
 }
开发者ID:jasegiffin,项目名称:JustUO,代码行数:9,代码来源:SpellHelper.cs

示例5: CheckTravel

		public static bool CheckTravel( Mobile caster, TravelCheckType type )
		{
			if( CheckTravel( caster, caster.Map, caster.Location, type ) )
				return true;

			SendInvalidMessage( caster, type );
			return false;
		}
开发者ID:brodock,项目名称:genova-project,代码行数:8,代码来源:SpellHelper.cs

示例6: CheckTravel

        public static bool CheckTravel(Map map, Point3D loc, TravelCheckType type, Mobile caster, out bool jail)
		{
            jail = false;

			if ( IsInvalid( map, loc ) ) // null, internal, out of bounds
				return false;

			// custom regions
			CustomRegion reg = Region.Find( loc, map ) as CustomRegion;
			CustomRegion reg2 = CustomRegion.FindDRDTRegion(caster);
			if( reg != null ) 
			{
				try
				{
					RegionControl regstone = null;

					//if a custom region does exsist find its controller
					regstone = reg.GetRegionControler(); 

					if (regstone != null && caster.AccessLevel == AccessLevel.Player)
					{
						if(regstone.AllowTravelSpellsInRegion && reg == reg2)
							return true;
						
						if(regstone.NoRecallInto && type == TravelCheckType.RecallTo)
							return false;

						if(regstone.NoGateInto && type == TravelCheckType.GateTo)
							return false;

						Spell spell = new GateTravelSpell(caster, null);

						if(regstone.IsRestrictedSpell(spell, caster) && type == TravelCheckType.GateFrom)
							return false;


						if(regstone.CannotEnter && type == TravelCheckType.TeleportTo)
							return false;
					}

				}
	
				catch(NullReferenceException e)
				{
					LogHelper.LogException(e);
					Console.WriteLine("{0} Caught exception.", e); 
				}
				catch(Exception ex)
				{
                    LogHelper.LogException(ex);
				}
			}

			if( reg2 != null ) 
			{
				try
				{
					RegionControl regstone = null;

					//if a custom region does exsist find its controller
					regstone = reg2.GetRegionControler(); 

					if (regstone != null && caster.AccessLevel == AccessLevel.Player)
					{
						if(regstone.AllowTravelSpellsInRegion && reg == reg2)
							return true;
						

						if(regstone.NoRecallInto && type == TravelCheckType.RecallTo)
							return false;

						if(regstone.NoGateInto && type == TravelCheckType.GateTo)
							return false;

						Spell spell = new GateTravelSpell(caster, null);

						if(regstone.IsRestrictedSpell(spell, caster) && type == TravelCheckType.GateFrom)
							return false;


						if(regstone.CannotEnter && type == TravelCheckType.TeleportTo)
							return false;
					}

				}
	
				catch(NullReferenceException e)
				{
					LogHelper.LogException(e);
					Console.WriteLine("{0} Caught exception.", e); 
				}
				catch(Exception ex)
				{
                    LogHelper.LogException(ex);
				}
			}

			//Deal with house SecurePremises flag
            if ((type == TravelCheckType.GateTo || type == TravelCheckType.RecallTo ||
                type == TravelCheckType.TeleportTo) && caster.AccessLevel == AccessLevel.Player)
//.........这里部分代码省略.........
开发者ID:zerodowned,项目名称:angelisland,代码行数:101,代码来源:SpellHelper.cs

示例7: CheckTravel

		public static bool CheckTravel(Mobile caster, Map map, Point3D loc, TravelCheckType type)
		{
			if (IsInvalid(map, loc)) // null, internal, out of bounds
			{
				if (caster != null)
				{
					SendInvalidMessage(caster, type);
				}

				return false;
			}

            if (caster is BaseCreature && (type == TravelCheckType.TeleportTo || type == TravelCheckType.TeleportFrom))
            {
                var bc = (BaseCreature)caster;

                if (!bc.Controlled && !bc.Summoned)
                {
                    return true;
                }
            }

			if (caster != null && caster.AccessLevel == AccessLevel.Player)
			{
				if (caster.Map != map && caster.Region != null && !(caster.Region is CustomRegion))
				{
					caster.SendLocalizedMessage(1019004); // You are not allowed to travel there.
					return false;
				}

				// Alan MOD only recall, gate, mark in felucca allowed
				if (map != Map.Felucca && caster.Region != null && !(caster.Region is CustomRegion))
				{
					return false;
				}
				// end Alan MOD

				if (caster.Region.IsPartOf(typeof(Jail)))
				{
					caster.SendLocalizedMessage(1114345); // You'll need a better jailbreak plan than that!
					return false;
				}
				CustomRegion customRegion;
				Region ga = Region.Find(loc, map);
				if (ga != null)
				{
					if (ga.IsPartOf(typeof(GreenAcres)))
					{
						caster.SendLocalizedMessage(1019004); // You are not allowed to travel there.
						return false;
					}
					customRegion = ga as CustomRegion;
					if (type == TravelCheckType.RecallTo &&
						(customRegion != null && customRegion.Controller != null &&
						 (!customRegion.Controller.AllowRecallIn || !customRegion.Controller.CanEnter)) ||
						type == TravelCheckType.GateTo &&
						(customRegion != null && customRegion.Controller != null &&
						 (!customRegion.Controller.AllowGateIn || !customRegion.Controller.CanEnter)))
					{
						caster.SendLocalizedMessage(1019004); // You are not allowed to travel there.
						return false;
					}
				}
			}

			// Always allow monsters to teleport
			bool isValid = true;

			for (int i = 0; isValid && i < m_Validators.Length; ++i)
			{
				isValid = m_Validators[i].CanTravel(type) || !m_Validators[i].Validator(caster, map, loc, type);
			}

			if (!isValid && caster != null)
			{
				SendInvalidMessage(caster, type);
			}

			return isValid;
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:80,代码来源:SpellHelper.cs

示例8: IsTrammelWind

		public static bool IsTrammelWind(Mobile caster, Map map, Point3D loc, TravelCheckType type)
		{
			return (map == Map.Trammel && IsWindLoc(loc) && caster.Skills[SkillName.Magery].Base >= 70.0);
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:4,代码来源:SpellHelper.cs

示例9: TravelRestrictionValidator

		public TravelRestrictionValidator(TravelValidator validator, TravelCheckType checktypes)
		{
			m_Validator = validator;
			m_CheckTypes = checktypes;
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:5,代码来源:SpellHelper.cs

示例10: CanTravel

		public bool CanTravel(TravelCheckType type)
		{
			return (m_CheckTypes & type) != 0;
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:4,代码来源:SpellHelper.cs

示例11: IsMLDungeon

		public static bool IsMLDungeon(Mobile caster, Map map, Point3D loc, TravelCheckType type)
		{
			return MondainsLegacy.IsMLRegion(Region.Find(loc, map));
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:4,代码来源:SpellHelper.cs

示例12: IsHeartwood

		public static bool IsHeartwood(Mobile caster, Map map, Point3D loc, TravelCheckType type)
		{
			int x = loc.X, y = loc.Y;

			return (map == Map.Trammel || map == Map.Felucca) && (x >= 6911 && y >= 254 && x < 7167 && y < 511);
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:6,代码来源:SpellHelper.cs

示例13: IsGuardianRoom

		public static bool IsGuardianRoom(Mobile caster, Map map, Point3D loc, TravelCheckType type)
		{
			if (map != Map.Malas)
			{
				return false;
			}

			int x = loc.X, y = loc.Y;

			return (x >= 356 && y >= 5 && x < 375 && y < 25);
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:11,代码来源:SpellHelper.cs

示例14: CheckTravel

		public static bool CheckTravel( Mobile caster, Map map, Point3D loc, TravelCheckType type )
		{
			if( IsInvalid( map, loc ) ) // null, internal, out of bounds
			{
				if( caster != null )
					SendInvalidMessage( caster, type );

				return false;
			}

            // Scriptiz : ajout des cages (holding cell)
			if( caster != null && caster.AccessLevel == AccessLevel.Player && (caster.Region.IsPartOf( typeof( Regions.Jail) ) || caster.Region.IsPartOf( typeof( Regions.HoldingCell) ) ))
			{
                caster.SendLocalizedMessage(1114345); // You'll need a better jailbreak plan then that!
				return false;
			}

            // Always allow monsters to teleport
            if (caster is BaseCreature && (type == TravelCheckType.TeleportTo || type == TravelCheckType.TeleportFrom))
            {
                BaseCreature bc = (BaseCreature)caster;

                if (!bc.Controlled && !bc.Summoned)
                    return true;
            }

			m_TravelCaster = caster;
			m_TravelType = type;

			int v = (int)type;
			bool isValid = true;

			for( int i = 0; isValid && i < m_Validators.Length; ++i )
				isValid = (m_Rules[v, i] || !m_Validators[i]( map, loc ));

			if( !isValid && caster != null )
				SendInvalidMessage( caster, type );

			return isValid;
		}
开发者ID:greeduomacro,项目名称:vivre-uo,代码行数:40,代码来源:SpellHelper.cs

示例15: IsIlshenar

		public static bool IsIlshenar(Mobile caster, Map map, Point3D loc, TravelCheckType type)
		{
			return (map == Map.Ilshenar);
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:4,代码来源:SpellHelper.cs


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