Add new mob 1hour, spawn mobs in dungeons and support nether

master
CasimirKaPazi 2022-01-31 22:20:43 +01:00
parent e8feaf88aa
commit f031d4980e
8 changed files with 65 additions and 5 deletions

View File

@ -93,6 +93,7 @@ local mob_class = {
physical = true,
collisionbox = {-0.25, -0.25, -0.25, 0.25, 0.25, 0.25},
visual_size = {x = 1, y = 1},
spritediv = {x = 1, y = 1},
texture_mods = "",
makes_footstep_sound = false,
view_range = 5,
@ -148,7 +149,8 @@ local mob_class = {
attack_players = true,
attack_npcs = true,
facing_fence = false,
_cmi_is_mob = true
_cmi_is_mob = true,
on_activate = {}
}
local mob_class_meta = {__index = mob_class}
@ -3495,6 +3497,7 @@ minetest.register_entity(name, setmetatable({
selectionbox = def.selectionbox or def.collisionbox,
visual = def.visual,
visual_size = def.visual_size,
spritediv = def.spritediv,
mesh = def.mesh,
makes_footstep_sound = def.makes_footstep_sound,
view_range = def.view_range,
@ -3574,6 +3577,10 @@ minetest.register_entity(name, setmetatable({
on_grown = def.on_grown,
on_activate = function(self, staticdata, dtime)
if def.on_activate then
def.on_activate(self, staticdata, dtime)
end
-- self.object:set_sprite({x=0, y=0}, 4, 0.2, false)
return self:mob_activate(staticdata, def, dtime)
end,

49
mods/mobs_flat/1hour.lua Normal file
View File

@ -0,0 +1,49 @@
-- support for MT game translation.
local S = minetest.get_translator("mobs_flat")
mobs:register_mob("mobs_flat:1hour", {
type = "monster",
passive = false,
attack_type = "dogfight",
pathfinding = true,
reach = 2,
damage = 3,
hp_min = 32,
hp_max = 64,
armor = 100,
collisionbox = {-0.4, -0.5, -0.4, 0.4, 0.5, 0.4},
visual = "upright_sprite",
textures = {"mobs_flat_1hour_front.png", "mobs_flat_1hour_back.png"},
spritediv = {x = 1, y = 4},
visual_size = {x=3, y=3},
makes_footstep_sound = false,
sounds = {
random = "mobs_spider",
},
walk_velocity = 3,
run_velocity = 5,
view_range = 10,
jump = true,
drops = {
{name = "default:stone", chance = 0.5, min = 0, max = 1},
},
water_damage = 1,
lava_damage = 0,
light_damage = 0,
fear_height = 1,
floats = 1,
on_activate = function(self)
self.object:set_sprite({x=0, y=0}, 4, 0.2, false)
end,
})
mobs:spawn({
name = "mobs_flat:1hour",
nodes = {"default:stone", "default:cobble", "nether:rack", "nether:rack_deep", "nether:lava_crust"},
neighbors = {"default:lava_source", "nether:lava_source", "nether:lava_crust"},
chance = 7,
active_object_count = 2,
})
mobs:register_egg("mobs_flat:1hour", S("1hour"), "default_moltenrock.png", 1)

View File

@ -14,7 +14,7 @@ http://www.gnu.org/licenses/lgpl-2.1.html
License of media (textures and sounds)
--------------------------------------
Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
http://creativecommons.org/licenses/by-sa/3.0/
Authors of media files
@ -32,3 +32,6 @@ erlehmann (GPL version 2 or later and CC BY-SA version 3.0 or later)
cisoun (WTFPL)
mobs_flat_dm*
mobs_flat_rat*
Stephen "Redshrike" Challener, https://opengameart.org/users/redshrike (CC BY-SA):
mobs_flat_1hour*

View File

@ -47,8 +47,8 @@ mobs:register_mob("mobs_flat:dungeon_master", {
mobs:spawn({
name = "mobs_flat:dungeon_master",
nodes = {"default:mossycobble"},
neighbors = {"default:mese", "default:stone_with_mese", "default:lava_source"},
nodes = {"default:mossycobble", "nether:rack", "nether:rack_deep"},
neighbors = {"default:mese", "default:stone_with_mese", "nether:rack", "default:mossycobble"},
chance = 70,
active_object_count = 2,
})

View File

@ -10,3 +10,4 @@ dofile(path .. "/omsk.lua")
dofile(path .. "/dustdevil.lua")
dofile(path .. "/rat.lua")
dofile(path .. "/dungeonmaster.lua")
dofile(path .. "/1hour.lua")

View File

@ -40,7 +40,7 @@ mobs:register_mob("mobs_flat:omsk", {
mobs:spawn({
name = "mobs_flat:omsk",
nodes = {"default:stone", "default:cobble", "default:mossycobble"},
neighbors = {"default:stone_with_iron"},
neighbors = {"default:stone_with_iron", "default:mossycobble"},
chance = 7,
active_object_count = 1
})

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.1 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.4 KiB