コード例 #1
0
ファイル: HouseCraftables.cs プロジェクト: tflynt91/TrueUO
        public static Item Create(Mobile m, CraftItem craftItem, ITool tool)
        {
            DoorType type = DoorType.StoneDoor_S_In;

            if (craftItem.Data is DoorType)
            {
                type = (DoorType)craftItem.Data;
            }

            return(new CraftableStoneHouseDoor(type, CraftableMetalHouseDoor.GetDoorFacing(type)));
        }
コード例 #2
0
ファイル: HouseCraftables.cs プロジェクト: tflynt91/TrueUO
        public void Replace()
        {
            BaseDoor door;

            if (Type < DoorType.LeftMetalDoor_S_In)
            {
                door = new CraftableStoneHouseDoor(Type, CraftableMetalHouseDoor.GetDoorFacing(Type));
            }
            else
            {
                door = new CraftableMetalHouseDoor(Type, CraftableMetalHouseDoor.GetDoorFacing(Type));
            }

            if (door is IResource)
            {
                ((IResource)door).Resource = _Resource;
            }

            if (Parent is Container)
            {
                ((Container)Parent).DropItem(door);
            }
            else
            {
                BaseHouse house = BaseHouse.FindHouseAt(this);

                door.MoveToWorld(Location, Map);

                door.IsLockedDown = IsLockedDown;
                door.IsSecure     = IsSecure;
                door.Movable      = Movable;

                if (house != null && house.LockDowns.ContainsKey(this))
                {
                    house.LockDowns.Remove(this);
                    house.LockDowns.Add(door, house.Owner);
                }
                else if (house != null && house.IsSecure(this))
                {
                    house.ReleaseSecure(house.Owner, this);
                    house.AddSecure(house.Owner, door);
                }
            }

            Delete();
        }
コード例 #3
0
ファイル: HouseCraftables.cs プロジェクト: tflynt91/TrueUO
        public virtual void OnFlip(Mobile from)
        {
            if (Open)
            {
                from.SendMessage("The door must be closed before you can do that.");
                return; // TODO: Message?
            }

            switch (Type)
            {
            default:
            case DoorType.StoneDoor_S_In:
                Type = DoorType.StoneDoor_S_Out;
                break;

            case DoorType.StoneDoor_S_Out:
                Type = DoorType.StoneDoor_S_In;
                break;

            case DoorType.StoneDoor_E_In:
                Type = DoorType.StoneDoor_E_Out;
                break;

            case DoorType.StoneDoor_E_Out:
                Type = DoorType.StoneDoor_E_In;
                break;

            case DoorType.LeftMetalDoor_S_In:
                Type = DoorType.LeftMetalDoor_S_Out;
                break;

            case DoorType.RightMetalDoor_S_In:
                Type = DoorType.RightMetalDoor_S_Out;
                break;

            case DoorType.LeftMetalDoor_E_In:
                Type = DoorType.LeftMetalDoor_E_Out;
                break;

            case DoorType.RightMetalDoor_E_In:
                Type = DoorType.RightMetalDoor_E_Out;
                break;

            case DoorType.LeftMetalDoor_S_Out:
                Type = DoorType.RightMetalDoor_E_Out;
                break;

            case DoorType.RightMetalDoor_S_Out:
                Type = DoorType.RightMetalDoor_S_In;
                break;

            case DoorType.LeftMetalDoor_E_Out:
                Type = DoorType.LeftMetalDoor_E_In;
                break;

            case DoorType.RightMetalDoor_E_Out:
                Type = DoorType.RightMetalDoor_E_In;
                break;
            }

            Facing = CraftableMetalHouseDoor.GetDoorFacing(Type);

            ClosedID = 0x324 + (2 * (int)Facing);
            OpenedID = 0x325 + (2 * (int)Facing);

            Offset = GetOffset(Facing);
            InvalidateProperties();
        }