GetDifficultyFor() public method

public GetDifficultyFor ( Mobile targ ) : double
targ Mobile
return double
Exemplo n.º 1
0
            protected override void OnTarget(Mobile from, object targeted)
            {
                if (!(targeted is Mobile))
                {
                    from.SendLocalizedMessage(1049528);                     // You cannot calm that!
                }
                else
                {
                    Mobile targ = (Mobile)targeted;
                    int    success = 0, fail = 0;

                    for (int ix = 0; ix < 100; ix++)
                    {
                        double diff  = m_Instrument.GetDifficultyFor(targ) - 10.0;
                        double music = from.Skills[SkillName.Musicianship].Value;

                        if (music > 100.0)
                        {
                            diff -= (music - 100.0) * 0.5;
                        }

                        if (!from.CheckTargetSkill(SkillName.Peacemaking, targ, diff - 25.0, diff + 25.0))
                        {
                            fail++;
                        }
                        else
                        {
                            success++;
                        }
                    }

                    from.SendMessage(String.Format("{0} successes {1} failures", success, fail));
                }
            }