diff --git a/Autoload/Slabs.gd b/Autoload/Slabs.gd index 83e15512..92894235 100644 --- a/Autoload/Slabs.gd +++ b/Autoload/Slabs.gd @@ -105,7 +105,8 @@ const OWNABLE = true const FLOOR_SLAB = false const BLOCK_SLAB = true enum { - BITMASK_GENERAL + BITMASK_FLOOR + BITMASK_BLOCK BITMASK_SIMPLE BITMASK_CLAIMED BITMASK_REINFORCED @@ -198,47 +199,47 @@ func fetch_name(slabID): var data = { -00: ["HARD", BLOCK_SLAB, BITMASK_GENERAL, PANEL_TOP_VIEW, 0, TAB_MAINSLAB, WIBBLE_ON, REMEMBER_PATH, NOT_OWNABLE], # 0 -01: ["GOLD", BLOCK_SLAB, BITMASK_GENERAL, PANEL_TOP_VIEW, 0, TAB_MAINSLAB, WIBBLE_ON, REMEMBER_PATH, NOT_OWNABLE], # 1 -02: ["DIRT", BLOCK_SLAB, BITMASK_GENERAL, PANEL_TOP_VIEW, 0, TAB_MAINSLAB, WIBBLE_ON, REMEMBER_PATH, NOT_OWNABLE], # 2 -03: ["TORCH_DIRT", BLOCK_SLAB, BITMASK_GENERAL, PANEL_SIDE_VIEW, 4, TAB_OTHER, WIBBLE_ON, REMEMBER_PATH, NOT_OWNABLE], # 3 +00: ["HARD", BLOCK_SLAB, BITMASK_BLOCK, PANEL_TOP_VIEW, 0, TAB_MAINSLAB, WIBBLE_ON, REMEMBER_PATH, NOT_OWNABLE], # 0 +01: ["GOLD", BLOCK_SLAB, BITMASK_BLOCK, PANEL_TOP_VIEW, 0, TAB_MAINSLAB, WIBBLE_ON, REMEMBER_PATH, NOT_OWNABLE], # 1 +02: ["DIRT", BLOCK_SLAB, BITMASK_BLOCK, PANEL_TOP_VIEW, 0, TAB_MAINSLAB, WIBBLE_ON, REMEMBER_PATH, NOT_OWNABLE], # 2 +03: ["TORCH_DIRT", BLOCK_SLAB, BITMASK_BLOCK, PANEL_SIDE_VIEW, 4, TAB_OTHER, WIBBLE_ON, REMEMBER_PATH, NOT_OWNABLE], # 3 04: ["DRAPE_WALL", BLOCK_SLAB, BITMASK_REINFORCED, PANEL_SIDE_VIEW, 4, TAB_OTHER, WIBBLE_ON, REMEMBER_PATH, OWNABLE], # 4 05: ["TORCH_WALL", BLOCK_SLAB, BITMASK_REINFORCED, PANEL_SIDE_VIEW, 4, TAB_OTHER, WIBBLE_ON, REMEMBER_PATH, OWNABLE], # 5 06: ["TWINS_WALL", BLOCK_SLAB, BITMASK_REINFORCED, PANEL_SIDE_VIEW, 4, TAB_OTHER, WIBBLE_ON, REMEMBER_PATH, OWNABLE], # 6 07: ["WOMAN_WALL", BLOCK_SLAB, BITMASK_REINFORCED, PANEL_SIDE_VIEW, 4, TAB_OTHER, WIBBLE_ON, REMEMBER_PATH, OWNABLE], # 7 08: ["PAIR_WALL", BLOCK_SLAB, BITMASK_REINFORCED, PANEL_SIDE_VIEW, 4, TAB_OTHER, WIBBLE_ON, REMEMBER_PATH, OWNABLE], # 8 09: ["DAMAGED_WALL", BLOCK_SLAB, BITMASK_REINFORCED, PANEL_SIDE_VIEW, 4, TAB_OTHER, WIBBLE_ON, REMEMBER_PATH, OWNABLE], # 9 -10: ["PATH", FLOOR_SLAB, BITMASK_GENERAL, PANEL_TOP_VIEW, 0, TAB_MAINSLAB, WIBBLE_ON, REMEMBER_PATH, NOT_OWNABLE], # 10 +10: ["PATH", FLOOR_SLAB, BITMASK_FLOOR, PANEL_TOP_VIEW, 0, TAB_MAINSLAB, WIBBLE_ON, REMEMBER_PATH, NOT_OWNABLE], # 10 11: ["PRETTY_PATH", FLOOR_SLAB, BITMASK_CLAIMED, PANEL_TOP_VIEW, 0, TAB_MAINSLAB, WIBBLE_ON, REMEMBER_PATH, OWNABLE], # 11 -12: ["LAVA", FLOOR_SLAB, BITMASK_GENERAL, PANEL_TOP_VIEW, 0, TAB_MAINSLAB, WIBBLE_ANIMATED, REMEMBER_LAVA, NOT_OWNABLE], # 12 -13: ["WATER", FLOOR_SLAB, BITMASK_GENERAL, PANEL_TOP_VIEW, 0, TAB_MAINSLAB, WIBBLE_ANIMATED, REMEMBER_WATER, NOT_OWNABLE], # 13 -14: ["ENTRANCE_ZONE", FLOOR_SLAB, BITMASK_GENERAL, PANEL_TOP_VIEW, 0, TAB_MAINSLAB, WIBBLE_ON, REMEMBER_PATH, OWNABLE], # 14 +12: ["LAVA", FLOOR_SLAB, BITMASK_FLOOR, PANEL_TOP_VIEW, 0, TAB_MAINSLAB, WIBBLE_ANIMATED, REMEMBER_LAVA, NOT_OWNABLE], # 12 +13: ["WATER", FLOOR_SLAB, BITMASK_FLOOR, PANEL_TOP_VIEW, 0, TAB_MAINSLAB, WIBBLE_ANIMATED, REMEMBER_WATER, NOT_OWNABLE], # 13 +14: ["ENTRANCE_ZONE", FLOOR_SLAB, BITMASK_FLOOR, PANEL_TOP_VIEW, 0, TAB_MAINSLAB, WIBBLE_ON, REMEMBER_PATH, OWNABLE], # 14 15: ["ENTRANCE_WALL", BLOCK_SLAB, BITMASK_REINFORCED, PANEL_SIDE_VIEW, 3, TAB_OTHER, WIBBLE_ON, REMEMBER_PATH, OWNABLE], # 15 -16: ["TREASURY_AREA", FLOOR_SLAB, BITMASK_GENERAL, PANEL_TOP_VIEW, 0, TAB_MAINSLAB, WIBBLE_ON, REMEMBER_PATH, OWNABLE], # 16 +16: ["TREASURY_AREA", FLOOR_SLAB, BITMASK_FLOOR, PANEL_TOP_VIEW, 0, TAB_MAINSLAB, WIBBLE_ON, REMEMBER_PATH, OWNABLE], # 16 17: ["TREASURY_WALL", BLOCK_SLAB, BITMASK_REINFORCED, PANEL_SIDE_VIEW, 3, TAB_OTHER, WIBBLE_ON, REMEMBER_PATH, OWNABLE], # 17 -18: ["BOOK_SHELVES", FLOOR_SLAB, BITMASK_GENERAL, PANEL_TOP_VIEW, 0, TAB_MAINSLAB, WIBBLE_ON, REMEMBER_PATH, OWNABLE], # 18 +18: ["BOOK_SHELVES", FLOOR_SLAB, BITMASK_FLOOR, PANEL_TOP_VIEW, 0, TAB_MAINSLAB, WIBBLE_ON, REMEMBER_PATH, OWNABLE], # 18 19: ["LIBRARY_WALL", BLOCK_SLAB, BITMASK_REINFORCED, PANEL_SIDE_VIEW, 3, TAB_OTHER, WIBBLE_ON, REMEMBER_PATH, OWNABLE], # 19 -20: ["PRISON_AREA", FLOOR_SLAB, BITMASK_GENERAL, PANEL_TOP_VIEW, 0, TAB_MAINSLAB, WIBBLE_ON, REMEMBER_PATH, OWNABLE], # 20 +20: ["PRISON_AREA", FLOOR_SLAB, BITMASK_FLOOR, PANEL_TOP_VIEW, 0, TAB_MAINSLAB, WIBBLE_ON, REMEMBER_PATH, OWNABLE], # 20 21: ["PRISON_WALL", BLOCK_SLAB, BITMASK_REINFORCED, PANEL_SIDE_VIEW, 3, TAB_OTHER, WIBBLE_ON, REMEMBER_PATH, OWNABLE], # 21 -22: ["TORTURE_AREA", FLOOR_SLAB, BITMASK_GENERAL, PANEL_TOP_VIEW, 0, TAB_MAINSLAB, WIBBLE_ON, REMEMBER_PATH, OWNABLE], # 22 +22: ["TORTURE_AREA", FLOOR_SLAB, BITMASK_FLOOR, PANEL_TOP_VIEW, 0, TAB_MAINSLAB, WIBBLE_ON, REMEMBER_PATH, OWNABLE], # 22 23: ["TORTURE_WALL", BLOCK_SLAB, BITMASK_REINFORCED, PANEL_SIDE_VIEW, 4, TAB_OTHER, WIBBLE_ON, REMEMBER_PATH, OWNABLE], # 23 -24: ["TRAINING_AREA", FLOOR_SLAB, BITMASK_GENERAL, PANEL_TOP_VIEW, 3, TAB_MAINSLAB, WIBBLE_ON, REMEMBER_PATH, OWNABLE], # 24 +24: ["TRAINING_AREA", FLOOR_SLAB, BITMASK_FLOOR, PANEL_TOP_VIEW, 3, TAB_MAINSLAB, WIBBLE_ON, REMEMBER_PATH, OWNABLE], # 24 25: ["TRAINING_WALL", BLOCK_SLAB, BITMASK_REINFORCED, PANEL_SIDE_VIEW, 3, TAB_OTHER, WIBBLE_ON, REMEMBER_PATH, OWNABLE], # 25 -26: ["HEART_PEDESTAL", FLOOR_SLAB, BITMASK_GENERAL, PANEL_TOP_VIEW, 0, TAB_MAINSLAB, WIBBLE_ON, REMEMBER_PATH, OWNABLE], # 26 +26: ["HEART_PEDESTAL", FLOOR_SLAB, BITMASK_FLOOR, PANEL_TOP_VIEW, 0, TAB_MAINSLAB, WIBBLE_ON, REMEMBER_PATH, OWNABLE], # 26 27: ["HEART_WALL", BLOCK_SLAB, BITMASK_REINFORCED, PANEL_SIDE_VIEW, 3, TAB_OTHER, WIBBLE_ON, REMEMBER_PATH, OWNABLE], # 27 -28: ["WORKSHOP_AREA", FLOOR_SLAB, BITMASK_GENERAL, PANEL_TOP_VIEW, 0, TAB_MAINSLAB, WIBBLE_ON, REMEMBER_PATH, OWNABLE], # 28 +28: ["WORKSHOP_AREA", FLOOR_SLAB, BITMASK_FLOOR, PANEL_TOP_VIEW, 0, TAB_MAINSLAB, WIBBLE_ON, REMEMBER_PATH, OWNABLE], # 28 29: ["WORKSHOP_WALL", BLOCK_SLAB, BITMASK_REINFORCED, PANEL_SIDE_VIEW, 3, TAB_OTHER, WIBBLE_ON, REMEMBER_PATH, OWNABLE], # 29 -30: ["SCAVENGE_AREA", FLOOR_SLAB, BITMASK_GENERAL, PANEL_TOP_VIEW, 0, TAB_MAINSLAB, WIBBLE_ON, REMEMBER_PATH, OWNABLE], # 30 +30: ["SCAVENGE_AREA", FLOOR_SLAB, BITMASK_FLOOR, PANEL_TOP_VIEW, 0, TAB_MAINSLAB, WIBBLE_ON, REMEMBER_PATH, OWNABLE], # 30 31: ["SCAVENGER_WALL", BLOCK_SLAB, BITMASK_REINFORCED, PANEL_SIDE_VIEW, 3, TAB_OTHER, WIBBLE_ON, REMEMBER_PATH, OWNABLE], # 31 -32: ["TEMPLE_POOL", FLOOR_SLAB, BITMASK_GENERAL, PANEL_TOP_VIEW, 0, TAB_MAINSLAB, WIBBLE_ON, REMEMBER_PATH, OWNABLE], # 32 +32: ["TEMPLE_POOL", FLOOR_SLAB, BITMASK_FLOOR, PANEL_TOP_VIEW, 0, TAB_MAINSLAB, WIBBLE_ON, REMEMBER_PATH, OWNABLE], # 32 33: ["TEMPLE_WALL", BLOCK_SLAB, BITMASK_REINFORCED, PANEL_SIDE_VIEW, 3, TAB_OTHER, WIBBLE_ON, REMEMBER_PATH, OWNABLE], # 33 -34: ["GRAVE_AREA", FLOOR_SLAB, BITMASK_GENERAL, PANEL_TOP_VIEW, 0, TAB_MAINSLAB, WIBBLE_ON, REMEMBER_PATH, OWNABLE], # 34 +34: ["GRAVE_AREA", FLOOR_SLAB, BITMASK_FLOOR, PANEL_TOP_VIEW, 0, TAB_MAINSLAB, WIBBLE_ON, REMEMBER_PATH, OWNABLE], # 34 35: ["GRAVE_WALL", BLOCK_SLAB, BITMASK_REINFORCED, PANEL_SIDE_VIEW, 3, TAB_OTHER, WIBBLE_ON, REMEMBER_PATH, OWNABLE], # 35 -36: ["HATCHERY", FLOOR_SLAB, BITMASK_GENERAL, PANEL_TOP_VIEW, 0, TAB_MAINSLAB, WIBBLE_ON, REMEMBER_PATH, OWNABLE], # 36 +36: ["HATCHERY", FLOOR_SLAB, BITMASK_FLOOR, PANEL_TOP_VIEW, 0, TAB_MAINSLAB, WIBBLE_ON, REMEMBER_PATH, OWNABLE], # 36 37: ["HATCHERY_WALL", BLOCK_SLAB, BITMASK_REINFORCED, PANEL_SIDE_VIEW, 3, TAB_OTHER, WIBBLE_ON, REMEMBER_PATH, OWNABLE], # 37 -38: ["LAIR_AREA", FLOOR_SLAB, BITMASK_GENERAL, PANEL_TOP_VIEW, 0, TAB_MAINSLAB, WIBBLE_ON, REMEMBER_PATH, OWNABLE], # 38 +38: ["LAIR_AREA", FLOOR_SLAB, BITMASK_FLOOR, PANEL_TOP_VIEW, 0, TAB_MAINSLAB, WIBBLE_ON, REMEMBER_PATH, OWNABLE], # 38 39: ["LAIR_WALL", BLOCK_SLAB, BITMASK_REINFORCED, PANEL_SIDE_VIEW, 3, TAB_OTHER, WIBBLE_ON, REMEMBER_PATH, OWNABLE], # 39 -40: ["BARRACK_AREA", FLOOR_SLAB, BITMASK_GENERAL, PANEL_TOP_VIEW, 0, TAB_MAINSLAB, WIBBLE_ON, REMEMBER_PATH, OWNABLE], # 40 +40: ["BARRACK_AREA", FLOOR_SLAB, BITMASK_FLOOR, PANEL_TOP_VIEW, 0, TAB_MAINSLAB, WIBBLE_ON, REMEMBER_PATH, OWNABLE], # 40 41: ["BARRACK_WALL", BLOCK_SLAB, BITMASK_REINFORCED, PANEL_SIDE_VIEW, 3, TAB_OTHER, WIBBLE_ON, REMEMBER_PATH, OWNABLE], # 41 42: ["DOOR_WOODEN", FLOOR_SLAB, BITMASK_DOOR1, PANEL_DOOR_VIEW, 3, TAB_NONE, WIBBLE_ON, REMEMBER_PATH, OWNABLE], # 42 43: ["DOOR_WOODEN2", FLOOR_SLAB, BITMASK_DOOR2, PANEL_DOOR_VIEW, 3, TAB_MAINSLAB, WIBBLE_ON, REMEMBER_PATH, OWNABLE], # 43 diff --git a/Scenes/CfgLoader.gd b/Scenes/CfgLoader.gd index 7986c0cb..e9968b40 100644 --- a/Scenes/CfgLoader.gd +++ b/Scenes/CfgLoader.gd @@ -126,7 +126,7 @@ func load_terrain_data(path): # 4ms setIsOwnable = Slabs.OWNABLE - var setBitmask = Slabs.BITMASK_GENERAL + var setBitmask = Slabs.BITMASK_BLOCK if slabSection.get("Animated", 0) == 1: setBitmask = Slabs.BITMASK_SIMPLE @@ -137,15 +137,18 @@ func load_terrain_data(path): # 4ms else: match slabSection.get("Category", 0): 0: # Unclaimed - setBitmask = Slabs.BITMASK_GENERAL + if setBlockType == Slabs.BLOCK_SLAB: + setBitmask = Slabs.BITMASK_BLOCK + elif setBlockType == Slabs.FLOOR_SLAB: + setBitmask = Slabs.BITMASK_FLOOR 1: # Diggable dirt - setBitmask = Slabs.BITMASK_GENERAL + setBitmask = Slabs.BITMASK_BLOCK 2: # Claimed path setBitmask = Slabs.BITMASK_CLAIMED 3: # Fortified wall setBitmask = Slabs.BITMASK_REINFORCED - 4: # Room interior - setBitmask = Slabs.BITMASK_GENERAL + 4: # Room + setBitmask = Slabs.BITMASK_FLOOR 5: # Obstacle setBitmask = Slabs.BITMASK_SIMPLE diff --git a/Scenes/CustomSlabSystem.gd b/Scenes/CustomSlabSystem.gd index 949fea21..25d9f87e 100644 --- a/Scenes/CustomSlabSystem.gd +++ b/Scenes/CustomSlabSystem.gd @@ -40,7 +40,7 @@ func load_unearth_custom_slabs_file(): "wibble_edges": cfg.get_value(section, "wibble_edges", false), "cube_data": slabCubeData, "floor_data": slabFloorData, - "bitmask": cfg.get_value(section, "bitmask", Slabs.BITMASK_GENERAL), + "bitmask": cfg.get_value(section, "bitmask", Slabs.BITMASK_FLOOR), "is_solid": cfg.get_value(section, "is_solid", Slabs.FLOOR_SLAB), "ownable": cfg.get_value(section, "ownable", Slabs.OWNABLE), } diff --git a/Scenes/SlabPlacement.gd b/Scenes/SlabPlacement.gd index 97b08efa..ebda2c5d 100644 --- a/Scenes/SlabPlacement.gd +++ b/Scenes/SlabPlacement.gd @@ -569,12 +569,14 @@ func place_general(xSlab, ySlab, slabID, ownership, surrID, surrOwner, bitmaskTy var bitmask match bitmaskType: - Slabs.BITMASK_REINFORCED: - bitmask = get_wall_bitmask(xSlab, ySlab, surrID, ownership) - Slabs.BITMASK_GENERAL: + Slabs.BITMASK_BLOCK: + bitmask = get_tall_bitmask(surrID) + Slabs.BITMASK_FLOOR: bitmask = get_general_bitmask(slabID, ownership, surrID, surrOwner) Slabs.BITMASK_CLAIMED: bitmask = get_claimed_bitmask(slabID, ownership, surrID, surrOwner) + Slabs.BITMASK_REINFORCED: + bitmask = get_wall_bitmask(xSlab, ySlab, surrID, ownership) Slabs.BITMASK_SIMPLE: bitmask = 1 # Always use south variation modifyForLiquid = false @@ -753,13 +755,13 @@ func set_columns(xSlab, ySlab, constructedColumns, constructedFloor): var xSubtile = i - (ySubtile*3) oDataClmPos.set_cell_clmpos((xSlab*3)+xSubtile, (ySlab*3)+ySubtile, clmIndex) -#func get_tall_bitmask(surrID): -# var bitmask = 0 -# if Slabs.data[ surrID[dir.s] ][Slabs.IS_SOLID] == false: bitmask += 1 -# if Slabs.data[ surrID[dir.w] ][Slabs.IS_SOLID] == false: bitmask += 2 -# if Slabs.data[ surrID[dir.n] ][Slabs.IS_SOLID] == false: bitmask += 4 -# if Slabs.data[ surrID[dir.e] ][Slabs.IS_SOLID] == false: bitmask += 8 -# return bitmask +func get_tall_bitmask(surrID): + var bitmask = 0 + if Slabs.data[ surrID[dir.s] ][Slabs.IS_SOLID] == false: bitmask += 1 + if Slabs.data[ surrID[dir.w] ][Slabs.IS_SOLID] == false: bitmask += 2 + if Slabs.data[ surrID[dir.n] ][Slabs.IS_SOLID] == false: bitmask += 4 + if Slabs.data[ surrID[dir.e] ][Slabs.IS_SOLID] == false: bitmask += 8 + return bitmask func get_general_bitmask(slabID, ownership, surrID, surrOwner): var bitmask = 0 # Center diff --git a/Scenes/UndoStates.gd b/Scenes/UndoStates.gd index ce5bb13a..a3f1d17a 100644 --- a/Scenes/UndoStates.gd +++ b/Scenes/UndoStates.gd @@ -38,18 +38,13 @@ func _process(delta): if undo_save_queued == true: set_process(false) while true: - print("a") if Input.is_mouse_button_pressed(BUTTON_LEFT) or \ oLoadingBar.visible == true or \ oNewMapWindow.currently_creating_new_map == true or \ performing_undo == true: - print("b") yield(get_tree(), "idle_frame") - print("c") else: - print("d") break - print("oThreadedSaveUndo.semaphore.post()") oThreadedSaveUndo.semaphore.post() undo_save_queued = false