1
0
mirror of https://codeberg.org/tenplus1/mobs_monster.git synced 2025-07-04 17:30:21 +02:00

code tidy

This commit is contained in:
tenplus1
2022-09-27 11:27:47 +01:00
parent 1ee293dae0
commit 84a9b630ce
11 changed files with 188 additions and 183 deletions

View File

@ -74,12 +74,12 @@ mobs:register_mob("mobs_monster:spider", {
{"mobs_spider_orange.png"},
{"mobs_spider_snowy.png"},
{"mobs_spider_grey.png"},
{"mobs_spider_crystal.png"},
{"mobs_spider_crystal.png"}
},
makes_footstep_sound = false,
sounds = {
random = "mobs_spider",
attack = "mobs_spider",
attack = "mobs_spider"
},
walk_velocity = 1,
run_velocity = 3,
@ -87,7 +87,7 @@ mobs:register_mob("mobs_monster:spider", {
view_range = 15,
floats = 0,
drops = {
{name = "farming:string", chance = 1, min = 0, max = 2},
{name = "farming:string", chance = 1, min = 0, max = 2}
},
water_damage = 5,
lava_damage = 5,
@ -102,7 +102,7 @@ mobs:register_mob("mobs_monster:spider", {
run_start = 1,
run_end = 21,
punch_start = 25,
punch_end = 45,
punch_end = 45
},
-- check surrounding nodes and spawn a specific spider
@ -224,32 +224,33 @@ mobs:register_mob("mobs_monster:spider", {
if not mobs.custom_spawn_monster then
-- above ground spawn
mobs:spawn({
name = "mobs_monster:spider",
nodes = {
"default:dirt_with_rainforest_litter", "default:snowblock",
"default:snow", "ethereal:crystal_dirt", "ethereal:cold_dirt"
},
min_light = 0,
max_light = 8,
chance = 7000,
active_object_count = 1,
min_height = 25,
max_height = 31000,
})
-- below ground spawn
mobs:spawn({
name = "mobs_monster:spider",
nodes = {"default:stone_with_mese", "default:mese", "default:stone"},
min_light = 0,
max_light = 7,
chance = 7000,
active_object_count = 1,
min_height = -31000,
max_height = -40,
})
-- above ground spawn
mobs:spawn({
name = "mobs_monster:spider",
nodes = {
"default:dirt_with_rainforest_litter", "default:snowblock",
"default:snow", "ethereal:crystal_dirt", "ethereal:cold_dirt"
},
min_light = 0,
max_light = 8,
chance = 7000,
active_object_count = 1,
min_height = 25,
max_height = 31000
})
-- below ground spawn
mobs:spawn({
name = "mobs_monster:spider",
nodes = {"default:stone_with_mese", "default:mese", "default:stone"},
min_light = 0,
max_light = 7,
chance = 7000,
active_object_count = 1,
min_height = -31000,
max_height = -40
})
end
@ -286,13 +287,15 @@ minetest.register_craft({
recipe = {
{"farming:string", "", "farming:string"},
{"", "farming:string", ""},
{"farming:string", "", "farming:string"},
{"farming:string", "", "farming:string"}
}
})
local web_place = function(pos)
if minetest.find_node_near(pos, 1, {"ignore"}) then return end
local pos2 = minetest.find_node_near(pos, 1, {"air", "group:leaves"}, true)
if pos2 then
@ -316,7 +319,7 @@ mobs:register_arrow("mobs_monster:cobweb", {
player:punch(self.object, 1.0, {
full_punch_interval = 2.0,
damage_groups = {fleshy = 3},
damage_groups = {fleshy = 3}
}, nil)
web_place(self.object:get_pos())
@ -330,7 +333,7 @@ mobs:register_arrow("mobs_monster:cobweb", {
player:punch(self.object, 1.0, {
full_punch_interval = 2.0,
damage_groups = {fleshy = 3},
damage_groups = {fleshy = 3}
}, nil)
end
})