Ejemplo n.º 1
0
        // Token: 0x06000054 RID: 84 RVA: 0x000056A8 File Offset: 0x000038A8
        public static DungeonFlow CreateRoomTypeSampleFlow(Dungeon dungeon)
        {
            DungeonFlow dungeonFlow = SampleFlow.CreateNewFlow(dungeon);

            dungeonFlow.name = "type_sample_flow";
            DungeonFlowNode dungeonFlowNode = SampleFlow.NodeFromAssetName(dungeonFlow, "elevator entrance");

            dungeonFlow.FirstNode = dungeonFlowNode;
            dungeonFlow.AddNodeToFlow(dungeonFlowNode, null);
            DungeonFlowNode parent = dungeonFlow.FirstNode;

            DungeonMaterial[] roomMaterialDefinitions = dungeon.roomMaterialDefinitions;
            Tools.Print <int?>((roomMaterialDefinitions != null) ? new int?(roomMaterialDefinitions.Length) : null, "FFFFFF", false);
            for (int i = 0; i < dungeon.roomMaterialDefinitions.Length; i++)
            {
                bool flag = dungeon.name == OfficialFlows.dungeonPrefabNames[3] && i == 5;
                if (!flag)
                {
                    PrototypeDungeonRoom prototypeDungeonRoom = RoomFactory.CreateEmptyRoom(14, 14);
                    prototypeDungeonRoom.overrideRoomVisualType = i;
                    DungeonFlowNode dungeonFlowNode2 = new DungeonFlowNode(dungeonFlow)
                    {
                        overrideExactRoom = prototypeDungeonRoom
                    };
                    dungeonFlow.AddNodeToFlow(dungeonFlowNode2, parent);
                    parent = dungeonFlowNode2;
                }
            }
            dungeonFlow.AddNodeToFlow(SampleFlow.NodeFromAssetName(dungeonFlow, "exit_room_basic"), parent);
            dungeon = null;
            return(dungeonFlow);
        }
Ejemplo n.º 2
0
        // Token: 0x06000053 RID: 83 RVA: 0x000055AC File Offset: 0x000037AC
        public static DungeonFlow CreateDebugFlow(Dungeon dungeon)
        {
            DungeonFlow dungeonFlow = SampleFlow.CreateEntranceExitFlow(dungeon);

            dungeonFlow.name = "debug_flow";
            DungeonFlowNode dungeonFlowNode = new DungeonFlowNode(dungeonFlow)
            {
                overrideExactRoom = RoomFactory.CreateEmptyRoom(12, 12)
            };
            DungeonFlowNode parent = dungeonFlowNode;

            dungeonFlow.AddNodeToFlow(dungeonFlowNode, dungeonFlow.FirstNode);
            foreach (RoomFactory.RoomData roomData in RoomFactory.rooms.Values)
            {
                string str = "Adding room to flow: ";
                PrototypeDungeonRoom room = roomData.room;
                Tools.Log <string>(str + ((room != null) ? room.ToString() : null));
                DungeonFlowNode dungeonFlowNode2 = new DungeonFlowNode(dungeonFlow)
                {
                    overrideExactRoom = roomData.room
                };
                dungeonFlow.AddNodeToFlow(dungeonFlowNode2, parent);
                dungeonFlowNode = new DungeonFlowNode(dungeonFlow)
                {
                    overrideExactRoom = RoomFactory.CreateEmptyRoom(12, 12)
                };
                dungeonFlow.AddNodeToFlow(dungeonFlowNode, dungeonFlowNode2);
                parent = dungeonFlowNode;
            }
            dungeon = null;
            return(dungeonFlow);
        }
Ejemplo n.º 3
0
        public static DungeonFlow CreateDebugFlow(Dungeon dungeon)
        {
            var flow = SampleFlow.CreateEntranceExitFlow(dungeon);

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

            flow.AddNodeToFlow(hub, flow.FirstNode);
            foreach (var room in RoomFactory.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 = RoomFactory.CreateEmptyRoom()
                };
                flow.AddNodeToFlow(hub, customRoom);
                lastNode = hub;
            }
            dungeon = null;
            return(flow);
        }
Ejemplo n.º 4
0
        // Token: 0x06000055 RID: 85 RVA: 0x000057A8 File Offset: 0x000039A8
        public static DungeonFlow CreateEntranceExitFlow(Dungeon dungeon)
        {
            DungeonFlow dungeonFlow = SampleFlow.CreateNewFlow(dungeon);

            dungeonFlow.name = "entrance_exit_flow";
            DungeonFlowNode dungeonFlowNode = SampleFlow.NodeFromAssetName(dungeonFlow, "elevator entrance");

            dungeonFlow.FirstNode = dungeonFlowNode;
            dungeonFlow.AddNodeToFlow(dungeonFlowNode, null);
            dungeonFlow.AddNodeToFlow(SampleFlow.NodeFromAssetName(dungeonFlow, "exit_room_basic"), dungeonFlowNode);
            dungeon = null;
            return(dungeonFlow);
        }
Ejemplo n.º 5
0
        // Token: 0x06000058 RID: 88 RVA: 0x00005900 File Offset: 0x00003B00
        public static DungeonFlowNode NodeFromAssetName(DungeonFlow flow, string name)
        {
            DungeonFlowNode      dungeonFlowNode      = new DungeonFlowNode(flow);
            PrototypeDungeonRoom prototypeDungeonRoom = SampleFlow.RoomFromAssetName(name);
            bool flag = prototypeDungeonRoom == null;

            if (flag)
            {
                Tools.Print <string>("Error loading room " + name, "FF0000", false);
            }
            dungeonFlowNode.overrideExactRoom = prototypeDungeonRoom;
            return(dungeonFlowNode);
        }
Ejemplo n.º 6
0
 public static void OnPreDungeonGen(LoopDungeonGenerator generator, Dungeon dungeon, DungeonFlow flow, int dungeonSeed)
 {
     // Tools.Print("Attempting to override floor layout...", "5599FF");
     //CollectDataForAnalysis(flow, dungeon);
     if (flow.name != "Foyer Flow" && !GameManager.IsReturningToFoyerWithPlayer)
     {
         if (debugFlow)
         {
             flow = SampleFlow.CreateDebugFlow(dungeon);
             generator.AssignFlow(flow);
         }
         //  Tools.Print("Dungeon name: " + dungeon.name);
         // Tools.Print("Override Flow set to: " + flow.name);
     }
     dungeon = null;
 }
Ejemplo n.º 7
0
        // Token: 0x06000056 RID: 86 RVA: 0x00005804 File Offset: 0x00003A04
        public static DungeonFlow CreateMazeFlow(Dungeon dungeon)
        {
            DungeonFlow dungeonFlow = SampleFlow.CreateNewFlow(dungeon);

            dungeonFlow.name = "maze_flow";
            DungeonFlowNode dungeonFlowNode = SampleFlow.NodeFromAssetName(dungeonFlow, "elevator entrance");

            dungeonFlow.FirstNode = dungeonFlowNode;
            dungeonFlow.AddNodeToFlow(dungeonFlowNode, null);
            DungeonFlowNode dungeonFlowNode2 = new DungeonFlowNode(dungeonFlow)
            {
                overrideExactRoom = RoomFactory.BuildFromResource("resource/rooms/maze.room").room
            };

            dungeonFlow.AddNodeToFlow(dungeonFlowNode2, dungeonFlowNode);
            dungeonFlow.AddNodeToFlow(SampleFlow.NodeFromAssetName(dungeonFlow, "exit_room_basic"), dungeonFlowNode2);
            dungeon = null;
            return(dungeonFlow);
        }