I suspiciously f****d up last commit so theres second part of the previous one

This commit is contained in:
Looki2000 2023-02-18 17:15:39 +01:00
parent cbeab46431
commit 1622e5cd6d
8 changed files with 49 additions and 87 deletions

View File

@ -0,0 +1 @@
name = amogus_blocks

View File

@ -0,0 +1 @@
name = amogus_craftings

View File

@ -92,22 +92,22 @@ local entity = {
-- play sus sound randomly with different pitch depending on situation
if self.mode == 0 or self.mode == 1 then -- stand still or walk
sound_pitch = 0.8
sound_propability = 100
self.sound_pitch = 0.8
self.sound_propability = 100
else -- chase (2)
sound_pitch = 1.2
sound_propability = 50
self.sound_pitch = 1.2
self.sound_propability = 50
end
if math.random(sound_propability) == 1 then
if math.random(self.sound_propability) == 1 then
amogus_general.play_random_sound(
"sus_sound",
self.object:get_pos(),
1.0, -- gain
40, -- max_hear_distance
sound_pitch -- pitch
self.sound_pitch -- pitch
)
end

View File

@ -0,0 +1 @@
name = amogus_entities

View File

@ -0,0 +1 @@
name = amogus_general

View File

@ -2,6 +2,11 @@
minetest.register_alias("mapgen_stone", "amogus_blocks:stone")
minetest.register_alias("mapgen_dirt", "amogus_blocks:dirt")
minetest.register_alias("mapgen_water_source", "amogus_blocks:water_source")
minetest.register_alias("mapgen_river_water_source", "amogus_blocks:water_source")
-- I need to register alias of amogus_blocks:water that doesn't even exist in any of the mods to air because Minetest is f****d up and tries to use "water" by default
minetest.register_alias("amogus_blocks:water", "air")
minetest.register_biome({
name = "amogus_beach",
@ -11,10 +16,7 @@ minetest.register_biome({
depth_filler = 3,
node_stone = "amogus_blocks:stone",
--node_water_top = "amogus_blocks:water",
--depth_water_top = 1,
node_water = "amogus_blocks:amogus_blocks:water_source",
--node_river_water = "amogus_blocks:water",
node_water = "amogus_blocks:water_source",
y_max = 6,
y_min = -5,
@ -23,17 +25,13 @@ minetest.register_biome({
})
minetest.register_biome({
name = "amogus_green_biome",
--node_dust = "amogus_blocks:stone",
node_top = "amogus_blocks:grass_green",
depth_top = 1,
node_filler = "amogus_blocks:dirt",
depth_filler = 1,
node_stone = "amogus_blocks:stone",
--node_water_top = "amogus_blocks:water",
--depth_water_top = 1,
node_water = "amogus_blocks:amogus_blocks:water_source",
--node_river_water = "amogus_blocks:water",
node_water = "amogus_blocks:water_source",
y_max = 31000,
y_min = 1,
@ -42,17 +40,13 @@ minetest.register_biome({
})
minetest.register_biome({
name = "amogus_biome",
--node_dust = "amogus_blocks:stone",
node_top = "amogus_blocks:grass",
depth_top = 1,
node_filler = "amogus_blocks:dirt",
depth_filler = 1,
node_stone = "amogus_blocks:stone",
--node_water_top = "amogus_blocks:water",
--depth_water_top = 1,
node_water = "amogus_blocks:amogus_blocks:water_source",
--node_river_water = "amogus_blocks:water",
node_water = "amogus_blocks:water_source",
y_max = 31000,
y_min = 1,
@ -452,39 +446,11 @@ minetest.register_decoration({
flags = "place_center_x, place_center_z",
rotation = "random",
})
--minetest.register_abm({
-- label = "Spawn random entities",
-- nodenames = {"group:soil", "group:crumbly", "group:choppy", "group:snappy", "group:cracky"},
-- interval = 15,
-- chance = 50,
-- action = function(pos)
-- local r = math.random(1, 500)
-- if r <= 50 then
-- minetest.add_entity({x = pos.x + math.random(-10, 10),
-- y = pos.y + 1,
-- z = pos.z + math.random(-10, 10)}, "amogus_entities:amogus")
-- minetest.sound_play("amogus_sound", {
-- pos = pos,
-- gain = 1.0,
-- max_hear_distance = 5
-- })
-- end
-- end
--})
minetest.register_on_generated(function(minp, maxp, seed)
--local is_newchunk = true
--for , pos in ipairs(minetest.find_nodes_in_area(minp, maxp, "mymod:amogus_spawner")) do
--is_new_chunk = false
-- break
--end
--if is_new_chunk then
for i = 1, math.random(10, 25) do
minetest.add_entity({x = minp.x + math.random(16), y = minp.y + 1, z = minp.z + math.random(16)}, "amogus_entities:amogus")
--minetest.sound_play("amogus_sound", { pos = pos,gain = 1.0,max_hear_distance = 5})
end
--end
for i = 1, math.random(10, 25) do
minetest.add_entity({x = minp.x + math.random(16), y = minp.y + 1, z = minp.z + math.random(16)}, "amogus_entities:amogus")
end
end)
@ -536,50 +502,40 @@ minetest.register_decoration({
schematic = minetest.get_modpath("amogus_generator") .. "/schematics/STATUE_GIANT.mts",
})
-- DEBUG
--imposters_spawned = 0
minetest.register_abm({
label = "Spawn Imposter",
nodenames = {"air"},
neighbors = {"group:stone"},
interval = 5,
chance = 500,
interval = 10,
chance = 200,
action = function(pos)
-- avoid spawning inside liquids
if minetest.registered_nodes[minetest.get_node(pos).name].liquidtype == "none" then
-- DEBUG
--imposters_spawned = imposters_spawned + 1
--minetest.chat_send_all("Imposters spawned: " .. imposters_spawned)
local light = minetest.get_node_light(pos)
local time = minetest.get_timeofday()
if light <= 12 and time >= 0.2 and time <= 0.8 then
local entities = minetest.get_objects_inside_radius(pos, 20)
local bat_count = 0
for _, entity in pairs(entities) do
-- get name while handling .name indexing error caused by get_luaentity() returning nil
-- i cant use get_entity_name() because its deprecated and spams logs
local name = entity:get_luaentity() and entity:get_luaentity().name or ""
-- only spawn on solid blocks AND in the dark
if minetest.registered_nodes[minetest.get_node({x = pos.x, y = pos.y - 1, z = pos.z}).name].walkable and minetest.get_node_light(pos) <= 12 then
-- do not spawn if there is already an sussy imposter nearby
local nearby_entities = minetest.get_objects_inside_radius(pos, 10)
local imposter_nearby = false
if name == "amogus_entities:sussy_imposter" then
bat_count = bat_count + 1
if bat_count >= 3 then
return
end
end
for _, entity in pairs(nearby_entities) do
if (entity:get_luaentity() and entity:get_luaentity().name or "") == "amogus_entities:sussy_imposter" then
imposter_nearby = true
break
end
end
if not imposter_nearby then
minetest.add_entity(pos, "amogus_entities:sussy_imposter")
end
end
end,
})
-- wtf is this??
--minetest.register_on_generated(function(minp, maxp, seed)
-- for x = minp.x, maxp.x do
-- for y = minp.y, maxp.y do
-- for z = minp.z, maxp.z do
-- local p = {x=x, y=y, z=z}
-- if minetest.get_node(p).name == "default:water_source" then
-- minetest.set_node(p, {name="default:water_source", param2=0})
-- end
-- end
-- end
-- end
-- end)
end
})

View File

@ -0,0 +1 @@
name = amogus_generator

View File

@ -0,0 +1 @@
name = amogus_items