Compare commits

...

10 Commits

Author SHA1 Message Date
tenplus1
f811494bbf typo in settings 2024-08-16 18:20:08 +01:00
tenplus1
9e3d06586e add custom spawn check and examples 2024-08-16 18:03:24 +01:00
tenplus1
528cd204b3 add mineclone support 2024-08-15 10:45:15 +01:00
tenplus1
73491efaca 5.x 2023-08-08 16:33:35 +01:00
tenplus1
c1822a5a94 add loaded msg's 2022-12-19 17:15:43 +00:00
tenplus1
d6b368bddf bat code license is MIT 2022-11-18 08:35:06 +00:00
tenplus1
e38351b9ae tidy code 2022-09-27 11:51:24 +01:00
tenplus1
fdcaf29872 add screenshot 2022-04-30 15:00:05 +01:00
tenplus1
cc6f3f113d add missing fly animation 2022-04-30 14:39:32 +01:00
tenplus1
aa3e7a99ce update license files and tidy code 2021-03-02 08:01:58 +00:00
19 changed files with 325 additions and 170 deletions

View File

@ -1,2 +0,0 @@
default
mobs

View File

@ -1,21 +1,20 @@
if minetest.get_modpath("mobs") and not mobs.mod and mobs.mod ~= "redo" then
minetest.log("error", "[mobs_bat] mobs redo API not found!")
return
end
-- local variables
local l_spawnnear = {"default:stone"}
local l_spawnchance = 30000
local l_skins = {
{"animal_bat.png"},
{"animal_bat.png^[colorize:black:150"}
}
local l_spawnnear = {"default:stone"}
local l_spawnchance = 30000
-- spawn definition
mobs:register_mob("mobs_bat:bat", {
type = "animal",
passive = false,
damage = 1,
reach = 1,
reach = 2,
attack_type = "dogfight",
hp_min = 7,
hp_max = 12,
@ -25,15 +24,15 @@ mobs:register_mob("mobs_bat:bat", {
mesh = "animal_bat.b3d",
textures = l_skins,
rotate = 270,
walk_velocity = 10,
run_velocity = 23,
walk_velocity = 3,--10,
run_velocity = 5,--23,
fall_speed = 0,
stepheight = 3,
sounds = {
random = "animal_bat",
war_cry = "animal_bat",
damage = "animal_bat",
attack = "animal_bat",
attack = "animal_bat"
},
fly = true,
water_damage = 2,
@ -41,27 +40,43 @@ mobs:register_mob("mobs_bat:bat", {
light_damage = 0,
view_range = 10,
animation = {
speed_normal = 24, speed_run = 24,
stand_start = 30, stand_end = 59,
walk_start = 30, walk_end = 59,
run_start = 30, run_end = 59,
punch_start = 60, punch_end = 89
speed_normal = 24, speed_run = 24,
stand_start = 30, stand_end = 59,
fly_start = 30, fly_end = 59,
walk_start = 30, walk_end = 59,
run_start = 30, run_end = 59,
punch_start = 60, punch_end = 89
},
on_rightclick = function(self, clicker)
mobs:capture_mob(self, clicker, 5, 60, 0, true, nil)
end
})
mobs:spawn({
name = "mobs_bat:bat",
nodes = {"air"},
neighbors = l_spawnnear,
max_light = 6,
interval = 30,
chance = l_spawnchance,
active_object_count = 2,
min_height = -100,
max_height = 150,
})
-- Check for custom spawn.lua
local MP = minetest.get_modpath(minetest.get_current_modname()) .. "/"
local input = io.open(MP .. "spawn.lua", "r")
if input then
input:close() ; input = nil ; dofile(MP .. "spawn.lua")
else
mobs:spawn({
name = "mobs_bat:bat",
nodes = {"air"},
neighbors = l_spawnnear,
max_light = 6,
interval = 30,
chance = l_spawnchance,
active_object_count = 2,
min_height = -100,
max_height = 150
})
end
-- mob egg
mobs:register_egg("mobs_bat:bat", "Bat", "animal_bat_inv.png", 0)
print("[MOD] Mobs Redo Bat loaded")

View File

@ -3,10 +3,9 @@
-- ANÝMAL BAT --
--------------------------
--------------------------
--
--
-- Model and textures from Defense Subgame
-- License of defense mod GPL
-- License of media (models, textures ) (CC BY-SA 3.0)
-- License of Api WTFPL Simple Mobs by PilzAdam > Mob Redo by Ten1plus > Redo+ Mahmutelmas06
-- License of code is MIT
-- License of media (models, textures ) (CC BY-SA 3.0)
-- Sounds from bigsoundbank and WTFPL ( confirmed by email )
--
--

View File

@ -1,4 +1,4 @@
name = mobs_bat
depends = default, mobs
optional_depends =
description = Adds bats into your world.
depends = mobs
min_minetest_version = 5.0

View File

@ -0,0 +1,14 @@
-- Bat spawn example
mobs:spawn({
name = "mobs_bat:bat",
nodes = {"air"},
neighbors = {"default:stone"},
max_light = 6,
interval = 30,
chance = 30000,
active_object_count = 2,
min_height = -100,
max_height = 150
})

Binary file not shown.

View File

@ -1,5 +1,7 @@
Licenses
Code: MIT
Model and textures:
CC-BY-SA 3.0, Author sapier
URL: http://creativecommons.org/licenses/by-sa/3.0/de/legalcode
URL: http://creativecommons.org/licenses/by-sa/3.0/de/legalcode

View File

@ -1,6 +0,0 @@
-- SETTINGS
ENABLE_GULLS = true
ENABLE_LARGE_BIRDS = true
ENABLE_SMALL_BIRDS = true

View File

@ -1,2 +0,0 @@
default
mobs

View File

@ -1,53 +1,29 @@
if minetest.get_modpath("mobs") and not mobs.mod and mobs.mod ~= "redo" then
minetest.log("error", "[mobs_birds] mobs redo API not found!")
return
end
-- local variables
local l_skins_gull = {
{"animal_gull_mesh.png"},
{"gull_black.png"},
{"gull_gray.png"},
{"gull_grayblue.png"}
}
local l_skins_bird = {
{"bird_blueish.png"},
{"bird_brown.png"},
{"bird_gray.png"},
{"bird_grayblue.png"},
{"bird_red.png"},
{"bird_redish.png"}
}
local l_anims = {
speed_normal = 24, speed_run = 24,
stand_start = 1, stand_end = 95,
walk_start = 1, walk_end = 95,
run_start = 1, run_end = 95
}
local l_model = "animal_gull.b3d"
local l_egg_texture = "default_cloud.png"
local l_capture_chance_h = 5
local l_capture_chance_n = 60
local l_spawn_in = {"air"}
local l_spawn_near_gull = {"default:water_source", "default:water_flowing"}
local l_spawn_near_bird = {
"default:leaves", "default:pine_needles",
"default:jungleleaves", "default:cactus"
}
local l_spawn_chance_gull = 24000
local l_spawn_chance_bird = 36000
local l_spawn_chance_gull = 24000
local l_spawn_chance_bird = 36000
-- load settings
dofile(minetest.get_modpath("mobs_birds").."/SETTINGS.txt")
if not ENABLE_LARGE_BIRDS then
l_spawn_chance_bird = l_spawn_chance_bird - 18000
end
if not ENABLE_SMALL_BIRDS then
local ENABLE_GULLS = minetest.settings:get_bool("mobs_birds.enable_gulls") ~= false
local ENABLE_LARGE = minetest.settings:get_bool("mobs_birds.enable_large_birds") ~= false
local ENABLE_SMALL = minetest.settings:get_bool("mobs_birds.enable_small_birds") ~= false
if not ENABLE_LARGE then
l_spawn_chance_bird = l_spawn_chance_bird - 18000
end
if not ENABLE_SMALL then
l_spawn_chance_bird = l_spawn_chance_bird - 18000
end
-- Mineclone check
local mod_mcl = minetest.get_modpath("mcl_core")
-- gulls
if ENABLE_GULLS then
mobs:register_mob("mobs_birds:gull", {
@ -58,8 +34,13 @@ if ENABLE_GULLS then
armor = 100,
collisionbox = {-1, -0.3, -1, 1, 0.3, 1},
visual = "mesh",
mesh = l_model,
textures = l_skins_gull,
mesh = "animal_gull.b3d",
textures = {
{"animal_gull_mesh.png"},
{"gull_black.png"},
{"gull_gray.png"},
{"gull_grayblue.png"}
},
rotate = 270,
walk_velocity = 4,
run_velocity = 6,
@ -71,28 +52,25 @@ if ENABLE_GULLS then
lava_damage = 10,
light_damage = 0,
view_range = 14,
animation = l_anims,
animation = {
speed_normal = 24, speed_run = 24,
stand_start = 1, stand_end = 95,
walk_start = 1, walk_end = 95,
fly_start = 1, fly_end = 95,
run_start = 1, run_end = 95
},
on_rightclick = function(self, clicker)
mobs:capture_mob(self, clicker, l_capture_chance_h, l_capture_chance_n, 0, true, nil)
mobs:capture_mob(self, clicker, 5, 60, 0, true, nil)
end
})
mobs:spawn({
name = "mobs_birds:gull",
nodes = l_spawn_in,
neighbors = l_spawn_near_gull,
max_light = 5,
interval = 30,
chance = l_spawn_chance_gull,
min_height = 0,
max_height = 200,
})
mobs:register_egg("mobs_birds:gull", "Gull", l_egg_texture, 1)
mobs:register_egg("mobs_birds:gull", "Gull", "default_cloud.png", 1)
end
-- large birds
if ENABLE_LARGE_BIRDS then
if ENABLE_LARGE then
mobs:register_mob("mobs_birds:bird_lg", {
type = "animal",
@ -102,8 +80,15 @@ if ENABLE_LARGE_BIRDS then
armor = 100,
collisionbox = {-0.5, -0.3, -0.5, 0.5, 0.3, 0.5},
visual = "mesh",
mesh = l_model,
textures = l_skins_bird,
mesh = "animal_gull.b3d",
textures = {
{"bird_blueish.png"},
{"bird_brown.png"},
{"bird_gray.png"},
{"bird_grayblue.png"},
{"bird_red.png"},
{"bird_redish.png"}
},
visual_size = {x = .5, y = .5},
rotate = 270,
walk_velocity = 4,
@ -116,28 +101,24 @@ if ENABLE_LARGE_BIRDS then
lava_damage = 10,
light_damage = 0,
view_range = 12,
animation = l_anims,
animation = {
speed_normal = 24, speed_run = 24,
stand_start = 1, stand_end = 95,
walk_start = 1, walk_end = 95,
run_start = 1, run_end = 95
},
on_rightclick = function(self, clicker)
mobs:capture_mob(self, clicker, l_capture_chance_h, l_capture_chance_n, 0, true, nil)
mobs:capture_mob(self, clicker, 5, 60, 0, true, nil)
end
})
mobs:spawn({
name = "mobs_birds:bird_lg",
nodes = l_spawn_in,
neighbors = l_spawn_near_bird,
max_light = 5,
interval = 30,
chance = l_spawn_chance_bird,
min_height = 0,
max_height = 200,
})
mobs:register_egg("mobs_birds:bird_lg", "Large bird", l_egg_texture, 1)
mobs:register_egg("mobs_birds:bird_lg", "Large bird", "default_cloud.png", 1)
end
-- small birds
if ENABLE_SMALL_BIRDS then
if ENABLE_SMALL then
mobs:register_mob("mobs_birds:bird_sm", {
type = "animal",
@ -147,8 +128,15 @@ if ENABLE_SMALL_BIRDS then
armor = 100,
collisionbox = {-0.25, -0.3, -0.25, 0.25, 0.3, 0.25},
visual = "mesh",
mesh = l_model,
textures = l_skins_bird,
mesh = "animal_gull.b3d",
textures = {
{"bird_blueish.png"},
{"bird_brown.png"},
{"bird_gray.png"},
{"bird_grayblue.png"},
{"bird_red.png"},
{"bird_redish.png"}
},
visual_size = {x = .25, y = .25},
rotate = 270,
walk_velocity = 4,
@ -161,22 +149,74 @@ if ENABLE_SMALL_BIRDS then
lava_damage = 10,
light_damage = 0,
view_range = 10,
animation = l_anims,
animation = {
speed_normal = 24, speed_run = 24,
stand_start = 1, stand_end = 95,
walk_start = 1, walk_end = 95,
run_start = 1, run_end = 95
},
on_rightclick = function(self, clicker)
mobs:capture_mob(self, clicker, l_capture_chance_h, l_capture_chance_n, 0, true, nil)
mobs:capture_mob(self, clicker, 5, 60, 0, true, nil)
end
})
mobs:spawn({
name = "mobs_birds:bird_sm",
nodes = l_spawn_in,
neighbors = l_spawn_near_bird,
max_light = 5,
interval = 30,
chance = l_spawn_chance_bird,
min_height = 0,
max_height = 200,
})
mobs:register_egg("mobs_birds:bird_sm", "Small bird", l_egg_texture, 1)
mobs:register_egg("mobs_birds:bird_sm", "Small bird", "default_cloud.png", 1)
end
-- Check for custom spawn.lua
local MP = minetest.get_modpath(minetest.get_current_modname()) .. "/"
local input = io.open(MP .. "spawn.lua", "r")
if input then
input:close() ; input = nil ; dofile(MP .. "spawn.lua")
else
if ENABLE_GULL then
mobs:spawn({
name = "mobs_birds:gull",
nodes = {"air"},
neighbors = {"group:water"},
max_light = 5,
interval = 30,
chance = l_spawn_chance_gull,
min_height = 0,
max_height = 200
})
end
if ENABLE_SMALL then
mobs:spawn({
name = "mobs_birds:bird_sm",
nodes = {"air"},
neighbors = {
"group:leaves" , (mod_mcl and "mcl_core:cactus" or "default:cactus")
},
max_light = 5,
interval = 30,
chance = l_spawn_chance_bird,
min_height = 0,
max_height = 200
})
end
if ENABLE_LARGE then
mobs:spawn({
name = "mobs_birds:bird_lg",
nodes = {"air"},
neighbors = {
"group:leaves" , (mod_mcl and "mcl_core:cactus" or "default:cactus")
},
max_light = 5,
interval = 30,
chance = l_spawn_chance_bird,
min_height = 0,
max_height = 200
})
end
end
print("[MOD] Mobs Redo Birds loaded")

View File

@ -1,4 +1,4 @@
name = mobs_birds
depends = default, mobs
optional_depends =
description = Adds birds into your world.
depends = mobs
min_minetest_version = 5.0

3
mobs_birds/settingtypes.txt Executable file
View File

@ -0,0 +1,3 @@
mobs_birds.enable_gulls (Enable Gulls) bool true
mobs_birds.enable_large_birds (Enable Large Birds) bool true
mobs_birds.enable_small_birds (Enable Small Birds) bool true

View File

@ -0,0 +1,54 @@
-- load settings
local ENABLE_GULLS = minetest.settings:get_bool("mobs_birds.enable_gulls") ~= false
local ENABLE_LARGE = minetest.settings:get_bool("mobs_birds.enable_large_birds") ~= false
local ENABLE_SMALL = minetest.settings:get_bool("mobs_birds.enable_small_birds") ~= false
-- Custom spawn examples
if ENABLE_GULL then
mobs:spawn({
name = "mobs_birds:gull",
nodes = {"air"},
neighbors = {"group:water"},
max_light = 5,
interval = 30,
chance = 24000,
min_height = 0,
max_height = 200
})
end
if ENABLE_SMALL then
mobs:spawn({
name = "mobs_birds:bird_sm",
nodes = {"air"},
neighbors = {
"group:leaves" , (mod_mcl and "mcl_core:cactus" or "default:cactus")
},
max_light = 5,
interval = 30,
chance = 18000,
min_height = 0,
max_height = 200
})
end
if ENABLE_LARGE then
mobs:spawn({
name = "mobs_birds:bird_lg",
nodes = {"air"},
neighbors = {
"group:leaves" , (mod_mcl and "mcl_core:cactus" or "default:cactus")
},
max_light = 5,
interval = 30,
chance = 18000,
min_height = 0,
max_height = 200
})
end

View File

@ -1,6 +1,6 @@
Licenses
Model/Textures: unknown
Author: AspireMint
Code: MIT
Model/Textures: CC-BY-SA 3.0, Author AspireMint
texture modification by: blert2112

View File

@ -1,2 +0,0 @@
default
mobs

View File

@ -1,22 +1,45 @@
if minetest.get_modpath("mobs") and not mobs.mod and mobs.mod ~= "redo" then
minetest.log("error", "[mobs_butterfly] mobs redo API not found!")
return
end
-- mod check and settings
local butterfly_mod = minetest.get_modpath("butterflies")
-- local variables
local l_skins = {
{"bf1.png^bf2.png^bf3.png^bf4.png^bf5.png"},
{"(bf1.png^[colorize:orange)^(bf2.png^[colorize:violet)^(bf3.png^[colorize:yellow)^(bf4.png^[colorize:cyan)^(bf5.png^[colorize:black)"},
{"(bf1.png^[colorize:magenta)^(bf2.png^[colorize:green)^(bf3.png^[colorize:red)^(bf4.png^[colorize:blue)^(bf5.png^[colorize:white)"},
{"(bf1.png^[colorize:yellow)^(bf2.png^[colorize:cyan)^(bf3.png^[colorize:green)^(bf4.png^[colorize:violet)^(bf5.png^[colorize:darkgray)"},
{"(bf1.png^[colorize:pink)^(bf2.png^[colorize:white)^(bf3.png^[colorize:blue)^(bf4.png^[colorize:orange)^(bf5.png^[colorize:gray)"},
{"(bf1.png^[colorize:darkgreen)^(bf2.png^[colorize:brown)^(bf3.png^[colorize:black)^(bf4.png^[colorize:darkgray)^(bf5.png^[colorize:red)"}
{ "(bf1.png^[colorize:orange)"
.."^(bf2.png^[colorize:violet)^(bf3.png^[colorize:yellow)"
.."^(bf4.png^[colorize:cyan)^(bf5.png^[colorize:black)"
},
{ "(bf1.png^[colorize:magenta)"
.."^(bf2.png^[colorize:green)"
.."^(bf3.png^[colorize:red)"
.."^(bf4.png^[colorize:blue)"
.."^(bf5.png^[colorize:white)"
},
{ "(bf1.png^[colorize:yellow)"
.."^(bf2.png^[colorize:cyan)"
.."^(bf3.png^[colorize:green)"
.."^(bf4.png^[colorize:violet)"
.."^(bf5.png^[colorize:darkgray)"
},
{ "(bf1.png^[colorize:pink)"
.."^(bf2.png^[colorize:white)"
.."^(bf3.png^[colorize:blue)"
.."^(bf4.png^[colorize:orange)"
.."^(bf5.png^[colorize:gray)"
},
{ "(bf1.png^[colorize:darkgreen)"
.."^(bf2.png^[colorize:brown)"
.."^(bf3.png^[colorize:black)"
.."^(bf4.png^[colorize:darkgray)"
.."^(bf5.png^[colorize:red)"
}
}
local l_spawnnear = {"group:flower"}
local l_spawnchance = 20000
-- Butterfly
-- Butterfly definition
mobs:register_mob("mobs_butterfly:butterfly", {
type = "animal",
passive = true,
@ -37,27 +60,44 @@ mobs:register_mob("mobs_butterfly:butterfly", {
fall_damage = 0,
view_range = 10,
animation = {
speed_normal = 15, speed_run = 30,
stand_start = 0, stand_end = 90,
walk_start = 0, walk_end = 90,
speed_normal = 15, speed_run = 30,
stand_start = 0, stand_end = 90,
walk_start = 0, walk_end = 90,
fly_start = 0, fly_end = 90
},
after_activate = function(self, staticdata, def, dtime)
if minetest.get_modpath("butterflies") then
if butterfly_mod then
local pos = self.object:get_pos()
local butter = {"white", "red", "violet"}
local replace = "butterflies:butterfly_"
.. butter[math.random(1, #butter)]
minetest.set_node(pos, {name = replace})
local replace = "butterflies:butterfly_" .. butter[math.random(#butter)]
minetest.set_node(pos, {name = replace})
self.object:remove()
end
end,
on_rightclick = function(self, clicker)
if not butterfly_mod then
mobs:capture_mob(self, clicker, 10, 80, 0, true, nil)
end
end
-- on_rightclick = function(self, clicker)
-- mobs:capture_mob(self, clicker, 10, 80, 0, true, nil)
-- end
})
--name, nodes, neighbors, min_light, max_light, interval, chance, active_object_count, min_height, max_height
-- mobs:spawn_specific("mobs_butterfly:butterfly", {"air"}, l_spawnnear, 5, 20, 30, l_spawnchance, 1, 0, 31000)
if not butterfly_mod then
-- mobs:register_egg("mobs_butterfly:butterfly", "Butterfly", "default_cloud.png", 1)
-- spawn in world
mobs:spawn_specific("mobs_butterfly:butterfly", {"air"},
l_spawnnear, 5, 20, 30, l_spawnchance, 1, 0, 31000)
-- spawn egg
mobs:register_egg("mobs_butterfly:butterfly", "Butterfly", "default_cloud.png", 1)
end
print("[MOD] Mobs Redo Butterfly loaded")

View File

@ -1,4 +1,4 @@
name = mobs_butterfly
depends = default, mobs
optional_depends =
description = Adds butterflies into your world.
depends = mobs
min_minetest_version = 5.0

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

BIN
screenshot.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB