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


C# Mobile.CanSee方法代码示例

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


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

示例1: Target

		public void Target( Mobile tinker, Mobile assembly )
		{
			if ( Deleted || !tinker.CanSee( this ) )
				return;

			int number = -1;

			if ( !tinker.CanSee( assembly ) )
			{
				number = 500237; // Target can not be seen.
			}
			else if ( assembly.Hits == assembly.HitsMax )
			{
				number = 1044281; // That being is not damaged!
			}
			else
			{
				if ( !tinker.BeginAction( typeof( AssemblyRepairKit ) ) )
				{
					number = 500310;// You are busy with something else
				}
				else
				{
					TimeSpan duration = TimeSpan.FromSeconds( 8 );

					InternalTimer t = new InternalTimer( this, tinker, assembly, duration );
					t.Start();

					tinker.SendMessage( "You begin to repair the assembly" );
					return;
				}
			}

			tinker.SendLocalizedMessage( number );
		}
开发者ID:Tukaramdas,项目名称:ServUO-EC-Test-Fork,代码行数:35,代码来源:Assembly+Repair+Kit.cs

示例2: 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

示例3: SendMessageTo

		private void SendMessageTo( Mobile to, string text, int hue )
		{
			if ( Deleted || !to.CanSee( this ) )
				return;

			to.Send( new Network.UnicodeMessage( Serial, ItemID, Network.MessageType.Regular, hue, 3, "ENU", "", text ) );
		}
开发者ID:greeduomacro,项目名称:last-wish,代码行数:7,代码来源:TrapableContainer.cs

示例4: OnMovement

        public override void OnMovement(Mobile m, Point3D oldLocation)
        {
            if (DateTime.UtcNow >= LastSpit && m.InRange(Location, 6) && m.CanSee(this))
            {
                PublicOverheadMessage(MessageType.Emote, 61, true, "*spits*");
                Effects.PlaySound(m.Location, m.Map, 0x19C);

                Timer.DelayCall(
                    TimeSpan.FromMilliseconds(100),
                    () =>
                    {
                            int bloodID = Utility.RandomMinMax(4650, 4655);

                            new MovingEffectInfo(this, m, m.Map, bloodID, 60).MovingImpact(
                                info =>
                                {
                                    var blood = new Blood
                                    {
                                        Name = "slime",
                                        ItemID = bloodID,
                                        Hue = 61
                                    };
                                    blood.MoveToWorld(info.Target.Location, info.Map);

                                    Effects.PlaySound(info.Target, info.Map, 0x028);
                                });
                    });
                LastSpit = DateTime.UtcNow + TimeSpan.FromSeconds(10);
            }
            base.OnMovement(m, oldLocation);
        }
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:31,代码来源:VitriolStatue.cs

示例5: SendMessageTo

		private void SendMessageTo( Mobile to, int number, int hue )
		{
			if ( Deleted || !to.CanSee( this ) )
				return;

			to.Send( new MessageLocalized( Serial, ItemID, MessageType.Regular, hue, 3, number, "", "" ) );
		}
开发者ID:kamronbatman,项目名称:DefianceUO-Pre1.10,代码行数:7,代码来源:TrapableContainer.cs

示例6: SendMessageTo

        private void SendMessageTo(Mobile to, string text, int hue)
        {
            if (Deleted || !to.CanSee(this))
                return;

            to.Send(new UnicodeMessage(Serial, ItemID, MessageType.Regular, hue, 3, to.Language, "", text));
        }
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:7,代码来源:ChargedTrapPouch.cs

示例7: Grab_OnTarget

        private static void Grab_OnTarget(Mobile from, object target)
        {
            if (!from.Alive || !from.CanSee(target) || !(target is Container))
                return;

            bool canLoot = false;
            Container cont = (Container)target;

            if (target is Corpse)
            {
                Corpse c = (Corpse)target;

                if (c.Owner == null || c.Killer == null) //unable to determine cause of death
                {
                    canLoot = true;
                }

                if (c.Owner is PlayerMobile)
                {
                    canLoot = false;
                    from.SendMessage("You cannot loot a player corpse.");
                }

                else if (c.Owner is BaseCreature && !(c.Owner is PlayerMobile)) //it's a monster corpse: do you have looting rights?
                {
                    BaseCreature bc = (BaseCreature)c.Owner;
                    List<DamageStore> lootingRights = BaseCreature.GetLootingRights(bc.DamageEntries, bc.HitsMax);
                    Mobile master = bc.GetMaster();

                    if (master != null && master == from) //if it's your pet, you always have the right
                        canLoot = true;

                    for (int i = 0; !canLoot && i < lootingRights.Count; i++)
                    {
                        if (lootingRights[i].m_Mobile != from)
                            continue;

                        canLoot = lootingRights[i].m_HasRight;
                    }

                    if (!canLoot)
                        from.SendMessage("You do not have the right to loot from that corpse.");
                }

                else
                {
                    canLoot = false;
                    from.SendMessage("You cannot loot that corpse.");
                }
            }
            else
            {
                canLoot = false;
                from.SendMessage("You cannot loot that!");
            }

            if (canLoot)
                GrabLoot(from, cont);
        }
开发者ID:justdanofficial,项目名称:khaeros,代码行数:59,代码来源:LootCommand.cs

示例8: Scissor

		public bool Scissor( Mobile from, Scissors scissors )
		{
			if ( Deleted || !from.CanSee( this ) ) return false;

			base.ScissorHelper( from, new Bandage(), 1 );

			return true;
		}
开发者ID:jsrn,项目名称:MidnightWatchServer,代码行数:8,代码来源:Cloth.cs

示例9: Scissor

        public override bool Scissor( Mobile from, Scissors scissors )
        {
            if ( Deleted || !from.CanSee( this ) ) return false;

            base.ScissorHelper( from, new Leather(), 1 );

            return true;
        }
开发者ID:jsrn,项目名称:MidnightWatchServer,代码行数:8,代码来源:Shoes.cs

示例10: Scissor

        public bool Scissor(Mobile from, Scissors scissors)
        {
            if (this.Deleted || !from.CanSee(this))
                return false;

            base.ScissorHelper(from, new Bone(), Utility.RandomMinMax(3, 5));

            return true;
        }
开发者ID:Crome696,项目名称:ServUO,代码行数:9,代码来源:RibCage.cs

示例11: Scissor

        public bool Scissor(Mobile from, Scissors scissors)
        {
            if (this.Deleted || !from.CanSee(this))
                return false;

            base.ScissorHelper(from, new Cloth(), 50);

            return true;
        }
开发者ID:FreeReign,项目名称:forkuo,代码行数:9,代码来源:BoltOfCloth.cs

示例12: OnSingleClick

		public override void OnSingleClick( Mobile from )
		{
			base.OnSingleClick( from );

			if ( Deleted || !from.CanSee( this ) )
				return;

			//if ( m_Account == null || from.Account != m_Account )
			LabelTo( from, 38, 1149839 ); // * Non-Transferable Account Bound Item *
		}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:10,代码来源:AccountSkillBall.cs

示例13: Scissor

        public bool Scissor( Mobile from, Scissors scissors )
        {
            if ( Deleted || !from.CanSee( this ) ) return false;

            Cloth c = new Cloth();
            c.Hue = this.Hue;
            base.ScissorHelper( from, c, 50 );

            return true;
        }
开发者ID:FreeReign,项目名称:Rebirth-Repack,代码行数:10,代码来源:BoltOfCloth.cs

示例14: Scissor

        public bool Scissor( Mobile from, Scissors scissors )
        {
            if ( Deleted || !from.CanSee( this ) )
                return false;

            from.SendLocalizedMessage( 1008117 ); // You cut the material into bandages and place them in your backpack.

            base.ScissorHelper( from, new Bandage(), 1 );

            return true;
        }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:11,代码来源:Cloth.cs

示例15: Scissor

        public bool Scissor( Mobile from, Scissors scissors )
        {
            if ( Deleted || !from.CanSee( this ) ) return false;

            //base.ScissorHelper( from, new Bandage(), 1 );
            this.Consume( 1 );
            Bandage give = new Bandage();
            give.Hue = this.Hue;
            from.AddToBackpack( give );

            return true;
        }
开发者ID:FreeReign,项目名称:Rebirth-Repack,代码行数:12,代码来源:UncutCloth.cs


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