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


C# Mobile.CheckTargetSkill方法代码示例

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


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

示例1: OnTarget

            protected override void OnTarget( Mobile from, object targeted )
            {
                if( targeted is Mobile )
                {
                    from.SendLocalizedMessage(502816); // You feel that such an action would be inappropriate
                }
                else if( targeted is TrapableContainer )
                {
                    TrapableContainer targ = (TrapableContainer)targeted;

                    from.Direction = from.GetDirectionTo(targ);

                    if( targ.TrapType == TrapType.None )
                    {
                        from.SendLocalizedMessage(502373); // That doesn't appear to be trapped
                        return;
                    }

                    from.PlaySound(0x241);

                    if( from.CheckTargetSkill(SkillName.RemoveTrap, targ, targ.TrapPower, targ.TrapPower + 30) )
                    {
                        targ.TrapPower = 0;
                        targ.TrapLevel = 0;
                        targ.TrapType = TrapType.None;
                        from.SendLocalizedMessage(502377); // You successfully render the trap harmless
                    }
                    else
                    {
                        from.SendLocalizedMessage(502372); // You fail to disarm the trap... but you don't set it off
                    }
                }
                else if( targeted is BaseDoor && ((BaseDoor)targeted).TrapAvailable )
                {
                    if( from.CheckTargetSkill(SkillName.RemoveTrap, targeted, (targeted is BaseHouseDoor ? 95.0 : 75.0), (targeted is BaseHouseDoor ? 120.0 : 100.0)) )
                    {
                        from.SendLocalizedMessage(502377); //You successfully render the trap harmless.
                        ((BaseDoor)targeted).RemoveTrap();
                    }
                    else
                    {
                        if( 0.20 >= Utility.RandomDouble() )
                        {
                            from.SendMessage("You fail to disarm the trap, and accidentally set it off!");
                            ((BaseDoor)targeted).DoorTrap.Trigger(from);
                        }
                        else
                            from.SendLocalizedMessage(502372);
                    }
                }
                else
                {
                    from.SendLocalizedMessage(502373); // That does'nt appear to be trapped
                }

                EventSink.InvokeSkillUsed(new SkillUsedEventArgs(from, from.Skills[SkillName.RemoveTrap]));
            }
开发者ID:greeduomacro,项目名称:hubroot,代码行数:57,代码来源:RemoveTrap.cs

示例2: ChangelingDropTarget

        public void ChangelingDropTarget(Mobile from, object obj)
        {
            if (!(obj is HairStrand))
            {
                from.SendMessage("Cela ne servirait à rien de verser le liquide ici");
                return;
            }

            HairStrand targ = (HairStrand)obj;

            if (from.Skills[SkillName.Alchemy].Value < 60)
            {
                from.SendMessage("Vos maigres talents d'alchimistes ne permettraient pas une pareille mixture...");
                return;
            }

            if (!from.CheckTargetSkill(SkillName.Alchemy, targ, 55, 95))
            {
                from.SendMessage("Vous mettez trop de cheveux à l'intérieur, ce qui gâche le mélange...");
                targ.Delete();
                return;
            }

            from.PrivateOverheadMessage(MessageType.Regular, 0x3B2, false, "Vous mélangez doucement le tout et terminez le mélange...", from.NetState);
            GenderPotion potion = new GenderPotion();
            potion.Female = targ.HairOwner.Female;
            from.AddToBackpack(potion);
            this.Delete();
            targ.Delete();
            return;
        }
开发者ID:greeduomacro,项目名称:vivre-uo,代码行数:31,代码来源:MorphBase.cs

示例3: Check

			private static void Check(Mobile from, BaseCreature c, double min)
			{
				if (from.CheckTargetSkill(SkillName.AnimalLore, c, min, 120.0))
					SendGump(from, c);
				else
					from.SendLocalizedMessage(500334); // You can't think of anything you know offhand.
			}
开发者ID:Crome696,项目名称:ServUO,代码行数:7,代码来源:AnimalLore.cs

示例4: OnTarget

            protected override void OnTarget(Mobile from, object targeted)
            {
                if (from == targeted)
                {
                    from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 500910); // Hmm, that person looks really silly.
                }
                else if (targeted is TownCrier)
                {
                    ((TownCrier)targeted).PrivateOverheadMessage(MessageType.Regular, 0x3B2, 500907, from.NetState); // He looks smart enough to remember the news.  Ask him about it.
                }
                else if (targeted is BaseVendor && ((BaseVendor)targeted).IsInvulnerable)
                {
                    ((BaseVendor)targeted).PrivateOverheadMessage(MessageType.Regular, 0x3B2, 500909, from.NetState); // That person could probably calculate the cost of what you buy from them.
                }
                else if (targeted is Mobile)
                {
                    Mobile targ = (Mobile)targeted;

                    int marginOfError = Math.Max(0, 20 - (int)(from.Skills[SkillName.EvalInt].Value / 5));

                    int intel = targ.Int + Utility.RandomMinMax(-marginOfError, +marginOfError);
                    int mana = ((targ.Mana * 100) / Math.Max(targ.ManaMax, 1)) + Utility.RandomMinMax(-marginOfError, +marginOfError);

                    int intMod = intel / 10;
                    int mnMod = mana / 10;

                    if (intMod > 10)
                        intMod = 10;
                    else if (intMod < 0)
                        intMod = 0;

                    if (mnMod > 10)
                        mnMod = 10;
                    else if (mnMod < 0)
                        mnMod = 0;

                    int body;

                    if (targ.Body.IsHuman)
                        body = targ.Female ? 11 : 0;
                    else
                        body = 22;

                    if (from.CheckTargetSkill(SkillName.EvalInt, targ, 0.0, 120.0))
                    {
                        targ.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 1038169 + intMod + body, from.NetState); // He/She/It looks [slighly less intelligent than a rock.]  [Of Average intellect] [etc...]

                        if (from.Skills[SkillName.EvalInt].Base >= 76.0)
                            targ.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 1038202 + mnMod, from.NetState); // That being is at [10,20,...] percent mental strength.
                    }
                    else 
                    {
                        targ.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 1038166 + (body / 11), from.NetState); // You cannot judge his/her/its mental abilities.
                    }
                }
                else if (targeted is Item)
                {
                    ((Item)targeted).SendLocalizedMessageTo(from, 500908, ""); // It looks smarter than a rock, but dumber than a piece of wood.
                }
            }
开发者ID:Crome696,项目名称:ServUO,代码行数:60,代码来源:EvalInt.cs

示例5: OnTarget

            protected override void OnTarget(Mobile from, object o)
            {
                if (o is Item)
                {
                    if (from.CheckTargetSkill(SkillName.ItemID, o, 0, 100))
                    {
                        if (o is BaseWeapon)
                            ((BaseWeapon)o).Identified = true;
                        else if (o is BaseArmor)
                            ((BaseArmor)o).Identified = true;

                        if (!Core.AOS)
                            ((Item)o).OnSingleClick(from);
                    }
                    else
                    {
                        from.SendLocalizedMessage(500353); // You are not certain...
                    }
                }
                else if (o is Mobile)
                {
                    ((Mobile)o).OnSingleClick(from);
                }
                else
                {
                    from.SendLocalizedMessage(500353); // You are not certain...
                }
                Server.Engines.XmlSpawner2.XmlAttach.RevealAttachments(from, o);
            }
开发者ID:Crome696,项目名称:ServUO,代码行数:29,代码来源:ItemIdentification.cs

示例6: OnTarget

			protected override void OnTarget( Mobile from, object o )
			{
				if ( o is Item )
				{
					if ( from.CheckTargetSkill( SkillName.ItemID, o, 0, 100 ) )
					{
						if ( o is BaseWeapon )
							((BaseWeapon)o).Identified = true;
						else if ( o is BaseArmor )
							((BaseArmor)o).Identified = true;

						((Item)o).OnSingleClick( from );
					}
					else
					{
						from.SendLocalizedMessage( 500353 ); // You are not certain...
					}
				}
				else if ( o is Mobile )
				{
					((Mobile)o).OnSingleClick( from );
				}
				else
				{
					from.SendLocalizedMessage( 500353 ); // You are not certain...
				}
			}
开发者ID:Grimoric,项目名称:RunUO.T2A,代码行数:27,代码来源:ItemIdentification.cs

示例7: OnTarget

			protected override void OnTarget( Mobile from, object targeted )
			{
                IEntity entity = targeted as IEntity; if (XmlScript.HasTrigger(entity, TriggerName.onTargeted) && UberScriptTriggers.Trigger(entity, from, TriggerName.onTargeted, null, null, null, 0, null, SkillName.TasteID, from.Skills[SkillName.TasteID].Value))
                {
                    return;
                }
                
                if ( targeted is Mobile )
				{
					from.SendLocalizedMessage( 502816 ); // You feel that such an action would be inappropriate.
				}
				else if ( targeted is Food )
				{
					Food food = (Food) targeted;

					if ( from.CheckTargetSkill( SkillName.TasteID, food, 0, 100 ) )
					{
						if ( food.Poison != null )
						{
							food.SendLocalizedMessageTo( from, 1038284 ); // It appears to have poison smeared on it.
						}
						else
						{
							// No poison on the food
							food.SendLocalizedMessageTo( from, 1010600 ); // You detect nothing unusual about this substance.
						}
					}
					else
					{
						// Skill check failed
						food.SendLocalizedMessageTo( from, 502823 ); // You cannot discern anything about this substance.
					}
				}
				else if ( targeted is BasePotion )
				{
					BasePotion potion = (BasePotion) targeted;

					potion.SendLocalizedMessageTo( from, 502813 ); // You already know what kind of potion that is.
					potion.SendLocalizedMessageTo( from, potion.LabelNumber );
				}
				else if ( targeted is PotionKeg )
				{
					PotionKeg keg = (PotionKeg) targeted;

					if ( keg.Held <= 0 )
					{
						keg.SendLocalizedMessageTo( from, 502228 ); // There is nothing in the keg to taste!
					}
					else
					{
						keg.SendLocalizedMessageTo( from, 502229 ); // You are already familiar with this keg's contents.
						keg.SendLocalizedMessageTo( from, keg.LabelNumber );
					}
				}
				else
				{
					// The target is not food or potion or potion keg.
					from.SendLocalizedMessage( 502820 ); // That's not something you can taste.
				}
			}
开发者ID:greeduomacro,项目名称:UO-Forever,代码行数:60,代码来源:TasteID.cs

示例8: OnTarget

            protected override void OnTarget( Mobile from, object targeted )
            {
                if ( targeted is Mobile )
                {
                    from.SendLocalizedMessage( 502816 ); // You feel that such an action would be inappropriate
                }
                else if ( targeted is TrapableContainer )
                {
                    TrapableContainer targ = (TrapableContainer)targeted;

                    from.Direction = from.GetDirectionTo( targ );

                    if ( !targ.Trapped )
                    {
                        from.SendLocalizedMessage( 502373 ); // That doesn't appear to be trapped
                        return;
                    }

                    from.PlaySound( 0x241 );

                    if ( from.CheckTargetSkill( SkillName.RemoveTrap, targ, targ.TrapPower, targ.TrapPower + 30 ) )
                    {
                        targ.Trapped = false;
                        from.SendLocalizedMessage( 502377 ); // You successfully render the trap harmless
                    }
                    else
                    {
                        from.SendLocalizedMessage( 502372 ); // You fail to disarm the trap... but you don't set it off
                    }
                }
                else
                {
                    from.SendLocalizedMessage( 502373 ); // That does'nt appear to be trapped
                }
            }
开发者ID:FreeReign,项目名称:Rebirth-Repack,代码行数:35,代码来源:RemoveTrap.cs

示例9: OnTarget

			protected override void OnTarget( Mobile from, object targeted )
			{
				if ( targeted is Mobile )
				{
					from.SendLocalizedMessage( 502816 ); // You feel that such an action would be inappropriate
				}
				else if ( targeted is Food )
				{
					if ( from.CheckTargetSkill( SkillName.TasteID, targeted, 0, 100 ) )
					{
						Food targ = (Food)targeted;

						if ( targ.Poison != null )
						{
							from.SendLocalizedMessage( 1038284 ); // It appears to have poison smeared on it
						}
						else
						{
							// No poison on the food
							from.SendLocalizedMessage( 502823 ); // You cannot discern anything about this substance
						}
					}
					else
					{
						// Skill check failed
						from.SendLocalizedMessage( 502823 ); // You cannot discern anything about this substance
					}
				}
				else
				{
					// The target is not food. (Potion support in the next version)
					from.SendLocalizedMessage( 502820 ); // That's not something you can taste
				}
			}
开发者ID:zerodowned,项目名称:angelisland,代码行数:34,代码来源:TasteID.cs

示例10: OnTarget

            protected override void OnTarget(Mobile from, object targeted)
            {
                if (from == targeted)
                {
                    from.LocalOverheadMessage(MessageType.Regular, 0x3B2, 500324); // You know yourself quite well enough already.
                }
                else if (targeted is TownCrier)
                {
                    ((TownCrier)targeted).PrivateOverheadMessage(MessageType.Regular, 0x3B2, 500322, from.NetState); // This person looks fine to me, though he may have some news...
                }
                else if (targeted is BaseVendor && ((BaseVendor)targeted).IsInvulnerable)
                {
                    ((BaseVendor)targeted).PrivateOverheadMessage(MessageType.Regular, 0x3B2, 500326, from.NetState); // That can not be inspected.
                }
                else if (targeted is Mobile)
                {
                    Mobile targ = (Mobile)targeted;

                    int marginOfError = Math.Max(0, 25 - (int)(from.Skills[SkillName.Anatomy].Value / 4));

                    int str = targ.Str + Utility.RandomMinMax(-marginOfError, +marginOfError);
                    int dex = targ.Dex + Utility.RandomMinMax(-marginOfError, +marginOfError);
                    int stm = ((targ.Stam * 100) / Math.Max(targ.StamMax, 1)) + Utility.RandomMinMax(-marginOfError, +marginOfError);

                    int strMod = str / 10;
                    int dexMod = dex / 10;
                    int stmMod = stm / 10;

                    if (strMod < 0)
                        strMod = 0;
                    else if (strMod > 10)
                        strMod = 10;

                    if (dexMod < 0)
                        dexMod = 0;
                    else if (dexMod > 10)
                        dexMod = 10;

                    if (stmMod > 10)
                        stmMod = 10;
                    else if (stmMod < 0)
                        stmMod = 0;

                    if (from.CheckTargetSkill(SkillName.Anatomy, targ, 0, 100))
                    {
                        targ.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 1038045 + (strMod * 11) + dexMod, from.NetState); // That looks [strong] and [dexterous].

                        if (from.Skills[SkillName.Anatomy].Base >= 65.0)
                            targ.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 1038303 + stmMod, from.NetState); // That being is at [10,20,...] percent endurance.
                    }
                    else
                    {
                        targ.PrivateOverheadMessage(MessageType.Regular, 0x3B2, 1042666, from.NetState); // You can not quite get a sense of their physical characteristics.
                    }
                }
                else if (targeted is Item)
                {
                    ((Item)targeted).SendLocalizedMessageTo(from, 500323, ""); // Only living things have anatomies!
                }
            }
开发者ID:Crome696,项目名称:ServUO,代码行数:60,代码来源:Anatomy.cs

示例11: OnTarget

            protected override void OnTarget(Mobile from, object targeted)
            {
                if (!from.Alive)
                {
                    from.SendLocalizedMessage(500331); // The spirits of the dead are not the province of animal lore.
                }
                else if (targeted is BaseCreature)
                {
                    BaseCreature c = (BaseCreature)targeted;

                    if (!c.IsDeadPet)
                    {
                        if (c.Body.IsAnimal || c.Body.IsMonster || c.Body.IsSea)
                        {
                            if (!c.Controlled && from.Skills[SkillName.AnimalLore].Value < 100.0)
                            {
                                from.SendLocalizedMessage(1049674); // At your skill level, you can only lore tamed creatures.
                            }
                            else if (!c.Controlled && !c.Tamable && from.Skills[SkillName.AnimalLore].Value < 110.0)
                            {
                                from.SendLocalizedMessage(1049675); // At your skill level, you can only lore tamed or tameable creatures.
                            }
                            else if (!from.CheckTargetSkill(SkillName.AnimalLore, c, 0.0, 120.0))
                            {
                                from.SendLocalizedMessage(500334); // You can't think of anything you know offhand.
                            }
                            else if ((c is LadyMelisande || c is DreadHorn || c is Travesty || c is MonstrousInterredGrizzle || c is ChiefParoxysmus || c is ShimmeringEffusion) && 0.01 < Utility.RandomDouble())
                            {
                                from.SendLocalizedMessage(500334); // You can't think of anything you know offhand.
                            }
                            else
                            {
                                from.CloseGump(typeof(AnimalLoreGump));
                                from.SendGump(new AnimalLoreGump(c));
                            }
                        }
                        else
                        {
                            from.SendLocalizedMessage(500329); // That's not an animal!
                        }
                    }
                    else
                    {
                        from.SendLocalizedMessage(500331); // The spirits of the dead are not the province of animal lore.
                    }
                }
                else
                {
                    from.SendLocalizedMessage(500329); // That's not an animal!
                }
            }
开发者ID:zerodowned,项目名称:JustUO-merged-with-EC-Support,代码行数:51,代码来源:AnimalLore.cs

示例12: OnTarget

            protected override void OnTarget( Mobile from, object targeted )
            {
                if( !from.Alive )
                {
                    from.SendLocalizedMessage(500331); // The spirits of the dead are not the province of animal lore.
                }
                else if( targeted is BaseCreature )
                {
                    BaseCreature c = (BaseCreature)targeted;

                    if( !c.IsDeadPet )
                    {
                        if( c.Body.IsAnimal || c.Body.IsMonster || c.Body.IsSea )
                        {
                            if( (!c.Controlled || !c.Tamable) && from.Skills[SkillName.AnimalLore].Base < 85.0 )
                            {
                                from.SendLocalizedMessage(1049674); // At your skill level, you can only lore tamed creatures.
                            }
                            else if( !c.Tamable && from.Skills[SkillName.AnimalLore].Base < 90.0 )
                            {
                                from.SendLocalizedMessage(1049675); // At your skill level, you can only lore tamed or tameable creatures.
                            }
                            else if( !from.CheckTargetSkill(SkillName.AnimalLore, c, 0.0, 100.0) )
                            {
                                from.SendLocalizedMessage(500334); // You can't think of anything you know offhand.
                            }
                            else
                            {
                                from.CloseGump(typeof(AnimalLoreGump));
                                from.SendGump(new AnimalLoreGump(c));
                            }
                        }
                        else
                        {
                            from.SendLocalizedMessage(500329); // That's not an animal!
                        }
                    }
                    else
                    {
                        from.SendLocalizedMessage(500331); // The spirits of the dead are not the province of animal lore.
                    }
                }
                else
                {
                    from.SendLocalizedMessage(500329); // That's not an animal!
                }

                EventSink.InvokeSkillUsed(new SkillUsedEventArgs(from, from.Skills[SkillName.AnimalLore]));
            }
开发者ID:greeduomacro,项目名称:hubroot,代码行数:49,代码来源:AnimalLore.cs

示例13: OnTarget

        public void OnTarget(Mobile from, object obj)
        {
            if (!(obj is AlchemyVial))
            {
                from.SendMessage("Cela ne servira à rien");
                return;
            }

            AlchemyVial targ = (AlchemyVial)obj;

            if (targ.AlchemyLiquidType != LiquidType.OgreBlood && targ.AlchemyLiquidType != LiquidType.OrcBlood && targ.AlchemyLiquidType != LiquidType.TrollBlood)
            {
                from.SendMessage("Vous versez le sang, mais rien ne se passe");
                targ.AlchemyLiquidType = LiquidType.None;
                return;
            }

            if (!from.CheckTargetSkill(SkillName.Alchemy, targ, 50, 95))
            {
                from.SendMessage("Vous versez le sang, mais échouez à faire tomber les gravats");
                targ.AlchemyLiquidType = LiquidType.None;
                return;
            }

            int rarete = 0;

            switch (Resource)
            {
                case CraftResource.BlackScales: rarete = 2; break;
                case CraftResource.WhiteScales: rarete = 3; break;
                case CraftResource.GreenScales: rarete = 4; break;
                case CraftResource.BlueScales: rarete = 4; break;
                default: rarete = 6; break;
            }
            if (this.Amount >= rarete)
            {
                from.SendMessage("Vous recueillez des gravats");
                this.m_Harvested = true;
                DragonOre ore = new DragonOre();
                ore.ItemID = 0x19B8;
                ore.Amount = (int)Math.Floor(this.Amount / (double)rarete);
                from.AddToBackpack(ore);
                targ.AlchemyLiquidType = LiquidType.None;
            }
            else
                from.SendMessage("Il n'y en a malheureusement pas assez pour constituer des gravats convenables");
        }
开发者ID:greeduomacro,项目名称:vivre-uo,代码行数:47,代码来源:Scales.cs

示例14: OnHit

 /*** ADDED ***/
 // ALAMBIK
 // Modification implementation of mounted chivalry
 public override void OnHit(Mobile attacker, Mobile defender, double damageBonus)
 {
     Skill skill = attacker.Skills[SkillName.Chivalry];
     if (attacker.Mounted    // attaquant sur un cheval
        && !(defender.Mounted)   // défenseur pas sur un cheval
        && ((attacker.Direction & Direction.Running) != 0)   // cours
        && (skill != null && (Utility.Random(120) <= ((int)(skill.Value) + 10)))
        && attacker.CheckTargetSkill(SkillName.Chivalry, defender, 0.0, 120.0)
        )
     {
         attacker.SendMessage("Votre attaque montée disloque votre adversaire!");
         defender.PlaySound(1308);
         base.OnHit(attacker, defender, 1.20);   // bonus 1/5 au lieu de 1/4
     }
     else
     {
         base.OnHit(attacker, defender, 1.0);
     }
 }
开发者ID:greeduomacro,项目名称:vivre-uo,代码行数:22,代码来源:Lance.cs

示例15: OnTarget

 protected override void OnTarget( Mobile from, object targeted )
 {
     if ( targeted is BaseWeapon || targeted is BaseArmor )
     {
         if ( from.CheckTargetSkill( SkillName.ArmsLore, targeted, 0, 100 ) )
         {
             // You study the item in an attempt to learn more of its craftsmanship and use.
             from.SendLocalizedMessage( 1061657 );
         }
         else
         {
             // You are not certain...
             from.SendLocalizedMessage( 500353 );
         }
     }
     else
     {
         // This is neither weapon nor armor.
         from.SendLocalizedMessage( 500352 );
     }
 }
开发者ID:Ravenwolfe,项目名称:xrunuo,代码行数:21,代码来源:ArmsLore.cs


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