initial upload

This commit is contained in:
tenplus1 2024-09-05 07:50:13 +01:00
parent 4b15f077cc
commit ca9cc80568
24 changed files with 511 additions and 2 deletions

13
LICENSE
View File

@ -1,9 +1,20 @@
MIT License
Copyright (c) 2024 tenplus1
Copyright (c) 2024 Tomas J. Luis
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Code by Tomas J. Luis, edited by TenPlus1 (MIT license)
Textures by Thomas J. Luis (CC0 license)
- Original sound for slime damage by RandomationPictures under licence CC0 1.0.
http://www.freesound.org/people/RandomationPictures/sounds/138481/
- Original sounds for slime jump, land and death by Dr. Minky under licence CC BY 3.0.
http://www.freesound.org/people/DrMinky/sounds/

View File

@ -1,3 +1,76 @@
# mobs_slimes
Add green and lava slimes to your world
"Slimes Redo" - Mod for Minetest (http://www.minetest.net/)
Introduction
===========================================================================
This mod adds two type of mobs in the world of Minetest: green slimes and lava slimes. They are hostile and will attack the players as soon as they see them. If they are defeated, the slimes maybe will reward the player with useful resources.
Green slimes live in the tall grass of the jungles and in the ancient ruins of lost temples. And lava slimes live deep underground near the lava pools.
Hope you like it!
Special thanks:
@TenPlus1, for all your help and amazing work to integrate Slimes with Mobs Redo.
@Jeija, for the original slimes mod (viewtopic.php?f=11&t=2979).
Details
===========================================================================
- This mod adds two new hostile mobs: green slimes and lava slimes.
- They attack players and hurt them on touch.
- The biger ones split in a random amout of smaller versions when defeated: big > medium > small.
- They use custom textures and sounds. (more work needs to be done here ;P)
- Thanks to the use of Mobs Redo API, the slimes have all the benefits of the other mobs included in the original:
> IA to search and attack players
> Enviromental damage
> Easy configuration
... and more.
Green slimes:
> spawn in jungle grass or in temples mossy cobble (default:mossycobble).
> on die, they drop a randomish amount of glue (from mesecon mod)
> Lava hurts them.
Lava slimes:
> spawn in lava pools deep under ground.
> on die, they drop a randomish amount of gunpowder (from default tnt mod).
> water hurts them.
> when they jump they can leave behind a footprint of fire. ^^
Install
===========================================================================
Unzip the archive an place it in minetest-base-directory/mods/slimes/
If you have a windows client or a linux run-in-place client.
If you have a linux system-wide instalation place it in ~/.minetest/mods/slimes/.
If you want to install this mod only in one world create the folder worldmods/ in your world directory.
For further information or help see: http://wiki.minetest.com/wiki/Installing_Mods
How to use the mod:
===========================================================================
1. Install Mobs Redo >= 1.10
2. Install Slimes Redo.
3. Enjoy
Mod Information
===========================================================================
Version: 0.2.1
Required Minetest Version: >=0.4.12
Dependencies: default, tnt, mobs redo >=1.10 (https://forum.minetest.net/viewtopic.php?f=9&t=9917)
Soft Dependencies: (none)
Highly Recommended: mesecon_materials (https://forum.minetest.net/viewtopic.php?f=11&t=628)
Craft Recipies: (none)
Git Repo: https://github.com/TomasJLuis/mt-slimes-redone
Minetest.net Forum: https://forum.minetest.net/viewtopic.php?f=9&t=11743
Modders/Developers
===========================================================================
If you are a modder, you should know that I've never used LUA before. this is my first mod for Mintetest, and I've used this mod to learn how to mod on Minetest. So may be you will find a code full of mistakes and bad practices... ;P
If you spot someting that can/must be improved/changed/removed and want to help me to improve this mode and my knowledge, please report to me on GitHub or on Minetest forum.
Thank you!
Version history
===========================================================================
0.3 - Code updated to run on 5.x clients, WTFPL license updated to MIT
0.2.1 - Updated to Mob Redo API 1.10
0.2 - Now using Mob Redo API (Thank you TenPlus1). Changed mod name to Slimes Redo to reflect better this.
0.1 - Initial release

199
greenslimes.lua Normal file
View File

@ -0,0 +1,199 @@
-- Green Slimes by TomasJLuis & TenPlus1
-- sounds
local green_sounds = {
damage = "slimes_damage",
death = "slimes_death",
jump = "slimes_jump",
attack = "slimes_attack",
}
-- green slime textures
local green_textures = {
"green_slime_sides.png", "green_slime_sides.png", "green_slime_sides.png",
"green_slime_sides.png", "green_slime_front.png", "green_slime_sides.png"
}
-- small green slime
mobs:register_mob("mobs_slimes:greensmall", {
type = "monster",
hp_min = 1, hp_max = 2,
collisionbox = {-0.25, -0.25, -0.25, 0.25, 0.25, 0.25},
visual = "cube",
visual_size = {x = 0.5, y = 0.5},
textures = {green_textures},
blood_texture = "green_slime_blood.png",
makes_footstep_sound = false,
sounds = green_sounds,
attack_type = "dogfight",
attacks_monsters = true,
damage = 1,
passive = false,
walk_velocity = 2,
run_velocity = 2,
walk_chance = 0,
jump_chance = 30,
jump_height = 6,
armor = 100,
view_range = 15,
drops = {
{name = "mesecons_materials:glue", chance = 4, min = 1, max = 2},
},
drawtype = "front",
water_damage = 0,
lava_damage = 10,
light_damage = 0,
})
-- medium green slime
mobs:register_mob("mobs_slimes:greenmedium", {
type = "monster",
hp_min = 3, hp_max = 4,
collisionbox = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
visual = "cube",
visual_size = {x = 1, y = 1},
textures = {green_textures},
blood_texture = "green_slime_blood.png",
makes_footstep_sound = false,
sounds = green_sounds,
attack_type = "dogfight",
attacks_monsters = true,
damage = 1,
passive = false,
walk_velocity = 2,
run_velocity = 2,
walk_chance = 0,
jump_chance = 30,
jump_height = 6,
armor = 100,
view_range = 15,
drawtype = "front",
water_damage = 0,
lava_damage = 10,
light_damage = 0,
on_die = function(self, pos)
local num = math.random(2, 4)
for i = 1, num do
minetest.add_entity({
x = pos.x + math.random(-2, 2),
y = pos.y + 1,
z = pos.z + (math.random(-2, 2))
}, "mobs_slimes:greensmall")
end
end,
})
-- big green slime
mobs:register_mob("mobs_slimes:greenbig", {
type = "monster",
hp_min = 5, hp_max = 6,
collisionbox = {-1, -1, -1, 1, 1, 1},
visual = "cube",
visual_size = {x = 2, y = 2},
textures = { green_textures },
blood_texture = "green_slime_blood.png",
makes_footstep_sound = false,
sounds = green_sounds,
attack_type = "dogfight",
attacks_monsters = true,
damage = 2,
passive = false,
walk_velocity = 2,
run_velocity = 2,
walk_chance = 0,
jump_chance = 30,
jump_height = 6,
armor = 100,
view_range = 15,
drawtype = "front",
water_damage = 0,
lava_damage = 10,
light_damage = 0,
on_die = function(self, pos)
local num = math.random(1, 2)
for i = 1, num do
minetest.add_entity({
x = pos.x + math.random(-2, 2),
y = pos.y + 1,
z = pos.z + (math.random(-2, 2))
}, "mobs_slimes:greenmedium")
end
end,
})
-- spawn eggs
mobs:register_egg("mobs_slimes:greensmall", "Small Green Slime", "green_slime_egg.png", 1)
mobs:register_egg("mobs_slimes:greenmedium", "Medium Green Slime", "green_slime_egg.png", 1)
mobs:register_egg("mobs_slimes:greenbig", "Big Green Slime", "green_slime_egg.png", 1)
-- spawn in world
mobs:spawn({
name = "mobs_slimes:greensmall",
nodes = {"default:junglegrass"},
neighbors = {"air", "default:junglegrass"},
min_light = 4,
chance = 5000,
min_height = 0,
active_object_count = 8
})
mobs:spawn({
name = "mobs_slimes:greenmedium",
nodes = {"default:junglegrass"},
neighbors = {"air", "default:junglegrass"},
min_light = 4,
chance = 10000,
min_height = 0,
active_object_count = 8
})
mobs:spawn({
name = "mobs_slimes:greenbig",
nodes = {"default:junglegrass"},
neighbors = {"air", "default:junglegrass"},
min_light = 4,
chance = 15000,
min_height = 0,
active_object_count = 8
})
mobs:spawn({
name = "mobs_slimes:greensmall",
nodes = {"default:mossycobble"},
min_light = 4,
chance = 10000,
min_height = 0,
active_object_count = 8
})
mobs:spawn({
name = "mobs_slimes:greenmedium",
nodes = {"default:mossycobble"},
min_light = 4,
chance = 10000,
min_height = 0,
active_object_count = 8
})
-- compatibility
mobs:alias_mob("slimes:greensmall", "mobs_slimes:greensmall")
mobs:alias_mob("slimes:greenmedium", "mobs_slimes:greenmedium")
mobs:alias_mob("slimes:greenbig", "mobs_slimes:greenbig")

23
init.lua Normal file
View File

@ -0,0 +1,23 @@
-- Slimes by TomasJLuis
-- Migration to Mobs Redo API by TenPlus1
-- get path
local path = minetest.get_modpath("mobs_slimes")
-- load mod files
dofile(path .. "/greenslimes.lua")
dofile(path .. "/lavaslimes.lua")
-- cannot find mesecons?, craft glue instead
if not minetest.get_modpath("mesecons_materials") then
minetest.register_craftitem(":mesecons_materials:glue", {
image = "jeija_glue.png",
description="Glue",
})
end
print("[MOD] Mobs Redo Slimes loaded")

196
lavaslimes.lua Normal file
View File

@ -0,0 +1,196 @@
-- Lava Slimes by TomasJLuis & TenPlus1
-- sounds
local lava_sounds = {
damage = "slimes_damage",
death = "slimes_death",
jump = "slimes_jump",
attack = "slimes_attack",
}
-- lava slime textures
local lava_textures = {
"lava_slime_sides.png", "lava_slime_sides.png", "lava_slime_sides.png",
"lava_slime_sides.png", "lava_slime_front.png", "lava_slime_sides.png"
}
-- small lava slime
mobs:register_mob("mobs_slimes:lavasmall", {
type = "monster",
hp_min = 1, hp_max = 2,
collisionbox = {-0.25, -0.25, -0.25, 0.25, 0.25, 0.25},
visual = "cube",
visual_size = {x = 0.5, y = 0.5},
textures = { lava_textures },
blood_texture = "lava_slime_blood.png",
makes_footstep_sound = false,
sounds = lava_sounds,
attack_type = "dogfight",
attacks_monsters = true,
damage = 1,
passive = false,
walk_velocity = 2,
run_velocity = 2,
walk_chance = 0,
jump_chance = 30,
jump_height = 6,
armor = 90,
view_range = 15,
drops = {
{name = "tnt:gunpowder", chance = 4, min = 1, max = 2},
},
drawtype = "front",
water_damage = 10,
lava_damage = 0,
light_damage = 0,
replace_rate = 20,
replace_what = {"air"},
replace_with = "fire:basic_flame",
fly_in = {"default:lava_source", "default:lava_flowing"},
glow = 10
})
-- medium lava slime
mobs:register_mob("mobs_slimes:lavamedium", {
type = "monster",
hp_min = 3, hp_max = 4,
collisionbox = {-0.5, -0.5, -0.5, 0.5, 0.5, 0.5},
visual = "cube",
visual_size = {x = 1, y = 1},
textures = { lava_textures },
blood_texture = "lava_slime_blood.png",
makes_footstep_sound = false,
sounds = lava_sounds,
attack_type = "dogfight",
attacks_monsters = true,
damage = 2,
passive = false,
walk_velocity = 2,
run_velocity = 2,
walk_chance = 0,
jump_chance = 30,
jump_height = 6,
armor = 90,
view_range = 15,
drawtype = "front",
water_damage = 10,
lava_damage = 0,
light_damage = 0,
replace_rate = 20,
replace_what = {"air"},
replace_with = "fire:basic_flame",
fly_in = {"default:lava_source", "default:lava_flowing"},
glow = 10,
on_die = function(self, pos)
local num = math.random(2, 4)
for i = 1, num do
minetest.add_entity({
x = pos.x + math.random(-2, 2),
y = pos.y + 1,
z = pos.z + (math.random(-2, 2))
}, "mobs_slimes:lavasmall")
end
end
})
-- big lava slime
mobs:register_mob("mobs_slimes:lavabig", {
type = "monster",
hp_min = 5, hp_max = 6,
collisionbox = {-1, -1, -1, 1, 1, 1},
visual = "cube",
visual_size = {x = 2, y = 2},
textures = { lava_textures },
blood_texture = "lava_slime_blood.png",
makes_footstep_sound = false,
sounds = lava_sounds,
attack_type = "dogfight",
attacks_monsters = true,
damage = 3,
passive = false,
walk_velocity = 2,
run_velocity = 2,
walk_chance = 0,
jump_chance = 30,
jump_height = 6,
armor = 90,
view_range = 15,
drawtype = "front",
water_damage = 10,
lava_damage = 0,
light_damage = 0,
replace_rate = 20,
replace_what = {"air"},
replace_with = "fire:basic_flame",
replace_offset = -1,
fly_in = {"default:lava_source", "default:lava_flowing"},
glow = 10,
on_die = function(self, pos)
local num = math.random(1, 2)
for i = 1, num do
minetest.add_entity({
x = pos.x + math.random(-2, 2),
y = pos.y + 1,
z = pos.z + (math.random(-2, 2))
}, "slimes:lavamedium")
end
end,
})
-- spawn eggs
mobs:register_egg("mobs_slimes:lavasmall", "Small Lava Slime", "lava_slime_egg.png", 1)
mobs:register_egg("mobs_slimes:lavamedium", "Medium Lava Slime", "lava_slime_egg.png", 1)
mobs:register_egg("mobs_slimes:lavabig", "Big Lava Slime", "lava_slime_egg.png", 1)
-- spawn in world
mobs:spawn({
name = "mobs_slimes:lavasmall",
nodes = {"default:lava_source"},
neighbors = {"default:lava_flowing"},
min_light = 4,
chance = 5000,
max_height = -64,
active_object_count = 8
})
mobs:spawn({
name = "mobs_slimes:lavamedium",
nodes = {"default:lava_source"},
neighbors = {"default:lava_flowing"},
min_light = 4,
chance = 10000,
max_height = -64,
active_object_count = 8
})
mobs:spawn({
name = "mobs_slimes:lavabig",
nodes = {"default:lava_source"},
neighbors = {"default:lava_flowing"},
min_light = 4,
chance = 15000,
max_height = -64,
active_object_count = 8
})
-- compatibility
mobs:alias_mob("slimes:lavasmall", "mobs_slimes:lavasmall")
mobs:alias_mob("slimes:lavamedium", "mobs_slimes:lavamedium")
mobs:alias_mob("slimes:lavabig", "mobs_slimes:lavabig")

7
mod.conf Normal file
View File

@ -0,0 +1,7 @@
title = Mobs Slimes
name = mobs_slimes
description = Add green and lava slimes to your world.
depends = mobs
optional_depends = default, lucky_block, simple_dialogs, screwdriver, mcl_core
author = ThomasJLuis
min_minetest_version = 5.0

BIN
screenshot.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 137 KiB

BIN
sounds/slimes_attack.ogg Normal file

Binary file not shown.

BIN
sounds/slimes_damage.ogg Normal file

Binary file not shown.

BIN
sounds/slimes_death.ogg Normal file

Binary file not shown.

BIN
sounds/slimes_jump.ogg Normal file

Binary file not shown.

Binary file not shown.

After

Width:  |  Height:  |  Size: 203 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.3 KiB

BIN
textures/jeija_glue.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 487 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 217 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.2 KiB

BIN
textures/lava_slime_egg.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 874 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 8.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB

BIN
textures/lava_slime_top.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 7.5 KiB