| 710 | } |
| 711 | |
| 712 | static bool produces_item(const boulder_percent_options &options, |
| 713 | MapExtras::MapCache &map, Random::MersenneRNG &rng, |
| 714 | const dug_tile_info &info) { |
| 715 | uint32_t probability; |
| 716 | if (info.tmat == df::tiletype_material::FEATURE) |
| 717 | probability = options.deep; |
| 718 | else { |
| 719 | switch (map.BlockAtTile(info.pos)->veinTypeAt(info.pos)) { |
| 720 | case df::inclusion_type::CLUSTER: |
| 721 | case df::inclusion_type::VEIN: |
| 722 | probability = options.vein; |
| 723 | break; |
| 724 | case df::inclusion_type::CLUSTER_ONE: |
| 725 | case df::inclusion_type::CLUSTER_SMALL: |
| 726 | probability = options.small_cluster; |
| 727 | break; |
| 728 | default: |
| 729 | probability = options.layer; |
| 730 | break; |
| 731 | } |
| 732 | } |
| 733 | |
| 734 | return rng.random(100) < probability; |
| 735 | } |
| 736 | |
| 737 | typedef std::map<std::pair<df::item_type, t_matpair>, std::vector<DFCoord>> |
| 738 | item_coords_t; |