Exemplo n.º 1
0
        public static DungeonFlow CreateRoomTypeSampleFlow(Dungeon dungeon)
        {
            var flow = CreateNewFlow(dungeon);

            flow.name = "type_sample_flow";

            var entrance = NodeFromAssetName(flow, "elevator entrance");

            flow.FirstNode = entrance;
            flow.AddNodeToFlow(entrance, null);

            //one room for each visual definition
            DungeonFlowNode lastNode = flow.FirstNode;

            ItemAPI.Tools.Print(dungeon.roomMaterialDefinitions?.Length);
            for (int i = 0; i < dungeon.roomMaterialDefinitions.Length; i++)
            {
                if (dungeon.name == OfficialFlows.dungeonPrefabNames[3] && i == 5)
                {
                    continue;
                }
                var room = RoomFactoryTrueForm.CreateEmptyRoom(14, 14);
                room.overrideRoomVisualType = i;
                var shrineNode = new DungeonFlowNode(flow)
                {
                    overrideExactRoom = room
                };
                flow.AddNodeToFlow(shrineNode, lastNode);
                lastNode = shrineNode;
            }
            //exit
            flow.AddNodeToFlow(NodeFromAssetName(flow, "exit_room_basic"), lastNode);
            dungeon = null;
            return(flow);
        }
Exemplo n.º 2
0
        public static DungeonFlow CreateDebugFlow(Dungeon dungeon)
        {
            var flow = SampleFlow.CreateEntranceExitFlow(dungeon);

            flow.name = "debug_flow";
            DungeonFlowNode
                customRoom,
                hub = new DungeonFlowNode(flow)
            {
                overrideExactRoom = RoomFactoryTrueForm.CreateEmptyRoom()
            },
                lastNode = hub;

            flow.AddNodeToFlow(hub, flow.FirstNode);
            foreach (var room in RoomFactoryTrueForm.rooms.Values)
            {
                Tools.Log("Adding room to flow: " + room.room);
                customRoom = new DungeonFlowNode(flow)
                {
                    overrideExactRoom = room.room
                };
                flow.AddNodeToFlow(customRoom, lastNode);
                hub = new DungeonFlowNode(flow)
                {
                    overrideExactRoom = RoomFactoryTrueForm.CreateEmptyRoom()
                };
                flow.AddNodeToFlow(hub, customRoom);
                lastNode = hub;
            }
            dungeon = null;
            return(flow);
        }