Example #1
0
 public InUseTimer(Mobile m, FootTrap trap, int featlevel)
     : base(TimeSpan.FromSeconds(featlevel * 2))
 {
     m_m = m;
     m_trap = trap;
     trap.InUse = true;
     m.Emote("*tries to break free from the foot trap*");
 }
Example #2
0
 public ArmTrapTimer(Mobile m, FootTrap trap, int featlevel)
     : base(TimeSpan.FromSeconds(6 / featlevel))
 {
     m_m = m;
     m_trap = trap;
     trap.InUse = true;
     m.RevealingAction();
     m_m.SendMessage(60, "You begin arming the foot trap.");
     m.Animate(32, 5, 1, true, false, 0);
     m_loc = m.Location;
     m_trap.SkillLevel = Convert.ToInt32(m_m.Skills[SkillName.ArmDisarmTraps].Fixed);
     m_trap.Owner = m_m;
     m_trap.Movable = false;
 }
Example #3
0
        public static void CheckBreakFree(Mobile from, FootTrap trap)
        {
            int str = from.Str;

            int chancetobreakfree = str - trap.m_SkillLevel;

            if (chancetobreakfree > (100 - (25 * trap.m_FeatLevel)))
            {
                chancetobreakfree = (100 - (25 * trap.m_FeatLevel));
            }

            if (chancetobreakfree < (50 - (10 * trap.m_FeatLevel)))
            {
                chancetobreakfree = (50 - (10 * trap.m_FeatLevel));
            }

            int attackroll = Utility.Random(100);

            if (attackroll <= chancetobreakfree)
                SetFree(from, trap);

            else
                from.Emote("*failed to break free from the foot trap*");
        }
Example #4
0
 public static void SetFree(Mobile from, FootTrap trap)
 {
     from.Emote("*broke free from the foot trap*");
     from.CantWalk = false;
     trap.Delete();
 }
Example #5
0
        public static void CheckAge(FootTrap trap)
        {
            TimeSpan maxage = new TimeSpan(0, trap.m_FeatLevel, 0);

            if (TimeSpan.Compare(maxage, trap.Aging) < 0)
            {
                trap.Delete();
            }
        }