diff --git a/data/orders/basic.json b/data/orders/basic.json index b3fae8dcd..16b05e0ba 100644 --- a/data/orders/basic.json +++ b/data/orders/basic.json @@ -256,10 +256,9 @@ "condition" : "AtLeast", "flags" : [ - "empty", - "bag" + "empty" ], - "item_type" : "BOX", + "item_type" : "BAG", "value" : 5 } ], @@ -310,10 +309,9 @@ "condition" : "AtLeast", "flags" : [ - "empty", - "bag" + "empty" ], - "item_type" : "BOX", + "item_type" : "BAG", "value" : 5 } ], @@ -725,6 +723,10 @@ }, { "condition" : "AtMost", + "flags" : + [ + "empty" + ], "item_subtype" : "ITEM_TOOL_MINECART", "item_type" : "TOOL", "value" : 2 @@ -844,14 +846,13 @@ "condition" : "AtMost", "flags" : [ - "empty", - "sewn_imageless" + "empty" ], - "item_type" : "BOX", + "item_type" : "BAG", "value" : 30 } ], - "job" : "ConstructChest", + "job" : "ConstructBag", "material_category" : [ "leather" @@ -880,14 +881,13 @@ "condition" : "AtMost", "flags" : [ - "empty", - "sewn_imageless" + "empty" ], - "item_type" : "BOX", + "item_type" : "BAG", "value" : 30 } ], - "job" : "ConstructChest", + "job" : "ConstructBag", "material_category" : [ "silk" @@ -916,14 +916,13 @@ "condition" : "AtMost", "flags" : [ - "empty", - "sewn_imageless" + "empty" ], - "item_type" : "BOX", + "item_type" : "BAG", "value" : 30 } ], - "job" : "ConstructChest", + "job" : "ConstructBag", "material_category" : [ "cloth" @@ -952,14 +951,13 @@ "condition" : "AtMost", "flags" : [ - "empty", - "sewn_imageless" + "empty" ], - "item_type" : "BOX", + "item_type" : "BAG", "value" : 30 } ], - "job" : "ConstructChest", + "job" : "ConstructBag", "material_category" : [ "yarn" @@ -1137,8 +1135,11 @@ }, { "condition" : "AtMost", - "item_type" : "LIQUID_MISC", - "material" : "LYE", + "contains" : + [ + "lye" + ], + "reaction_id" : "MAKE_SOAP_FROM_TALLOW", "value" : 5 } ], @@ -1166,8 +1167,11 @@ }, { "condition" : "AtLeast", - "item_type" : "LIQUID_MISC", - "material" : "LYE", + "contains" : + [ + "lye" + ], + "reaction_id" : "MAKE_SOAP_FROM_TALLOW", "value" : 3 }, { @@ -1200,8 +1204,11 @@ }, { "condition" : "AtLeast", - "item_type" : "LIQUID_MISC", - "material" : "LYE", + "contains" : + [ + "lye" + ], + "reaction_id" : "MAKE_SOAP_FROM_OIL", "value" : 3 }, { diff --git a/data/orders/furnace.json b/data/orders/furnace.json index 54d7d758e..62e389ded 100644 --- a/data/orders/furnace.json +++ b/data/orders/furnace.json @@ -152,10 +152,9 @@ "condition" : "AtLeast", "flags" : [ - "empty", - "bag" + "empty" ], - "item_type" : "BOX", + "item_type" : "BAG", "value" : 10 }, { diff --git a/docs/dev/Lua API.rst b/docs/dev/Lua API.rst index ebd82ce19..8b2d8b513 100644 --- a/docs/dev/Lua API.rst +++ b/docs/dev/Lua API.rst @@ -1779,6 +1779,10 @@ Maps module Returns the biome info struct for the given global map region. + ``dfhack.maps.getBiomeType(region_coord2d)`` or ``getBiomeType(x,y)`` + + Returns the biome_type for the given global map region. + * ``dfhack.maps.enableBlockUpdates(block[,flow,temperature])`` Enables updates for liquid flow or temperature, unless already active. @@ -1798,7 +1802,7 @@ Maps module * ``dfhack.maps.getTileBiomeRgn(coords)``, or ``getTileBiomeRgn(x,y,z)`` - Returns *x, y* for use with ``getRegionBiome``. + Returns *x, y* for use with ``getRegionBiome`` and ``getBiomeType``. * ``dfhack.maps.getPlantAtTile(pos)``, or ``getPlantAtTile(x,y,z)`` diff --git a/library/LuaApi.cpp b/library/LuaApi.cpp index 84612f790..ceb79556f 100644 --- a/library/LuaApi.cpp +++ b/library/LuaApi.cpp @@ -2131,6 +2131,13 @@ static int maps_getPlantAtTile(lua_State *L) return 1; } +static int maps_getBiomeType(lua_State *L) +{ + auto pos = CheckCoordXY(L, 1, true); + lua_pushinteger(L, Maps::getBiomeType(pos.x, pos.y)); + return 1; +} + static const luaL_Reg dfhack_maps_funcs[] = { { "isValidTilePos", maps_isValidTilePos }, { "isTileVisible", maps_isTileVisible }, @@ -2141,6 +2148,7 @@ static const luaL_Reg dfhack_maps_funcs[] = { { "getRegionBiome", maps_getRegionBiome }, { "getTileBiomeRgn", maps_getTileBiomeRgn }, { "getPlantAtTile", maps_getPlantAtTile }, + { "getBiomeType", maps_getBiomeType }, { NULL, NULL } }; diff --git a/library/include/modules/Maps.h b/library/include/modules/Maps.h index 225efae17..e468dcf9c 100644 --- a/library/include/modules/Maps.h +++ b/library/include/modules/Maps.h @@ -349,8 +349,8 @@ extern DFHACK_EXPORT df::plant *getPlantAtTile(int32_t x, int32_t y, int32_t z); inline df::plant *getPlantAtTile(df::coord pos) { return getPlantAtTile(pos.x, pos.y, pos.z); } -DFHACK_EXPORT df::enums::biome_type::biome_type GetBiomeType(int world_coord_x, int world_coord_y); -DFHACK_EXPORT df::enums::biome_type::biome_type GetBiomeTypeWithRef(int world_coord_x, int world_coord_y, int world_ref_y_coord); +DFHACK_EXPORT df::enums::biome_type::biome_type getBiomeType(int world_coord_x, int world_coord_y); +DFHACK_EXPORT df::enums::biome_type::biome_type getBiomeTypeWithRef(int world_coord_x, int world_coord_y, int world_ref_y_coord); } diff --git a/library/modules/Maps.cpp b/library/modules/Maps.cpp index e046faa0e..ddcd6078f 100644 --- a/library/modules/Maps.cpp +++ b/library/modules/Maps.cpp @@ -987,7 +987,7 @@ Return the biome type, given a position coordinate expressed in world_tiles The world ref coordinates are used for tropicality determination and may refer to a tile neighboring the "official" one. *****************************************************************************/ -df::enums::biome_type::biome_type Maps::GetBiomeTypeWithRef(int world_coord_x, +df::enums::biome_type::biome_type Maps::getBiomeTypeWithRef(int world_coord_x, int world_coord_y, int world_ref_coord_y ) @@ -1186,7 +1186,7 @@ df::enums::biome_type::biome_type Maps::GetBiomeTypeWithRef(int world_coord_x, Module main function. Return the biome type, given a position coordinate expressed in world_tiles *****************************************************************************/ -df::enums::biome_type::biome_type Maps::GetBiomeType(int world_coord_x, int world_coord_y) +df::enums::biome_type::biome_type Maps::getBiomeType(int world_coord_x, int world_coord_y) { - return Maps::GetBiomeTypeWithRef(world_coord_x, world_coord_y, world_coord_y); + return Maps::getBiomeTypeWithRef(world_coord_x, world_coord_y, world_coord_y); } diff --git a/plugins/autofarm.cpp b/plugins/autofarm.cpp index 566c49355..44253b2f9 100644 --- a/plugins/autofarm.cpp +++ b/plugins/autofarm.cpp @@ -315,7 +315,7 @@ public: biome = biome_type::SUBTERRANEAN_WATER; else { df::coord2d region(Maps::getTileBiomeRgn(df::coord(bb->centerx, bb->centery, bb->z))); - biome = Maps::GetBiomeType(region.x, region.y); + biome = Maps::getBiomeType(region.x, region.y); } farms[biome].push_back(farm); } diff --git a/plugins/embark-assistant/survey.cpp b/plugins/embark-assistant/survey.cpp index 80bf58fbd..9655fa886 100644 --- a/plugins/embark-assistant/survey.cpp +++ b/plugins/embark-assistant/survey.cpp @@ -790,7 +790,7 @@ void embark_assist::survey::high_level_world_survey(embark_assist::defs::geo_dat offset_count++; results.biome_index[l] = world_data->region_map[adjusted.x][adjusted.y].region_id; - results.biome[l] = DFHack::Maps::GetBiomeTypeWithRef(adjusted.x, adjusted.y, k); + results.biome[l] = DFHack::Maps::getBiomeTypeWithRef(adjusted.x, adjusted.y, k); temperature = world_data->region_map[adjusted.x][adjusted.y].temperature; negative = temperature < 0; diff --git a/plugins/lua/fortplan.lua b/plugins/lua/fortplan.lua deleted file mode 100644 index 71e69c69d..000000000 --- a/plugins/lua/fortplan.lua +++ /dev/null @@ -1,13 +0,0 @@ -local _ENV = mkmodule('plugins.fortplan') - -require('dfhack.buildings') - -function construct_building_from_params(building_type, x, y, z) - local pos = xyz2pos(x, y, z) - local bld, err = - dfhack.buildings.constructBuilding{type=building_type, pos=pos} - if err then error(err) end - return bld -end - -return _ENV diff --git a/scripts b/scripts index 4e97b8095..9666cb8eb 160000 --- a/scripts +++ b/scripts @@ -1 +1 @@ -Subproject commit 4e97b809511660f7b5fc98e82f7d1cfff49395ee +Subproject commit 9666cb8ebcc51f8e4bb2fb99116636793a7e4270