diff --git a/API.lua b/API.lua index ea9a6f8..3354df1 100644 --- a/API.lua +++ b/API.lua @@ -12,6 +12,9 @@ for k, mob_mod in ipairs(ENABLED_MODS) do if mob_mod == "mobs" and not (mobs.mod == "redo") then goto continue end + -- include spawners mob addons + dofile(minetest.get_modpath("spawners").."/mob_mummy.lua") + table.insert(spawners.mob_tables, {name=mob.name, mod_prefix=mob_mod, egg_name_custom=mob.egg_name_custom, dummy_size=mob.dummy_size, dummy_offset=mob.dummy_offset, dummy_mesh=mob.dummy_mesh, dummy_texture=mob.dummy_texture, night_only=mob.night_only, sound_custom=mob.sound_custom}) -- use custom egg or create a default egg @@ -229,18 +232,20 @@ function spawners.check_node_status(pos, mob, night_only) return false end - -- spawn only at day - if not night_only and node_light < min_node_light then - return false, true - end - - -- spawn only at night - if night_only then - if not (19359 > tod and tod > 5200) or node_light < min_node_light then - return random_pos - else + if night_only ~= "disable" then + -- spawn only at day + if not night_only and node_light < min_node_light then return false, true end + + -- spawn only at night + if night_only then + if not (19359 > tod and tod > 5200) or node_light < min_node_light then + return random_pos + else + return false, true + end + end end return random_pos, false diff --git a/config.lua b/config.lua index 8caa53b..fee849c 100644 --- a/config.lua +++ b/config.lua @@ -10,17 +10,31 @@ -- * [dummy_texture : table] - Textures used for the mob. --- * [night_only : string] - If true mobs will spawn only during the night or in dark areas, default:true. +-- * [night_only : boolean : string] - If true mobs will spawn only during the night or in dark areas, default:true. Writing "disable" will disable light check and it will spawn in both states (night and day) -- [sound_custom : string] - Custom name for the sound file name if differ from default: i.e 'mobs_cow'. -- [*] -> MANDATORY - has to be filled in! -- mods what should be enabled and loded, remove/add the one you want to load -ENABLED_MODS = {"mobs", "pyramids", "creatures"} +ENABLED_MODS = {"mobs", "pyramids", "creatures", "spawners"} -- mobs properties - setup all you mobs here MOBS_PROPS = { + + ["spawners"] = { -- SPAWNERS (THIS) MOD CONFIG + { + name="mummy", + egg_name_custom="", + dummy_size={x=0.4,y=0.4}, + dummy_offset=0, + dummy_mesh="creatures_mummy.b3d", + dummy_texture={"creatures_mummy.png"}, + night_only="disable", + sound_custom="spawners_mob_mummy" + } + }, + ["mobs"] = { -- MOBS REDO CONFIG { name="sheep_white", @@ -137,7 +151,6 @@ MOBS_PROPS = { } }, - ["creatures"] = { -- CREATURES MOD CONFIG { name="chicken", @@ -188,7 +201,6 @@ MOBS_PROPS = { dummy_texture={"creatures_oerrki.png"}, night_only=false, sound_custom="creatures_oerrki_idle" - } + } } - -} \ No newline at end of file +} diff --git a/mob_mummy.lua b/mob_mummy.lua new file mode 100644 index 0000000..aa860b2 --- /dev/null +++ b/mob_mummy.lua @@ -0,0 +1,74 @@ +-- modified Sand Monster by PilzAdam with Mummy by BlockMen + +local mummy_def = { + type = "monster", + passive = false, + attack_type = "dogfight", + pathfinding = true, + reach = 2, + damage = 4, + hp_min = 40, + hp_max = 40, + armor = 100, + collisionbox = {-0.4, -1, -0.4, 0.4, 0.8, 0.4}, + visual = "mesh", + mesh = "spawners_mob_mummy.b3d", + textures = { + {"spawners_mob_mummy.png"}, + }, + makes_footstep_sound = true, + sounds = { + random = "spawners_mob_mummy", + }, + walk_velocity = .75, + run_velocity = 1.5, + view_range = 8, + jump = true, + floats = 0, + drops = {}, + water_damage = 4, + lava_damage = 8, + light_damage = 0, + fear_height = 4, + animation = { + speed_normal = 15, + speed_run = 15, + stand_start = 0, + stand_end = 39, + walk_start = 41, + walk_end = 72, + run_start = 74, + run_end = 105, + punch_start = 74, + punch_end = 105, + }, + on_die = function(self, pos) + minetest.sound_play("spawners_mob_mummy_death", { + object = self.object, + pos = pos, + max_hear_distance = 10 + }) + end, +} + +-- drop mod specific blocks if the mod is found +if minetest.get_modpath("pyramids") then + mummy_def["drops"] = { + {name = "default:sandstone", chance = 1, min = 1, max = 3}, + {name = "default:sandstonebrick", chance = 2, min = 1, max = 2}, + {name = "pyramids:deco_stone1", chance = 15, min = 1, max = 1}, + {name = "pyramids:deco_stone2", chance = 15, min = 1, max = 1}, + {name = "pyramids:deco_stone3", chance = 15, min = 1, max = 1}, + } +else -- default drops + mummy_def["drops"] = { + {name = "default:sandstone", chance = 1, min = 1, max = 3}, + {name = "default:sandstonebrick", chance = 2, min = 1, max = 3}, + } +end + +mobs:register_mob("spawners:mummy", mummy_def) + +mobs:register_spawn("spawners:mummy", {"default:desert_sand", "default:desert_stone"}, 20, 0, 7000, 2, 0) + +mobs:register_egg("spawners:mummy", "Mummy Monster", "default_sandstone_brick", 1) diff --git a/models/spawners_mob_mummy.b3d b/models/spawners_mob_mummy.b3d new file mode 100644 index 0000000..9782504 Binary files /dev/null and b/models/spawners_mob_mummy.b3d differ diff --git a/sounds/spawners_mob_mummy.1.ogg b/sounds/spawners_mob_mummy.1.ogg new file mode 100644 index 0000000..cc9ae67 Binary files /dev/null and b/sounds/spawners_mob_mummy.1.ogg differ diff --git a/sounds/spawners_mob_mummy.2.ogg b/sounds/spawners_mob_mummy.2.ogg new file mode 100644 index 0000000..2fcb5fa Binary files /dev/null and b/sounds/spawners_mob_mummy.2.ogg differ diff --git a/sounds/spawners_mob_mummy_death.1.ogg b/sounds/spawners_mob_mummy_death.1.ogg new file mode 100644 index 0000000..03902e1 Binary files /dev/null and b/sounds/spawners_mob_mummy_death.1.ogg differ diff --git a/sounds/spawners_mob_mummy_hit.1.ogg b/sounds/spawners_mob_mummy_hit.1.ogg new file mode 100644 index 0000000..6548fa7 Binary files /dev/null and b/sounds/spawners_mob_mummy_hit.1.ogg differ diff --git a/textures/spawners_mob_mummy.png b/textures/spawners_mob_mummy.png new file mode 100644 index 0000000..351383a Binary files /dev/null and b/textures/spawners_mob_mummy.png differ