Merge pull request #3489 from myk002/myk_obsidian

[dig-now] handle obsidian
develop
Myk 2023-06-21 02:16:25 -07:00 committed by GitHub
commit c0fb6d6465
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 25 additions and 18 deletions

@ -49,6 +49,7 @@ changelog.txt uses a syntax similar to RST, with a few special sequences:
- Blueprint library: pump_stack: updated walkthrough and separated dig and channel steps so boulders can be cleared - Blueprint library: pump_stack: updated walkthrough and separated dig and channel steps so boulders can be cleared
- Blueprint library: aquifer_tap: updated walkthrough - Blueprint library: aquifer_tap: updated walkthrough
- `orders`: better order conditions for the ``smelting`` library orders to reduce cancellation spam - `orders`: better order conditions for the ``smelting`` library orders to reduce cancellation spam
- `dig-now`: can now handle digging obsidian that has been formed from magma and water
## Documentation ## Documentation
- `blueprint-library-guide`: update Dreamfort screenshots, add ``aquifer_tap`` screenshot - `blueprint-library-guide`: update Dreamfort screenshots, add ``aquifer_tap`` screenshot

@ -388,21 +388,37 @@ struct dug_tile_info {
df::tiletype tt = map.tiletypeAt(pos); df::tiletype tt = map.tiletypeAt(pos);
tmat = tileMaterial(tt); tmat = tileMaterial(tt);
itype = df::item_type::BOULDER;
imat = -1;
df::tiletype_shape shape = tileShape(tt);
if (shape == df::tiletype_shape::WALL || shape == df::tiletype_shape::FORTIFICATION) {
switch (tmat) {
case df::tiletype_material::STONE:
case df::tiletype_material::MINERAL:
case df::tiletype_material::FEATURE:
imat = map.baseMaterialAt(pos).mat_index;
break;
case df::tiletype_material::LAVA_STONE:
{
MaterialInfo mi;
if (mi.findInorganic("OBSIDIAN"))
imat = mi.index;
return; // itype should always be BOULDER, regardless of vein
}
default:
break;
}
}
switch (map.BlockAtTile(pos)->veinTypeAt(pos)) { switch (map.BlockAtTile(pos)->veinTypeAt(pos)) {
case df::inclusion_type::CLUSTER_ONE: case df::inclusion_type::CLUSTER_ONE:
case df::inclusion_type::CLUSTER_SMALL: case df::inclusion_type::CLUSTER_SMALL:
itype = df::item_type::ROUGH; itype = df::item_type::ROUGH;
break; break;
default: default:
itype = df::item_type::BOULDER; break;
} }
imat = -1;
if (tileShape(tt) == df::tiletype_shape::WALL
&& (tmat == df::tiletype_material::STONE
|| tmat == df::tiletype_material::MINERAL
|| tmat == df::tiletype_material::FEATURE))
imat = map.baseMaterialAt(pos).mat_index;
} }
}; };
@ -415,7 +431,6 @@ static bool is_diggable(MapExtras::MapCache &map, const DFCoord &pos,
case df::tiletype_material::RIVER: case df::tiletype_material::RIVER:
case df::tiletype_material::TREE: case df::tiletype_material::TREE:
case df::tiletype_material::ROOT: case df::tiletype_material::ROOT:
case df::tiletype_material::LAVA_STONE:
case df::tiletype_material::MAGMA: case df::tiletype_material::MAGMA:
case df::tiletype_material::HFS: case df::tiletype_material::HFS:
case df::tiletype_material::UNDERWORLD_GATE: case df::tiletype_material::UNDERWORLD_GATE:
@ -444,15 +459,6 @@ static bool dig_tile(color_ostream &out, MapExtras::MapCache &map,
return false; return false;
} }
/** The algorithm process seems to be:
* for each tile
* check for a designation
* if a designation exists send it to dig_tile
*
* dig_tile (below) then digs the layer below the channel designated tile
* thereby changing it and causing its designation to be lost
* */
df::tiletype target_type = df::tiletype::Void; df::tiletype target_type = df::tiletype::Void;
switch(designation) { switch(designation) {
case df::tile_dig_designation::Default: case df::tile_dig_designation::Default: