Compare commits
30 Commits
d4d8cc526a
...
master
Author | SHA1 | Date | |
---|---|---|---|
ec80a22c1e | |||
521a630efe | |||
32da63e517 | |||
fe00a32992 | |||
15aab8037a | |||
a195057c8a | |||
185b4d22d4 | |||
edc86fec21 | |||
a02ca31b92 | |||
5d8bcde2ae | |||
70edecd5bb | |||
6ea38b5a16 | |||
d86f9253a7 | |||
004d7ed31d | |||
ddc541f8ed | |||
fc1c015d73 | |||
6de7ee6b11 | |||
1a576f2bb1 | |||
5c956edfe3 | |||
ad470a4ad2 | |||
68ae991ca6 | |||
4ab678d7ec | |||
50039fe67d | |||
11f8cbbe54 | |||
59ad0f8da8 | |||
1e224174ae | |||
83a9a1dc27 | |||
8c410bd87e | |||
130f46c81f | |||
a1030bf7d5 |
@ -1,17 +1,19 @@
|
||||
-- Translation support
|
||||
local S = minetest.get_translator("mobs_monster")
|
||||
|
||||
local S = core.get_translator("mobs_monster")
|
||||
|
||||
-- custom dirt monster type
|
||||
|
||||
local dirt_types = {
|
||||
|
||||
{ nodes = {"ethereal:dry_dirt"},
|
||||
skins = {"mobs_dirt_monster3.png"},
|
||||
drops = {
|
||||
{name = "ethereal:dry_dirt", chance = 1, min = 0, max = 2}
|
||||
{name = "ethereal:dry_dirt", chance = 1, min = 0, max = 2},
|
||||
{name = "ethereal:charcoal_lump", chance = 2, min = 0, max = 1}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
-- Dirt Monster by PilzAdam
|
||||
|
||||
mobs:register_mob("mobs_monster:dirt_monster", {
|
||||
@ -33,31 +35,25 @@ mobs:register_mob("mobs_monster:dirt_monster", {
|
||||
},
|
||||
blood_texture = "default_dirt.png",
|
||||
makes_footstep_sound = true,
|
||||
sounds = {
|
||||
random = "mobs_dirtmonster"
|
||||
},
|
||||
sounds = {random = "mobs_dirtmonster"},
|
||||
view_range = 15,
|
||||
walk_velocity = 1,
|
||||
run_velocity = 3,
|
||||
jump = true,
|
||||
drops = {
|
||||
{name = "default:dirt", chance = 1, min = 0, max = 2}
|
||||
{name = "default:dirt", chance = 1, min = 0, max = 2},
|
||||
{name = "default:clay_lump", chance = 2, min = 0, max = 1}
|
||||
},
|
||||
water_damage = 1,
|
||||
lava_damage = 5,
|
||||
light_damage = 3,
|
||||
fear_height = 4,
|
||||
animation = {
|
||||
speed_normal = 15,
|
||||
speed_run = 15,
|
||||
stand_start = 0,
|
||||
stand_end = 14,
|
||||
walk_start = 15,
|
||||
walk_end = 38,
|
||||
run_start = 40,
|
||||
run_end = 63,
|
||||
punch_start = 40,
|
||||
punch_end = 63
|
||||
speed_normal = 15, speed_run = 15,
|
||||
stand_start = 0, stand_end = 14,
|
||||
walk_start = 15, walk_end = 38,
|
||||
run_start = 40, run_end = 63,
|
||||
punch_start = 40, punch_end = 63
|
||||
},
|
||||
|
||||
-- check surrounding nodes and spawn a specific monster
|
||||
@ -70,14 +66,12 @@ mobs:register_mob("mobs_monster:dirt_monster", {
|
||||
|
||||
tmp = dirt_types[n]
|
||||
|
||||
if minetest.find_node_near(pos, 1, tmp.nodes) then
|
||||
if core.find_node_near(pos, 1, tmp.nodes) then
|
||||
|
||||
self.base_texture = tmp.skins
|
||||
self.object:set_properties({textures = tmp.skins})
|
||||
|
||||
if tmp.drops then
|
||||
self.drops = tmp.drops
|
||||
end
|
||||
if tmp.drops then self.drops = tmp.drops end
|
||||
|
||||
return true
|
||||
end
|
||||
@ -87,6 +81,7 @@ mobs:register_mob("mobs_monster:dirt_monster", {
|
||||
end
|
||||
})
|
||||
|
||||
-- where to spawn
|
||||
|
||||
if not mobs.custom_spawn_monster then
|
||||
|
||||
@ -102,8 +97,10 @@ if not mobs.custom_spawn_monster then
|
||||
})
|
||||
end
|
||||
|
||||
-- spawn egg
|
||||
|
||||
mobs:register_egg("mobs_monster:dirt_monster", S("Dirt Monster"), "default_dirt.png", 1)
|
||||
|
||||
-- compatibility with older mobs mod
|
||||
|
||||
mobs:alias_mob("mobs:dirt_monster", "mobs_monster:dirt_monster") -- compatibility
|
||||
mobs:alias_mob("mobs:dirt_monster", "mobs_monster:dirt_monster")
|
||||
|
@ -1,5 +1,7 @@
|
||||
-- Translation support
|
||||
local S = minetest.get_translator("mobs_monster")
|
||||
|
||||
local S = core.get_translator("mobs_monster")
|
||||
|
||||
-- custom dungeon master types
|
||||
|
||||
local master_types = {
|
||||
|
||||
@ -11,7 +13,6 @@ local master_types = {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
-- Dungeon Master by PilzAdam
|
||||
|
||||
mobs:register_mob("mobs_monster:dungeon_master", {
|
||||
@ -59,16 +60,11 @@ mobs:register_mob("mobs_monster:dungeon_master", {
|
||||
light_damage = 0,
|
||||
fear_height = 3,
|
||||
animation = {
|
||||
stand_start = 0,
|
||||
stand_end = 19,
|
||||
walk_start = 20,
|
||||
walk_end = 35,
|
||||
punch_start = 36,
|
||||
punch_end = 48,
|
||||
shoot_start = 36,
|
||||
shoot_end = 48,
|
||||
speed_normal = 15,
|
||||
speed_run = 15
|
||||
stand_start = 0, stand_end = 19,
|
||||
walk_start = 20, walk_end = 35,
|
||||
punch_start = 36, punch_end = 48,
|
||||
shoot_start = 36, shoot_end = 48,
|
||||
speed_normal = 15, speed_run = 15
|
||||
},
|
||||
|
||||
-- check surrounding nodes and spawn a specific monster
|
||||
@ -81,14 +77,12 @@ mobs:register_mob("mobs_monster:dungeon_master", {
|
||||
|
||||
tmp = master_types[n]
|
||||
|
||||
if minetest.find_node_near(pos, 1, tmp.nodes) then
|
||||
if core.find_node_near(pos, 1, tmp.nodes) then
|
||||
|
||||
self.base_texture = tmp.skins
|
||||
self.object:set_properties({textures = tmp.skins})
|
||||
|
||||
if tmp.drops then
|
||||
self.drops = tmp.drops
|
||||
end
|
||||
if tmp.drops then self.drops = tmp.drops end
|
||||
|
||||
return true
|
||||
end
|
||||
@ -98,6 +92,7 @@ mobs:register_mob("mobs_monster:dungeon_master", {
|
||||
end
|
||||
})
|
||||
|
||||
-- where to spawn
|
||||
|
||||
if not mobs.custom_spawn_monster then
|
||||
|
||||
@ -111,14 +106,17 @@ if not mobs.custom_spawn_monster then
|
||||
})
|
||||
end
|
||||
|
||||
-- spawn egg
|
||||
|
||||
mobs:register_egg("mobs_monster:dungeon_master", S("Dungeon Master"), "fire_basic_flame.png", 1, true)
|
||||
mobs:register_egg("mobs_monster:dungeon_master", S("Dungeon Master"),
|
||||
"fire_basic_flame.png", 1, true)
|
||||
|
||||
-- old mobs mod compatibility
|
||||
|
||||
mobs:alias_mob("mobs:dungeon_master", "mobs_monster:dungeon_master") -- compatibility
|
||||
mobs:alias_mob("mobs:dungeon_master", "mobs_monster:dungeon_master")
|
||||
|
||||
-- fireball arrow
|
||||
|
||||
-- fireball (weapon)
|
||||
mobs:register_arrow("mobs_monster:fireball", {
|
||||
visual = "sprite",
|
||||
visual_size = {x = 1, y = 1},
|
||||
@ -159,6 +157,7 @@ mobs:register_arrow("mobs_monster:fireball", {
|
||||
|
||||
-- direct hit, no fire... just plenty of pain
|
||||
hit_player = function(self, player)
|
||||
|
||||
player:punch(self.object, 1.0, {
|
||||
full_punch_interval = 1.0,
|
||||
damage_groups = {fleshy = 8}
|
||||
@ -166,6 +165,7 @@ mobs:register_arrow("mobs_monster:fireball", {
|
||||
end,
|
||||
|
||||
hit_mob = function(self, player)
|
||||
|
||||
player:punch(self.object, 1.0, {
|
||||
full_punch_interval = 1.0,
|
||||
damage_groups = {fleshy = 8}
|
||||
@ -178,4 +178,4 @@ mobs:register_arrow("mobs_monster:fireball", {
|
||||
end
|
||||
})
|
||||
|
||||
--minetest.override_item("default:obsidian", {on_blast = function() end})
|
||||
--core.override_item("default:obsidian", {on_blast = function() end})
|
||||
|
@ -1,11 +1,13 @@
|
||||
-- Translation support
|
||||
local S = minetest.get_translator("mobs_monster")
|
||||
|
||||
-- translation and drops
|
||||
|
||||
local S = core.get_translator("mobs_monster")
|
||||
|
||||
local mob_drops = {
|
||||
{name = "fireflies:firefly", chance = 1, min = 1, max = 1}
|
||||
}
|
||||
|
||||
if minetest.get_modpath("ethereal") then
|
||||
if core.get_modpath("ethereal") then
|
||||
|
||||
table.insert(mob_drops,
|
||||
{name = "ethereal:fire_dust", chance = 1, min = 1, max = 1})
|
||||
@ -26,14 +28,12 @@ mobs:register_mob("mobs_monster:fire_spirit", {
|
||||
collisionbox = {-0.1, -0.1, -0.1, 0.1, 0.1, 0.1},
|
||||
visual_scale = {x = 0.5, y = 0.5, z = 0.5},
|
||||
visual = "sprite",
|
||||
textures = {
|
||||
{"mobs_fire_spirit.png"}
|
||||
},
|
||||
textures = {{"mobs_fire_spirit.png"}},
|
||||
glow = 14,
|
||||
blood_texture = "fire_basic_flame.png",
|
||||
immune_to = {
|
||||
{"bucket:bucket_water", 1},
|
||||
{"bucket:bucket_river_water", 1},
|
||||
{"bucket:bucket_water", 2},
|
||||
{"bucket:bucket_river_water", 2},
|
||||
{"all"}
|
||||
},
|
||||
makes_footstep_sound = false,
|
||||
@ -48,7 +48,7 @@ mobs:register_mob("mobs_monster:fire_spirit", {
|
||||
jump = true,
|
||||
jump_height = 6,
|
||||
drops = mob_drops,
|
||||
water_damage = 1,
|
||||
water_damage = 4,
|
||||
lava_damage = 0,
|
||||
fire_damage = 0,
|
||||
light_damage = 0,
|
||||
@ -67,9 +67,7 @@ mobs:register_mob("mobs_monster:fire_spirit", {
|
||||
|
||||
self.flame_timer = (self.flame_timer or 0) + dtime
|
||||
|
||||
if self.flame_timer < 0.25 then
|
||||
return
|
||||
end
|
||||
if self.flame_timer < 0.1 then return end
|
||||
|
||||
self.flame_timer = 0
|
||||
|
||||
@ -80,6 +78,7 @@ mobs:register_mob("mobs_monster:fire_spirit", {
|
||||
end
|
||||
})
|
||||
|
||||
-- where to spawn
|
||||
|
||||
if not mobs.custom_spawn_monster then
|
||||
|
||||
@ -95,5 +94,6 @@ if not mobs.custom_spawn_monster then
|
||||
})
|
||||
end
|
||||
|
||||
-- spawn egg
|
||||
|
||||
mobs:register_egg("mobs_monster:fire_spirit", S("Fire Spirit"), "fire_basic_flame.png", 1)
|
||||
|
22
init.lua
@ -1,11 +1,11 @@
|
||||
|
||||
-- Load support for intllib.
|
||||
local path = minetest.get_modpath(minetest.get_current_modname()) .. "/"
|
||||
-- translation and mod path
|
||||
|
||||
-- Translation support
|
||||
local S = minetest.get_translator("mobs_monster")
|
||||
local S = core.get_translator("mobs_monster")
|
||||
local path = core.get_modpath(core.get_current_modname()) .. "/"
|
||||
|
||||
-- Check for custom mob spawn file
|
||||
|
||||
local input = io.open(path .. "spawn.lua", "r")
|
||||
|
||||
if input then
|
||||
@ -14,11 +14,11 @@ if input then
|
||||
input = nil
|
||||
end
|
||||
|
||||
|
||||
-- helper function
|
||||
|
||||
local function ddoo(mob)
|
||||
|
||||
if minetest.settings:get_bool("mobs_monster." .. mob) == false then
|
||||
if core.settings:get_bool("mobs_monster." .. mob) == false then
|
||||
print("[Mobs_Monster] " .. mob .. " disabled!")
|
||||
return
|
||||
end
|
||||
@ -27,6 +27,7 @@ local function ddoo(mob)
|
||||
end
|
||||
|
||||
-- Monsters
|
||||
|
||||
ddoo("dirt_monster") -- PilzAdam
|
||||
ddoo("dungeon_master")
|
||||
ddoo("oerkki")
|
||||
@ -39,17 +40,16 @@ ddoo("spider") -- AspireMint
|
||||
ddoo("land_guard")
|
||||
ddoo("fire_spirit")
|
||||
|
||||
-- Load custom spawning if found
|
||||
|
||||
-- Load custom spawning
|
||||
if mobs.custom_spawn_monster then
|
||||
dofile(path .. "spawn.lua")
|
||||
end
|
||||
|
||||
|
||||
-- Lucky Blocks
|
||||
if minetest.get_modpath("lucky_block") then
|
||||
|
||||
if core.get_modpath("lucky_block") then
|
||||
dofile(path .. "lucky_block.lua")
|
||||
end
|
||||
|
||||
|
||||
print ("[MOD] Mobs Monster loaded")
|
||||
print ("[MOD] Mobs Redo Monsters loaded")
|
||||
|
@ -1,5 +1,7 @@
|
||||
-- Translation support
|
||||
local S = minetest.get_translator("mobs_monster")
|
||||
|
||||
-- translation and custom land guard types
|
||||
|
||||
local S = core.get_translator("mobs_monster")
|
||||
|
||||
local guard_types = {
|
||||
|
||||
@ -36,7 +38,7 @@ mobs:register_mob("mobs_monster:land_guard", {
|
||||
attack_type = "dogfight",
|
||||
group_attack = true,
|
||||
reach = 3,
|
||||
damage = 15,
|
||||
damage = 12,
|
||||
hp_min = 30,
|
||||
hp_max = 65,
|
||||
armor = 50,
|
||||
@ -50,9 +52,7 @@ mobs:register_mob("mobs_monster:land_guard", {
|
||||
{"mobs_land_guard3.png"}
|
||||
},
|
||||
makes_footstep_sound = true,
|
||||
sounds = {
|
||||
random = "mobs_dungeonmaster",
|
||||
},
|
||||
sounds = {random = "mobs_dungeonmaster"},
|
||||
walk_velocity = 1.5,
|
||||
run_velocity = 3.4,
|
||||
jump = true,
|
||||
@ -69,14 +69,10 @@ mobs:register_mob("mobs_monster:land_guard", {
|
||||
light_damage = 0,
|
||||
fear_height = 8,
|
||||
animation = {
|
||||
stand_start = 0,
|
||||
stand_end = 19,
|
||||
walk_start = 20,
|
||||
walk_end = 35,
|
||||
punch_start = 36,
|
||||
punch_end = 48,
|
||||
speed_normal = 15,
|
||||
speed_run = 20,
|
||||
stand_start = 0, stand_end = 19,
|
||||
walk_start = 20, walk_end = 35,
|
||||
punch_start = 36, punch_end = 48,
|
||||
speed_normal = 15, speed_run = 20,
|
||||
},
|
||||
|
||||
-- check surrounding nodes and spawn a specific guard
|
||||
@ -89,15 +85,13 @@ mobs:register_mob("mobs_monster:land_guard", {
|
||||
|
||||
tmp = guard_types[n]
|
||||
|
||||
if minetest.find_node_near(pos, 1, tmp.nodes) then
|
||||
if core.find_node_near(pos, 1, tmp.nodes) then
|
||||
|
||||
self.base_texture = { tmp.skins[math.random(#tmp.skins)] }
|
||||
self.object:set_properties({textures = self.base_texture})
|
||||
self.docile_by_day = tmp.docile
|
||||
|
||||
if tmp.drops then
|
||||
self.drops = tmp.drops
|
||||
end
|
||||
if tmp.drops then self.drops = tmp.drops end
|
||||
|
||||
return true
|
||||
end
|
||||
@ -107,20 +101,23 @@ mobs:register_mob("mobs_monster:land_guard", {
|
||||
end,
|
||||
})
|
||||
|
||||
-- where to spawn
|
||||
|
||||
if not mobs.custom_spawn_monster then
|
||||
mobs:spawn({
|
||||
name = "mobs_monster:land_guard",
|
||||
nodes = {
|
||||
"default:snow", "default:ice", "default:stone",
|
||||
"default:dry_dirt_with_dry_grass", "ethereal:dry_dirt"
|
||||
},
|
||||
max_light = 7,
|
||||
chance = 25000,
|
||||
min_height = 0,
|
||||
active_object_count = 1,
|
||||
})
|
||||
|
||||
mobs:spawn({
|
||||
name = "mobs_monster:land_guard",
|
||||
nodes = {
|
||||
"default:snow", "default:ice", "default:stone",
|
||||
"default:dry_dirt_with_dry_grass", "ethereal:dry_dirt"
|
||||
},
|
||||
max_light = 7,
|
||||
chance = 25000,
|
||||
min_height = 0,
|
||||
active_object_count = 1,
|
||||
})
|
||||
end
|
||||
|
||||
-- spawn egg
|
||||
|
||||
mobs:register_egg("mobs_monster:land_guard", S("Land Guard"), "default_ice.png", 1)
|
||||
|
200
lava_flan.lua
@ -1,5 +1,5 @@
|
||||
-- Translation support
|
||||
local S = minetest.get_translator("mobs_monster")
|
||||
|
||||
local S = core.get_translator("mobs_monster")
|
||||
|
||||
-- Lava Flan by Zeg9 (additional textures by JurajVajda)
|
||||
|
||||
@ -7,14 +7,14 @@ mobs:register_mob("mobs_monster:lava_flan", {
|
||||
type = "monster",
|
||||
passive = false,
|
||||
attack_type = "dogfight",
|
||||
reach = 2,
|
||||
reach = 2.5,
|
||||
damage = 3,
|
||||
hp_min = 10,
|
||||
hp_min = 20,
|
||||
hp_max = 35,
|
||||
armor = 80,
|
||||
collisionbox = {-0.5, -0.5, -0.5, 0.5, 1.5, 0.5},
|
||||
visual = "mesh",
|
||||
mesh = "zmobs_lava_flan.x",
|
||||
mesh = "zmobs_lava_flan.b3d",
|
||||
textures = {
|
||||
{"zmobs_lava_flan.png"},
|
||||
{"zmobs_lava_flan2.png"},
|
||||
@ -39,9 +39,12 @@ mobs:register_mob("mobs_monster:lava_flan", {
|
||||
fire_damage = 0,
|
||||
light_damage = 0,
|
||||
immune_to = {
|
||||
{"mobs:pick_lava", -2} -- lava pick heals 2 health
|
||||
{"mobs:pick_lava", -2}, -- lava pick heals 2 health
|
||||
{"default:lava_source", 0}, -- so that damage per second doesnt affect mob
|
||||
{"default:lava_flowing", 0},
|
||||
{"nether:lava_source", 0},
|
||||
},
|
||||
fly_in = {"default:lava_source", "default:lava_flowing"},
|
||||
fly_in = {"default:lava_source", "default:lava_flowing", "nether:lava_source"},
|
||||
animation = {
|
||||
speed_normal = 15,
|
||||
speed_run = 15,
|
||||
@ -59,7 +62,7 @@ mobs:register_mob("mobs_monster:lava_flan", {
|
||||
on_die = function(self, pos)
|
||||
|
||||
local cod = self.cause_of_death or {}
|
||||
local def = cod.node and minetest.registered_nodes[cod.node]
|
||||
local def = cod.node and core.registered_nodes[cod.node]
|
||||
|
||||
if def and def.groups and def.groups.water then
|
||||
|
||||
@ -67,7 +70,7 @@ mobs:register_mob("mobs_monster:lava_flan", {
|
||||
|
||||
mobs:effect(pos, 40, "tnt_smoke.png", 3, 5, 2, 0.5, nil, false)
|
||||
|
||||
minetest.sound_play("fire_extinguish_flame",
|
||||
core.sound_play("fire_extinguish_flame",
|
||||
{pos = pos, max_hear_distance = 12, gain = 1.5}, true)
|
||||
|
||||
self.object:remove()
|
||||
@ -78,16 +81,16 @@ mobs:register_mob("mobs_monster:lava_flan", {
|
||||
else
|
||||
mobs:effect(pos, 40, "fire_basic_flame.png", 2, 3, 2, 5, 10, nil)
|
||||
|
||||
local nods = minetest.find_nodes_in_area(
|
||||
{x = pos.x, y = pos.y + 1, z = pos.z},
|
||||
{x = pos.x, y = pos.y, z = pos.z}, "air")
|
||||
local nods = core.find_nodes_in_area(
|
||||
{x = pos.x, y = pos.y + 1, z = pos.z},
|
||||
{x = pos.x, y = pos.y, z = pos.z}, "air")
|
||||
|
||||
-- place flame if position empty and flame exists
|
||||
if nods and #nods > 0
|
||||
and minetest.registered_nodes["fire:basic_flame"] then
|
||||
and core.registered_nodes["fire:basic_flame"] then
|
||||
|
||||
pos = nods[math.random(#nods)]
|
||||
minetest.set_node(pos, {name = "fire:basic_flame"})
|
||||
core.set_node(pos, {name = "fire:basic_flame"})
|
||||
end
|
||||
|
||||
self.object:remove()
|
||||
@ -96,93 +99,98 @@ mobs:register_mob("mobs_monster:lava_flan", {
|
||||
glow = 10
|
||||
})
|
||||
|
||||
-- where to spawn
|
||||
|
||||
if not mobs.custom_spawn_monster then
|
||||
mobs:spawn({
|
||||
name = "mobs_monster:lava_flan",
|
||||
nodes = {"default:lava_source"},
|
||||
chance = 1500,
|
||||
active_object_count = 1,
|
||||
max_height = 0
|
||||
})
|
||||
|
||||
mobs:spawn({
|
||||
name = "mobs_monster:lava_flan",
|
||||
nodes = {"default:lava_source"},
|
||||
chance = 1500,
|
||||
active_object_count = 1,
|
||||
max_height = 0
|
||||
})
|
||||
end
|
||||
|
||||
-- spawn egg
|
||||
|
||||
-- add spawn egg
|
||||
mobs:register_egg("mobs_monster:lava_flan", S("Lava Flan"), "default_lava.png", 1)
|
||||
|
||||
-- compatibility for old mobs mod
|
||||
|
||||
-- compatibility alias, only needed for servers who used the old mobs mod
|
||||
mobs:alias_mob("mobs:lava_flan", "mobs_monster:lava_flan")
|
||||
|
||||
|
||||
-- lava orb
|
||||
minetest.register_craftitem(":mobs:lava_orb", {
|
||||
|
||||
core.register_craftitem(":mobs:lava_orb", {
|
||||
description = S("Lava orb"),
|
||||
inventory_image = "zmobs_lava_orb.png",
|
||||
light_source = 14
|
||||
})
|
||||
|
||||
minetest.register_alias("zmobs:lava_orb", "mobs:lava_orb")
|
||||
core.register_alias("zmobs:lava_orb", "mobs:lava_orb")
|
||||
|
||||
minetest.register_craft({
|
||||
core.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "mobs:lava_orb",
|
||||
burntime = 80
|
||||
})
|
||||
|
||||
-- backup and replace old function
|
||||
|
||||
-- Lava Pick (digs and smelts at same time)
|
||||
local old_handle_node_drops = core.handle_node_drops
|
||||
|
||||
local old_handle_node_drops = minetest.handle_node_drops
|
||||
function core.handle_node_drops(pos, drops, digger)
|
||||
|
||||
function minetest.handle_node_drops(pos, drops, digger)
|
||||
-- are we a player using the lava pick?
|
||||
if digger and digger:get_wielded_item():get_name() == ("mobs:pick_lava") then
|
||||
|
||||
-- does player exist?
|
||||
if not digger then return end
|
||||
local hot_drops = {}
|
||||
local is_cooked
|
||||
|
||||
-- are we holding Lava Pick?
|
||||
if digger:get_wielded_item():get_name() ~= ("mobs:pick_lava") then
|
||||
return old_handle_node_drops(pos, drops, digger)
|
||||
end
|
||||
for _, drop in ipairs(drops) do
|
||||
|
||||
-- reset new smelted drops
|
||||
local hot_drops = {}
|
||||
local stack = ItemStack(drop)
|
||||
|
||||
-- loop through current node drops
|
||||
for _, drop in ipairs(drops) do
|
||||
while not stack:is_empty() do
|
||||
|
||||
-- get cooked output of current drops
|
||||
local stack = ItemStack(drop)
|
||||
local output, decremented_input = core.get_craft_result({
|
||||
method = "cooking", width = 1, items = {stack}})
|
||||
|
||||
while not stack:is_empty() do
|
||||
if output.item:is_empty() then
|
||||
table.insert_all(hot_drops, decremented_input.items)
|
||||
break
|
||||
else
|
||||
is_cooked = true
|
||||
|
||||
local output, decremented_input = minetest.get_craft_result({
|
||||
method = "cooking",
|
||||
width = 1,
|
||||
items = {stack}
|
||||
})
|
||||
if not output.item:is_empty() then
|
||||
table.insert(hot_drops, output.item)
|
||||
end
|
||||
|
||||
if output.item:is_empty() then
|
||||
table.insert_all(hot_drops, output.replacements)
|
||||
|
||||
table.insert_all(hot_drops, decremented_input.items)
|
||||
break
|
||||
else
|
||||
if not output.item:is_empty() then
|
||||
table.insert(hot_drops, output.item)
|
||||
stack = decremented_input.items[1] or ItemStack()
|
||||
end
|
||||
|
||||
table.insert_all(hot_drops, output.replacements)
|
||||
|
||||
stack = decremented_input.items[1] or ItemStack()
|
||||
end
|
||||
end
|
||||
|
||||
drops = hot_drops -- replace normal drops with cooked versions
|
||||
|
||||
if is_cooked then
|
||||
|
||||
mobs:effect(pos, 1, "tnt_smoke.png", 3, 5, 2, 0.5, nil, false)
|
||||
|
||||
core.sound_play("fire_extinguish_flame",
|
||||
{pos = pos, max_hear_distance = 5, gain = 0.05}, true)
|
||||
end
|
||||
end
|
||||
|
||||
return old_handle_node_drops(pos, hot_drops, digger)
|
||||
return old_handle_node_drops(pos, drops, digger)
|
||||
end
|
||||
|
||||
minetest.register_tool(":mobs:pick_lava", {
|
||||
-- lava pick, smelts nodes when you dig
|
||||
|
||||
core.register_tool(":mobs:pick_lava", {
|
||||
description = S("Lava Pickaxe"),
|
||||
inventory_image = "mobs_pick_lava.png",
|
||||
tool_capabilities = {
|
||||
@ -190,9 +198,7 @@ minetest.register_tool(":mobs:pick_lava", {
|
||||
max_drop_level = 3,
|
||||
groupcaps = {
|
||||
cracky = {
|
||||
times = {[1] = 1.80, [2] = 0.80, [3] = 0.40},
|
||||
uses = 40,
|
||||
maxlevel = 3
|
||||
times = {[1] = 1.80, [2] = 0.80, [3] = 0.40}, uses = 40, maxlevel = 3
|
||||
}
|
||||
},
|
||||
damage_groups = {fleshy = 6, fire = 1},
|
||||
@ -201,7 +207,9 @@ minetest.register_tool(":mobs:pick_lava", {
|
||||
light_source = 14
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
-- recipe
|
||||
|
||||
core.register_craft({
|
||||
output = "mobs:pick_lava",
|
||||
recipe = {
|
||||
{"mobs:lava_orb", "mobs:lava_orb", "mobs:lava_orb"},
|
||||
@ -210,16 +218,16 @@ minetest.register_craft({
|
||||
}
|
||||
})
|
||||
|
||||
-- Add [toolranks] mod support if found
|
||||
if minetest.get_modpath("toolranks") then
|
||||
-- Add [toolranks] mod support
|
||||
|
||||
minetest.override_item("mobs:pick_lava", {
|
||||
original_description = "Lava Pickaxe",
|
||||
description = toolranks.create_description("Lava Pickaxe", 0, 1),
|
||||
after_use = toolranks.new_afteruse})
|
||||
if core.get_modpath("toolranks") then
|
||||
|
||||
core.override_item("mobs:pick_lava", {
|
||||
original_description = S("Lava Pickaxe"),
|
||||
description = toolranks.create_description("Lava Pickaxe", 0, 1),
|
||||
after_use = toolranks.new_afteruse})
|
||||
end
|
||||
|
||||
|
||||
-- obsidian flan
|
||||
|
||||
mobs:register_mob("mobs_monster:obsidian_flan", {
|
||||
@ -231,21 +239,17 @@ mobs:register_mob("mobs_monster:obsidian_flan", {
|
||||
arrow = "mobs_monster:obsidian_arrow",
|
||||
reach = 2,
|
||||
damage = 3,
|
||||
hp_min = 10,
|
||||
hp_min = 20,
|
||||
hp_max = 35,
|
||||
armor = 30,
|
||||
visual_size = {x = 0.6, y = 0.6},
|
||||
collisionbox = {-0.3, -0.3, -0.3, 0.3, 0.8, 0.3},
|
||||
visual = "mesh",
|
||||
mesh = "zmobs_lava_flan.x",
|
||||
textures = {
|
||||
{"mobs_obsidian_flan.png"}
|
||||
},
|
||||
mesh = "zmobs_lava_flan.b3d",
|
||||
textures = {{"mobs_obsidian_flan.png"}},
|
||||
blood_texture = "default_obsidian.png",
|
||||
makes_footstep_sound = true,
|
||||
sounds = {
|
||||
random = "mobs_lavaflan"
|
||||
},
|
||||
sounds = {random = "mobs_lavaflan"},
|
||||
walk_velocity = 0.1,
|
||||
run_velocity = 0.5,
|
||||
jump = false,
|
||||
@ -260,28 +264,23 @@ mobs:register_mob("mobs_monster:obsidian_flan", {
|
||||
fire_damage = 0,
|
||||
light_damage = 0,
|
||||
animation = {
|
||||
speed_normal = 15,
|
||||
speed_run = 15,
|
||||
stand_start = 0,
|
||||
stand_end = 8,
|
||||
walk_start = 10,
|
||||
walk_end = 18,
|
||||
run_start = 20,
|
||||
run_end = 28,
|
||||
punch_start = 20,
|
||||
punch_end = 28
|
||||
speed_normal = 15, speed_run = 15,
|
||||
stand_start = 0, stand_end = 8,
|
||||
walk_start = 10, walk_end = 18,
|
||||
run_start = 20, run_end = 28,
|
||||
punch_start = 20, punch_end = 28
|
||||
}
|
||||
})
|
||||
|
||||
-- spawn egg
|
||||
|
||||
-- add spawn egg
|
||||
mobs:register_egg("mobs_monster:obsidian_flan", S("Obsidian Flan"),
|
||||
"default_obsidian.png", 1)
|
||||
|
||||
-- obsidian arrow and grief setting check
|
||||
|
||||
local mobs_griefing = minetest.settings:get_bool("mobs_griefing") ~= false
|
||||
local mobs_griefing = core.settings:get_bool("mobs_griefing") ~= false
|
||||
|
||||
-- mese arrow (weapon)
|
||||
mobs:register_arrow("mobs_monster:obsidian_arrow", {
|
||||
visual = "sprite",
|
||||
visual_size = {x = 0.5, y = 0.5},
|
||||
@ -289,6 +288,7 @@ mobs:register_arrow("mobs_monster:obsidian_arrow", {
|
||||
velocity = 6,
|
||||
|
||||
hit_player = function(self, player)
|
||||
|
||||
player:punch(self.object, 1.0, {
|
||||
full_punch_interval = 1.0,
|
||||
damage_groups = {fleshy = 8},
|
||||
@ -296,6 +296,7 @@ mobs:register_arrow("mobs_monster:obsidian_arrow", {
|
||||
end,
|
||||
|
||||
hit_mob = function(self, player)
|
||||
|
||||
player:punch(self.object, 1.0, {
|
||||
full_punch_interval = 1.0,
|
||||
damage_groups = {fleshy = 8},
|
||||
@ -304,18 +305,15 @@ mobs:register_arrow("mobs_monster:obsidian_arrow", {
|
||||
|
||||
hit_node = function(self, pos, node)
|
||||
|
||||
if mobs_griefing == false or minetest.is_protected(pos, "") then
|
||||
if mobs_griefing == false or core.is_protected(pos, "") then
|
||||
return
|
||||
end
|
||||
|
||||
local texture = "default_dirt.png" --fallback texture
|
||||
|
||||
local radius = 1
|
||||
local def = minetest.registered_nodes[node]
|
||||
local def = node and core.registered_nodes[node.name]
|
||||
|
||||
if def then
|
||||
node = {name = node}
|
||||
end
|
||||
if not def then return end
|
||||
|
||||
if def and def.tiles and def.tiles[1] then
|
||||
texture = def.tiles[1]
|
||||
@ -327,7 +325,7 @@ mobs:register_arrow("mobs_monster:obsidian_arrow", {
|
||||
return
|
||||
end
|
||||
|
||||
minetest.add_particlespawner({
|
||||
core.add_particlespawner({
|
||||
amount = 32,
|
||||
time = 0.1,
|
||||
minpos = vector.subtract(pos, radius / 2),
|
||||
@ -346,10 +344,10 @@ mobs:register_arrow("mobs_monster:obsidian_arrow", {
|
||||
collisiondetection = true
|
||||
})
|
||||
|
||||
minetest.set_node(pos, {name = "air"})
|
||||
core.set_node(pos, {name = "air"})
|
||||
|
||||
local snd = def.sounds and def.sounds.dug or "default_dig_crumbly"
|
||||
|
||||
minetest.sound_play(snd, {pos = pos, max_hear_distance = 12, gain = 1.0}, true)
|
||||
core.sound_play(snd, {pos = pos, max_hear_distance = 8, gain = 1.0}, true)
|
||||
end
|
||||
})
|
||||
|
@ -35,6 +35,7 @@ Textures by AMMOnym (WTFPL)
|
||||
Textures by TenPlus1 (MIT)
|
||||
mobs_stone_monster3.png
|
||||
mobs_fireball.png
|
||||
mobs_obsidian_flan.png
|
||||
|
||||
Textures by Sirrobzeroone (CC0 1.0 Universal)
|
||||
mobs_stone_monster4.png
|
||||
@ -71,10 +72,12 @@ AspireMint (CC BY-SA 3.0)
|
||||
mobs_spider_snowy.png
|
||||
mobs_spider_grey.png
|
||||
mobs_spider_crystal.png
|
||||
zmobs_lava_flan.b3d
|
||||
zmobs_lava_flan.png
|
||||
zmobs_lava_flan2.png
|
||||
zmobs_lava_flan3.png
|
||||
|
||||
Zeg9 (CC BY-SA 3.0)
|
||||
zmobs_lava_flan.x
|
||||
zmobs_lava_flan.png
|
||||
zmobs_lava_orb.png
|
||||
|
||||
Sounds by Cyberpangolin (WTFPL) https://forum.minetest.net/viewtopic.php?t=10798
|
||||
|
14
locale/mobs_monster.pt_BR.tr
Normal file
@ -0,0 +1,14 @@
|
||||
# textdomain:mobs_monster
|
||||
Cobweb=Teia de Aranha
|
||||
Dirt Monster=Monstro de Terra
|
||||
Dungeon Master=Mestre das Dungeons
|
||||
Lava Flan=Pudim de Lava
|
||||
Lava Pickaxe=Picareta de Lava
|
||||
Lava orb=Orb de Lava
|
||||
Mese Monster=Monstro de mese
|
||||
#Obsidian Flan=Pudim de Obsidian
|
||||
Oerkki=Oerkki
|
||||
Sand Monster=Monstro de Areia
|
||||
Spider=Aranha
|
||||
Stone Monster=Monstro de pedra
|
||||
Tree Monster= Arvore Monstro
|
14
locale/mobs_monster.ru.tr
Normal file
@ -0,0 +1,14 @@
|
||||
# textdomain:mobs_monster
|
||||
Cobweb=Паутина
|
||||
Dirt Monster=Земляной Монстр
|
||||
Dungeon Master=Хозяйн Подземелья
|
||||
Lava Flan=Лавовый Слизень
|
||||
Lava Pickaxe=Лавовая Кирка
|
||||
Lava orb=Лавовая сфера
|
||||
Mese Monster=Месе Монстр
|
||||
Obsidian Flan=Обсидиановый Слизень
|
||||
Oerkki=Дух Ведьмы
|
||||
Sand Monster=Песочный Монстр
|
||||
Spider=Паук
|
||||
Stone Monster=Каменный Монстр
|
||||
Tree Monster=Древесный Монстр
|
19
locale/mobs_monster.uk.tr
Normal file
@ -0,0 +1,19 @@
|
||||
# textdomain:mobs_monster
|
||||
Mobs Monster=Моби Монстри
|
||||
Add many different monsters into your world.=Додає багато різних монстрів у світ.
|
||||
Adds many types of monster.=Додає багато різних типів монстрів.
|
||||
Cobweb=Павутина
|
||||
Dirt Monster=Земляний монстр
|
||||
Dungeon Master=Хазяїн печер
|
||||
Lava Flan=Лавовий слимак
|
||||
Lava Pickaxe=Лавове кайло
|
||||
Lava orb=Лавова сфера
|
||||
Mese Monster=Месе монстр
|
||||
Obsidian Flan=Обсидіановий слимак
|
||||
Oerkki=Оерккі
|
||||
Land Guard=Охоронець землі
|
||||
Fire Spirit=Вогняний дух
|
||||
Sand Monster=Пісочний монстр
|
||||
Spider=Павук
|
||||
Stone Monster=Кам'яний монстр
|
||||
Tree Monster=Дерево-монстр
|
@ -1,3 +1,6 @@
|
||||
|
||||
-- web trap schematic
|
||||
|
||||
local web = {name = "mobs:cobweb"}
|
||||
local web_trap = {
|
||||
size = {x = 3, y = 3, z = 3},
|
||||
@ -20,6 +23,8 @@ lucky_block:add_schematics({
|
||||
{"webtrap", web_trap, {x = 1, y = 0, z = 1}},
|
||||
})
|
||||
|
||||
-- add lucky blocks
|
||||
|
||||
lucky_block:add_blocks({
|
||||
{"sch", "webtrap", 1, true},
|
||||
{"spw", "mobs:dungeon_master", 1, nil, nil, 3, "Billy"},
|
||||
@ -32,6 +37,7 @@ lucky_block:add_blocks({
|
||||
{"spw", "mobs:spider", 5},
|
||||
{"spw", "mobs:mese_monster", 2},
|
||||
{"spw", "mobs:lava_flan", 3},
|
||||
{"spw", "mobs_monster:land_guard", 2},
|
||||
{"nod", "default:chest", 0, {
|
||||
{name = "mobs:lava_orb", max = 1}}},
|
||||
})
|
||||
|
308
mese_monster.lua
@ -1,140 +1,139 @@
|
||||
-- Translation support
|
||||
local S = minetest.get_translator("mobs_monster")
|
||||
|
||||
-- translation and custom mese monster types
|
||||
|
||||
local S = core.get_translator("mobs_monster")
|
||||
|
||||
local mese_monster_types = {
|
||||
|
||||
-- mese_monster_red
|
||||
{
|
||||
y_min = -20,
|
||||
y_max = -1000,
|
||||
damage = 2,
|
||||
reach = 3,
|
||||
hp_min = 15,
|
||||
hp_max = 25,
|
||||
armor = 80,
|
||||
skins = {"mobs_mese_monster_red.png"},
|
||||
immune_to = {
|
||||
{"default:pick_wood", 0},
|
||||
{"default:shovel_wood", 0},
|
||||
{"default:axe_wood", 0},
|
||||
{"default:sword_wood", 0}
|
||||
{ -- red
|
||||
y_min = -20,
|
||||
y_max = -1000,
|
||||
damage = 2,
|
||||
reach = 3,
|
||||
hp_min = 15,
|
||||
hp_max = 25,
|
||||
armor = 80,
|
||||
skins = {"mobs_mese_monster_red.png"},
|
||||
immune_to = {
|
||||
{"default:pick_wood", 0},
|
||||
{"default:shovel_wood", 0},
|
||||
{"default:axe_wood", 0},
|
||||
{"default:sword_wood", 0}
|
||||
},
|
||||
drops = {
|
||||
{name = "default:mese_crystal", chance = 15, min = 0, max = 1},
|
||||
{name = "default:mese_crystal_fragment", chance = 2, min = 0, max = 1}
|
||||
},
|
||||
arrow_override = function(self)
|
||||
self.velocity = 6
|
||||
self.damage = 2
|
||||
end
|
||||
},
|
||||
drops = {
|
||||
{name = "default:mese_crystal", chance = 15, min = 0, max = 1},
|
||||
{name = "default:mese_crystal_fragment", chance = 2, min = 0, max = 1}
|
||||
},
|
||||
arrow_override = function(self)
|
||||
self.velocity = 6
|
||||
self.damage = 2
|
||||
end
|
||||
},
|
||||
|
||||
-- mese_monster_green
|
||||
{
|
||||
y_min = -1001,
|
||||
y_max = -2000,
|
||||
damage = 3,
|
||||
reach = 3,
|
||||
hp_min = 20,
|
||||
hp_max = 30,
|
||||
armor = 75,
|
||||
skins = {"mobs_mese_monster_green.png"},
|
||||
immune_to = {
|
||||
{"default:pick_wood", 0},
|
||||
{"default:shovel_wood", 0},
|
||||
{"default:axe_wood", 0},
|
||||
{"default:sword_wood", 0},
|
||||
{"default:pick_stone", 0},
|
||||
{"default:shovel_stone", 0},
|
||||
{"default:axe_stone", 0},
|
||||
{"default:sword_stone", 0}
|
||||
{ -- green
|
||||
y_min = -1001,
|
||||
y_max = -2000,
|
||||
damage = 3,
|
||||
reach = 3,
|
||||
hp_min = 20,
|
||||
hp_max = 30,
|
||||
armor = 75,
|
||||
skins = {"mobs_mese_monster_green.png"},
|
||||
immune_to = {
|
||||
{"default:pick_wood", 0},
|
||||
{"default:shovel_wood", 0},
|
||||
{"default:axe_wood", 0},
|
||||
{"default:sword_wood", 0},
|
||||
{"default:pick_stone", 0},
|
||||
{"default:shovel_stone", 0},
|
||||
{"default:axe_stone", 0},
|
||||
{"default:sword_stone", 0}
|
||||
},
|
||||
drops = {
|
||||
{name = "default:mese_crystal", chance = 12, min = 0, max = 1},
|
||||
{name = "default:mese_crystal_fragment", chance = 1, min = 0, max = 1}
|
||||
},
|
||||
arrow_override = function(self)
|
||||
self.velocity = 6
|
||||
self.damage = 2
|
||||
end
|
||||
},
|
||||
drops = {
|
||||
{name = "default:mese_crystal", chance = 12, min = 0, max = 1},
|
||||
{name = "default:mese_crystal_fragment", chance = 1, min = 0, max = 1}
|
||||
},
|
||||
arrow_override = function(self)
|
||||
self.velocity = 6
|
||||
self.damage = 2
|
||||
end
|
||||
},
|
||||
|
||||
-- mese_monster_blue
|
||||
{
|
||||
y_min = -2001,
|
||||
y_max = -3000,
|
||||
damage = 3,
|
||||
reach = 4,
|
||||
hp_min = 25,
|
||||
hp_max = 35,
|
||||
armor = 70,
|
||||
skins = {"mobs_mese_monster_blue.png"},
|
||||
immune_to = {
|
||||
{"default:pick_wood", 0},
|
||||
{"default:shovel_wood", 0},
|
||||
{"default:axe_wood", 0},
|
||||
{"default:sword_wood", 0},
|
||||
{"default:pick_stone", 0},
|
||||
{"default:shovel_stone", 0},
|
||||
{"default:axe_stone", 0},
|
||||
{"default:sword_stone", 0},
|
||||
{"default:pick_bronze", 0},
|
||||
{"default:shovel_bronze", 0},
|
||||
{"default:axe_bronze", 0},
|
||||
{"default:sword_bronze", 0}
|
||||
{ -- blue
|
||||
y_min = -2001,
|
||||
y_max = -3000,
|
||||
damage = 3,
|
||||
reach = 4,
|
||||
hp_min = 25,
|
||||
hp_max = 35,
|
||||
armor = 70,
|
||||
skins = {"mobs_mese_monster_blue.png"},
|
||||
immune_to = {
|
||||
{"default:pick_wood", 0},
|
||||
{"default:shovel_wood", 0},
|
||||
{"default:axe_wood", 0},
|
||||
{"default:sword_wood", 0},
|
||||
{"default:pick_stone", 0},
|
||||
{"default:shovel_stone", 0},
|
||||
{"default:axe_stone", 0},
|
||||
{"default:sword_stone", 0},
|
||||
{"default:pick_bronze", 0},
|
||||
{"default:shovel_bronze", 0},
|
||||
{"default:axe_bronze", 0},
|
||||
{"default:sword_bronze", 0}
|
||||
},
|
||||
drops = {
|
||||
{name = "default:mese", chance = 15, min = 0, max = 1},
|
||||
{name = "default:mese_crystal", chance = 9, min = 0, max = 2},
|
||||
{name = "default:mese_crystal_fragment", chance = 1, min = 0, max = 2}
|
||||
},
|
||||
arrow_override = function(self)
|
||||
self.velocity = 7
|
||||
self.damage = 3
|
||||
end
|
||||
},
|
||||
drops = {
|
||||
{name = "default:mese", chance = 15, min = 0, max = 1},
|
||||
{name = "default:mese_crystal", chance = 9, min = 0, max = 2},
|
||||
{name = "default:mese_crystal_fragment", chance = 1, min = 0, max = 2}
|
||||
},
|
||||
arrow_override = function(self)
|
||||
self.velocity = 7
|
||||
self.damage = 3
|
||||
end
|
||||
},
|
||||
|
||||
-- mese_monster_purple
|
||||
{
|
||||
y_min = -3000,
|
||||
y_max = -31000,
|
||||
damage = 4,
|
||||
reach = 5,
|
||||
hp_min = 30,
|
||||
hp_max = 40,
|
||||
armor = 60,
|
||||
skins = {"mobs_mese_monster_purple.png"},
|
||||
immune_to = {
|
||||
{"default:pick_wood", 0},
|
||||
{"default:shovel_wood", 0},
|
||||
{"default:axe_wood", 0},
|
||||
{"default:sword_wood", 0},
|
||||
{"default:pick_stone", 0},
|
||||
{"default:shovel_stone", 0},
|
||||
{"default:axe_stone", 0},
|
||||
{"default:sword_stone", 0},
|
||||
{"default:pick_bronze", 0},
|
||||
{"default:shovel_bronze", 0},
|
||||
{"default:axe_bronze", 0},
|
||||
{"default:sword_bronze", 0},
|
||||
{"default:pick_steel", 0},
|
||||
{"default:shovel_steel", 0},
|
||||
{"default:axe_steel", 0},
|
||||
{"default:sword_steel", 0}
|
||||
},
|
||||
drops = {
|
||||
{name = "default:mese", chance = 9, min = 0, max = 1},
|
||||
{name = "default:mese_crystal", chance = 6, min = 0, max = 2},
|
||||
{name = "default:mese_crystal_fragment", chance = 1, min = 0, max = 3}
|
||||
},
|
||||
arrow_override = function(self)
|
||||
self.velocity = 8
|
||||
self.damage = 4
|
||||
end
|
||||
}}
|
||||
|
||||
{ -- purple
|
||||
y_min = -3000,
|
||||
y_max = -31000,
|
||||
damage = 4,
|
||||
reach = 5,
|
||||
hp_min = 30,
|
||||
hp_max = 40,
|
||||
armor = 60,
|
||||
skins = {"mobs_mese_monster_purple.png"},
|
||||
immune_to = {
|
||||
{"default:pick_wood", 0},
|
||||
{"default:shovel_wood", 0},
|
||||
{"default:axe_wood", 0},
|
||||
{"default:sword_wood", 0},
|
||||
{"default:pick_stone", 0},
|
||||
{"default:shovel_stone", 0},
|
||||
{"default:axe_stone", 0},
|
||||
{"default:sword_stone", 0},
|
||||
{"default:pick_bronze", 0},
|
||||
{"default:shovel_bronze", 0},
|
||||
{"default:axe_bronze", 0},
|
||||
{"default:sword_bronze", 0},
|
||||
{"default:pick_steel", 0},
|
||||
{"default:shovel_steel", 0},
|
||||
{"default:axe_steel", 0},
|
||||
{"default:sword_steel", 0}
|
||||
},
|
||||
drops = {
|
||||
{name = "default:mese", chance = 9, min = 0, max = 1},
|
||||
{name = "default:mese_crystal", chance = 6, min = 0, max = 2},
|
||||
{name = "default:mese_crystal_fragment", chance = 1, min = 0, max = 3}
|
||||
},
|
||||
arrow_override = function(self)
|
||||
self.velocity = 8
|
||||
self.damage = 4
|
||||
end
|
||||
}
|
||||
}
|
||||
|
||||
-- Mese Monster by SirrobZeroone
|
||||
|
||||
mobs:register_mob("mobs_monster:mese_monster", {
|
||||
type = "monster",
|
||||
visual_size = {x = 10, y = 10}, -- Got scale wrong in blender by factor of 10 - S01
|
||||
@ -155,9 +154,7 @@ mobs:register_mob("mobs_monster:mese_monster", {
|
||||
collisionbox = {-0.75, -0.5, -0.75, 0.75, 2.5, 0.75},
|
||||
visual = "mesh",
|
||||
mesh = "mobs_mese_monster.b3d",
|
||||
textures = {
|
||||
{"mobs_mese_monster_purple.png"}
|
||||
},
|
||||
textures = {{"mobs_mese_monster_purple.png"}},
|
||||
blood_texture = "default_mese_crystal_fragment.png",
|
||||
makes_footstep_sound = false,
|
||||
sounds = {
|
||||
@ -187,36 +184,21 @@ mobs:register_mob("mobs_monster:mese_monster", {
|
||||
lava_damage = 1,
|
||||
light_damage = 0,
|
||||
animation = {
|
||||
speed_normal = 18,
|
||||
speed_run = 18,
|
||||
walk_start = 10,
|
||||
walk_end = 41,
|
||||
walk_speed = 20,
|
||||
run_start = 10,
|
||||
run_end = 41,
|
||||
run_speed = 30,
|
||||
stand_start = 60,
|
||||
stand_end = 83,
|
||||
shoot_start = 100,
|
||||
shoot_end = 113,
|
||||
die_start = 125,
|
||||
die_end = 141,
|
||||
death_speed = 25,
|
||||
die_loop = false,
|
||||
jump_start = 150 ,
|
||||
jump_end = 168,
|
||||
jump_loop = false,
|
||||
punch_start = 175,
|
||||
punch_end = 189
|
||||
speed_normal = 18, speed_run = 18,
|
||||
walk_start = 10, walk_end = 41, walk_speed = 20,
|
||||
run_start = 10, run_end = 41, run_speed = 30,
|
||||
stand_start = 60, stand_end = 83,
|
||||
shoot_start = 100, shoot_end = 113,
|
||||
die_start = 125, die_end = 141, death_speed = 25, die_loop = false,
|
||||
jump_start = 150 , jump_end = 168, jump_loop = false,
|
||||
punch_start = 175, punch_end = 189
|
||||
},
|
||||
|
||||
after_activate = function(self, staticdata, def, dtime)
|
||||
|
||||
local tex = self and self.textures and self.textures[1]
|
||||
|
||||
if tex == "zmobs_mese_monster.png" then
|
||||
self.object:remove()
|
||||
end
|
||||
if tex == "zmobs_mese_monster.png" then self.object:remove() end
|
||||
end,
|
||||
|
||||
on_spawn = function(self)
|
||||
@ -256,11 +238,11 @@ mobs:register_mob("mobs_monster:mese_monster", {
|
||||
-- direction sets type N = red, E = green, S = blue, W = purple
|
||||
-- Just for fun - S01
|
||||
|
||||
local objects = minetest.get_objects_inside_radius(pos, 10)
|
||||
local objects = core.get_objects_inside_radius(pos, 10)
|
||||
|
||||
for i, obj in ipairs(objects) do
|
||||
|
||||
if minetest.is_player(obj)
|
||||
if core.is_player(obj)
|
||||
and obj:get_wielded_item():get_name() == "mobs_monster:mese_monster" then
|
||||
|
||||
local degree = (360 + math.deg(obj:get_look_horizontal())) % 360
|
||||
@ -287,14 +269,15 @@ mobs:register_mob("mobs_monster:mese_monster", {
|
||||
end
|
||||
})
|
||||
|
||||
-- mese arrow item
|
||||
|
||||
-- mese arrow (weapon)
|
||||
minetest.register_craftitem("mobs_monster:mese_crystal_fragment_arrow", {
|
||||
core.register_craftitem("mobs_monster:mese_crystal_fragment_arrow", {
|
||||
description = S("Mese Monster Arrow"),
|
||||
inventory_image = "mobs_mese_arrow.png",
|
||||
groups = {not_in_creative_inventory = 1}
|
||||
})
|
||||
|
||||
-- mese arrow
|
||||
|
||||
mobs:register_arrow("mobs_monster:mese_arrow", {
|
||||
visual = "wielditem",
|
||||
@ -305,6 +288,7 @@ mobs:register_arrow("mobs_monster:mese_arrow", {
|
||||
damage = 2,
|
||||
|
||||
hit_player = function(self, player)
|
||||
|
||||
player:punch(self.object, 1.0, {
|
||||
full_punch_interval = 1.0,
|
||||
damage_groups = {fleshy = self.damage}
|
||||
@ -312,6 +296,7 @@ mobs:register_arrow("mobs_monster:mese_arrow", {
|
||||
end,
|
||||
|
||||
hit_mob = function(self, player)
|
||||
|
||||
player:punch(self.object, 1.0, {
|
||||
full_punch_interval = 1.0,
|
||||
damage_groups = {fleshy = self.damage}
|
||||
@ -322,6 +307,7 @@ mobs:register_arrow("mobs_monster:mese_arrow", {
|
||||
end
|
||||
})
|
||||
|
||||
-- where to spawn
|
||||
|
||||
if not mobs.custom_spawn_monster then
|
||||
|
||||
@ -335,17 +321,19 @@ if not mobs.custom_spawn_monster then
|
||||
})
|
||||
end
|
||||
|
||||
-- spawn egg
|
||||
|
||||
mobs:register_egg("mobs_monster:mese_monster", S("Mese Monster"), "default_mese_block.png", 1)
|
||||
|
||||
-- compatibility with older mobs mod
|
||||
|
||||
mobs:alias_mob("mobs:mese_monster", "mobs_monster:mese_monster") -- compatiblity
|
||||
mobs:alias_mob("mobs:mese_monster", "mobs_monster:mese_monster")
|
||||
|
||||
-- 9x mese crystal fragments = 1x mese crystal recipe
|
||||
|
||||
-- 9x mese crystal fragments = 1x mese crystal
|
||||
local f = "default:mese_crystal_fragment"
|
||||
|
||||
minetest.register_craft({
|
||||
core.register_craft({
|
||||
output = "default:mese_crystal",
|
||||
recipe = {{f, f, f}, {f, f, f}, {f, f, f}}
|
||||
})
|
||||
|
BIN
models/zmobs_lava_flan.b3d
Normal file
28
oerkki.lua
@ -1,5 +1,5 @@
|
||||
-- Translation support
|
||||
local S = minetest.get_translator("mobs_monster")
|
||||
|
||||
local S = core.get_translator("mobs_monster")
|
||||
|
||||
-- Oerkki by PilzAdam
|
||||
|
||||
@ -22,9 +22,7 @@ mobs:register_mob("mobs_monster:oerkki", {
|
||||
{"mobs_oerkki3.png"}
|
||||
},
|
||||
makes_footstep_sound = false,
|
||||
sounds = {
|
||||
random = "mobs_oerkki"
|
||||
},
|
||||
sounds = {random = "mobs_oerkki"},
|
||||
walk_velocity = 1,
|
||||
run_velocity = 3,
|
||||
view_range = 10,
|
||||
@ -38,16 +36,11 @@ mobs:register_mob("mobs_monster:oerkki", {
|
||||
light_damage = 1,
|
||||
fear_height = 4,
|
||||
animation = {
|
||||
stand_start = 0,
|
||||
stand_end = 23,
|
||||
walk_start = 24,
|
||||
walk_end = 36,
|
||||
run_start = 37,
|
||||
run_end = 49,
|
||||
punch_start = 37,
|
||||
punch_end = 49,
|
||||
speed_normal = 15,
|
||||
speed_run = 15
|
||||
stand_start = 0, stand_end = 23,
|
||||
walk_start = 24, walk_end = 36,
|
||||
run_start = 37, run_end = 49,
|
||||
punch_start = 37, punch_end = 49,
|
||||
speed_normal = 15, speed_run = 15
|
||||
},
|
||||
replace_rate = 5,
|
||||
replace_what = {"default:torch"},
|
||||
@ -59,6 +52,7 @@ mobs:register_mob("mobs_monster:oerkki", {
|
||||
},
|
||||
})
|
||||
|
||||
-- where to spawn
|
||||
|
||||
if not mobs.custom_spawn_monster then
|
||||
|
||||
@ -71,8 +65,10 @@ if not mobs.custom_spawn_monster then
|
||||
})
|
||||
end
|
||||
|
||||
-- spawn egg
|
||||
|
||||
mobs:register_egg("mobs_monster:oerkki", S("Oerkki"), "default_obsidian.png", 1)
|
||||
|
||||
-- compatibility with older mobs mod
|
||||
|
||||
mobs:alias_mob("mobs:oerkki", "mobs_monster:oerkki") -- compatiblity
|
||||
mobs:alias_mob("mobs:oerkki", "mobs_monster:oerkki")
|
||||
|
@ -1,8 +1,9 @@
|
||||
-- Translation support
|
||||
local S = minetest.get_translator("mobs_monster")
|
||||
|
||||
local S = core.get_translator("mobs_monster")
|
||||
|
||||
-- custom particle effects
|
||||
local effect = function(pos, amount, texture, min_size, max_size, radius, gravity, glow)
|
||||
|
||||
local function effect(pos, amount, texture, min_size, max_size, radius, gravity, glow)
|
||||
|
||||
radius = radius or 2
|
||||
min_size = min_size or 0.5
|
||||
@ -10,7 +11,7 @@ local effect = function(pos, amount, texture, min_size, max_size, radius, gravit
|
||||
gravity = gravity or -10
|
||||
glow = glow or 0
|
||||
|
||||
minetest.add_particlespawner({
|
||||
core.add_particlespawner({
|
||||
amount = amount,
|
||||
time = 0.25,
|
||||
minpos = pos,
|
||||
@ -28,7 +29,6 @@ local effect = function(pos, amount, texture, min_size, max_size, radius, gravit
|
||||
})
|
||||
end
|
||||
|
||||
|
||||
-- Sand Monster by PilzAdam
|
||||
|
||||
mobs:register_mob("mobs_monster:sand_monster", {
|
||||
@ -52,32 +52,28 @@ mobs:register_mob("mobs_monster:sand_monster", {
|
||||
},
|
||||
blood_texture = "default_desert_sand.png",
|
||||
makes_footstep_sound = true,
|
||||
sounds = {
|
||||
random = "mobs_sandmonster"
|
||||
},
|
||||
sounds = {random = "mobs_sandmonster"},
|
||||
walk_velocity = 1.5,
|
||||
run_velocity = 4,
|
||||
view_range = 8,
|
||||
jump = true,
|
||||
floats = 0,
|
||||
drops = {
|
||||
{name = "default:desert_sand", chance = 1, min = 3, max = 5}
|
||||
{name = "default:silver_sand", chance = 2, min = 1, max = 2},
|
||||
{name = "default:desert_sand", chance = 2, min = 1, max = 2},
|
||||
{name = "default:sand", chance = 2, min = 1, max = 2},
|
||||
{name = "default:clay_lump", chance = 2, min = 0, max = 1}
|
||||
},
|
||||
water_damage = 3,
|
||||
lava_damage = 4,
|
||||
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
|
||||
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
|
||||
},
|
||||
immune_to = {
|
||||
{"default:shovel_wood", 3}, -- shovels deal more damage to sand monster
|
||||
@ -90,7 +86,7 @@ mobs:register_mob("mobs_monster:sand_monster", {
|
||||
--[[
|
||||
custom_attack = function(self, p)
|
||||
local pos = self.object:get_pos()
|
||||
minetest.add_item(pos, "default:sand")
|
||||
core.add_item(pos, "default:sand")
|
||||
end,
|
||||
]]
|
||||
on_die = function(self, pos)
|
||||
@ -116,6 +112,8 @@ mobs:register_mob("mobs_monster:sand_monster", {
|
||||
]]
|
||||
})
|
||||
|
||||
-- where to spawn
|
||||
|
||||
if not mobs.custom_spawn_monster then
|
||||
|
||||
mobs:spawn({
|
||||
@ -127,9 +125,11 @@ if not mobs.custom_spawn_monster then
|
||||
})
|
||||
end
|
||||
|
||||
-- spawn egg
|
||||
|
||||
mobs:register_egg("mobs_monster:sand_monster", S("Sand Monster"),
|
||||
"default_desert_sand.png", 1)
|
||||
|
||||
-- compatibility with older mobs mod
|
||||
|
||||
mobs:alias_mob("mobs:sand_monster", "mobs_monster:sand_monster") -- compatibility
|
||||
mobs:alias_mob("mobs:sand_monster", "mobs_monster:sand_monster")
|
||||
|
92
spider.lua
@ -1,7 +1,9 @@
|
||||
-- Translation support
|
||||
local S = minetest.get_translator("mobs_monster")
|
||||
|
||||
local get_velocity = function(self)
|
||||
local S = core.get_translator("mobs_monster")
|
||||
|
||||
-- helper function
|
||||
|
||||
local function get_velocity(self)
|
||||
|
||||
local v = self.object:get_velocity()
|
||||
|
||||
@ -11,6 +13,9 @@ local get_velocity = function(self)
|
||||
return (v.x * v.x + v.z * v.z) ^ 0.5
|
||||
end
|
||||
|
||||
local math_cos, math_sin = math.cos, math.sin
|
||||
|
||||
-- custom spider types
|
||||
|
||||
local spider_types = {
|
||||
|
||||
@ -44,14 +49,13 @@ local spider_types = {
|
||||
|
||||
{ nodes = {"ethereal:crystal_dirt", "ethereal:crystal_spike"},
|
||||
skins = {"mobs_spider_crystal.png"},
|
||||
docile = true,
|
||||
docile = true, immune_to = {{"ethereal:crystal_spike", 0}},
|
||||
drops = {
|
||||
{name = "farming:string", chance = 1, min = 0, max = 2},
|
||||
{name = "ethereal:crystal_spike", chance = 15, min = 1, max = 2}}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
-- Spider by AspireMint (CC-BY-SA 3.0 license)
|
||||
|
||||
mobs:register_mob("mobs_monster:spider", {
|
||||
@ -64,8 +68,8 @@ mobs:register_mob("mobs_monster:spider", {
|
||||
damage = 3,
|
||||
hp_min = 10,
|
||||
hp_max = 30,
|
||||
armor = 200,
|
||||
collisionbox = {-0.8, -0.5, -0.8, 0.8, 0, 0.8},
|
||||
armor = 100,
|
||||
collisionbox = {-0.7, -0.5, -0.7, 0.7, 0, 0.7},
|
||||
visual_size = {x = 1, y = 1},
|
||||
visual = "mesh",
|
||||
mesh = "mobs_spider.b3d",
|
||||
@ -92,17 +96,13 @@ mobs:register_mob("mobs_monster:spider", {
|
||||
water_damage = 5,
|
||||
lava_damage = 5,
|
||||
light_damage = 0,
|
||||
-- node_damage = false, -- disable damage_per_second node damage
|
||||
animation = {
|
||||
speed_normal = 15,
|
||||
speed_run = 20,
|
||||
stand_start = 0,
|
||||
stand_end = 0,
|
||||
walk_start = 1,
|
||||
walk_end = 21,
|
||||
run_start = 1,
|
||||
run_end = 21,
|
||||
punch_start = 25,
|
||||
punch_end = 45
|
||||
speed_normal = 15, speed_run = 20,
|
||||
stand_start = 0, stand_end = 0,
|
||||
walk_start = 1, walk_end = 21,
|
||||
run_start = 1, run_end = 21,
|
||||
punch_start = 25, punch_end = 45
|
||||
},
|
||||
|
||||
-- check surrounding nodes and spawn a specific spider
|
||||
@ -115,15 +115,15 @@ mobs:register_mob("mobs_monster:spider", {
|
||||
|
||||
tmp = spider_types[n]
|
||||
|
||||
if minetest.find_node_near(pos, 1, tmp.nodes) then
|
||||
if core.find_node_near(pos, 1, tmp.nodes) then
|
||||
|
||||
self.base_texture = tmp.skins
|
||||
self.object:set_properties({textures = tmp.skins})
|
||||
self.docile_by_day = tmp.docile
|
||||
|
||||
if tmp.drops then
|
||||
self.drops = tmp.drops
|
||||
end
|
||||
if tmp.drops then self.drops = tmp.drops end
|
||||
|
||||
if tmp.immune_to then self.immune_to = tmp.immune_to end
|
||||
|
||||
if tmp.shoot then
|
||||
self.attack_type = "dogshoot"
|
||||
@ -136,6 +136,7 @@ mobs:register_mob("mobs_monster:spider", {
|
||||
end
|
||||
|
||||
if tmp.small then
|
||||
|
||||
self.object:set_properties({
|
||||
collisionbox = {-0.2, -0.2, -0.2, 0.2, 0, 0.2},
|
||||
visual_size = {x = 0.25, y = 0.25}
|
||||
@ -154,9 +155,7 @@ mobs:register_mob("mobs_monster:spider", {
|
||||
|
||||
-- quarter second timer
|
||||
self.spider_timer = (self.spider_timer or 0) + dtime
|
||||
if self.spider_timer < 0.25 then
|
||||
return
|
||||
end
|
||||
if self.spider_timer < 0.25 then return end
|
||||
self.spider_timer = 0
|
||||
|
||||
-- need to be stopped to go onwards
|
||||
@ -166,18 +165,14 @@ mobs:register_mob("mobs_monster:spider", {
|
||||
end
|
||||
|
||||
local pos = self.object:get_pos()
|
||||
local yaw = self.object:get_yaw()
|
||||
|
||||
-- sanity check
|
||||
if not yaw then return end
|
||||
|
||||
local yaw = self.object:get_yaw() ; if not yaw then return end
|
||||
local prop = self.object:get_properties()
|
||||
|
||||
pos.y = pos.y + prop.collisionbox[2] - 0.2
|
||||
|
||||
local dir_x = -math.sin(yaw) * (prop.collisionbox[4] + 0.5)
|
||||
local dir_z = math.cos(yaw) * (prop.collisionbox[4] + 0.5)
|
||||
local nod = minetest.get_node_or_nil({
|
||||
local dir_x = -math_sin(yaw) * (prop.collisionbox[4] + 0.5)
|
||||
local dir_z = math_cos(yaw) * (prop.collisionbox[4] + 0.5)
|
||||
local nod = core.get_node_or_nil({
|
||||
x = pos.x + dir_x,
|
||||
y = pos.y + 0.5,
|
||||
z = pos.z + dir_z
|
||||
@ -187,8 +182,8 @@ mobs:register_mob("mobs_monster:spider", {
|
||||
local v = self.object:get_velocity()
|
||||
|
||||
-- can only climb solid facings
|
||||
if not nod or not minetest.registered_nodes[nod.name]
|
||||
or not minetest.registered_nodes[nod.name].walkable then
|
||||
if not nod or not core.registered_nodes[nod.name]
|
||||
or not core.registered_nodes[nod.name].walkable then
|
||||
self.disable_falling = nil
|
||||
v.y = 0
|
||||
self.object:set_velocity(v)
|
||||
@ -203,7 +198,9 @@ mobs:register_mob("mobs_monster:spider", {
|
||||
-- move up facing
|
||||
v.x = 0 ; v.y = 0
|
||||
v.y = self.jump_height
|
||||
mobs:set_animation(self, "jump")
|
||||
|
||||
self:set_animation("jump")
|
||||
|
||||
self.object:set_velocity(v)
|
||||
end,
|
||||
|
||||
@ -224,6 +221,7 @@ mobs:register_mob("mobs_monster:spider", {
|
||||
end
|
||||
})
|
||||
|
||||
-- where to spawn
|
||||
|
||||
if not mobs.custom_spawn_monster then
|
||||
|
||||
@ -238,7 +236,7 @@ if not mobs.custom_spawn_monster then
|
||||
max_light = 8,
|
||||
chance = 7000,
|
||||
active_object_count = 1,
|
||||
min_height = 25,
|
||||
min_height = 2,
|
||||
max_height = 31000
|
||||
})
|
||||
|
||||
@ -255,16 +253,18 @@ if not mobs.custom_spawn_monster then
|
||||
})
|
||||
end
|
||||
|
||||
-- spawn egg
|
||||
|
||||
mobs:register_egg("mobs_monster:spider", S("Spider"), "mobs_cobweb.png", 1)
|
||||
|
||||
-- compatibility with older mobs mod
|
||||
|
||||
mobs:alias_mob("mobs_monster:spider2", "mobs_monster:spider") -- compatibility
|
||||
mobs:alias_mob("mobs_monster:spider2", "mobs_monster:spider")
|
||||
mobs:alias_mob("mobs:spider", "mobs_monster:spider")
|
||||
|
||||
-- cobweb and recipe
|
||||
|
||||
-- cobweb
|
||||
minetest.register_node(":mobs:cobweb", {
|
||||
core.register_node(":mobs:cobweb", {
|
||||
description = S("Cobweb"),
|
||||
drawtype = "plantlike",
|
||||
visual_scale = 1.2,
|
||||
@ -280,11 +280,12 @@ minetest.register_node(":mobs:cobweb", {
|
||||
liquid_range = 0,
|
||||
walkable = false,
|
||||
groups = {snappy = 1, disable_jump = 1},
|
||||
is_ground_content = false,
|
||||
drop = "farming:string",
|
||||
sounds = default and default.node_sound_leaves_defaults()
|
||||
sounds = mobs.node_sound_leaves_defaults()
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
core.register_craft({
|
||||
output = "mobs:cobweb",
|
||||
recipe = {
|
||||
{"farming:string", "", "farming:string"},
|
||||
@ -293,18 +294,21 @@ minetest.register_craft({
|
||||
}
|
||||
})
|
||||
|
||||
-- cobweb place function
|
||||
|
||||
local web_place = function(pos)
|
||||
|
||||
if minetest.find_node_near(pos, 1, {"ignore"}) then return end
|
||||
if core.find_node_near(pos, 1, {"ignore"}) then return end
|
||||
|
||||
local pos2 = minetest.find_node_near(pos, 1, {"air", "group:leaves"}, true)
|
||||
local pos2 = core.find_node_near(pos, 1, {"air", "group:leaves"}, true)
|
||||
|
||||
if pos2 then
|
||||
minetest.swap_node(pos2, {name = "mobs:cobweb"})
|
||||
core.swap_node(pos2, {name = "mobs:cobweb"})
|
||||
end
|
||||
end
|
||||
|
||||
-- cobweb arrow
|
||||
|
||||
mobs:register_arrow("mobs_monster:cobweb", {
|
||||
visual = "sprite",
|
||||
visual_size = {x = 1, y = 1},
|
||||
|
@ -1,5 +1,7 @@
|
||||
-- Translation support
|
||||
local S = minetest.get_translator("mobs_monster")
|
||||
|
||||
-- translation and custom stone monster types
|
||||
|
||||
local S = core.get_translator("mobs_monster")
|
||||
|
||||
local stone_types = {
|
||||
|
||||
@ -22,7 +24,6 @@ local stone_types = {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
-- Stone Monster by PilzAdam
|
||||
|
||||
mobs:register_mob("mobs_monster:stone_monster", {
|
||||
@ -43,9 +44,7 @@ mobs:register_mob("mobs_monster:stone_monster", {
|
||||
{"mobs_stone_monster2.png"} -- by AMMOnym
|
||||
},
|
||||
makes_footstep_sound = true,
|
||||
sounds = {
|
||||
random = "mobs_stonemonster"
|
||||
},
|
||||
sounds = {random = "mobs_stonemonster"},
|
||||
walk_velocity = 1,
|
||||
run_velocity = 2,
|
||||
jump_height = 0,
|
||||
@ -61,16 +60,11 @@ mobs:register_mob("mobs_monster:stone_monster", {
|
||||
lava_damage = 1,
|
||||
light_damage = 0,
|
||||
animation = {
|
||||
speed_normal = 15,
|
||||
speed_run = 15,
|
||||
stand_start = 0,
|
||||
stand_end = 14,
|
||||
walk_start = 15,
|
||||
walk_end = 38,
|
||||
run_start = 40,
|
||||
run_end = 63,
|
||||
punch_start = 40,
|
||||
punch_end = 63
|
||||
speed_normal = 15, speed_run = 15,
|
||||
stand_start = 0, stand_end = 14,
|
||||
walk_start = 15, walk_end = 38,
|
||||
run_start = 40, run_end = 63,
|
||||
punch_start = 40, punch_end = 63
|
||||
},
|
||||
immune_to = {
|
||||
{"default:pick_wood", 0}, -- wooden pick doesnt hurt stone monster
|
||||
@ -91,14 +85,12 @@ mobs:register_mob("mobs_monster:stone_monster", {
|
||||
|
||||
tmp = stone_types[n]
|
||||
|
||||
if minetest.find_node_near(pos, 1, tmp.nodes) then
|
||||
if core.find_node_near(pos, 1, tmp.nodes) then
|
||||
|
||||
self.base_texture = tmp.skins
|
||||
self.object:set_properties({textures = tmp.skins})
|
||||
|
||||
if tmp.drops then
|
||||
self.drops = tmp.drops
|
||||
end
|
||||
if tmp.drops then self.drops = tmp.drops end
|
||||
|
||||
return true
|
||||
end
|
||||
@ -108,20 +100,24 @@ mobs:register_mob("mobs_monster:stone_monster", {
|
||||
end
|
||||
})
|
||||
|
||||
-- where to spawn
|
||||
|
||||
if not mobs.custom_spawn_monster then
|
||||
|
||||
mobs:spawn({
|
||||
name = "mobs_monster:stone_monster",
|
||||
nodes = {"default:stone", "default:desert_stone", "default:sandstone"},
|
||||
nodes = {"default:stone", "default:desert_stone", "default:sandstone",
|
||||
"default:permafrost_with_stones"},
|
||||
max_light = 7,
|
||||
chance = 7000,
|
||||
max_height = 0
|
||||
})
|
||||
end
|
||||
|
||||
-- spawn egg
|
||||
|
||||
mobs:register_egg("mobs_monster:stone_monster", S("Stone Monster"), "default_stone.png", 1)
|
||||
|
||||
-- compatibility with older mobs mod
|
||||
|
||||
mobs:alias_mob("mobs:stone_monster", "mobs_monster:stone_monster") -- compatibility
|
||||
mobs:alias_mob("mobs:stone_monster", "mobs_monster:stone_monster")
|
||||
|
Before Width: | Height: | Size: 275 B After Width: | Height: | Size: 891 B |
Before Width: | Height: | Size: 9.2 KiB After Width: | Height: | Size: 9.2 KiB |
Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.2 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.1 KiB |
Before Width: | Height: | Size: 1.8 KiB After Width: | Height: | Size: 1.6 KiB |
@ -1,5 +1,7 @@
|
||||
-- Translation support
|
||||
local S = minetest.get_translator("mobs_monster")
|
||||
|
||||
-- translation and custom tree monster types
|
||||
|
||||
local S = core.get_translator("mobs_monster")
|
||||
|
||||
local tree_types = {
|
||||
|
||||
@ -20,7 +22,7 @@ local tree_types = {
|
||||
{name = "ethereal:frost_leaves", chance = 1, min = 1, max = 2},
|
||||
{name = "ethereal:frost_tree", chance = 2, min = 1, max = 2},
|
||||
{name = "ethereal:crystal_spike", chance = 4, min = 0, max = 2}
|
||||
}
|
||||
}, glow = 1
|
||||
},
|
||||
|
||||
{ nodes = {"ethereal:yellowleaves"},
|
||||
@ -30,7 +32,7 @@ local tree_types = {
|
||||
{name = "ethereal:yellowleaves", chance = 1, min = 1, max = 2},
|
||||
{name = "ethereal:yellow_tree_sapling", chance = 2, min = 0, max = 2},
|
||||
{name = "ethereal:golden_apple", chance = 3, min = 0, max = 2}
|
||||
}
|
||||
}, glow = 1
|
||||
},
|
||||
|
||||
{ nodes = {"default:acacia_bush_leaves"},
|
||||
@ -44,7 +46,6 @@ local tree_types = {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
-- Tree Monster (or Tree Gollum) by PilzAdam
|
||||
|
||||
mobs:register_mob("mobs_monster:tree_monster", {
|
||||
@ -67,9 +68,7 @@ mobs:register_mob("mobs_monster:tree_monster", {
|
||||
},
|
||||
blood_texture = "default_wood.png",
|
||||
makes_footstep_sound = true,
|
||||
sounds = {
|
||||
random = "mobs_treemonster"
|
||||
},
|
||||
sounds = {random = "mobs_treemonster"},
|
||||
walk_velocity = 1,
|
||||
run_velocity = 3,
|
||||
jump = true,
|
||||
@ -96,16 +95,11 @@ mobs:register_mob("mobs_monster:tree_monster", {
|
||||
-- {"all", 0}, -- only weapons on list deal damage
|
||||
},
|
||||
animation = {
|
||||
speed_normal = 15,
|
||||
speed_run = 15,
|
||||
stand_start = 0,
|
||||
stand_end = 24,
|
||||
walk_start = 25,
|
||||
walk_end = 47,
|
||||
run_start = 48,
|
||||
run_end = 62,
|
||||
punch_start = 48,
|
||||
punch_end = 62
|
||||
speed_normal = 15, speed_run = 15,
|
||||
stand_start = 0, stand_end = 24,
|
||||
walk_start = 25, walk_end = 47,
|
||||
run_start = 48, run_end = 62,
|
||||
punch_start = 48, punch_end = 62
|
||||
},
|
||||
|
||||
-- check surrounding nodes and spawn a specific tree monster
|
||||
@ -120,16 +114,17 @@ mobs:register_mob("mobs_monster:tree_monster", {
|
||||
|
||||
if tmp.explode and math.random(2) == 1 then return true end
|
||||
|
||||
if minetest.find_node_near(pos, 1, tmp.nodes) then
|
||||
if core.find_node_near(pos, 1, tmp.nodes) then
|
||||
|
||||
self.base_texture = tmp.skins
|
||||
self.object:set_properties({textures = tmp.skins})
|
||||
|
||||
if tmp.drops then
|
||||
self.drops = tmp.drops
|
||||
end
|
||||
if tmp.glow then self.object:set_properties({glow = tmp.glow}) end
|
||||
|
||||
if tmp.drops then self.drops = tmp.drops end
|
||||
|
||||
if tmp.explode then
|
||||
|
||||
self.attack_type = "explode"
|
||||
self.explosion_radius = 3
|
||||
self.explosion_timer = 3
|
||||
@ -156,6 +151,7 @@ mobs:register_mob("mobs_monster:tree_monster", {
|
||||
end
|
||||
})
|
||||
|
||||
-- where to spawn
|
||||
|
||||
if not mobs.custom_spawn_monster then
|
||||
|
||||
@ -169,8 +165,10 @@ if not mobs.custom_spawn_monster then
|
||||
})
|
||||
end
|
||||
|
||||
-- spawn egg
|
||||
|
||||
mobs:register_egg("mobs_monster:tree_monster", S("Tree Monster"), "default_tree_top.png", 1)
|
||||
|
||||
-- compatibility with older mobs mod
|
||||
|
||||
mobs:alias_mob("mobs:tree_monster", "mobs_monster:tree_monster") -- compatibility
|
||||
mobs:alias_mob("mobs:tree_monster", "mobs_monster:tree_monster")
|
||||
|