code tidy
This commit is contained in:
parent
5d914bdbd8
commit
919696be2e
@ -19,6 +19,7 @@ if not ENABLE_SWIMMERS then
|
|||||||
l_spawn_chance = l_spawn_chance - 20000
|
l_spawn_chance = l_spawn_chance - 20000
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
-- no float
|
-- no float
|
||||||
if ENABLE_WALKERS then
|
if ENABLE_WALKERS then
|
||||||
|
|
||||||
@ -48,16 +49,21 @@ if ENABLE_WALKERS then
|
|||||||
lava_damage = 10,
|
lava_damage = 10,
|
||||||
light_damage = 0,
|
light_damage = 0,
|
||||||
animation = {
|
animation = {
|
||||||
speed_normal = 24, speed_run = 24,
|
speed_normal = 24,
|
||||||
stand_start = 0, stand_end = 80,
|
speed_run = 24,
|
||||||
walk_start = 81, walk_end = 170,
|
stand_start = 0,
|
||||||
run_start = 81, run_end = 170,
|
stand_end = 80,
|
||||||
punch_start = 205, punch_end = 220
|
walk_start = 81,
|
||||||
|
walk_end = 170,
|
||||||
|
run_start = 81,
|
||||||
|
run_end = 170,
|
||||||
|
punch_start = 205,
|
||||||
|
punch_end = 220
|
||||||
},
|
},
|
||||||
drops = {
|
drops = {
|
||||||
{name = "mobs:meat_raw", chance = 1, min = 1, max = 3},
|
{name = "mobs:meat_raw", chance = 1, min = 1, max = 3},
|
||||||
{name = "mobs:leather", chance = 1, min = 0, max = 2},
|
{name = "mobs:leather", chance = 1, min = 0, max = 2}
|
||||||
},
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
mobs:spawn({
|
mobs:spawn({
|
||||||
@ -73,12 +79,13 @@ if ENABLE_WALKERS then
|
|||||||
interval = 30,
|
interval = 30,
|
||||||
chance = l_spawn_chance,
|
chance = l_spawn_chance,
|
||||||
min_height = 0,
|
min_height = 0,
|
||||||
max_height = 10,
|
max_height = 10
|
||||||
})
|
})
|
||||||
|
|
||||||
mobs:register_egg("mobs_crocs:crocodile", "Crocodile", "default_grass.png", 1)
|
mobs:register_egg("mobs_crocs:crocodile", "Crocodile", "default_grass.png", 1)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
-- float
|
-- float
|
||||||
if ENABLE_FLOATERS then
|
if ENABLE_FLOATERS then
|
||||||
|
|
||||||
@ -107,16 +114,21 @@ if ENABLE_FLOATERS then
|
|||||||
lava_damage = 10,
|
lava_damage = 10,
|
||||||
light_damage = 0,
|
light_damage = 0,
|
||||||
animation = {
|
animation = {
|
||||||
speed_normal = 24, speed_run = 24,
|
speed_normal = 24,
|
||||||
stand_start = 0, stand_end = 80,
|
speed_run = 24,
|
||||||
walk_start = 81, walk_end = 170,
|
stand_start = 0,
|
||||||
run_start = 81, run_end = 170,
|
stand_end = 80,
|
||||||
punch_start = 205, punch_end = 220
|
walk_start = 81,
|
||||||
|
walk_end = 170,
|
||||||
|
run_start = 81,
|
||||||
|
run_end = 170,
|
||||||
|
punch_start = 205,
|
||||||
|
punch_end = 220
|
||||||
},
|
},
|
||||||
drops = {
|
drops = {
|
||||||
{name = "mobs:meat_raw", chance = 1, min = 1, max = 3},
|
{name = "mobs:meat_raw", chance = 1, min = 1, max = 3},
|
||||||
{name = "mobs:leather", chance = 1, min = 0, max = 2},
|
{name = "mobs:leather", chance = 1, min = 0, max = 2}
|
||||||
},
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
mobs:spawn({
|
mobs:spawn({
|
||||||
@ -130,13 +142,14 @@ if ENABLE_FLOATERS then
|
|||||||
interval = 30,
|
interval = 30,
|
||||||
chance = l_spawn_chance,
|
chance = l_spawn_chance,
|
||||||
min_height = -3,
|
min_height = -3,
|
||||||
max_height = 10,
|
max_height = 10
|
||||||
})
|
})
|
||||||
|
|
||||||
mobs:register_egg("mobs_crocs:crocodile_float", "Crocodile (floater)",
|
mobs:register_egg("mobs_crocs:crocodile_float", "Crocodile (floater)",
|
||||||
"default_grass.png", 1)
|
"default_grass.png", 1)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
-- swim
|
-- swim
|
||||||
if ENABLE_SWIMMERS then
|
if ENABLE_SWIMMERS then
|
||||||
|
|
||||||
@ -167,16 +180,22 @@ if ENABLE_SWIMMERS then
|
|||||||
lava_damage = 10,
|
lava_damage = 10,
|
||||||
light_damage = 0,
|
light_damage = 0,
|
||||||
animation = {
|
animation = {
|
||||||
speed_normal = 24, speed_run = 24,
|
speed_normal = 24,
|
||||||
stand_start = 0, stand_end = 80,
|
speed_run = 24,
|
||||||
walk_start = 81, walk_end = 170,
|
stand_start = 0,
|
||||||
fly_start = 81, fly_end = 170,
|
stand_end = 80,
|
||||||
run_start = 81, run_end = 170,
|
walk_start = 81,
|
||||||
punch_start = 205, punch_end = 220
|
walk_end = 170,
|
||||||
|
fly_start = 81,
|
||||||
|
fly_end = 170,
|
||||||
|
run_start = 81,
|
||||||
|
run_end = 170,
|
||||||
|
punch_start = 205,
|
||||||
|
punch_end = 220
|
||||||
},
|
},
|
||||||
drops = {
|
drops = {
|
||||||
{name = "mobs:meat_raw", chance = 1, min = 1, max = 3},
|
{name = "mobs:meat_raw", chance = 1, min = 1, max = 3},
|
||||||
{name = "mobs:leather", chance = 1, min = 0, max = 2},
|
{name = "mobs:leather", chance = 1, min = 0, max = 2}
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|
||||||
@ -187,9 +206,9 @@ if ENABLE_SWIMMERS then
|
|||||||
interval = 30,
|
interval = 30,
|
||||||
chance = l_spawn_chance,
|
chance = l_spawn_chance,
|
||||||
min_height = -8,
|
min_height = -8,
|
||||||
max_height = 10,
|
max_height = 10
|
||||||
})
|
})
|
||||||
|
|
||||||
mobs:register_egg("mobs_crocs:crocodile_swim", "Crocodile (swimmer)",
|
mobs:register_egg("mobs_crocs:crocodile_swim", "Crocodile (swimmer)",
|
||||||
"default_grass.png", 1)
|
"default_grass.png", 1)
|
||||||
end
|
end
|
||||||
|
@ -27,6 +27,7 @@ if SPRITE_VERSION then
|
|||||||
l_trop_textures = {{"animal_fish_blue_white_fish_blue_white_item.png"}}
|
l_trop_textures = {{"animal_fish_blue_white_fish_blue_white_item.png"}}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
-- Clownfish
|
-- Clownfish
|
||||||
mobs:register_mob("mobs_fish:clownfish", {
|
mobs:register_mob("mobs_fish:clownfish", {
|
||||||
type = "animal",
|
type = "animal",
|
||||||
@ -84,6 +85,7 @@ mobs:register_mob("mobs_fish:clownfish", {
|
|||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
mobs:spawn({
|
mobs:spawn({
|
||||||
name = "mobs_fish:clownfish",
|
name = "mobs_fish:clownfish",
|
||||||
nodes = {
|
nodes = {
|
||||||
@ -98,8 +100,10 @@ mobs:spawn({
|
|||||||
active_object_count = 5
|
active_object_count = 5
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
mobs:register_egg("mobs_fish:clownfish", "Clownfish",
|
mobs:register_egg("mobs_fish:clownfish", "Clownfish",
|
||||||
"animal_clownfish_clownfish_item.png", 0)
|
"animal_clownfish_clownfish_item.png", 0)
|
||||||
|
|
||||||
|
|
||||||
-- Tropical fish
|
-- Tropical fish
|
||||||
mobs:register_mob("mobs_fish:tropical", {
|
mobs:register_mob("mobs_fish:tropical", {
|
||||||
@ -156,6 +160,7 @@ mobs:register_mob("mobs_fish:tropical", {
|
|||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
mobs:spawn({
|
mobs:spawn({
|
||||||
name = "mobs_fish:tropical",
|
name = "mobs_fish:tropical",
|
||||||
nodes = {
|
nodes = {
|
||||||
@ -170,8 +175,9 @@ mobs:spawn({
|
|||||||
active_object_count = 5
|
active_object_count = 5
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
mobs:register_egg("mobs_fish:tropical", "Tropical fish",
|
mobs:register_egg("mobs_fish:tropical", "Tropical fish",
|
||||||
"animal_fish_blue_white_fish_blue_white_item.png", 0)
|
"animal_fish_blue_white_fish_blue_white_item.png", 0)
|
||||||
|
|
||||||
|
|
||||||
local function add_food_group(item)
|
local function add_food_group(item)
|
||||||
|
@ -26,11 +26,11 @@ mobs:register_mob("mobs_jellyfish:jellyfish", {
|
|||||||
light_damage = 0,
|
light_damage = 0,
|
||||||
|
|
||||||
on_rightclick = function(self, clicker)
|
on_rightclick = function(self, clicker)
|
||||||
mobs:capture_mob(self, clicker, 80, 100, 0,
|
mobs:capture_mob(self, clicker, 80, 100, 0, true, "mobs_jellyfish:jellyfish")
|
||||||
true, "mobs_jellyfish:jellyfish")
|
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
mobs:spawn({
|
mobs:spawn({
|
||||||
name = "mobs_jellyfish:jellyfish",
|
name = "mobs_jellyfish:jellyfish",
|
||||||
nodes = {"default:water_source"},
|
nodes = {"default:water_source"},
|
||||||
@ -38,7 +38,8 @@ mobs:spawn({
|
|||||||
min_light = 5,
|
min_light = 5,
|
||||||
interval = 30,
|
interval = 30,
|
||||||
chance = 10000,
|
chance = 10000,
|
||||||
max_height = 0,
|
max_height = 0
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
mobs:register_egg("mobs_jellyfish:jellyfish", "Jellyfish", "jellyfish_inv.png", 0)
|
mobs:register_egg("mobs_jellyfish:jellyfish", "Jellyfish", "jellyfish_inv.png", 0)
|
||||||
|
@ -77,8 +77,8 @@ if ENABLE_SHARK_LARGE then
|
|||||||
jump = false,
|
jump = false,
|
||||||
stepheight = 0,
|
stepheight = 0,
|
||||||
drops = {
|
drops = {
|
||||||
{name = "mobs:meat_raw", chance = 1, min = 1, max = 3},
|
{name = "mobs:meat_raw", chance = 1, min = 1, max = 3}
|
||||||
},
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
mobs:spawn({
|
mobs:spawn({
|
||||||
@ -90,13 +90,14 @@ if ENABLE_SHARK_LARGE then
|
|||||||
},
|
},
|
||||||
interval = 30,
|
interval = 30,
|
||||||
chance = l_spawn_chance,
|
chance = l_spawn_chance,
|
||||||
max_height = 0,
|
max_height = 0
|
||||||
})
|
})
|
||||||
|
|
||||||
mobs:register_egg("mobs_sharks:shark_lg", "Shark (large)",
|
mobs:register_egg("mobs_sharks:shark_lg", "Shark (large)",
|
||||||
"mob_shark_shark_item.png", 0)
|
"mob_shark_shark_item.png", 0)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
-- medium
|
-- medium
|
||||||
if ENABLE_SHARK_MEDIUM then
|
if ENABLE_SHARK_MEDIUM then
|
||||||
|
|
||||||
@ -137,8 +138,8 @@ if ENABLE_SHARK_MEDIUM then
|
|||||||
jump = false,
|
jump = false,
|
||||||
stepheight = 0,
|
stepheight = 0,
|
||||||
drops = {
|
drops = {
|
||||||
{name = "mobs:meat_raw", chance = 1, min = 1, max = 3},
|
{name = "mobs:meat_raw", chance = 1, min = 1, max = 3}
|
||||||
},
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
mobs:spawn({
|
mobs:spawn({
|
||||||
@ -150,13 +151,14 @@ if ENABLE_SHARK_MEDIUM then
|
|||||||
},
|
},
|
||||||
interval = 30,
|
interval = 30,
|
||||||
chance = l_spawn_chance,
|
chance = l_spawn_chance,
|
||||||
max_height = 0,
|
max_height = 0
|
||||||
})
|
})
|
||||||
|
|
||||||
mobs:register_egg("mobs_sharks:shark_md", "Shark (medium)",
|
mobs:register_egg("mobs_sharks:shark_md", "Shark (medium)",
|
||||||
"mob_shark_shark_item.png", 0)
|
"mob_shark_shark_item.png", 0)
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
-- small
|
-- small
|
||||||
if ENABLE_SHARK_SMALL then
|
if ENABLE_SHARK_SMALL then
|
||||||
|
|
||||||
@ -197,8 +199,8 @@ if ENABLE_SHARK_SMALL then
|
|||||||
jump = false,
|
jump = false,
|
||||||
stepheight = 0,
|
stepheight = 0,
|
||||||
drops = {
|
drops = {
|
||||||
{name = "mobs:meat_raw", chance = 1, min = 1, max = 3},
|
{name = "mobs:meat_raw", chance = 1, min = 1, max = 3}
|
||||||
},
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
mobs:spawn({
|
mobs:spawn({
|
||||||
@ -210,7 +212,7 @@ if ENABLE_SHARK_SMALL then
|
|||||||
},
|
},
|
||||||
interval = 30,
|
interval = 30,
|
||||||
chance = l_spawn_chance,
|
chance = l_spawn_chance,
|
||||||
max_height = 0,
|
max_height = 0
|
||||||
})
|
})
|
||||||
|
|
||||||
mobs:register_egg("mobs_sharks:shark_sm", "Shark (small)",
|
mobs:register_egg("mobs_sharks:shark_sm", "Shark (small)",
|
||||||
|
@ -11,6 +11,7 @@ local l_skins = {
|
|||||||
|
|
||||||
local l_spawn_chance = 30000
|
local l_spawn_chance = 30000
|
||||||
|
|
||||||
|
|
||||||
-- land turtle
|
-- land turtle
|
||||||
mobs:register_mob("mobs_turtles:turtle", {
|
mobs:register_mob("mobs_turtles:turtle", {
|
||||||
type = "animal",
|
type = "animal",
|
||||||
@ -47,13 +48,13 @@ mobs:register_mob("mobs_turtles:turtle", {
|
|||||||
hide_end = 100
|
hide_end = 100
|
||||||
},
|
},
|
||||||
drops = {
|
drops = {
|
||||||
{name = "mobs:meat_raw", chance = 1, min = 1, max = 3},
|
{name = "mobs:meat_raw", chance = 1, min = 1, max = 3}
|
||||||
},
|
},
|
||||||
follow = "farming:carrot",
|
follow = "farming:carrot",
|
||||||
|
|
||||||
on_rightclick = function(self, clicker)
|
on_rightclick = function(self, clicker)
|
||||||
|
|
||||||
self.state = "hide" -- was ""
|
self.state = "hide"
|
||||||
|
|
||||||
mobs:set_velocity(self, 0)
|
mobs:set_velocity(self, 0)
|
||||||
|
|
||||||
@ -62,6 +63,7 @@ mobs:register_mob("mobs_turtles:turtle", {
|
|||||||
self.animation.speed_normal, 0)
|
self.animation.speed_normal, 0)
|
||||||
|
|
||||||
minetest.after(5, function()
|
minetest.after(5, function()
|
||||||
|
|
||||||
if self and self.object then
|
if self and self.object then
|
||||||
self.state = "stand"
|
self.state = "stand"
|
||||||
end
|
end
|
||||||
@ -78,6 +80,7 @@ mobs:register_mob("mobs_turtles:turtle", {
|
|||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
mobs:spawn({
|
mobs:spawn({
|
||||||
name = "mobs_turtles:turtle",
|
name = "mobs_turtles:turtle",
|
||||||
nodes = {
|
nodes = {
|
||||||
@ -93,11 +96,13 @@ mobs:spawn({
|
|||||||
interval = 30,
|
interval = 30,
|
||||||
chance = l_spawn_chance,
|
chance = l_spawn_chance,
|
||||||
min_height = 1,
|
min_height = 1,
|
||||||
max_height = 10,
|
max_height = 10
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
mobs:register_egg("mobs_turtles:turtle", "Turtle", "default_grass.png", 1)
|
mobs:register_egg("mobs_turtles:turtle", "Turtle", "default_grass.png", 1)
|
||||||
|
|
||||||
|
|
||||||
-- sea turtle
|
-- sea turtle
|
||||||
mobs:register_mob("mobs_turtles:seaturtle", {
|
mobs:register_mob("mobs_turtles:seaturtle", {
|
||||||
type = "animal",
|
type = "animal",
|
||||||
@ -138,13 +143,14 @@ mobs:register_mob("mobs_turtles:seaturtle", {
|
|||||||
hide_end = 100
|
hide_end = 100
|
||||||
},
|
},
|
||||||
drops = {
|
drops = {
|
||||||
{name = "mobs:meat_raw", chance = 1, min = 1, max = 3},
|
{name = "mobs:meat_raw", chance = 1, min = 1, max = 3}
|
||||||
},
|
},
|
||||||
on_rightclick = function(self, clicker)
|
on_rightclick = function(self, clicker)
|
||||||
mobs:capture_mob(self, clicker, 0, 0, 80, true, nil)
|
mobs:capture_mob(self, clicker, 0, 0, 80, true, nil)
|
||||||
end
|
end
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
mobs:spawn({
|
mobs:spawn({
|
||||||
name = "mobs_turtles:seaturtle",
|
name = "mobs_turtles:seaturtle",
|
||||||
nodes = {"default:water_flowing","default:water_source"},
|
nodes = {"default:water_flowing","default:water_source"},
|
||||||
@ -155,7 +161,8 @@ mobs:spawn({
|
|||||||
min_light = 5,
|
min_light = 5,
|
||||||
interval = 30,
|
interval = 30,
|
||||||
chance = l_spawn_chance,
|
chance = l_spawn_chance,
|
||||||
max_height = 0,
|
max_height = 0
|
||||||
})
|
})
|
||||||
|
|
||||||
|
|
||||||
mobs:register_egg("mobs_turtles:seaturtle", "Sea Turtle", "default_water.png", 1)
|
mobs:register_egg("mobs_turtles:seaturtle", "Sea Turtle", "default_water.png", 1)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user