• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# TravelCheckType类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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


示例16: SendInvalidMessage

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


示例17: IsFeluccaSolenHive

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


示例18: CheckTravel

        public bool CheckTravel(Mobile from, TravelCheckType type)
        {
            if (from.AccessLevel > AccessLevel.Player)
                return true;

            switch (type)
            {
                case TravelCheckType.RecallFrom: return true;
                case TravelCheckType.RecallTo: return false;
                case TravelCheckType.GateFrom: return false;
                case TravelCheckType.GateTo: return false;
                case TravelCheckType.Mark: return false;
                case TravelCheckType.TeleportFrom: return true;
                case TravelCheckType.TeleportTo: return true;
            }

            return false;
        }
开发者ID:ITLongwell,项目名称:ServUO,代码行数:18,代码来源:Region.cs


示例19: IsFeluccaT2A

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


示例20: IsFeluccaDungeon

		public static bool IsFeluccaDungeon(Mobile caster, Map map, Point3D loc, TravelCheckType type)
		{
			Region region = Region.Find(loc, map);
			return (region.IsPartOf(typeof(DungeonRegion)) && region.Map == Map.Felucca);
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:5,代码来源:SpellHelper.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# Tree类代码示例发布时间:2022-05-24
下一篇:
C# Transpose类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap