public static BaseDoorTrap CreateTrapByType(DoorTrapType type, Mobile owner, int uses)
        {
            BaseDoorTrap trap = null;

            switch (type)
            {
            case DoorTrapType.Arrow:
                trap = new DoorArrowTrap(owner, uses);
                break;

            case DoorTrapType.Dart:
                trap = new DoorDartTrap(owner, uses);
                break;

            case DoorTrapType.Explosion:
                trap = new DoorExplosionTrap(owner);
                break;

            case DoorTrapType.Guillotine:
                trap = new DoorGuillotineTrap(owner);
                break;

            case DoorTrapType.Poison:
                trap = new DoorPoisonTrap(owner, uses);
                break;
            }

            return(trap);
        }
예제 #2
0
		public static BaseDoorTrap CreateTrapByType( DoorTrapType type, Mobile owner, int uses )
		{
			BaseDoorTrap trap = null;

			switch( type )
			{
				case DoorTrapType.Arrow:
					trap = new DoorArrowTrap( owner, uses );
					break;
				case DoorTrapType.Dart:
					trap = new DoorDartTrap( owner, uses );
					break;
				case DoorTrapType.Explosion:
					trap = new DoorExplosionTrap( owner );
					break;
				case DoorTrapType.Guillotine:
					trap = new DoorGuillotineTrap( owner );
					break;
				case DoorTrapType.Poison:
					trap = new DoorPoisonTrap( owner, uses );
					break;
			}

			return trap;
		}
 public BaseDoorTrap(Mobile owner, DoorTrapType type, bool refillable, int uses)
 {
     _owner      = owner;
     _type       = type;
     _active     = false;
     _refillable = refillable;
     _uses       = uses;
 }
예제 #4
0
		public BaseDoorTrap( Mobile owner, DoorTrapType type, bool refillable, int uses )
		{
			_owner = owner;
			_type = type;
			_active = false;
			_refillable = refillable;
			_uses = uses;
		}
        public DoorTrapInstaller(Mobile owner, DoorTrapType type, int initialUses)
            : base(0x1EBB)
        {
            _owner       = owner;
            _trapType    = type;
            _initialUses = initialUses;

            Name = "an installation kit for a door trap";
        }
예제 #6
0
        public DoorTrapInstaller( Mobile owner, DoorTrapType type, int initialUses )
            : base(0x1EBB)
        {
            _owner = owner;
            _trapType = type;
            _initialUses = initialUses;

            Name = "an installation kit for a door trap";
        }
        public override void Deserialize(GenericReader reader)
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            _owner       = reader.ReadMobile();
            _trapType    = (DoorTrapType)reader.ReadInt();
            _initialUses = reader.ReadInt();
        }
        public BaseDoorTrap(GenericReader reader)
        {
            int version = reader.ReadInt();

            _owner      = reader.ReadMobile();
            _type       = (DoorTrapType)reader.ReadInt();
            _active     = reader.ReadBool();
            _refillable = reader.ReadBool();
            _uses       = reader.ReadInt();
            _door       = (BaseDoor)reader.ReadItem();
        }
예제 #9
0
        public virtual bool AttachTrap(BaseDoorTrap trap)
        {
            if (HasTrap() || trap == null)
                return false;

            _trap = trap;
            _trapType = trap.TrapType;

            trap.Active = true;
            trap.Door = this;

            return true;
        }
예제 #10
0
        public virtual bool AttachTrap(BaseDoorTrap trap)
        {
            if (HasTrap() || trap == null)
            {
                return(false);
            }

            _trap     = trap;
            _trapType = trap.TrapType;

            trap.Active = true;
            trap.Door   = this;

            return(true);
        }
예제 #11
0
		public BaseDoorTrap( GenericReader reader )
		{
			int version = reader.ReadInt();

			_owner = reader.ReadMobile();
			_type = (DoorTrapType)reader.ReadInt();
			_active = reader.ReadBool();
			_refillable = reader.ReadBool();
			_uses = reader.ReadInt();
			_door = (BaseDoor)reader.ReadItem();
		}
예제 #12
0
 public virtual void RemoveTrap()
 {
     _trap     = null;
     _trapType = DoorTrapType.None;
 }
예제 #13
0
        public override void Deserialize( GenericReader reader )
        {
            base.Deserialize(reader);

            int version = reader.ReadInt();

            _owner = reader.ReadMobile();
            _trapType = (DoorTrapType)reader.ReadInt();
            _initialUses = reader.ReadInt();
        }
예제 #14
0
 public virtual void RemoveTrap()
 {
     _trap = null;
     _trapType = DoorTrapType.None;
 }