Skip to content
GitLab
Menu
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Illuna-Minetest
mobs_monster
Commits
22308b4c
Commit
22308b4c
authored
Mar 01, 2021
by
tenplus1
Browse files
add different dirt and stone type monsters
parent
05ccc871
Changes
6
Hide whitespace changes
Inline
Side-by-side
dirt_monster.lua
View file @
22308b4c
local
S
=
mobs
.
intllib
local
dirt_types
=
{
{
nodes
=
{
"ethereal:dry_dirt"
},
skins
=
{
"mobs_dirt_monster3.png"
},
drops
=
{
{
name
=
"ethereal:dry_dirt"
,
chance
=
1
,
min
=
0
,
max
=
2
}
}
}
}
-- Dirt Monster by PilzAdam
...
...
@@ -19,6 +29,7 @@ mobs:register_mob("mobs_monster:dirt_monster", {
mesh
=
"mobs_stone_monster.b3d"
,
textures
=
{
{
"mobs_dirt_monster.png"
},
{
"mobs_dirt_monster2.png"
},
},
blood_texture
=
"default_dirt.png"
,
makes_footstep_sound
=
true
,
...
...
@@ -48,19 +59,39 @@ mobs:register_mob("mobs_monster:dirt_monster", {
punch_start
=
40
,
punch_end
=
63
,
},
})
-- check surrounding nodes and spawn a specific spider
on_spawn
=
function
(
self
)
local
spawn_on
=
"default:dirt_with_grass"
local
pos
=
self
.
object
:
get_pos
()
;
pos
.
y
=
pos
.
y
-
1
local
tmp
for
n
=
1
,
#
dirt_types
do
tmp
=
dirt_types
[
n
]
if
minetest
.
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
return
true
end
end
return
true
-- run only once, false/nil runs every activation
end
})
if
minetest
.
get_modpath
(
"ethereal"
)
then
spawn_on
=
"ethereal:gray_dirt"
end
if
not
mobs
.
custom_spawn_monster
then
mobs
:
spawn
({
name
=
"mobs_monster:dirt_monster"
,
nodes
=
{
spawn_on
},
nodes
=
{
"default:dirt_with_grass"
,
"ethereal:gray_dirt"
,
"ethereal:dry_dirt"
},
min_light
=
0
,
max_light
=
7
,
chance
=
6000
,
...
...
stone_monster.lua
View file @
22308b4c
local
S
=
mobs
.
intllib
local
stone_types
=
{
{
nodes
=
{
"default:desert_stone"
},
skins
=
{
"mobs_stone_monster3.png"
},
drops
=
{
{
name
=
"default:desert_cobble"
,
chance
=
1
,
min
=
0
,
max
=
2
},
{
name
=
"default:iron_lump"
,
chance
=
5
,
min
=
0
,
max
=
2
},
{
name
=
"default:gold_lump"
,
chance
=
5
,
min
=
0
,
max
=
2
}
}
}
}
-- Stone Monster by PilzAdam
...
...
@@ -34,7 +46,7 @@ mobs:register_mob("mobs_monster:stone_monster", {
drops
=
{
{
name
=
"default:cobble"
,
chance
=
1
,
min
=
0
,
max
=
2
},
{
name
=
"default:coal_lump"
,
chance
=
3
,
min
=
0
,
max
=
2
},
{
name
=
"default:iron_lump"
,
chance
=
5
,
min
=
0
,
max
=
2
}
,
{
name
=
"default:iron_lump"
,
chance
=
5
,
min
=
0
,
max
=
2
}
},
water_damage
=
0
,
lava_damage
=
1
,
...
...
@@ -59,6 +71,32 @@ mobs:register_mob("mobs_monster:stone_monster", {
{
"default:pick_mese"
,
6
},
{
"default:pick_diamond"
,
7
},
},
-- check surrounding nodes and spawn a specific spider
on_spawn
=
function
(
self
)
local
pos
=
self
.
object
:
get_pos
()
;
pos
.
y
=
pos
.
y
-
1
local
tmp
for
n
=
1
,
#
stone_types
do
tmp
=
stone_types
[
n
]
if
minetest
.
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
return
true
end
end
return
true
-- run only once, false/nil runs every activation
end
})
...
...
textures/mobs_dirt_monster2.png
0 → 100644
View file @
22308b4c
594 Bytes
textures/mobs_dirt_monster3.png
0 → 100644
View file @
22308b4c
610 Bytes
textures/mobs_stone_monster2.png
View replaced file @
05ccc871
View file @
22308b4c
3.6 KB
|
W:
|
H:
757 Bytes
|
W:
|
H:
2-up
Swipe
Onion skin
textures/mobs_stone_monster3.png
0 → 100644
View file @
22308b4c
3.6 KB
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment