Exemplo n.º 1
0
        protected void LoopPresets(uint pRoom, Room2 room, Level lvl)
        {
            for (var pPreset = room.pPreset; pPreset != 0;)
            {
                var preset = game.Debugger.Read <PresetUnit>(pPreset);

                var tileLevelNo = CollisionMap.GetTileLevelNo(game, room, preset.dwTxtFileNo);
                if (tileLevelNo != 0)
                {
                    var exit = new LevelExit
                    {
                        dwTargetLevel = tileLevelNo,
                        ptPos         = new Point((int)((room.dwPosX * 5) + preset.dwPosX), (int)((room.dwPosY * 5) + preset.dwPosY)),
                        dwType        = (uint)ExitType.Tile,
                        dwId          = preset.dwTxtFileNo,
                        pRoom2        = pRoom
                    };

                    if (!levelExits.ContainsKey(lvl.dwLevelNo))
                    {
                        levelExits.Add(lvl.dwLevelNo, new List <LevelExit>());
                    }

                    if (levelExits[lvl.dwLevelNo].Find(it => it.dwTargetLevel == tileLevelNo) == null)
                    {
                        levelExits[lvl.dwLevelNo].Add(exit);
                    }
                }

                DrawPreset(room, lvl, preset);

                pPreset = preset.pPresetNext;
            }
        }
Exemplo n.º 2
0
        public JsonResult GetSingleRoom2D(string fileName)//ПЕРЕПИСАТЬ!!!!
        {
            Room2 room = new Room2();

            using (AdmShipDataContext db3 = new AdmShipDataContext())
            {
                var sRoom = db3.GetSingleRoom2D(fileName);
                foreach (var r in sRoom)
                {
                    room.floor           = r.RoomFloor;
                    room.roomNumber      = r.roomNumber;
                    room.planRoomNumber  = r.roomPlanNumber;
                    room.roomFunction    = r.roomFunction;
                    room.roomSquare      = (decimal)r.roomSquare;
                    room.totalLiveSpace  = (decimal)r.totalLivingSpace;
                    room.specialFunction = (decimal)r.roomSpecFunction;
                    room.ancillarySquare = (decimal)r.ancillarySquare;
                    room.roomHeight      = r.roomHeight;
                    room.balconySquare   = (decimal)r.balconySquare;
                    room.roomFilename    = r.roomFilename3ds;
                    room.roomId          = r.roomId;
                }
            }
            return(Json(room));
        }
Exemplo n.º 3
0
        public void OnUpdate(GameTime gameTime)
        {
            Room1.OnUpdate(gameTime);
            Room2.OnUpdate(gameTime);
            Room3.OnUpdate(gameTime);

            Title.OnUpdate(gameTime);

            ProcessInput();
        }
Exemplo n.º 4
0
        private static Area[] GetAreas()
        {
            var area1 = Room1.GetRoom();
            var area2 = Room2.GetRoom();
            var area3 = Room3.GetRoom();
            var area4 = Room4.GetRoom();

            return(new Area[4] {
                area1, area2, area3, area4
            });
        }
Exemplo n.º 5
0
        public void Room2Test()
        {
            var room2_1   = new Room2("1 2 3 4 7 2 1 -3 0 -2 3 -1");
            var room2_2   = new Room2("1 2 3 4 7 2 1 -2 0 -2 3 -2");
            var room2_3   = new Room2("1 2 3 4 1 4");
            var variables = new int[5] {
                2, 3, 4, 5, 0
            };

            Assert.AreEqual(room2_1.IndexOfTunnelWhichPigGo(variables), 2);
            Assert.AreEqual(room2_2.IndexOfTunnelWhichPigGo(variables), 3);
            Assert.AreEqual(room2_3.IndexOfTunnelWhichPigGo(variables), 4);
        }
Exemplo n.º 6
0
    private void GoToNextRoom()
    {
        Room2.PlayerEnterInRoom();
        Room1.DeInitRoom();
        FindObjectOfType <TestMovement>().OnRoomEnter(); // tmp need player singletone

        foreach (Door door in Room2.Doors)
        {
            if (door.OnNode == FindObjectOfType <TestMovement>().CurrentNode)
            {
                door.TransitionMade = true;
            }
        }
    }
Exemplo n.º 7
0
    /*
     * 部屋の生成
     * 区画生成時と同時に生成
     */
    public void CreateRoom(int area_num)
    {
        // 部屋の大きさだけ先に生成
        RoomSize size = new RoomSize(area_num == 1 || area_num == (DUNGEON_SIZE * DUNGEON_SIZE));

        // 部屋が区画内に収まる範囲で部屋の位置決め(ランダム)
        int     room_top  = Random.Range(_top + OUTSKIRTS, _bottom - OUTSKIRTS - size.Height);
        int     room_left = Random.Range(_right + OUTSKIRTS + size.Widht, _left - OUTSKIRTS);
        Vector3 position  = new Vector3(room_left, 0, room_top);

        // 部屋の作成
        room = new Room2(size, position);
        room.Create(area_num);
    }
Exemplo n.º 8
0
    /// <summary>
    /// Awake method of MirrorPuzzleCubeParent
    /// </summary>
    private void Awake()
    {
        cubes = GetComponentsInChildren <MirrorPuzzleCube>();

        // Checks if the cubes are in correct position
        if (correctPosition == currentPosition)
        {
            InCorrectPosition = true;
        }
        else
        {
            InCorrectPosition = false;
        }

        room2         = FindObjectOfType <Room2>();
        ThisCoroutine = null;
    }
Exemplo n.º 9
0
        public static uint GetTileLevelNo(D2Game game, Room2 room2, uint dwTileNo)
        {
            for (var pRoomTile = room2.pRoomTiles; pRoomTile != 0;)
            {
                var roomTile = game.Debugger.Read <RoomTile>(pRoomTile);
                if (game.Debugger.ReadUInt(roomTile.nNum) == dwTileNo)
                {
                    room2 = game.Debugger.Read <Room2>(roomTile.pRoom2);
                    var lvl = game.Debugger.Read <Level>(room2.pLevel);
                    return(lvl.dwLevelNo);
                }

                pRoomTile = roomTile.pNext;
            }

            return(0);
        }
Exemplo n.º 10
0
 public override void TurnRoomsOff()
 {
     //Deactivates all rooms except the point of entry and save rooms.
     if (Room0 != null)
     {
         Room0.SetActive(false);
     }
     if (Room1 != null)
     {
         //Room1.SetActive(false);
     }
     if (Room2 != null)
     {
         Room2.SetActive(false);
     }
     if (Room3 != null)
     {
         Room3.SetActive(false);
     }
     if (Room4 != null)
     {
         Room4.SetActive(false);
     }
     if (Room5 != null)
     {
         Room5.SetActive(false);
     }
     if (Room6 != null)
     {
         Room6.SetActive(false);
     }
     if (Room7 != null)
     {
         //Room7.SetActive(false);
     }
     if (Room8 != null)
     {
         Room8.SetActive(false);
     }
     if (Room9 != null)
     {
         Room9.SetActive(false);
     }
     if (Room10 != null)
     {
         Room10.SetActive(false);
     }
     if (Room11 != null)
     {
         Room11.SetActive(false);
     }
     if (Room12 != null)
     {
         //Room12.SetActive(false);
     }
     if (Room13 != null)
     {
         //Room13.SetActive(false);
     }
     if (Room14 != null)
     {
         Room14.SetActive(false);
     }
     if (Room15 != null)
     {
         //Room15.SetActive(false);
     }
     if (Room16 != null)
     {
         Room16.SetActive(false);
     }
     if (Room17 != null)
     {
         Room17.SetActive(false);
     }
     if (Room18 != null)
     {
         Room18.SetActive(false);
     }
     if (Room19 != null)
     {
         //Room19.SetActive(false);
     }
     if (Room20 != null)
     {
         Room20.SetActive(false);
     }
     if (Room21 != null)
     {
         Room21.SetActive(false);
     }
     if (Room22 != null)
     {
         Room22.SetActive(false);
     }
     if (Room23 != null)
     {
         //Room23.SetActive(false);
     }
     if (Room24 != null)
     {
         Room24.SetActive(false);
     }
     if (Room25 != null)
     {
         Room25.SetActive(false);
     }
     if (Room26 != null)
     {
         //Room26.SetActive(false);
     }
     if (Room27 != null)
     {
         Room27.SetActive(false);
     }
     if (Room28 != null)
     {
         Room28.SetActive(false);
     }
     if (Room29 != null)
     {
         //Room29.SetActive(false);
     }
     if (Room30 != null)
     {
         Room30.SetActive(false);
     }
     if (Room31 != null)
     {
         //Room31.SetActive(false);
     }
     if (Room32 != null)
     {
         Room32.SetActive(false);
     }
 }
Exemplo n.º 11
0
        protected void DrawPreset(Room2 room, Level lvl, PresetUnit preset)
        {
            var cellNo = -1;

            // Special NPC Check
            if (preset.dwType == 1)
            {
                // Izual
                if (preset.dwTxtFileNo == 256)
                {
                    cellNo = 300;
                }
                // Hephasto
                else if (preset.dwTxtFileNo == 402)
                {
                    cellNo = 745;
                }
            }
            else if (preset.dwType == 2)
            {
                switch (preset.dwTxtFileNo)
                {
                case 580:       // Uber Chest in Lower Kurast
                    if (lvl.dwLevelNo == 79)
                    {
                        cellNo = 9;
                    }
                    break;

                case 371:       // Countess Chest
                    cellNo = 301;
                    break;

                case 152:       // Act 2 Orifice
                    cellNo = 300;
                    break;

                case 460:       // Frozen Anya
                    cellNo = 1468;
                    break;

                case 402:       // Canyon / Arcane Waypoint
                    if (lvl.dwLevelNo == 46)
                    {
                        cellNo = 0;
                    }
                    break;

                case 376:       // Hell Forge
                    cellNo = 376;
                    break;

                default:
                    break;
                }

                if (cellNo == -1 && preset.dwTxtFileNo <= 572)
                {
                    var pTxt = game.Debugger.Call <IntPtr>(D2Common.GetObjectTxt,
                                                           MagicConvention.StdCall,
                                                           preset.dwTxtFileNo);
                    if (pTxt != IntPtr.Zero)
                    {
                        var txt = game.Debugger.Read <ObjectTxt>(pTxt);
                        cellNo = (int)txt.nAutoMap;
                    }
                }
            }

            if (cellNo > 0 /* && cellNo < 1258*/)
            {
                var pCell = game.Debugger.Call <IntPtr>(D2Client.NewAutomapCell,
                                                        MagicConvention.FastCall);

                var cell = game.Debugger.Read <AutomapCell>(pCell);

                var x = preset.dwPosX + room.dwPosX * 5;
                var y = preset.dwPosY + room.dwPosY * 5;

                cell.nCellNo = (ushort)cellNo;
                cell.xPixel  = (ushort)(((short)x - (short)y) * 1.6 + 1);
                cell.yPixel  = (ushort)((y + x) * 0.8 - 3);

                game.Debugger.Write <AutomapCell>(pCell, cell);

                var pAutomapLayer = game.Debugger.Read <uint>(D2Client.pAutoMapLayer);
                game.Debugger.Call(D2Client.AddAutomapCell,
                                   MagicConvention.FastCall,
                                   pCell,
                                   pAutomapLayer + 0x10); // &((*p_D2CLIENT_AutomapLayer)->pObjects)
            }
        }