mirror of
				https://github.com/FaceDeer/dfcaverns.git
				synced 2025-10-31 16:25:22 +01:00 
			
		
		
		
	add names to the glowing pits and some of the ruins
This commit is contained in:
		| @@ -1,4 +1,4 @@ | ||||
| name = df_caverns | ||||
| description = Adds vast underground caverns in the style of Dwarf Fortress, complete with underground flora in diverse biomes. Also adds stalactite/stalagmite decorations in the smaller tunnels. | ||||
| depends = default, subterrane, df_trees, df_mapitems | ||||
| optional_depends = df_farming, ice_sprites, oil, df_underworld_items, magma_conduits, bones_loot, named_waypoints, map | ||||
| optional_depends = df_farming, ice_sprites, oil, df_underworld_items, magma_conduits, bones_loot, named_waypoints, map, namegen | ||||
| @@ -59,7 +59,7 @@ local mushroom_cavern_floor = function(abs_cracks, humidity, vi, area, data, dat | ||||
| 	end | ||||
|  | ||||
| 	local rand = math.random() * math.min(abs_cracks, 1) * humidityfactor | ||||
| 	if rand < 0.00075 then | ||||
| 	if rand < 0.0005 then | ||||
| 		data[vi+ystride] = c_giant_mycelium | ||||
| 	elseif rand < 0.003 then | ||||
| 		local schematic = df_primordial_items.get_primordial_mushroom() | ||||
| @@ -325,7 +325,7 @@ local decorate_primordial = function(minp, maxp, seed, vm, node_arrays, area, da | ||||
| 			minetest.get_node_timer(area:position(vi)):start(math.random(10, 60)) | ||||
| 		else | ||||
| 			data[vi] = c_mycelial_dirt | ||||
| 			if math.random() < 0.01 then | ||||
| 			if math.random() < 0.025 then | ||||
| 				local rand_vi = vi + random_dir[math.random(1,4)] | ||||
| 				if data[rand_vi] == c_air then | ||||
| 					data[rand_vi] = c_giant_mycelium | ||||
| @@ -365,7 +365,7 @@ minetest.register_abm({ | ||||
| 	nodenames = {"df_primordial_items:dirt_with_jungle_grass"}, | ||||
| 	neighbors = {"air"}, | ||||
| 	interval = 60.0, | ||||
| 	chance = 20, | ||||
| 	chance = 50, | ||||
| 	action = function(pos, node, active_object_count, active_object_count_wider) | ||||
| 		if minetest.find_node_near(pos, 2, {"group:primordial_jungle_plant"}) == nil then | ||||
| 			local pos_above = {x=pos.x, y=pos.y+1, z=pos.z} | ||||
| @@ -382,7 +382,7 @@ minetest.register_abm({ | ||||
| 	nodenames = {"df_primordial_items:dirt_with_mycelium"}, | ||||
| 	neighbors = {"air"}, | ||||
| 	interval = 60.0, | ||||
| 	chance = 20, | ||||
| 	chance = 50, | ||||
| 	action = function(pos, node, active_object_count, active_object_count_wider) | ||||
| 		if minetest.find_node_near(pos, 3, {"group:primordial_fungal_plant"}) == nil then | ||||
| 			local pos_above = {x=pos.x, y=pos.y+1, z=pos.z} | ||||
|   | ||||
| @@ -1,11 +1,16 @@ | ||||
| if not df_caverns.config.enable_underworld or not minetest.get_modpath("df_underworld_items") then | ||||
| 	return | ||||
| end | ||||
| local modpath = minetest.get_modpath(minetest.get_current_modname()) | ||||
|  | ||||
| local S = minetest.get_translator("df_caverns") | ||||
|  | ||||
| local bones_loot_path = minetest.get_modpath("bones_loot") | ||||
| local named_waypoints_path = minetest.get_modpath("named_waypoints") | ||||
| local namegen_path = minetest.get_modpath("namegen") | ||||
|  | ||||
| local name_pit = function() end | ||||
| local name_ruin = function() end | ||||
|  | ||||
| if named_waypoints_path then | ||||
| 	local pit_waypoint_def = { | ||||
| @@ -37,8 +42,35 @@ if named_waypoints_path then | ||||
| 		seal_waypoint_def.on_discovery = named_waypoints.default_discovery_popup | ||||
| 	end | ||||
| 	named_waypoints.register_named_waypoints("puzzle_seals", seal_waypoint_def) | ||||
|  | ||||
| 	if namegen_path then | ||||
| 		namegen.parse_lines(io.lines(modpath.."/underworld_names.cfg")) | ||||
| 		 | ||||
| 		name_pit = function() | ||||
| 			return namegen.generate("glowing_pits") | ||||
| 		end | ||||
| 		name_ruin = function() | ||||
| 			return namegen.generate("underworld_ruins") | ||||
| 		end | ||||
| 		 | ||||
| 		local underworld_ruin_def = { | ||||
| 			default_name = S("Ancient ruin"), | ||||
| 			discovery_volume_radius = tonumber(minetest.settings:get("dfcaverns_pit_discovery_range")) or 60, | ||||
| 		} | ||||
| 		if minetest.settings:get_bool("dfcaverns_show_pits_in_hud", true) then | ||||
| 			underworld_ruin_def.visibility_volume_radius = tonumber(minetest.settings:get("dfcaverns_pit_visibility_range")) or 500 | ||||
| 			underworld_ruin_def.on_discovery = named_waypoints.default_discovery_popup | ||||
| 		end | ||||
| 		if minetest.settings:get_bool("dfcaverns_pit_hud_requires_mapping_kit", true) | ||||
| 			and minetest.registered_items["map:mapping_kit"] then | ||||
| 			underworld_ruin_def.visibility_requires_item = "map:mapping_kit" | ||||
| 		end | ||||
| 		named_waypoints.register_named_waypoints("underworld_ruins", underworld_ruin_def) | ||||
| 	end | ||||
| end | ||||
|  | ||||
|  | ||||
|  | ||||
| local c_slade = minetest.get_content_id("df_underworld_items:slade") | ||||
| local c_slade_block = minetest.get_content_id("df_underworld_items:slade_block") | ||||
| local c_air = minetest.get_content_id("air") | ||||
| @@ -324,7 +356,7 @@ minetest.register_on_generated(function(minp, maxp, seed) | ||||
| 			local floor_height =  math.floor(abs_cave * floor_mult + median + floor_displace + wave) | ||||
| 			 | ||||
| 			if named_waypoints_path and floor_height == y and pit and pit.location.x == x and pit.location.z == z then | ||||
| 				named_waypoints.add_waypoint("glowing_pits", {x=x, y=y, z=z}) | ||||
| 				named_waypoints.add_waypoint("glowing_pits", {x=x, y=y, z=z}, {name=name_pit()}) | ||||
| 			end | ||||
|  | ||||
| 			local underside_height = math.floor(y_min + math.abs(wave) / 5)+2 -- divide wave by five to smooth out the underside of the slade, we only want the interface to ripple a little down here | ||||
| @@ -347,7 +379,7 @@ minetest.register_on_generated(function(minp, maxp, seed) | ||||
| 					local pit_value = nvals_pit[area_pit:index(x,y,z)] * pit.variance | ||||
| 					local distance = vector.distance({x=x, y=y, z=z}, {x=pit.location.x, y=y, z=pit.location.z}) + pit_value | ||||
| 					if distance < pit.radius -3 then | ||||
| 						if y < median + floor_displace + wave - pit.depth then | ||||
| 						if y < median + floor_displace + wave - pit.depth or y < underside_height + plasma_depth_min then | ||||
| 							data[vi] = c_pit_plasma | ||||
| 						else | ||||
| 							data[vi] = c_air | ||||
| @@ -429,6 +461,11 @@ minetest.register_on_generated(function(minp, maxp, seed) | ||||
| 							mapgen_helper.place_schematic_on_data(data, data_param2, area, building.pos, small_building_schematic, building.rotation) | ||||
| 						elseif building.building_type == "medium building" then | ||||
| 							mapgen_helper.place_schematic_on_data(data, data_param2, area, building.pos, medium_building_schematic, building.rotation) | ||||
| 							if named_waypoints_path and namegen_path then | ||||
| 								if not next(named_waypoints.get_waypoints_in_area("underworld_ruins", vector.subtract(building.pos, 250), vector.add(building.pos, 250))) then | ||||
| 									named_waypoints.add_waypoint("underworld_ruins", {x=building.pos.x, y=floor_height+1, z=building.pos.z}, {name=name_ruin()}) | ||||
| 								end | ||||
| 							end							 | ||||
| 						elseif building.building_type == "small slab" then | ||||
| 							mapgen_helper.place_schematic_on_data(data, data_param2, area, building.pos, small_slab_schematic, building.rotation) | ||||
| 						else | ||||
|   | ||||
							
								
								
									
										18
									
								
								df_caverns/underworld_names.cfg
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										18
									
								
								df_caverns/underworld_names.cfg
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,18 @@ | ||||
| name "glowing_pits" { | ||||
|     customGroupA = "Actinic, Amethyst, Angry, Atrocious, Bad, Blighted, Baneful, Baleful, Beastly, Calamitous, Corrupt, Crazed, Damnable, Demoniacal, Demonic, Depraved, Destructive, Devilish, Diabolical, Disastrous, Execrable, Fiendish, Foul, Frenzied, Glaring, Harmful, Hateful, Heinous, Hellish, Hideous, Infernal, Iniquitous, Injurious, Loathsome, Lost, Maleficent, Malevolent, Malicious, Malignant, Manic, Nefarious, Nightmare, Obscene, Offensive, Pernicious, Poison, Possessed, Rancorous, Repugnant, Repulsive, Revolting, Spiteful, Unhallowed, Unpleasant, Vicious, Vile, Villainous, Violent, Wicked, Wrathful" | ||||
|  | ||||
|     customGroupB = "Abyss, Aperture, Breach, Cavity, Chasm, Crevasse, Depth, Deep, Fissure, Funnel, Gate, Gulf, Hell, Hole, Hollow, Inferno, Maw, Mouth, Opening, Pit, Portal, Puncture, Ravager, Rent, Rift, Rim, Schism, Shaft, Split, Throat, Void, Well" | ||||
| 	 | ||||
|     customGroupC = "Adversity, Affliction, Annihilation, Bale, Bane, Blight, Calamity, Cataclysm, Catastrophe, Collapse, Conclusion, Condemnation, Death, Defeat, Destiny, Destruction, Disaster, Doom, Downfall, Failure, Grief, Harm, Hazard, Judgment, Karma, Misadventure, Mischance, Misfortune, Mishap, Ruin, Ruination, Tragedy, Undoing, Verdict, Woe" | ||||
|  | ||||
|     rules = "%50The_$A_$B, The_$B_of_$C, %10The_$A_$B_of_$C" | ||||
| } | ||||
|  | ||||
| name "underworld_ruins" { | ||||
|  | ||||
|     customGroupA = "Abandoned, Absent, Adrift, Alien, Anonymous, Bare, Barren, Blank, Buried, Clandestine, Cloaked, Concealed, Covered, Cryptic, Dark, Dead, Depleted, Deserted, Desolate, Despoiled, Destitute, Devoid, Disappeared, Distant, Exhausted, Empty, Forfeit, Forfeited, Forsaken, Hidden, Incognito, Indiscernible, Invisible, Irretrievable, Irrevocable, Masked, Mislaid, Misplaced, Mystic, Mystical, Nameless, Obscured, Secluded, Secret, Sequestered, Shadowy, Shrouded, Stark, Strange, Uncelebrated, Uncharted, Undiscovered, Unexplained, Unexplored, Unfamiliar, Unfilled, Unidentified, Unknown, Unnamed, Unredeemed, Unsung, Untold, Vacant, Vacated, Vanished, Veiled, Wayward, Warrior's, King's, Knave's, Coward's, Cardinal's, Priest's, Soldier's, Noble, Steadfast, Children's, Howling, Silent, Grinding, Dusty" | ||||
| 	 | ||||
|     customGroupB = "Temple, Chapel, House, Sanctuary, Shrine, Fortress, Tomb, Crypt, Graves, Citadel, Garrison, Rampart, Redoubt, Refuge, Asylum, Haven, Hideout, Retreat, Shelter, Stronghold, Covert, Den, Settlement, Preserve, Seat, Watch, Bulwark, Necropolis, Catacomb, Ruin, Hulk, Wreck" | ||||
|  | ||||
|     rules = "The_$A_$B" | ||||
| } | ||||
		Reference in New Issue
	
	Block a user