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


C# Mobile.InLOS方法代码示例

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


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

示例1: OnDoubleClick

		public override void OnDoubleClick( Mobile from )
		{
			if ( !from.InRange( GetWorldLocation(), 2 ) || !from.InLOS( this ) )
			{
				from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that
			}
			else if ( Visible && ( ItemID == 4656 || ItemID == 4702 ) && DateTime.Now >= m_NextUse )
			{
				Point3D p = GetWorldLocation();

				if ( 1 > Utility.Random( Math.Max( Math.Abs( from.X - p.X ), Math.Abs( from.Y - p.Y ) ) ) )
				{
					Effects.PlaySound( from.Location, from.Map, from.GetHurtSound() );
					from.PublicOverheadMessage( MessageType.Regular, from.SpeechHue, true, "Ouch!" );
					SpellHelper.Damage( TimeSpan.FromSeconds( 0.5 ), from, Utility.Dice( 2, 10, 5 ) );
				}

				Effects.PlaySound( GetWorldLocation(), Map, 0x387 );

				Timer.DelayCall( TimeSpan.FromSeconds( 0.25 ), new TimerCallback( Down1 ) );
				Timer.DelayCall( TimeSpan.FromSeconds( 0.50 ), new TimerCallback( Down2 ) );

				Timer.DelayCall( TimeSpan.FromSeconds( 5.00 ), new TimerCallback( BackUp ) );

				m_NextUse = DateTime.Now + TimeSpan.FromSeconds( 10.0 );
			}
		}
开发者ID:FreeReign,项目名称:imaginenation,代码行数:27,代码来源:Guillotine.cs

示例2: OnDoubleClick

 public override void OnDoubleClick(Mobile from)
 {
     if ((!from.InRange(GetWorldLocation(), 2) || !from.InLOS(this)) && from.AccessLevel == AccessLevel.Player)
     {
         from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
         return;
     }
     m_TimeOut = DateTime.Now - m_LastBuild;
     if (m_UpdateTimer < m_TimeOut || itemarray == null)
         BuildArrayList(from);
     else if (turboslotsarray != null)
     {
         foreach (TurboSlot t in turboslotsarray)
         {
             if ((t == null || t.Deleted) )
             {
                 BuildArrayList(from);
                 break;
             }
         }
     }
     if (turboslotsarray != null)
     {
         from.CloseGump(typeof(TurboSlotsStatGump));
         from.SendGump(new TurboSlotsStatGump(from, turboslotsarray));
     }
 }
开发者ID:FreeReign,项目名称:imaginenation,代码行数:27,代码来源:turboslotstats.cs

示例3: BeginSacrifice

		public void BeginSacrifice( Mobile from )
		{
			if ( Deleted )
				return;

			if ( m_Skull != null && m_Skull.Deleted )
				Skull = null;

			if ( from.Map != Map || !from.InRange( GetWorldLocation(), 3 ) || !from.InLOS(this) )
			{
                from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
			}
			else if ( !Harrower.CanSpawn )
			{
				from.SendMessage( "The harrower has already been spawned." );
			}
			else if ( m_Skull == null )
			{
				from.SendLocalizedMessage( 1049485 ); // What would you like to sacrifice?
				from.Target = new SacrificeTarget( this );
			}
			else
			{
				SendLocalizedMessageTo( from, 1049487, "" ); // I already have my champions awakening skull!
			}
		}
开发者ID:FreeReign,项目名称:imaginenation,代码行数:26,代码来源:ChampionSkullBrazier.cs

示例4: Drink

		public override void Drink( Mobile from )
		{
			if( from.InRange( GetWorldLocation(), 1) && from.InLOS( this ) )
				from.Target = new ShrinkTarget( from, this, false );
			else
                from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
		}
开发者ID:FreeReign,项目名称:imaginenation,代码行数:7,代码来源:ShrinkPotion.cs

示例5: OnDoubleClick

		public override void OnDoubleClick( Mobile from )
		{
			Direction dir;
			if ( from.Location != this.Location )
				dir = from.GetDirectionTo( this );
			else if ( this.East )
				dir = Direction.West;
			else
				dir = Direction.North;

			from.Direction = dir;

			bool canThrow = true;

			if ( !from.InRange( this, 4 ) || !from.InLOS( this ) )
				canThrow = false;
			else if ( this.East )
				canThrow = ( dir == Direction.Left || dir == Direction.West || dir == Direction.Up );
			else
				canThrow = ( dir == Direction.Up || dir == Direction.North || dir == Direction.Right );

			if ( canThrow )
				Throw( from );
			else
				from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that.
		}
开发者ID:greeduomacro,项目名称:last-wish,代码行数:26,代码来源:DartBoard.cs

示例6: OnDoubleClick

        public override void OnDoubleClick(Mobile from)
        {
            if (Filled)
            {
                if (from.InRange(this, 3) && from.InLOS(this))
                {
                    from.SendAsciiMessage("You look at the Tombstone");
                    from.PlaySound(47);
                    from.SendGump(new GraveGump());
                }
                else if (IsChildOf(from.Backpack))
                {
                    from.SendAsciiMessage("You look at the Tombstone");
                    from.PlaySound(47);
                    from.SendGump(new GraveGump());
                }
                else
                {
                    from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
                }
            }

            if (!(Filled))
            {
                if (!IsChildOf(from.Backpack))
                    from.SendLocalizedMessage(1042001); // That must be in your pack for you to use it.
                else
                {
                    from.Target = new InternalTarget(this);
                    from.SendAsciiMessage("This tombstone is blank!");
                    from.SendAsciiMessage("Target a players head to bury them.");
                }
            }
        }
开发者ID:FreeReign,项目名称:imaginenation,代码行数:34,代码来源:Gravestone.cs

示例7: OnTarget

        public void OnTarget(Mobile from, object obj)
        {
            if (!from.InRange(GetWorldLocation(), 5) || !from.InLOS(this))
                from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
            else if (obj is Corpse)
            {
                Corpse c = obj as Corpse;

                if (c.Carved)
                    return;

                if (c.Owner is PlayerMobile)
                {
                    ((ICarvable)obj).Carve(from, this);
                    c.PublicOverheadMessage(MessageType.Emote, 33, true, string.Format("*You see {0} steal the soul of {1}*", from.Name, c.Owner.Name));
                    from.PlaySound(0x19c);
                    from.PlaySound(20);
                    from.PlaySound(230);
                    Effects.SendLocationEffect(c.Location, c.Map, 0x37c4, 18, 15, 1);
                }
                else
                    ((ICarvable) obj).Carve(from, this);
            }
            else
                from.SendAsciiMessage("You cannot use this on that");
        }
开发者ID:FreeReign,项目名称:imaginenation,代码行数:26,代码来源:DaemonClaws.cs

示例8: OnDoubleClick

		public override void OnDoubleClick( Mobile from )
		{
            if (from.InRange(GetWorldLocation(), 2) && from.InLOS(this))
                Roll(from);
            else
                from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
		}
开发者ID:FreeReign,项目名称:imaginenation,代码行数:7,代码来源:Dices.cs

示例9: OnHit

		public override void OnHit(Mobile attacker, Mobile defender, int damage)
		{
			ClearCurrentAbility(attacker);

			attacker.SendLocalizedMessage(1060084); // You attack with lightning speed!
			defender.SendLocalizedMessage(1060085); // Your attacker strikes with lightning speed!

			defender.PlaySound(0x3BB);
			defender.FixedEffect(0x37B9, 244, 25);

			// Swing again:

			// If no combatant, wrong map, one of us is a ghost, or cannot see, or deleted, then stop combat
			if (defender == null || defender.Deleted || attacker.Deleted || defender.Map != attacker.Map || !defender.Alive || !attacker.Alive || !attacker.CanSee(defender))
			{
				attacker.Combatant = null;
				return;
			}

			IWeapon weapon = attacker.Weapon;

			if (weapon == null)
				return;

			if (!attacker.InRange(defender, weapon.MaxRange))
				return;

			if (attacker.InLOS(defender))
			{
				BaseWeapon.InDoubleStrike = true;
				attacker.RevealingAction();
				attacker.NextCombatTime = DateTime.Now + weapon.OnSwing(attacker, defender);
				BaseWeapon.InDoubleStrike = false;
			}
		}
开发者ID:ITLongwell,项目名称:aedilis2server,代码行数:35,代码来源:DoubleStrike.cs

示例10: OnDoubleClick

        public override void OnDoubleClick(Mobile from)
        {
            if (Parent != null || !VerifyMove(from))
                return;

            if (!from.InRange(this, 2) || !from.InLOS(this))
            {
                from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 1019045); // I can't reach that.
                return;
            }

            if (ItemID == 0xA57) // rolled
            {
                Direction dir = PlayerMobile.GetDirection4(from.Location, Location);

                if (dir == Direction.North || dir == Direction.South)
                    ItemID = 0xA55;
                else
                    ItemID = 0xA56;
            }
            else // unrolled
            {
                ItemID = 0xA57;

                //Iza - do not send gump
                //if ( !from.HasGump( typeof( LogoutGump ) ) )
                //{
                //    CampfireEntry entry = Campfire.GetEntry( from );

                //    if ( entry != null && entry.Safe )
                //        from.SendGump( new LogoutGump( entry, this ) );
                //}
            }
        }
开发者ID:FreeReign,项目名称:imaginenation,代码行数:34,代码来源:Bedroll.cs

示例11: CheckUse

		private bool CheckUse( Mobile from )
		{
			if ( !IsAccessibleTo( from ) )
				return false;

			if ( from.Map != Map || !from.InRange( GetWorldLocation(), 2 ) || !from.InLOS(this) )
			{
				from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that.
				return false;
			}

			if ( !from.CanBeginAction( typeof( FireHorn ) ) )
			{
				from.SendLocalizedMessage( 1049615 ); // You must take a moment to catch your breath.
				return false;
			}

			int sulfAsh = Core.AOS ? 4 : 15;
			if ( from.Backpack == null || from.Backpack.GetAmount( typeof( SulfurousAsh ) ) < sulfAsh )
			{
				from.SendLocalizedMessage( 1049617 ); // You do not have enough sulfurous ash.
				return false;
			}

			return true;
		}
开发者ID:FreeReign,项目名称:imaginenation,代码行数:26,代码来源:FireHorn.cs

示例12: Resurrect

		public static void Resurrect( Mobile m, Item item )
		{
            if ( m.InRange(item, 2) && m.InLOS(item))
            {
                if (!m.Alive)
                {
                    if (m.Map == null || !m.Map.CanFit(m.Location, 16, false, false))
                    {
                        m.SendLocalizedMessage(502391); // Thou can not be resurrected there!
                    }
                    else if (m.Region is HouseRegion)
                    {
                        m.SendAsciiMessage("You can't get resurrected in house regions.");
                    }
                    else
                    {
                        m.PlaySound(0x214);
                        m.FixedEffect(0x376A, 10, 16);

                        m.Resurrect();

                        //m.CloseGump(typeof(ResurrectGump));
                        //m.SendGump(new ResurrectGump(m, item, ResurrectMessage.VirtueShrine));
                    }
                }
            }
            else
            {
                m.LocalOverheadMessage(MessageType.Regular, 906, 1019045); // I can't reach that.
            }	
        }
开发者ID:FreeReign,项目名称:imaginenation,代码行数:31,代码来源:Ankhs.cs

示例13: OnDoubleClick

		public override void OnDoubleClick( Mobile from )
		{
			if ( !from.InRange( GetWorldLocation(), 3 ) || !from.InLOS(this))
				from.LocalOverheadMessage( MessageType.Regular, 0x3B2, 1019045 ); // I can't reach that.
			else
				from.SendAsciiMessage( "This looks like part of a larger contraption." );
		}
开发者ID:FreeReign,项目名称:imaginenation,代码行数:7,代码来源:PowerCrystal.cs

示例14: CheckAnvilAndForge

		public static void CheckAnvilAndForge( Mobile from, int range, out bool anvil, out bool forge )
		{
			anvil = false;
			forge = false;

			Map map = from.Map;

			if ( map == null )
				return;

			IPooledEnumerable eable = map.GetItemsInRange( from.Location, range );

			foreach ( Item item in eable )
			{
				Type type = item.GetType();

				bool isAnvil = ( type.IsDefined( typeofAnvil, false ) || item.ItemID == 4015 || item.ItemID == 4016 || item.ItemID == 0x2DD5 || item.ItemID == 0x2DD6 );
				bool isForge = ( type.IsDefined( typeofForge, false ) || item.ItemID == 4017 || (item.ItemID >= 6522 && item.ItemID <= 6569) || item.ItemID == 0x2DD8 );

				if ( isAnvil || isForge )
				{
					if ( (from.Z + 16) < item.Z || (item.Z + 16) < from.Z || !from.InLOS( item ) )
						continue;

					anvil = anvil || isAnvil;
					forge = forge || isForge;

					if ( anvil && forge )
						break;
				}
			}

			eable.Free();

			for ( int x = -range; (!anvil || !forge) && x <= range; ++x )
			{
				for ( int y = -range; (!anvil || !forge) && y <= range; ++y )
				{
					StaticTile[] tiles = map.Tiles.GetStaticTiles( from.X+x, from.Y+y, true );

					for ( int i = 0; (!anvil || !forge) && i < tiles.Length; ++i )
					{
						int id = tiles[i].ID;

						bool isAnvil = ( id == 4015 || id == 4016 || id == 0x2DD5 || id == 0x2DD6 );
						bool isForge = ( id == 4017 || (id >= 6522 && id <= 6569) || id == 0x2DD8 );

						if ( isAnvil || isForge )
						{
							if ( (from.Z + 16) < tiles[i].Z || (tiles[i].Z + 16) < from.Z || !from.InLOS( new Point3D( from.X+x, from.Y+y, tiles[i].Z + (tiles[i].Height/2) + 1 ) ) )
								continue;

							anvil = anvil || isAnvil;
							forge = forge || isForge;
						}
					}
				}
			}
		}
开发者ID:greeduomacro,项目名称:vivre-uo,代码行数:59,代码来源:DefBlacksmithy.cs

示例15: OnDoubleClick

		public override void OnDoubleClick( Mobile from )
		{
            Point3D loc = GetWorldLocation();

            if (!from.InLOS(loc) || !from.InRange(loc, 2))
                from.LocalOverheadMessage(MessageType.Regular, 0x3E9, 1019045); // I can't reach that
            else
                Fishing.System.BeginHarvesting(from, this);
		}
开发者ID:greeduomacro,项目名称:vivre-uo,代码行数:9,代码来源:FishingPole.cs


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