1
0
Fork 0
MineClone2/mods/ENTITIES/mobs_mc/silverfish.lua

141 lines
4.1 KiB
Lua
Raw Normal View History

2017-07-05 01:15:46 +00:00
--###################
--################### SILVERFISH
--###################
local S = minetest.get_translator("mobs_mc")
2017-07-05 01:15:46 +00:00
mcl_mobs.register_mob("mobs_mc:silverfish", {
2021-04-25 15:30:15 +00:00
description = S("Silverfish"),
2017-07-05 01:15:46 +00:00
type = "monster",
2020-04-11 00:46:03 +00:00
spawn_class = "hostile",
2017-07-05 01:15:46 +00:00
passive = false,
group_attack = true,
reach = 1,
hp_min = 8,
hp_max = 8,
2020-12-06 14:46:42 +00:00
xp_min = 5,
xp_max = 5,
2020-11-09 17:59:08 +00:00
armor = {fleshy = 100, arthropod = 100},
2017-07-05 01:15:46 +00:00
collisionbox = {-0.4, -0.01, -0.4, 0.4, 0.44, 0.4},
visual = "mesh",
mesh = "mobs_mc_silverfish.b3d",
textures = {
{"mobs_mc_silverfish.png"},
},
pathfinding = 1,
visual_size = {x=3, y=3},
sounds = {
random = "mobs_mc_silverfish_idle",
death = "mobs_mc_silverfish_death",
damage = "mobs_mc_silverfish_hurt",
distance = 16,
},
2017-07-05 01:15:46 +00:00
makes_footstep_sound = false,
walk_velocity = 0.6,
run_velocity = 2,
jump = true,
fear_height = 4,
2022-05-25 21:25:15 +00:00
replace_what = {
{"mcl_core:stone", "mcl_monster_eggs:monster_egg_stone", -1},
{"mcl_core:cobble", "mcl_monster_eggs:monster_egg_cobble", -1},
{"mcl_core:stonebrick", "mcl_monster_eggs:monster_egg_stonebrick", -1},
{"mcl_core:stonebrickmossy", "mcl_monster_eggs:monster_egg_stonebrickmossy", -1},
{"mcl_core:stonebrickcracked", "mcl_monster_eggs:monster_egg_stonebrickcracked", -1},
{"mcl_core:stonebrickcarved", "mcl_monster_eggs:monster_egg_stonebrickcarved", -1},
},
2017-07-05 01:15:46 +00:00
replace_rate = 2,
animation = {
speed_normal = 25, speed_run = 50,
stand_start = 0, stand_end = 20,
walk_start = 0, walk_end = 20,
run_start = 0, run_end = 20,
},
view_range = 16,
attack_type = "dogfight",
2017-07-05 01:15:46 +00:00
damage = 1,
reach = 1,
2017-07-05 01:15:46 +00:00
})
mcl_mobs.register_egg("mobs_mc:silverfish", S("Silverfish"), "#6d6d6d", "#313131", 0)
2017-07-05 01:15:46 +00:00
-- Monster egg blocks (Minetest Game)
if minetest.get_modpath("default") and mobs_mc.create_monster_egg_nodes then
local spawn_silverfish = function(pos, oldnode, oldmetadata, digger)
2020-07-10 14:08:40 +00:00
if not minetest.is_creative_enabled(digger:get_player_name()) then
2017-07-05 01:15:46 +00:00
minetest.add_entity(pos, "mobs_mc:silverfish")
end
end
minetest.register_node("mobs_mc:monster_egg_stone", {
description = "Stone Monster Egg",
2017-07-05 01:15:46 +00:00
tiles = {"default_stone.png"},
groups = {oddly_breakable_by_hand = 2, spawns_silverfish = 1},
drop = '',
2017-07-05 01:15:46 +00:00
is_ground_content = true,
sounds = default.node_sound_stone_defaults(),
after_dig_node = spawn_silverfish,
})
minetest.register_node("mobs_mc:monster_egg_cobble", {
description = "Cobblestone Monster Egg",
2017-07-05 01:15:46 +00:00
tiles = {"default_cobble.png"},
is_ground_content = false,
groups = {oddly_breakable_by_hand = 2, spawns_silverfish = 1},
drop = '',
2017-07-05 01:15:46 +00:00
sounds = default.node_sound_stone_defaults(),
after_dig_node = spawn_silverfish,
})
minetest.register_node("mobs_mc:monster_egg_mossycobble", {
description = "Mossy Cobblestone Monster Egg",
2017-07-05 01:15:46 +00:00
tiles = {"default_mossycobble.png"},
is_ground_content = false,
groups = {oddly_breakable_by_hand = 2, spawns_silverfish = 1},
drop = '',
2017-07-05 01:15:46 +00:00
sounds = default.node_sound_stone_defaults(),
after_dig_node = spawn_silverfish,
})
minetest.register_node("mobs_mc:monster_egg_stonebrick", {
description = "Stone Brick Monster Egg",
2017-07-05 01:15:46 +00:00
paramtype2 = "facedir",
place_param2 = 0,
tiles = {"default_stone_brick.png"},
is_ground_content = false,
groups = {oddly_breakable_by_hand = 2, spawns_silverfish = 1},
drop = '',
2017-07-05 01:15:46 +00:00
sounds = default.node_sound_stone_defaults(),
after_dig_node = spawn_silverfish,
})
minetest.register_node("mobs_mc:monster_egg_stone_block", {
description = "Stone Block Monster Egg",
2017-07-05 01:15:46 +00:00
tiles = {"default_stone_block.png"},
is_ground_content = false,
groups = {oddly_breakable_by_hand = 2, spawns_silverfish = 1},
drop = '',
2017-07-05 01:15:46 +00:00
sounds = default.node_sound_stone_defaults(),
after_dig_node = spawn_silverfish,
})
-- Randomly spawn stone monster eggs in the world
local mg_name = minetest.get_mapgen_setting("mg_name")
local scarcity
if mg_name == "v6" then
scarcity = 28 * 28 * 28
else
scarcity = 22 * 22 * 22
end
minetest.register_ore({
ore_type = "scatter",
ore = "mobs_mc:monster_egg_stone",
wherein = "default:stone",
clust_scarcity = scarcity,
clust_num_ores = 3,
clust_size = 2,
y_min = -31000,
y_max = 31000,
biomes = { "grassland" },
})
end