Merge pull request #1 from minetest-mobs-mods/feature/ethereal-compat

Feature/ethereal compat
This commit is contained in:
Tai Kedzierski 2019-08-02 13:38:40 +01:00 committed by GitHub
commit f517964ce0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
26 changed files with 235 additions and 108 deletions

16
CHANGELOG.md Normal file
View File

@ -0,0 +1,16 @@
* 2019-07-31 : Grossam
* spawn.lua rewritten using mobs:spawn()
* spawn rules modified for more consistency (e.g. hedgehogs now spawn at night)
* some sounds and textures added
* dragon arrow bug corrected
* elemental an great drangons can fly in water (still take damages from it !)
* great dragons may spawn in caverealms
* 2019-07-28 : Grossam
* some little bugs corrected
* dragon_normal described as 'minor dragons' and now they can spawn
* ice dragons are now named "Blue dragon"
* hatched great dragons are tamed now
* great dragons now need a diamond block nest (you've to deserve greatness !)
* 2019-07-27 : Grossam
* Forked on https://git.fwhost.eu/Grossam/dmobs

View File

@ -1,4 +1,3 @@
# D00Med's Mobs # D00Med's Mobs
Thanks to TenPlus1, blert2112, and taikedz Thanks to D00Med, TenPlus1, blert2112, Grossam and taikedz

11
api.lua
View File

@ -160,9 +160,12 @@ function object_fly(entity, dtime, speed, shoots, arrow, moving_anim, stand_anim
local yaw = entity.driver:get_look_yaw(); local yaw = entity.driver:get_look_yaw();
local pos = entity.object:get_pos() local pos = entity.object:get_pos()
local node = minetest.get_node(pos).name local node = minetest.get_node(pos).name
if node == "default:water_source" or node == "default:river_water_source" or node == "default:river_water_flowing" or node == "default:water_flowing" then
entity.object:set_velocity({x=velo.x*0.9, y=-1, z=velo.z*0.9}) -- Commented condition makes dragons stuck in water, lava and so on…
elseif ctrl.up then -- if node == "default:water_source" or node == "default:river_water_source" or node == "default:river_water_flowing" or node == "default:water_flowing" or node == "default:lava_source" or node == "default:lava_flowing" then
-- entity.object:set_velocity({x=velo.x*0.5, y=velo.y*0.5, z=velo.z*0.5})
-- end
if ctrl.up then
entity.object:set_yaw(yaw+math.pi+math.pi/2) entity.object:set_yaw(yaw+math.pi+math.pi/2)
entity.object:set_velocity(vec_forward) entity.object:set_velocity(vec_forward)
elseif ctrl.down then elseif ctrl.down then
@ -202,8 +205,8 @@ function object_fly(entity, dtime, speed, shoots, arrow, moving_anim, stand_anim
end end
end end
--lib_mount (not required by new functions)
--lib_mount (not required by new functions)
local function is_group(pos, group) local function is_group(pos, group)
local nn = minetest.get_node(pos).name local nn = minetest.get_node(pos).name

View File

@ -1,7 +1,10 @@
local name = {}
local base_arrow = { local base_arrow = {
visual = "sprite", visual = "sprite",
visual_size = {x = 0.5, y = 0.5}, visual_size = {x = 0.5, y = 0.5},
velocity = 8, velocity = 8,
textures = {},
tail = 1, -- enable tail tail = 1, -- enable tail
tail_texture = "dmobs_ice.png", tail_texture = "dmobs_ice.png",
@ -25,6 +28,7 @@ local base_arrow = {
} }
for _,arrowtype in pairs( {"ice","lightning","poison"} ) do for _,arrowtype in pairs( {"ice","lightning","poison"} ) do
base_arrow.textures = {"dmobs_"..arrowtype..".png"}, base_arrow.textures = {"dmobs_"..arrowtype..".png"}
mobs:register_arrow("dmobs:"..arrowtype, dmobs.deepclone(base_arrow) ) name = "dmobs:"..arrowtype
mobs:register_arrow(name, dmobs.deepclone(base_arrow) )
end end

View File

@ -1,4 +1,6 @@
default default
mobs mobs
wool wool
farming? farming?
ethereal?
caverealms?

View File

@ -2,12 +2,26 @@ D00Med's Mobs
How to Dragon How to Dragon
By defeating dragons you will get eggs. Place them in their ideal environment and feed them a gem to create an elemental egg. By defeating dragons you will get eggs. Place them in their ideal environment and feed them a dragon gem (the violet one) to create an
elemental egg.
Environements :
* Fire : lava source
* Lightning : obsidian
* Poison : cactus
* Ice : ice
* Great : diamond block
By defeating special dragons, you can obtain elemental gems. By defeating special dragons, you can obtain elemental gems.
Feed the right elemental gem to the elemental egg to hatch a dragon. Feed the right elemental gem to the elemental egg to hatch a dragon:
* Fire : fire gem
* Lightning : lightning gem
* Poison : poison gem
* Ice : ice gem
* Great : dragon gem
Use the Use key to shoot fireballs when riding your new pet dragon. Use the Use key to shoot fireballs when riding your new pet dragon.
Press the forward key to fly to the direction you're looking
ENjoy Enjoy !

View File

@ -1,3 +1,5 @@
-- Fire dragon
local dragondef = { local dragondef = {
type = "monster", type = "monster",
passive = false, passive = false,
@ -37,14 +39,15 @@ local dragondef = {
run_velocity = 5, run_velocity = 5,
jump = true, jump = true,
fly = true, fly = true,
fly_in = {"air","default:water_source", "default:water_flowing", "default:lava_source", "default:lava_flowing"},
drops = { drops = {
{name = "dmobs:egg", chance = 1, min = 1, max = 1}, {name = "dmobs:egg", chance = 1, min = 1, max = 1},
{name = "dmobs:dragon_gem", chance = 1, min = 1, max = 1}, {name = "dmobs:dragon_gem", chance = 1, min = 1, max = 1},
}, },
fall_speed = 0, fall_speed = 0,
stepheight = 10, stepheight = 10,
water_damage = 2, water_damage = 3,
lava_damage = 0, lava_damage = 1,
light_damage = 0, light_damage = 0,
view_range = 20, view_range = 20,
animation = { animation = {
@ -64,13 +67,15 @@ local dragondef = {
on_rightclick = dmobs.dragon.on_rc on_rightclick = dmobs.dragon.on_rc
} }
mobs:register_mob("dmobs:dragon", dmobs.deepclone(dragondef) )
-- The wild dragon is registered
mobs:register_mob("dmobs:dragon1", dmobs.deepclone(dragondef) )
-- The def is modified to make it tamed and rideable
dragondef.type = "npc" dragondef.type = "npc"
dragondef.attacks_monsters = true dragondef.attacks_monsters = true
dragondef.on_rightclick = dmobs.dragon.ride dragondef.on_rightclick = dmobs.dragon.ride
dragondef.do_custom = dmobs.dragon.do_custom dragondef.do_custom = dmobs.dragon.do_custom
-- The tamed version is registered
mobs:register_mob("dmobs:dragon_red", dmobs.deepclone(dragondef) ) mobs:register_mob("dmobs:dragon_red", dmobs.deepclone(dragondef) )

View File

@ -1,3 +1,5 @@
-- Lightning dragon
local dragondef = { local dragondef = {
type = "monster", type = "monster",
passive = false, passive = false,
@ -31,12 +33,13 @@ local dragondef = {
pathfinding = true, pathfinding = true,
fall_damage = 0, fall_damage = 0,
sounds = { sounds = {
shoot_attack = "mobs_fireball", shoot_attack = "dmobs_thunder",
}, },
walk_velocity = 3, walk_velocity = 3,
run_velocity = 5, run_velocity = 5,
jump = true, jump = true,
fly = true, fly = true,
fly_in = {"air","default:water_source","default:water_flowing"},
drops = { drops = {
{name = "dmobs:egg", chance = 1, min = 1, max = 1}, {name = "dmobs:egg", chance = 1, min = 1, max = 1},
{name = "dmobs:dragon_gem", chance = 1, min = 1, max = 1}, {name = "dmobs:dragon_gem", chance = 1, min = 1, max = 1},

View File

@ -1,3 +1,5 @@
-- Poison dragon
local dragondef = { local dragondef = {
type = "monster", type = "monster",
passive = false, passive = false,
@ -31,12 +33,13 @@ local dragondef = {
pathfinding = true, pathfinding = true,
fall_damage = 0, fall_damage = 0,
sounds = { sounds = {
shoot_attack = "mobs_fireball", shoot_attack = "dmobs_poison",
}, },
walk_velocity = 3, walk_velocity = 3,
run_velocity = 5, run_velocity = 5,
jump = true, jump = true,
fly = true, fly = true,
fly_in = {"air","default:water_source","default:water_flowing"},
drops = { drops = {
{name = "dmobs:egg", chance = 1, min = 1, max = 1}, {name = "dmobs:egg", chance = 1, min = 1, max = 1},
{name = "dmobs:dragon_gem", chance = 1, min = 1, max = 1}, {name = "dmobs:dragon_gem", chance = 1, min = 1, max = 1},

View File

@ -1,3 +1,5 @@
-- Ice dragon
local dragondef = { local dragondef = {
type = "monster", type = "monster",
passive = false, passive = false,
@ -31,20 +33,21 @@ local dragondef = {
pathfinding = true, pathfinding = true,
fall_damage = 0, fall_damage = 0,
sounds = { sounds = {
shoot_attack = "mobs_fireball", shoot_attack = "dmobs_wind.ogg",
}, },
walk_velocity = 3, walk_velocity = 3,
run_velocity = 5, run_velocity = 5,
jump = true, jump = true,
fly = true, fly = true,
fly_in = {"air","default:water_source","default:water_flowing"},
drops = { drops = {
{name = "dmobs:egg", chance = 1, min = 1, max = 1}, {name = "dmobs:egg", chance = 1, min = 1, max = 1},
{name = "dmobs:dragon_gem", chance = 1, min = 1, max = 1}, {name = "dmobs:dragon_gem", chance = 1, min = 1, max = 1},
}, },
fall_speed = 0, fall_speed = 0,
stepheight = 10, stepheight = 10,
water_damage = 2, water_damage = 1,
lava_damage = 0, lava_damage = 2,
light_damage = 0, light_damage = 0,
view_range = 20, view_range = 20,
animation = { animation = {
@ -64,14 +67,12 @@ local dragondef = {
on_rightclick = dmobs.dragon.on_rc on_rightclick = dmobs.dragon.on_rc
} }
mobs:register_mob("dmobs:dragon4", dmobs.deepclone(dragondef) ) mobs:register_mob("dmobs:dragon4", dmobs.deepclone(dragondef) )
dragondef.type = "npc" dragondef.type = "npc"
dragondef.attacks_monsters = true dragondef.attacks_monsters = true
dragondef.on_rightclick = dmobs.dragon.ride dragondef.on_rightclick = dmobs.dragon.ride
dragondef.do_custom = dmobs.dragon.do_custom dragondef.do_custom = dmobs.dragon.do_custom
mobs:register_mob("dmobs:dragon_blue", dmobs.deepclone(dragondef) ) mobs:register_mob("dmobs:dragon_blue", dmobs.deepclone(dragondef) )

View File

@ -1,4 +1,4 @@
--dragon -- 'Generic' dragon
dofile(minetest.get_modpath("dmobs").."/dragons/piloting.lua") dofile(minetest.get_modpath("dmobs").."/dragons/piloting.lua")
@ -15,8 +15,8 @@ mobs:register_mob("dmobs:dragon", {
dogshoot_count_max =5, dogshoot_count_max =5,
arrow = "dmobs:fire", arrow = "dmobs:fire",
shoot_offset = 1, shoot_offset = 1,
hp_min = 70, hp_min = 50,
hp_max = 100, hp_max = 80,
armor = 100, armor = 100,
collisionbox = {-0.6, -1.2, -0.6, 0.6, 0.6, 0.6}, collisionbox = {-0.6, -1.2, -0.6, 0.6, 0.6, 0.6},
visual = "mesh", visual = "mesh",
@ -68,9 +68,3 @@ mobs:register_mob("dmobs:dragon", {
do_custom = dmobs.dragon.step_custom, do_custom = dmobs.dragon.step_custom,
on_rightclick = dmobs.dragon.on_rc on_rightclick = dmobs.dragon.on_rc
}) })
mobs:spawn_specific("dmobs:dragon", {"air"}, {"default:stone"}, 20, 10, 300, 15000, 2, -100, 11000)
mobs:register_egg("dmobs:dragon", "Dragon", "default_apple.png", 1)

View File

@ -4,8 +4,8 @@ local dragonpairs = {
fire = {colour="red",nest="default:lava_source"}, fire = {colour="red",nest="default:lava_source"},
lightning = {colour="black",nest="default:obsidian"}, lightning = {colour="black",nest="default:obsidian"},
poison = {colour="green",nest="default:cactus"}, poison = {colour="green",nest="default:cactus"},
ice = {colour="black",nest="default:ice"}, ice = {colour="blue",nest="default:ice"},
great = {colour="great",nest=""}, great = {colour="great",nest="default:diamond_block"}, -- You've to deserve greatness !'
} }
local function egg_transform(pos, node, clicker, item, _) local function egg_transform(pos, node, clicker, item, _)
@ -41,6 +41,10 @@ local function egg_transform(pos, node, clicker, item, _)
break break
end end
end end
-- default to Great dragon si it doesn't crash
if dragon_type == nil then
dragon_type = "great"
end
minetest.chat_send_player(clicker:get_player_name()," ... something seems to be happening .... come back later?") minetest.chat_send_player(clicker:get_player_name()," ... something seems to be happening .... come back later?")
@ -74,7 +78,7 @@ local function egghatch(pos, node, clicker, item, _)
local thedragon = "dmobs:dragon_"..details.colour local thedragon = "dmobs:dragon_"..details.colour
if eggnode == "dmobs:dragon_egg_great" then if eggnode == "dmobs:dragon_egg_great" then
thedragon = "dmobs:dragon_great" thedragon = "dmobs:dragon_great_tame"
end end
local ent = minetest.add_entity(pos, thedragon) local ent = minetest.add_entity(pos, thedragon)
@ -98,7 +102,10 @@ local function egghatch(pos, node, clicker, item, _)
end -- for loop end -- for loop
end end
-- Egg form dfinitions -----------------------------------------
---------------------- ---
-- Egg form definitions --
--------------------------
local base_egg = { -- base template for all dragon eggs local base_egg = { -- base template for all dragon eggs
description = "Dragon Egg", description = "Dragon Egg",
@ -116,21 +123,25 @@ local base_egg = { -- base template for all dragon eggs
minetest.register_node("dmobs:egg", dmobs.deepclone(base_egg) ) -- clone, to not affect the base template minetest.register_node("dmobs:egg", dmobs.deepclone(base_egg) ) -- clone, to not affect the base template
-- Fire egg
base_egg.groups.not_in_creative_inventory=1 base_egg.groups.not_in_creative_inventory=1
base_egg.on_rightclick = egghatch base_egg.on_rightclick = egghatch
base_egg.tiles = {"dmobs_egg1.png"} base_egg.tiles = {"dmobs_egg1.png"}
minetest.register_node("dmobs:dragon_egg_fire", dmobs.deepclone(base_egg) ) minetest.register_node("dmobs:dragon_egg_fire", dmobs.deepclone(base_egg) )
-- Lightning egg
base_egg.tiles = {"dmobs_egg2.png"} base_egg.tiles = {"dmobs_egg2.png"}
minetest.register_node("dmobs:dragon_egg_lightning", dmobs.deepclone(base_egg) ) minetest.register_node("dmobs:dragon_egg_lightning", dmobs.deepclone(base_egg) )
-- Poison egg
base_egg.tiles = {"dmobs_egg3.png"} base_egg.tiles = {"dmobs_egg3.png"}
minetest.register_node("dmobs:dragon_egg_poison", dmobs.deepclone(base_egg) ) minetest.register_node("dmobs:dragon_egg_poison", dmobs.deepclone(base_egg) )
-- Ice egg
base_egg.tiles = {"dmobs_egg4.png"} base_egg.tiles = {"dmobs_egg4.png"}
minetest.register_node("dmobs:dragon_egg_ice", dmobs.deepclone(base_egg) ) minetest.register_node("dmobs:dragon_egg_ice", dmobs.deepclone(base_egg) )
-- Great dragon egg
base_egg.groups.not_in_creative_inventory=nil base_egg.groups.not_in_creative_inventory=nil
base_egg.tiles = {"default_sandstone.png"} base_egg.tiles = {"default_sandstone.png"}
base_egg.description = "Great Dragon Egg" base_egg.description = "Great Dragon Egg"

View File

@ -11,8 +11,8 @@ local gdragon_base = {
dogshoot_count_max =5, dogshoot_count_max =5,
arrow = "dmobs:lightning", arrow = "dmobs:lightning",
shoot_offset = 1, shoot_offset = 1,
hp_min = 140, hp_min = 150,
hp_max = 180, hp_max = 250,
armor = 220, armor = 220,
collisionbox = {-0.6, -1.4, -0.6, 0.6, 0.6, 0.6}, collisionbox = {-0.6, -1.4, -0.6, 0.6, 0.6, 0.6},
visual = "mesh", visual = "mesh",
@ -37,6 +37,7 @@ local gdragon_base = {
run_velocity = 5, run_velocity = 5,
jump = true, jump = true,
fly = true, fly = true,
fly_in = {"air","default:water_source","default:water_flowing", "default:lava_source","default:lava_flowing"},
drops = { drops = {
{name = "dmobs:dragon_egg_great", chance = 1, min = 1, max = 1}, {name = "dmobs:dragon_egg_great", chance = 1, min = 1, max = 1},
}, },
@ -67,11 +68,7 @@ gdragon_base.type = "npc"
gdragon_base.attacks_monsters = true gdragon_base.attacks_monsters = true
gdragon_base.on_rightclick = dmobs.dragon.ride gdragon_base.on_rightclick = dmobs.dragon.ride
gdragon_base.do_custom = dmobs.dragon.do_custom gdragon_base.do_custom = dmobs.dragon.do_custom
mobs:register_mob("dmobs:dragon_great_tame", dmobs.deepclone(gdragon_base) ) mobs:register_mob("dmobs:dragon_great_tame", dmobs.deepclone(gdragon_base) )
mobs:register_egg("dmobs:dragon_great", "Boss Dragon", "dmobs_egg1.png", 1)
mobs:register_egg("dmobs:dragon_great_tame", "Great Dragon", "default_lava_source_animated.png", 1)

View File

@ -31,21 +31,24 @@ minetest.register_craftitem("dmobs:dragon_gem", {
}) })
--spawns and eggs ----------
-- Eggs --
----------
-- mobs:spawn_specific("dmobs:dragon", {"air"}, {"default:stone"}, 20, 10, 300, 15000, 2, -100, 11000) -- Wild dragons
-- mobs:spawn_specific("dmobs:dragon2", {"air"}, {"default:stone"}, 20, 10, 300, 15000, 2, -100, 11000) mobs:register_egg("dmobs:dragon", "Minor Dragon", "default_apple.png", 1)
-- mobs:spawn_specific("dmobs:dragon3", {"air"}, {"default:stone"}, 20, 10, 300, 15000, 2, -100, 11000) mobs:register_egg("dmobs:dragon1", "Wild Fire Dragon", "default_apple.png", 1)
-- mobs:spawn_specific("dmobs:dragon4", {"air"}, {"default:stone"}, 20, 10, 300, 15000, 2, -100, 11000) mobs:register_egg("dmobs:dragon2", "Wild Lightning Dragon", "dmobs_lightning.png", 1)
mobs:register_egg("dmobs:dragon", "Wild Fire Dragon", "default_apple.png", 1)
mobs:register_egg("dmobs:dragon2", "Wild Lightning Dragon", "default_mese_crystal.png", 1)
mobs:register_egg("dmobs:dragon3", "Wild Poison Dragon", "dmobs_poison.png", 1) mobs:register_egg("dmobs:dragon3", "Wild Poison Dragon", "dmobs_poison.png", 1)
mobs:register_egg("dmobs:dragon4", "Wild Ice Dragon", "default_ice.png", 1) mobs:register_egg("dmobs:dragon4", "Wild Ice Dragon", "default_ice.png", 1)
mobs:register_egg("dmobs:dragon_great", "Boss Dragon", "dmobs_egg1.png", 1)
mobs:register_egg("dmobs:waterdragon", "Boss Waterdragon", "dmobs_egg4.png", 1)
mobs:register_egg("dmobs:wyvern", "Boss Wyvern", "dmobs_egg3.png", 1)
mobs:register_egg("dmobs:dragon_red", "Tame Fire Dragon", "default_apple.png", 1) -- Tamed dragons
mobs:register_egg("dmobs:dragon_black", "Tame Lightning Dragon", "default_mese_crystal.png", 1) mobs:register_egg("dmobs:dragon_red", "Tamed Fire Dragon", "default_apple.png", 1)
mobs:register_egg("dmobs:dragon_green", "Tame Poison Dragon", "dmobs_poison.png", 1) mobs:register_egg("dmobs:dragon_black", "Tamed Lightning Dragon", "dmobs_lightning.png", 1)
mobs:register_egg("dmobs:dragon_blue", "Tame Ice Dragon", "default_ice.png", 1) mobs:register_egg("dmobs:dragon_green", "Tamed Poison Dragon", "dmobs_poison.png", 1)
mobs:register_egg("dmobs:dragon_blue", "Tamed Ice Dragon", "default_ice.png", 1)
mobs:register_egg("dmobs:dragon_great_tame", "Tamed Great Dragon", "default_lava_source_animated.png", 1)

View File

@ -1,3 +1,5 @@
-- Waterdragon (Hydra)
mobs:register_mob("dmobs:waterdragon", { mobs:register_mob("dmobs:waterdragon", {
type = "monster", type = "monster",
passive = false, passive = false,
@ -25,6 +27,7 @@ mobs:register_mob("dmobs:waterdragon", {
makes_footstep_sound = true, makes_footstep_sound = true,
sounds = { sounds = {
random = "mobs_dirtmonster", random = "mobs_dirtmonster",
shoot_attack = "dmobs_wave"
}, },
view_range = 15, view_range = 15,
rotate = 180, rotate = 180,
@ -103,9 +106,9 @@ mobs:register_mob("dmobs:waterdragon_2", {
blood_texture = "mobs_blood.png", blood_texture = "mobs_blood.png",
makes_footstep_sound = true, makes_footstep_sound = true,
sounds = { sounds = {
shoot_attack = "mobs_fireball", shoot_attack = "dmobs_wave",
random = "velociraptor", random = "velociraptor",
}, },
view_range = 15, view_range = 15,
rotate = 180, rotate = 180,
floats = 0, floats = 0,
@ -130,6 +133,3 @@ mobs:register_mob("dmobs:waterdragon_2", {
shoot_end = 40, shoot_end = 40,
}, },
}) })
mobs:register_egg("dmobs:waterdragon", "Boss Waterdragon", "dmobs_egg4.png", 1)

View File

@ -37,7 +37,7 @@ mobs:register_mob("dmobs:wyvern", {
{name = "dmobs:dragon_gem_lightning", chance = 1, min = 1, max = 1}, {name = "dmobs:dragon_gem_lightning", chance = 1, min = 1, max = 1},
}, },
sounds = { sounds = {
shoot_attack = "mobs_fireball", shoot_attack = "dmobs_poison",
random = "velociraptor", random = "velociraptor",
}, },
water_damage = 0, water_damage = 0,
@ -58,6 +58,3 @@ mobs:register_mob("dmobs:wyvern", {
}, },
knock_back = 2, knock_back = 2,
}) })
mobs:register_egg("dmobs:wyvern", "Boss Wyvern", "dmobs_egg3.png", 1)

View File

@ -83,11 +83,12 @@ if dmobs.regulars then
end end
end end
-- dragons!! ---------------
-- dragons!! --
---------------
if not dmobs.dragons then loadmob("dragon_normal","/dragons/")
loadmob("dragon_normal","/dragons/") if dmobs.dragons then
else
loadmob("main","/dragons/") loadmob("main","/dragons/")
loadmob("dragon1","/dragons/") loadmob("dragon1","/dragons/")
loadmob("dragon2","/dragons/") loadmob("dragon2","/dragons/")

View File

@ -31,6 +31,12 @@ mobs_pig.ogg - from mobs_animal by TenPlus1 (MIT)
dmobs_chirrup.ogg - CC BY SA 3.0 taikedz dmobs_chirrup.ogg - CC BY SA 3.0 taikedz
wasp.ogg - Public Domain wasp.ogg - Public Domain
* dmobs_thunder.ogg - CC-0 : https://freesound.org/people/Josh74000MC/sounds/475094/
* dmobs_wind.ogg - CC-BY 3.0 : https://freesound.org/people/Pedaling%20Prince/sounds/338952/
* dmobs_poison.ogg - CC-BY 3.0 : https://freesound.org/people/qubodup/sounds/182789/
* dmobs_wave.ogg - CC-BY 3.0 : https://freesound.org/people/Kayyy/sounds/61011/
--License of lib_mount: --License of lib_mount:
-- Minetest mod: lib_mount -- Minetest mod: lib_mount
-- ======================= -- =======================
@ -49,4 +55,4 @@ wasp.ogg - Public Domain
-- License of source code: -- License of source code:
-- ----------------------- -- -----------------------
-- WTFPL -- WTFPL

1
mod.conf Normal file
View File

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

BIN
sounds/dmobs_poison.ogg Normal file

Binary file not shown.

BIN
sounds/dmobs_thunder.ogg Normal file

Binary file not shown.

BIN
sounds/dmobs_wave.ogg Normal file

Binary file not shown.

BIN
sounds/dmobs_wind.ogg Normal file

Binary file not shown.

137
spawn.lua
View File

@ -1,52 +1,119 @@
-- spawn.lua rewritten, using this latest function frim mobs_redo :
--
--mobs:spawn({
-- name = "dmobs:dragon",
-- nodes = {"air"},
-- neighbor = {"default:stone"},
-- min_light = 10,
-- max_light = 15,
-- interval = 300,
-- chance = 15000,
-- active_object_count = 2,
-- min_height = -100,
-- max_height = 11000,
--})
--
-- The fonction creates a rule defining how a mob will spawn.
-- Call it several times to create several rules.
-- mobs:spawn() seems to ignore unloaded nodes. So no need checking for loaded mods ?
--local eth = minetest.get_modpath("ethereal")
--local cr = minetest.get_modpath("caverealms")
--local nodes, neighbor = {}, {}
if dmobs.regulars then if dmobs.regulars then
-- friendlies -- friendlies
-- nodes = {"darkage:marble"}
-- neighbor = {"darkage:slate"}
mobs:spawn({name = "dmobs:nyan", nodes = {"air"}, neighbor = {"group:leaves"},
min_light = 10, max_light = 15, interval = 300, chance = 64000, active_object_count = 2, min_height = 0, max_height = 2000})
mobs:spawn({name = "dmobs:nyan", nodes = {"air"}, neighbor = {"ethereal:mushroom", "nyanland:meseleaves"},
min_light = 10, max_light = 15, interval = 300, chance = 16000, active_object_count = 2, min_height = 0, max_height = 2000})
mobs:spawn({name = "dmobs:hedgehog", nodes = {"group:flora", "ethereal:prairie_dirt"},
neighbor = {}, min_light = 0, max_light = 8, interval = 300, chance = 8000, active_object_count = 3, min_height = 0, max_height = 2000})
mobs:spawn({name = "dmobs:whale", nodes = {"default:water_source"}, neighbor = {"group:sand"},
min_light = 0, max_light = 15, interval = 300, chance = 16000, active_object_count = 2, min_height = -100, max_height = 0})
mobs:spawn({name = "dmobs:owl", nodes = {"group:tree"}, neighbor = {},
min_light = 0, max_light = 7, interval = 300, chance = 16000, active_object_count = 2, min_height = 0, max_height = 2000})
mobs:spawn({name = "dmobs:gnorm", nodes = {"default:dirt_with_grass", "ethereal:bamboo_dirt"}, neighbor = {},
min_light = 10, max_light = 15, interval = 300, chance = 32000, active_object_count = 2, min_height = -100, max_height = 0})
mobs:spawn({name = "dmobs:tortoise", nodes = {"default:water_source", "group:sand"}, neighbor = {},
min_light = 5, max_light = 10, interval = 300, chance = 8000, active_object_count = 2, min_height = -100, max_height = 500})
mobs:spawn({name = "dmobs:elephant", nodes = {"default:dirt_with_dry_grass", "ethereal:grove_dirt"}, neighbor = {},
min_light = 10, max_light = 15, interval = 300, chance = 16000, active_object_count = 2, min_height = 0, max_height = 2000})
mobs:spawn({name = "dmobs:pig", nodes = {"default:dirt_with_grass", "ethereal:prairie_dirt", "nyanland:cloudstone"}, neighbor = {},
min_light = 10, max_light = 15, interval = 300, chance = 32000, active_object_count = 2, min_height = 0, max_height = 2000})
mobs:spawn({name = "dmobs:panda", nodes = {"default:dirt_with_grass", "ethereal:bamboo_dirt"}, neighbor = {},
min_light = 10, max_light = 15, interval = 300, chance = 32000, active_object_count = 2, min_height = 0, max_height = 2000})
mobs:register_spawn("dmobs:nyan", {"default:pine_needles","default:leaves"}, 20, 10, 50000, 2, 31000)
mobs:register_spawn("dmobs:nyan", {"nyanland:meseleaves"}, 20, 10, 15000, 2, 31000)
mobs:register_spawn("dmobs:hedgehog", {"default:dirt_with_grass","default:pine_needles"}, 20, 10, 15000, 2, 31000)
mobs:register_spawn("dmobs:whale", {"default:water_source"}, 20, 10, 15000, -20, 1000)
mobs:register_spawn("dmobs:owl", {"default:leaves","default:tree"}, 20, 10, 15000, 2, 31000)
mobs:register_spawn("dmobs:gnorm", {"default:dirt_with_grass","default:wood"}, 20, 10, 32000, 2, 31000)
mobs:register_spawn("dmobs:tortoise", {"default:clay","default:sand"}, 20, 10, 15000, 2, 31000)
mobs:register_spawn("dmobs:elephant", {"default:dirt_with_dry_grass","default:desert_sand"}, 20, 10, 15000, 2, 31000)
mobs:register_spawn("dmobs:badger", {"default:dirt_with_grass","default:dirt"}, 20, 10, 15000, 2, 31000)
mobs:register_spawn("dmobs:pig", {"default:pine_needles","default:leaves", "nyanland:cloudstone"}, 20, 10, 32000, 2, 31000)
mobs:register_spawn("dmobs:panda", {"default:dirt_with_grass","ethereal:bamboo_dirt"}, 20, 10, 15000, 2, 31000)
-- baddies -- baddies
mobs:register_spawn("dmobs:wasp", {"default:dirt_with_grass"}, 20, 10, 32000, 2, 31000) mobs:spawn({name = "dmobs:wasp", nodes = {"air"}, neighbor = {"group:leaves"}, min_light = 10, max_light = 15, interval = 300, chance = 32000, active_object_count = 2, min_height = 0, max_height = 2000})
mobs:register_spawn("dmobs:wasp", {"dmobs:hive"}, 20, 10, 16000, 2, 31000) mobs:spawn({name = "dmobs:wasp", nodes = {"dmobs:hive"}, neighbor = {}, min_light = 10, max_light = 15, interval = 300, chance = 16000, active_object_count = 2, min_height = 0, max_height = 2000})
mobs:register_spawn("dmobs:wasp_leader", {"default:dirt_with_grass","dmobs:hive"}, 20, 10, 64000, 2, 31000) mobs:spawn({name = "dmobs:wasp_leader", nodes = {"group:leaves", "dmobs:hive"}, neighbor = {}, min_light = 10, max_light = 15, interval = 300, chance = 64000, active_object_count = 2, min_height = 0, max_height = 2000})
mobs:register_spawn("dmobs:golem", {"default:stone"}, 7, 0, 16000, 2, 31000) mobs:spawn({name = "dmobs:golem", nodes = {"group:stone"}, neighbor = {}, min_light = 0,
mobs:register_spawn("dmobs:pig_evil", {"default:pine_needles","default:leaves"}, 20, 10, 32000, 2, 31000) max_light = 7, interval = 300, chance = 16000, active_object_count = 2, min_height = -32000, max_height = 100})
mobs:register_spawn("dmobs:fox", {"default:dirt_with_grass","default:dirt"}, 20, 10, 32000, 2, 31000) mobs:spawn({name = "dmobs:pig_evil", nodes = {"group:leave", "ethereal:bamboo_leaves"}, neighbor = {},
min_light = 10, max_light = 15, interval = 300, chance = 64000, active_object_count = 2, min_height = 0, max_height = 2000})
mobs:spawn({name = "dmobs:fox", nodes = {"group:leaves"}, neighbor = {},
min_light = 0, max_light = 10, interval = 300, chance = 32000, active_object_count = 2, min_height = 0, max_height = 2000})
mobs:spawn({name = "dmobs:rat", nodes = {"group:stone", "group:sand"}, neighbor = {},
min_light = 0, max_light = 10, interval = 300, chance = 32000, active_object_count = 2, min_height = -30000, max_height = 100})
mobs:spawn({name = "dmobs:treeman", nodes = {"group:leaves"}, neighbor = {},
min_light = 7, max_light = 15, interval = 300, chance = 16000, active_object_count = 2, min_height = 0, max_height = 2000})
mobs:spawn({name = "dmobs:skeleton", nodes = {"group:stone","caverealms:stone_with_salt","default:desert_sand"}, neighbor = {},
min_light = 0, max_light = 10, interval = 300, chance = 16000, active_object_count = 2, min_height = -31000, max_height = -1000})
-- Orcs and ogres spawn more often when dragons are disabled
if not dmobs.dragons then if not dmobs.dragons then
mobs:register_spawn("dmobs:orc", {"default:snow","default:snow_block", "default:desert_sand"}, 20, 10, 15000, 2, 31000) mobs:spawn({name = "dmobs:orc",
mobs:register_spawn("dmobs:ogre", {"default:snow","default:dirt_with_dry_grass", "default:desert_sand"}, 20, 10, 15000, 2, 31000) nodes = {"default:snow_block", "default:permafrost_with_moss", "default:permafrost_with_stone", "ethereal:cold_dirt"},
neighbor = {}, min_light = 0, max_light = 10, interval = 300, chance = 6000,
active_object_count = 2, min_height = 0, max_height = 2000})
mobs:spawn({name = "dmobs:ogre",
nodes = {"default:snow_block", "default:permafrost_with_moss", "default:permafrost_with_stone", "ethereal:cold_dirt"},
neighbor = {}, min_light = 0, max_light = 10, interval = 300, chance = 16000,
active_object_count = 2, min_height = 0, max_height = 2000})
else else
mobs:register_spawn("dmobs:orc", {"default:snow","default:snow_block", "default:desert_sand"}, 20, 10, 3500, 2, 31000) mobs:spawn({name = "dmobs:orc",
mobs:register_spawn("dmobs:ogre", {"default:snow","default:dirt_with_dry_grass", "default:desert_sand"}, 20, 10, 350, 2, 31000) nodes = {"default:snow_block", "default:permafrost_with_moss", "default:permafrost_with_stone", "ethereal:cold_dirt"},
neighbor = {}, min_light = 0, max_light = 10, interval = 300, chance = 8000,
active_object_count = 2, min_height = 0, max_height = 2000})
mobs:spawn({name = "dmobs:ogre",
nodes = {"default:snow_block", "default:permafrost_with_moss", "default:permafrost_with_stone", "ethereal:cold_dirt"},
neighbor = {}, min_light = 0, max_light = 10, interval = 300, chance = 32000,
active_object_count = 2, min_height = 0, max_height = 2000})
end end
mobs:register_spawn("dmobs:rat", {"default:stone","default:sand"}, 20, 0, 32000, 2, 31000)
mobs:register_spawn("dmobs:treeman", {"default:leaves", "default:pine_needles"}, 7, 0, 16000, 2, 31000)
mobs:register_spawn("dmobs:skeleton", {"default:stone"}, 7, 0, 16000, 2, 31000)
end end
-- dragons
mobs:register_spawn("dmobs:dragon", {"default:leaves","default:dirt_with_grass"}, 20, 10, 64000, 2, 31000) -------------
-- dragons --
-------------
-- Generic dragon always spawn, the others only if enabled
mobs:spawn({name = "dmobs:dragon", nodes = {"group:leaves"}, neighbor = {},
min_light = 5, max_light = 15, interval = 300, chance = 16000, active_object_count = 2, min_height = 0, max_height = 30000})
if dmobs.dragons then if dmobs.dragons then
mobs:register_spawn("dmobs:dragon2", {"default:pine_needles"}, 20, 10, 64000, 2, 31000) mobs:spawn({name = "dmobs:dragon1", nodes = {"ethereal:fiery_dirt", "default:desert_sand"}, neighbor = {},
mobs:register_spawn("dmobs:dragon3", {"default:acacia_leaves","default:dirt_with_dry_grass"}, 20, 10, 64000, 2, 31000) min_light = 5, max_light = 15, interval = 300, chance = 24000, active_object_count = 2, min_height = 0, max_height = 30000})
mobs:register_spawn("dmobs:dragon4", {"default:jungleleaves"}, 20, 10, 64000, 2, 31000) mobs:spawn({name = "dmobs:dragon2", nodes = {"ethereal:crystal_dirt", "default:dirt_with_dry_grass"}, neighbor = {},
mobs:register_spawn("dmobs:waterdragon", {"default:water_source"}, 20, 10, 32000, 1, 31000, false) min_light = 5, max_light = 15, interval = 300, chance = 24000, active_object_count = 2, min_height = 0, max_height = 30000})
mobs:register_spawn("dmobs:wyvern", {"default:leaves"}, 20, 10, 32000, 1, 31000, false) mobs:spawn({name = "dmobs:dragon3", nodes = {"ethereal:jungle_dirt", "default:jungleleaves"}, neighbor = {},
mobs:register_spawn("dmobs:dragon_great", {"default:lava_source"}, 20, 0, 64000, -21000, 1000, false) min_light = 0, max_light = 10, interval = 300, chance = 24000, active_object_count = 2, min_height = 0, max_height = 30000})
mobs:spawn({name = "dmobs:dragon4",
nodes = {"default:snow_block", "default:permafrost_with_moss", "default:permafrost_with_stone", "ethereal:cold_dirt"}, neighbor = {},
min_light = 5, max_light = 15, interval = 300, chance = 24000, active_object_count = 2, min_height = 0, max_height = 30000})
mobs:spawn({name = "dmobs:waterdragon", nodes = {"default:water_source"}, neighbor = {"air"},
min_light = 0, max_light = 15, interval = 300, chance = 32000, active_object_count = 2, min_height = -10, max_height = 100})
mobs:spawn({name = "dmobs:wyvern", nodes = {"group:leaves"}, neighbor = {},
min_light = 0, max_light = 10, interval = 300, chance = 32000, active_object_count = 2, min_height = 0, max_height = 30000})
mobs:spawn({name = "dmobs:dragon_great",
nodes = {"ethereal:jungle_dirt", "default:jungleleaves", "default:lava_source", "caverealms:glow_mese",
"caverealms:glow_amethyst", "caverealms:glow_crystal", "caverealms:glow_emerald","cavereals:glow_ruby"}, neighbor = {},
min_light = 0, max_light = 15, interval = 300, chance = 32000, active_object_count = 2, min_height = -30000, max_height = 30000})
end end

Binary file not shown.

After

Width:  |  Height:  |  Size: 55 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 378 B

After

Width:  |  Height:  |  Size: 1.0 KiB