Code tidy
parent
7ed926a4c5
commit
5a4c8c74fb
12
bee.lua
12
bee.lua
|
@ -21,7 +21,7 @@ mobs:register_mob("mobs:bee", {
|
|||
jump = true,
|
||||
drops = {
|
||||
{name = "mobs:honey",
|
||||
chance = 1, min = 1, max = 2,},
|
||||
chance = 1, min = 1, max = 2},
|
||||
},
|
||||
water_damage = 1,
|
||||
lava_damage = 1,
|
||||
|
@ -56,16 +56,16 @@ minetest.register_node("mobs:beehive", {
|
|||
description = "Beehive",
|
||||
drawtype = "plantlike",
|
||||
visual_scale = 1.0,
|
||||
tiles ={"mobs_beehive.png"},
|
||||
tiles = {"mobs_beehive.png"},
|
||||
inventory_image = "mobs_beehive.png",
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
walkable = true,
|
||||
groups = {fleshy=3,dig_immediate=3},
|
||||
groups = {fleshy = 3, dig_immediate = 3},
|
||||
sounds = default.node_sound_defaults(),
|
||||
after_place_node = function(pos, placer, itemstack)
|
||||
if placer:is_player() then
|
||||
minetest.set_node(pos, {name="mobs:beehive", param2=1})
|
||||
minetest.set_node(pos, {name = "mobs:beehive", param2 = 1})
|
||||
minetest.add_entity(pos, "mobs:bee")
|
||||
end
|
||||
end,
|
||||
|
@ -83,7 +83,7 @@ minetest.register_craft({
|
|||
minetest.register_node("mobs:honey_block", {
|
||||
description = "Honey Block",
|
||||
tiles = {"mobs_honey_block.png"},
|
||||
groups = {snappy=3,flammable=2},
|
||||
groups = {snappy = 3, flammable = 2},
|
||||
sounds = default.node_sound_dirt_defaults(),
|
||||
})
|
||||
|
||||
|
@ -101,4 +101,4 @@ minetest.register_craft({
|
|||
recipe = {
|
||||
{"mobs:honey_block"},
|
||||
}
|
||||
})
|
||||
})
|
33
bunny.lua
33
bunny.lua
|
@ -2,13 +2,11 @@
|
|||
-- Bunny by ExeterDad
|
||||
|
||||
mobs:register_mob("mobs:bunny", {
|
||||
-- animal, monster, npc
|
||||
type = "animal",
|
||||
-- is it aggressive
|
||||
passive = true,
|
||||
-- health & armor
|
||||
hp_min = 1, hp_max = 4, armor = 200,
|
||||
-- textures and model
|
||||
hp_min = 1,
|
||||
hp_max = 4,
|
||||
armor = 200,
|
||||
collisionbox = {-0.268, -0.5, -0.268, 0.268, 0.167, 0.268},
|
||||
visual = "mesh",
|
||||
mesh = "mobs_bunny.b3d",
|
||||
|
@ -18,36 +16,32 @@ mobs:register_mob("mobs:bunny", {
|
|||
{"mobs_bunny_brown.png"},
|
||||
{"mobs_bunny_white.png"},
|
||||
},
|
||||
-- sounds
|
||||
sounds = {},
|
||||
makes_footstep_sound = false,
|
||||
-- speed and jump
|
||||
walk_velocity = 1, run_velocity = 2,
|
||||
walk_velocity = 1,
|
||||
run_velocity = 2,
|
||||
jump = true,
|
||||
-- drops meat when dead
|
||||
drops = {
|
||||
{name = "mobs:meat_raw",
|
||||
chance = 1, min = 1, max = 2,},
|
||||
chance = 1, min = 1, max = 2},
|
||||
},
|
||||
-- damaged by
|
||||
water_damage = 1,
|
||||
lava_damage = 4,
|
||||
light_damage = 0,
|
||||
-- model animation
|
||||
animation = {
|
||||
speed_normal = 15,
|
||||
stand_start = 1, stand_end = 15,
|
||||
walk_start = 16, walk_end = 24,
|
||||
punch_start = 16, punch_end = 24,
|
||||
stand_start = 1,
|
||||
stand_end = 15,
|
||||
walk_start = 16,
|
||||
walk_end = 24,
|
||||
punch_start = 16,
|
||||
punch_end = 24,
|
||||
},
|
||||
-- follows carrot from farming redo
|
||||
follow = "farming:carrot",
|
||||
view_range = 5,
|
||||
-- eat carrots
|
||||
replace_rate = 80,
|
||||
replace_what = {"farming:carrot_7", "farming:carrot_8", "farming_plus:carrot"},
|
||||
replace_with = "air",
|
||||
-- right click to pick up rabbit
|
||||
on_rightclick = function(self, clicker)
|
||||
local item = clicker:get_wielded_item()
|
||||
local name = clicker:get_player_name()
|
||||
|
@ -95,4 +89,5 @@ mobs:register_mob("mobs:bunny", {
|
|||
})
|
||||
|
||||
mobs:register_spawn("mobs:bunny", {"default:dirt_with_grass", "ethereal:prairie_dirt"}, 20, 10, 15000, 1, 31000)
|
||||
mobs:register_egg("mobs:bunny", "Bunny", "mobs_bunny_inv.png", 0)
|
||||
|
||||
mobs:register_egg("mobs:bunny", "Bunny", "mobs_bunny_inv.png", 0)
|
10
chicken.lua
10
chicken.lua
|
@ -10,6 +10,7 @@ mobs:register_mob("mobs:chicken", {
|
|||
collisionbox = {-0.3, -0.75, -0.3, 0.3, 0.1, 0.3},
|
||||
visual = "mesh",
|
||||
mesh = "mobs_chicken.x",
|
||||
-- seems a lot of textures but this fixes the problem with the model
|
||||
textures = {
|
||||
{"mobs_chicken.png", "mobs_chicken.png", "mobs_chicken.png", "mobs_chicken.png",
|
||||
"mobs_chicken.png", "mobs_chicken.png", "mobs_chicken.png", "mobs_chicken.png", "mobs_chicken.png"},
|
||||
|
@ -44,7 +45,7 @@ mobs:register_mob("mobs:chicken", {
|
|||
},
|
||||
follow = "farming:seed_wheat",
|
||||
view_range = 5,
|
||||
replace_rate = 4000,
|
||||
replace_rate = 8000,
|
||||
replace_what = {"air"},
|
||||
replace_with = "mobs:egg",
|
||||
on_rightclick = function(self, clicker)
|
||||
|
@ -75,7 +76,8 @@ mobs:register_mob("mobs:chicken", {
|
|||
self.owner = name
|
||||
end
|
||||
minetest.sound_play("mobs_chicken", {
|
||||
object = self.object,gain = 1.0,
|
||||
object = self.object,
|
||||
gain = 1.0,
|
||||
max_hear_distance = 15,
|
||||
loop = false,
|
||||
})
|
||||
|
@ -110,7 +112,7 @@ minetest.register_node("mobs:egg", {
|
|||
groups = {snappy=2, dig_immediate=3},
|
||||
after_place_node = function(pos, placer, itemstack)
|
||||
if placer:is_player() then
|
||||
minetest.set_node(pos, {name="mobs:egg", param2=1})
|
||||
minetest.set_node(pos, {name = "mobs:egg", param2 = 1})
|
||||
end
|
||||
end
|
||||
})
|
||||
|
@ -146,4 +148,4 @@ minetest.register_craft({
|
|||
type = "cooking",
|
||||
recipe = "mobs:chicken_raw",
|
||||
output = "mobs:chicken_cooked",
|
||||
})
|
||||
})
|
24
cow.lua
24
cow.lua
|
@ -15,7 +15,6 @@ mobs:register_mob("mobs:cow", {
|
|||
textures = {
|
||||
{"mobs_cow.png"},
|
||||
},
|
||||
visual_size = {x=1,y=1},
|
||||
makes_footstep_sound = true,
|
||||
sounds = {
|
||||
random = "mobs_cow",
|
||||
|
@ -33,11 +32,16 @@ mobs:register_mob("mobs:cow", {
|
|||
lava_damage = 5,
|
||||
light_damage = 0,
|
||||
animation = {
|
||||
speed_normal = 15, speed_run = 15,
|
||||
stand_start = 0, stand_end = 30,
|
||||
walk_start = 35, walk_end = 65,
|
||||
run_start = 105, run_end = 135,
|
||||
punch_start = 70, punch_end = 100,
|
||||
speed_normal = 15,
|
||||
speed_run = 15,
|
||||
stand_start = 0,
|
||||
stand_end = 30,
|
||||
walk_start = 35,
|
||||
walk_end = 65,
|
||||
run_start = 105,
|
||||
run_end = 135,
|
||||
punch_start = 70,
|
||||
punch_end = 100,
|
||||
},
|
||||
follow = "farming:wheat",
|
||||
view_range = 7,
|
||||
|
@ -55,7 +59,7 @@ mobs:register_mob("mobs:cow", {
|
|||
end
|
||||
local inv = clicker:get_inventory()
|
||||
inv:remove_item("main", "bucket:bucket_empty")
|
||||
if inv:room_for_item("main", {name="mobs:bucket_milk"}) then
|
||||
if inv:room_for_item("main", {name = "mobs:bucket_milk"}) then
|
||||
clicker:get_inventory():add_item("main", "mobs:bucket_milk")
|
||||
else
|
||||
local pos = self.object:getpos()
|
||||
|
@ -93,7 +97,7 @@ mobs:register_mob("mobs:cow", {
|
|||
minetest.sound_play("mobs_cow", {
|
||||
object = self.object,
|
||||
gain = 1.0,
|
||||
max_hear_distance = 32,
|
||||
max_hear_distance = 10,
|
||||
loop = false,
|
||||
})
|
||||
end
|
||||
|
@ -142,7 +146,7 @@ minetest.register_node("mobs:cheeseblock", {
|
|||
description = "Cheese Block",
|
||||
tiles = {"mobs_cheeseblock.png"},
|
||||
is_ground_content = false,
|
||||
groups = {crumbly=3},
|
||||
groups = {crumbly = 3},
|
||||
sounds = default.node_sound_dirt_defaults()
|
||||
})
|
||||
|
||||
|
@ -160,4 +164,4 @@ minetest.register_craft({
|
|||
recipe = {
|
||||
{'mobs:cheeseblock'},
|
||||
}
|
||||
})
|
||||
})
|
12
crafts.lua
12
crafts.lua
|
@ -1,12 +1,12 @@
|
|||
|
||||
-- Meat & Cooked Meat
|
||||
|
||||
-- raw meat
|
||||
minetest.register_craftitem("mobs:meat_raw", {
|
||||
description = "Raw Meat",
|
||||
inventory_image = "mobs_meat_raw.png",
|
||||
on_use = minetest.item_eat(3),
|
||||
})
|
||||
|
||||
-- cooked meat
|
||||
minetest.register_craftitem("mobs:meat", {
|
||||
description = "Meat",
|
||||
inventory_image = "mobs_meat.png",
|
||||
|
@ -20,8 +20,7 @@ minetest.register_craft({
|
|||
cooktime = 5,
|
||||
})
|
||||
|
||||
-- Golden Lasso
|
||||
|
||||
-- golden lasso
|
||||
minetest.register_tool("mobs:magic_lasso", {
|
||||
description = "Magic Lasso (right-click animal to put in inventory)",
|
||||
inventory_image = "mobs_magic_lasso.png",
|
||||
|
@ -36,8 +35,7 @@ minetest.register_craft({
|
|||
}
|
||||
})
|
||||
|
||||
-- Net
|
||||
|
||||
-- net
|
||||
minetest.register_tool("mobs:net", {
|
||||
description = "Net (right-click animal to put in inventory)",
|
||||
inventory_image = "mobs_net.png",
|
||||
|
@ -50,4 +48,4 @@ minetest.register_craft({
|
|||
{"default:stick", "", "default:stick"},
|
||||
{"farming:string", "default:stick", "farming:string"},
|
||||
}
|
||||
})
|
||||
})
|
|
@ -9,13 +9,12 @@ mobs:register_mob("mobs:dirt_monster", {
|
|||
hp_min = 3,
|
||||
hp_max = 27,
|
||||
armor = 100,
|
||||
collisionbox = {-0.4, -0.01, -0.4, 0.4, 1.9, 0.4},
|
||||
collisionbox = {-0.4, -1, -0.4, 0.4, 0.8, 0.4},
|
||||
visual = "mesh",
|
||||
mesh = "mobs_stone_monster.x",
|
||||
mesh = "mobs_stone_monster.b3d",
|
||||
textures = {
|
||||
{"mobs_dirt_monster.png"},
|
||||
},
|
||||
visual_size = {x=3, y=2.6},
|
||||
blood_texture = "default_dirt.png",
|
||||
makes_footstep_sound = true,
|
||||
sounds = {
|
||||
|
@ -33,14 +32,19 @@ mobs:register_mob("mobs:dirt_monster", {
|
|||
lava_damage = 5,
|
||||
light_damage = 2,
|
||||
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,
|
||||
},
|
||||
})
|
||||
|
||||
mobs:register_spawn("mobs:dirt_monster", {"default:dirt_with_grass", "ethereal:gray_dirt"}, 5, 0, 7000, 1, 31000)
|
||||
|
||||
mobs:register_egg("mobs:dirt_monster", "Dirt Monster", "default_dirt.png", 1)
|
||||
mobs:register_egg("mobs:dirt_monster", "Dirt Monster", "default_dirt.png", 1)
|
|
@ -20,7 +20,6 @@ mobs:register_mob("mobs:dungeon_master", {
|
|||
{"mobs_dungeon_master2.png"},
|
||||
{"mobs_dungeon_master3.png"},
|
||||
},
|
||||
visual_size = {x=1, y=1},
|
||||
makes_footstep_sound = true,
|
||||
sounds = {
|
||||
random = "mobs_dungeonmaster",
|
||||
|
@ -32,22 +31,26 @@ mobs:register_mob("mobs:dungeon_master", {
|
|||
view_range = 15,
|
||||
drops = {
|
||||
{name = "default:mese_crystal_fragment",
|
||||
chance = 1, min = 1, max = 3,},
|
||||
chance = 1, min = 1, max = 3},
|
||||
{name = "default:diamond",
|
||||
chance = 4, min = 1, max = 1,},
|
||||
chance = 4, min = 1, max = 1},
|
||||
{name = "default:mese_crystal",
|
||||
chance = 2, min = 1, max = 2,},
|
||||
chance = 2, min = 1, max = 2},
|
||||
{name = "default:diamond_block",
|
||||
chance = 30, min = 1, max = 1,},
|
||||
chance = 30, min = 1, max = 1},
|
||||
},
|
||||
water_damage = 1,
|
||||
lava_damage = 1,
|
||||
light_damage = 0,
|
||||
animation = {
|
||||
stand_start = 0, stand_end = 19,
|
||||
walk_start = 20, walk_end = 35,
|
||||
punch_start = 36, punch_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,
|
||||
speed_normal = 15,
|
||||
speed_run = 15,
|
||||
},
|
||||
})
|
||||
|
||||
|
@ -58,22 +61,22 @@ mobs:register_egg("mobs:dungeon_master", "Dungeon Master", "fire_basic_flame.png
|
|||
-- fireball (weapon)
|
||||
mobs:register_arrow("mobs:fireball", {
|
||||
visual = "sprite",
|
||||
visual_size = {x=1, y=1},
|
||||
visual_size = {x = 1, y = 1},
|
||||
textures = {"mobs_fireball.png"},
|
||||
velocity = 6,
|
||||
|
||||
-- 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},
|
||||
full_punch_interval = 1.0,
|
||||
damage_groups = {fleshy = 8},
|
||||
}, 0)
|
||||
end,
|
||||
|
||||
hit_mob = function(self, player)
|
||||
player:punch(self.object, 1.0, {
|
||||
full_punch_interval=1.0,
|
||||
damage_groups = {fleshy=8},
|
||||
full_punch_interval = 1.0,
|
||||
damage_groups = {fleshy = 8},
|
||||
}, 0)
|
||||
end,
|
||||
|
||||
|
@ -81,4 +84,4 @@ mobs:register_arrow("mobs:fireball", {
|
|||
hit_node = function(self, pos, node)
|
||||
mobs:explosion(pos, 1, 1, 0)
|
||||
end
|
||||
})
|
||||
})
|
2
init.lua
2
init.lua
|
@ -35,4 +35,4 @@ dofile(path.."/crafts.lua")
|
|||
|
||||
if minetest.setting_get("log_mods") then
|
||||
minetest.log("action", "mobs loaded")
|
||||
end
|
||||
end
|
27
kitten.lua
27
kitten.lua
|
@ -2,16 +2,14 @@
|
|||
-- Kitten by Jordach / BFD
|
||||
|
||||
mobs:register_mob("mobs:kitten", {
|
||||
-- animal, monster, npc
|
||||
type = "animal",
|
||||
-- is it aggressive
|
||||
passive = true,
|
||||
-- health & armor
|
||||
hp_min = 5, hp_max = 10, armor = 200,
|
||||
-- textures and model
|
||||
hp_min = 5,
|
||||
hp_max = 10,
|
||||
armor = 200,
|
||||
collisionbox = {-0.3, -0.3, -0.3, 0.3, 0.1, 0.3},
|
||||
visual = "mesh",
|
||||
visual_size = {x=0.5, y=0.5},
|
||||
visual_size = {x = 0.5, y = 0.5},
|
||||
mesh = "mobs_kitten.b3d",
|
||||
textures = {
|
||||
{"mobs_kitten_striped.png"},
|
||||
|
@ -19,33 +17,27 @@ mobs:register_mob("mobs:kitten", {
|
|||
{"mobs_kitten_ginger.png"},
|
||||
{"mobs_kitten_sandy.png"},
|
||||
},
|
||||
blood_texture = "mobs_blood.png",
|
||||
-- sounds
|
||||
makes_footstep_sound = false,
|
||||
sounds = {
|
||||
random = "mobs_kitten",
|
||||
},
|
||||
-- speed and jump
|
||||
walk_velocity = 0.6,
|
||||
jump = false,
|
||||
-- drops string
|
||||
drops = {
|
||||
{name = "farming:string",
|
||||
chance = 1, min = 1, max = 1},
|
||||
},
|
||||
-- damaged by
|
||||
water_damage = 1,
|
||||
lava_damage = 5,
|
||||
-- model animation
|
||||
animation = {
|
||||
speed_normal = 42,
|
||||
stand_start = 97, stand_end = 192,
|
||||
walk_start = 0, walk_end = 96,
|
||||
stand_start = 97,
|
||||
stand_end = 192,
|
||||
walk_start = 0,
|
||||
walk_end = 96,
|
||||
},
|
||||
-- follows rat
|
||||
follow = "mobs:rat",
|
||||
view_range = 8,
|
||||
-- feed with raw fish to tame or right click to pick up
|
||||
on_rightclick = function(self, clicker)
|
||||
local item = clicker:get_wielded_item()
|
||||
local name = clicker:get_player_name()
|
||||
|
@ -81,4 +73,5 @@ mobs:register_mob("mobs:kitten", {
|
|||
})
|
||||
|
||||
mobs:register_spawn("mobs:kitten", {"default:dirt_with_grass", "ethereal:grove_dirt"}, 20, 12, 22000, 1, 31000)
|
||||
mobs:register_egg("mobs:kitten", "Kitten", "mobs_kitten_inv.png", 0)
|
||||
|
||||
mobs:register_egg("mobs:kitten", "Kitten", "mobs_kitten_inv.png", 0)
|
|
@ -16,7 +16,6 @@ mobs:register_mob("mobs:lava_flan", {
|
|||
{"zmobs_lava_flan.png"},
|
||||
},
|
||||
blood_texture = "fire_basic_flame.png",
|
||||
visual_size = {x=1, y=1},
|
||||
makes_footstep_sound = false,
|
||||
sounds = {
|
||||
random = "mobs_lavaflan",
|
||||
|
@ -29,20 +28,25 @@ mobs:register_mob("mobs:lava_flan", {
|
|||
floats = 0,
|
||||
drops = {
|
||||
{name = "mobs:lava_orb",
|
||||
chance = 15, min = 1, max = 1,},
|
||||
chance = 15, min = 1, max = 1},
|
||||
},
|
||||
water_damage = 5,
|
||||
lava_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,
|
||||
},
|
||||
on_die = function(self, pos)
|
||||
minetest.set_node(pos, {name="fire:basic_flame"})
|
||||
minetest.set_node(pos, {name = "fire:basic_flame"})
|
||||
end,
|
||||
})
|
||||
|
||||
|
@ -56,4 +60,4 @@ minetest.register_craftitem("mobs:lava_orb", {
|
|||
inventory_image = "zmobs_lava_orb.png",
|
||||
})
|
||||
|
||||
minetest.register_alias("zmobs:lava_orb", "mobs:lava_orb")
|
||||
minetest.register_alias("zmobs:lava_orb", "mobs:lava_orb")
|
|
@ -18,7 +18,6 @@ mobs:register_mob("mobs:mese_monster", {
|
|||
textures = {
|
||||
{"zmobs_mese_monster.png"},
|
||||
},
|
||||
visual_size = {x=1, y=1},
|
||||
blood_texture = "default_mese_crystal_fragment.png",
|
||||
makes_footstep_sound = false,
|
||||
sounds = {
|
||||
|
@ -33,19 +32,24 @@ mobs:register_mob("mobs:mese_monster", {
|
|||
fall_speed = -6,
|
||||
drops = {
|
||||
{name = "default:mese_crystal",
|
||||
chance = 9, min = 1, max = 3,},
|
||||
chance = 9, min = 1, max = 3},
|
||||
{name = "default:mese_crystal_fragment",
|
||||
chance = 1, min = 1, max = 9,},
|
||||
chance = 1, min = 1, max = 9},
|
||||
},
|
||||
water_damage = 0,
|
||||
lava_damage = 0,
|
||||
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 = 15, punch_end = 38, -- was 40 & 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 = 15, -- was 40
|
||||
punch_end = 38, -- was 63
|
||||
},
|
||||
})
|
||||
|
||||
|
@ -56,21 +60,21 @@ mobs:register_egg("mobs:mese_monster", "Mese Monster", "default_mese_block.png",
|
|||
-- mese arrow (weapon)
|
||||
mobs:register_arrow("mobs:mese_arrow", {
|
||||
visual = "sprite",
|
||||
visual_size = {x=.5, y=.5},
|
||||
visual_size = {x = 0.5, y = 0.5},
|
||||
textures = {"default_mese_crystal_fragment.png"},
|
||||
velocity = 6,
|
||||
|
||||
hit_player = function(self, player)
|
||||
player:punch(self.object, 1.0, {
|
||||
full_punch_interval=1.0,
|
||||
damage_groups = {fleshy=1},
|
||||
full_punch_interval = 1.0,
|
||||
damage_groups = {fleshy = 1},
|
||||
}, 0)
|
||||
end,
|
||||
|
||||
hit_mob = function(self, player)
|
||||
player:punch(self.object, 1.0, {
|
||||
full_punch_interval=1.0,
|
||||
damage_groups = {fleshy=1},
|
||||
full_punch_interval = 1.0,
|
||||
damage_groups = {fleshy = 1},
|
||||
}, 0)
|
||||
end,
|
||||
|
||||
|
@ -86,4 +90,4 @@ minetest.register_craft({
|
|||
{"default:mese_crystal_fragment", "default:mese_crystal_fragment", "default:mese_crystal_fragment"},
|
||||
{"default:mese_crystal_fragment", "default:mese_crystal_fragment", "default:mese_crystal_fragment"},
|
||||
}
|
||||
})
|
||||
})
|
54
npc.lua
54
npc.lua
|
@ -1,19 +1,20 @@
|
|||
|
||||
-- Npc by TenPlus1
|
||||
|
||||
mobs.npc_drops = { "default:pick_steel", "mobs:meat", "default:sword_steel", "default:shovel_steel", "farming:bread", "bucket:bucket_water" }
|
||||
mobs.npc_drops = {
|
||||
"default:pick_steel", "mobs:meat", "default:sword_steel",
|
||||
"default:shovel_steel", "farming:bread", "bucket:bucket_water"
|
||||
}
|
||||
|
||||
mobs:register_mob("mobs:npc", {
|
||||
-- animal, monster, npc
|
||||
type = "npc",
|
||||
-- aggressive, deals 2 damage to player/monster when hit
|
||||
passive = false,
|
||||
damage = 3,
|
||||
attack_type = "dogfight",
|
||||
attacks_monsters = true,
|
||||
-- health & armor
|
||||
hp_min = 10, hp_max = 20, armor = 100,
|
||||
-- textures and model
|
||||
hp_min = 10,
|
||||
hp_max = 20,
|
||||
armor = 100,
|
||||
collisionbox = {-0.35,-1.0,-0.35, 0.35,0.8,0.35},
|
||||
visual = "mesh",
|
||||
mesh = "character.b3d",
|
||||
|
@ -22,58 +23,53 @@ mobs:register_mob("mobs:npc", {
|
|||
{"mobs_npc.png"},
|
||||
{"mobs_npc2.png"}, -- female by nuttmeg20
|
||||
},
|
||||
visual_size = {x=1, y=1},
|
||||
-- sounds
|
||||
makes_footstep_sound = true,
|
||||
sounds = {},
|
||||
-- speed and jump
|
||||
walk_velocity = 2,
|
||||
run_velocity = 3,
|
||||
jump = true,
|
||||
-- drops wood and chance of apples when dead
|
||||
drops = {
|
||||
{name = "default:wood",
|
||||
chance = 1, min = 1, max = 3},
|
||||
{name = "default:apple",
|
||||
chance = 2, min = 1, max = 2},
|
||||
{name = "default:axe_stone",
|
||||
chance = 3, min = 1, max = 1},
|
||||
chance = 5, min = 1, max = 1},
|
||||
},
|
||||
-- damaged by
|
||||
water_damage = 0,
|
||||
lava_damage = 2,
|
||||
light_damage = 0,
|
||||
-- follow diamond
|
||||
follow = "default:diamond",
|
||||
view_range = 15,
|
||||
-- set owner and order
|
||||
owner = "",
|
||||
order = "follow",
|
||||
-- model animation
|
||||
animation = {
|
||||
speed_normal = 30, speed_run = 30,
|
||||
stand_start = 0, stand_end = 79,
|
||||
walk_start = 168, walk_end = 187,
|
||||
run_start = 168, run_end = 187,
|
||||
punch_start = 200, punch_end = 219,
|
||||
speed_normal = 30,
|
||||
speed_run = 30,
|
||||
stand_start = 0,
|
||||
stand_end = 79,
|
||||
walk_start = 168,
|
||||
walk_end = 187,
|
||||
run_start = 168,
|
||||
run_end = 187,
|
||||
punch_start = 200,
|
||||
punch_end = 219,
|
||||
},
|
||||
-- right clicking with cooked meat will give npc more health
|
||||
on_rightclick = function(self, clicker)
|
||||
local item = clicker:get_wielded_item()
|
||||
local name = clicker:get_player_name()
|
||||
|
||||
-- heal npc
|
||||
-- feed to heal npc
|
||||
if item:get_name() == "mobs:meat"
|
||||
or item:get_name() == "farming:bread" then
|
||||
-- feed and add health
|
||||
|
||||
local hp = self.object:get_hp()
|
||||
-- return if full health
|
||||
if hp >= self.hp_max then
|
||||
minetest.chat_send_player(name, "NPC at full health.")
|
||||
return
|
||||
end
|
||||
hp = hp + 4 -- add restorative value
|
||||
-- new health shouldn't exceed self.hp_max
|
||||
hp = hp + 4
|
||||
if hp > self.hp_max then hp = self.hp_max end
|
||||
self.object:set_hp(hp)
|
||||
-- take item
|
||||
|
@ -90,7 +86,7 @@ mobs:register_mob("mobs:npc", {
|
|||
end
|
||||
local pos = self.object:getpos()
|
||||
pos.y = pos.y + 0.5
|
||||
minetest.add_item(pos, {name = mobs.npc_drops[math.random(1,#mobs.npc_drops)]})
|
||||
minetest.add_item(pos, {name = mobs.npc_drops[math.random(1, #mobs.npc_drops)]})
|
||||
|
||||
else
|
||||
-- if owner switch between follow and stand
|
||||
|
@ -108,7 +104,7 @@ mobs:register_mob("mobs:npc", {
|
|||
mobs:capture_mob(self, clicker, 0, 5, 80, false, nil)
|
||||
end,
|
||||
})
|
||||
-- spawning disabled for now
|
||||
|
||||
--mobs:register_spawn("mobs:npc", {"default:dirt_with_grass"}, 20, 0, 7000, 1, 31000)
|
||||
-- register spawn egg
|
||||
mobs:register_egg("mobs:npc", "Npc", "default_brick.png", 1)
|
||||
|
||||
mobs:register_egg("mobs:npc", "Npc", "default_brick.png", 1)
|
20
oerkki.lua
20
oerkki.lua
|
@ -16,7 +16,6 @@ mobs:register_mob("mobs:oerkki", {
|
|||
{"mobs_oerkki.png"},
|
||||
{"mobs_oerkki2.png"},
|
||||
},
|
||||
visual_size = {x=1, y=1},
|
||||
makes_footstep_sound = false,
|
||||
sounds = {
|
||||
random = "mobs_oerkki",
|
||||
|
@ -27,17 +26,22 @@ mobs:register_mob("mobs:oerkki", {
|
|||
jump = true,
|
||||
drops = {
|
||||
{name = "default:obsidian",
|
||||
chance = 3, min = 1, max = 2,},
|
||||
chance = 3, min = 1, max = 2},
|
||||
},
|
||||
water_damage = 2,
|
||||
lava_damage = 4,
|
||||
light_damage = 1,
|
||||
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 = 40,
|
||||
replace_what = {"default:torch"},
|
||||
|
@ -47,4 +51,4 @@ mobs:register_mob("mobs:oerkki", {
|
|||
|
||||
mobs:register_spawn("mobs:oerkki", {"default:stone"}, 5, 0, 7000, 1, -10)
|
||||
|
||||
mobs:register_egg("mobs:oerkki", "Oerkki", "default_obsidian.png", 1)
|
||||
mobs:register_egg("mobs:oerkki", "Oerkki", "default_obsidian.png", 1)
|
2
rat.lua
2
rat.lua
|
@ -50,4 +50,4 @@ minetest.register_craft({
|
|||
output = "mobs:rat_cooked",
|
||||
recipe = "mobs:rat",
|
||||
cooktime = 5,
|
||||
})
|
||||
})
|
|
@ -15,7 +15,6 @@ mobs:register_mob("mobs:sand_monster", {
|
|||
textures = {
|
||||
{"mobs_sand_monster.png"},
|
||||
},
|
||||
visual_size = {x=1,y=1},
|
||||
makes_footstep_sound = true,
|
||||
sounds = {
|
||||
random = "mobs_sandmonster",
|
||||
|
@ -27,20 +26,25 @@ mobs:register_mob("mobs:sand_monster", {
|
|||
floats = 0,
|
||||
drops = {
|
||||
{name = "default:desert_sand",
|
||||
chance = 1, min = 3, max = 5,},
|
||||
chance = 1, min = 3, max = 5},
|
||||
},
|
||||
water_damage = 3,
|
||||
lava_damage = 4,
|
||||
light_damage = 0,
|
||||
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,
|
||||
},
|
||||
})
|
||||
|
||||
mobs:register_spawn("mobs:sand_monster", {"default:desert_sand"}, 20, 0, 7000, 1, 31000)
|
||||
|
||||
mobs:register_egg("mobs:sand_monster", "Sand Monster", "default_desert_sand.png", 1)
|
||||
mobs:register_egg("mobs:sand_monster", "Sand Monster", "default_desert_sand.png", 1)
|
16
sheep.lua
16
sheep.lua
|
@ -13,7 +13,6 @@ mobs:register_mob("mobs:sheep", {
|
|||
textures = {
|
||||
{"mobs_sheep.png"},
|
||||
},
|
||||
visual_size = {x=1,y=1},
|
||||
gotten_texture = {"mobs_sheep_shaved.png"},
|
||||
gotten_mesh = "mobs_sheep_shaved.b3d",
|
||||
makes_footstep_sound = true,
|
||||
|
@ -32,9 +31,12 @@ mobs:register_mob("mobs:sheep", {
|
|||
lava_damage = 5,
|
||||
light_damage = 0,
|
||||
animation = {
|
||||
speed_normal = 15, speed_run = 15,
|
||||
stand_start = 0, stand_end = 80,
|
||||
walk_start = 81, walk_end = 100,
|
||||
speed_normal = 15,
|
||||
speed_run = 15,
|
||||
stand_start = 0,
|
||||
stand_end = 80,
|
||||
walk_start = 81,
|
||||
walk_end = 100,
|
||||
},
|
||||
follow = "farming:wheat",
|
||||
view_range = 5,
|
||||
|
@ -77,7 +79,7 @@ mobs:register_mob("mobs:sheep", {
|
|||
minetest.sound_play("mobs_sheep", {
|
||||
object = self.object,
|
||||
gain = 1.0,
|
||||
max_hear_distance = 20,
|
||||
max_hear_distance = 10,
|
||||
loop = false,
|
||||
})
|
||||
end
|
||||
|
@ -93,7 +95,7 @@ mobs:register_mob("mobs:sheep", {
|
|||
pos.y = pos.y + 0.5
|
||||
local obj = minetest.add_item(pos, ItemStack("wool:white "..math.random(2,3)))
|
||||
if obj then
|
||||
obj:setvelocity({x=math.random(-1,1), y=5, z=math.random(-1,1)})
|
||||
obj:setvelocity({x = math.random(-1,1), y = 5, z = math.random(-1,1)})
|
||||
end
|
||||
item:add_wear(650) -- 100 uses
|
||||
clicker:set_wielded_item(item)
|
||||
|
@ -125,4 +127,4 @@ minetest.register_craft({
|
|||
{'', 'default:steel_ingot', ''},
|
||||
{'', 'group:stick', 'default:steel_ingot'},
|
||||
}
|
||||
})
|
||||
})
|
27
spider.lua
27
spider.lua
|
@ -15,7 +15,7 @@ mobs:register_mob("mobs:spider", {
|
|||
textures = {
|
||||
{"mobs_spider.png"},
|
||||
},
|
||||
visual_size = {x=7,y=7},
|
||||
visual_size = {x = 7, y = 7},
|
||||
makes_footstep_sound = false,
|
||||
sounds = {
|
||||
random = "mobs_spider",
|
||||
|
@ -26,21 +26,26 @@ mobs:register_mob("mobs:spider", {
|
|||
jump = true,
|
||||
view_range = 15,
|
||||
floats = 0,
|
||||
drops = {
|
||||
drops = {
|
||||
{name = "farming:string",
|
||||
chance = 1, min = 1, max = 5,},
|
||||
chance = 1, min = 1, max = 5},
|
||||
{name = "ethereal:crystal_spike",
|
||||
chance = 15, min = 1, max = 2,},
|
||||
chance = 15, min = 1, max = 2},
|
||||
},
|
||||
water_damage = 5,
|
||||
lava_damage = 5,
|
||||
light_damage = 0,
|
||||
animation = {
|
||||
speed_normal = 15, speed_run = 15,
|
||||
stand_start = 1, stand_end = 1,
|
||||
walk_start = 20, walk_end = 40,
|
||||
run_start = 20, run_end = 40,
|
||||
punch_start = 50, punch_end = 90,
|
||||
speed_normal = 15,
|
||||
speed_run = 15,
|
||||
stand_start = 1,
|
||||
stand_end = 1,
|
||||
walk_start = 20,
|
||||
walk_end = 40,
|
||||
run_start = 20,
|
||||
run_end = 40,
|
||||
punch_start = 50,
|
||||
punch_end = 90,
|
||||
},
|
||||
})
|
||||
|
||||
|
@ -69,7 +74,7 @@ minetest.register_node("mobs:cobweb", {
|
|||
liquid_renewable = false,
|
||||
liquid_range = 0,
|
||||
walkable = false,
|
||||
groups = {snappy=1,liquid=3},
|
||||
groups = {snappy = 1, liquid = 3},
|
||||
drop = "farming:cotton",
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
})
|
||||
|
@ -81,4 +86,4 @@ minetest.register_craft({
|
|||
{"", "farming:string", ""},
|
||||
{"farming:string", "", "farming:string"},
|
||||
}
|
||||
})
|
||||
})
|
|
@ -15,7 +15,6 @@ mobs:register_mob("mobs:stone_monster", {
|
|||
textures = {
|
||||
{"mobs_stone_monster.png"},
|
||||
},
|
||||
visual_size = {x=1, y=1},
|
||||
makes_footstep_sound = true,
|
||||
sounds = {
|
||||
random = "mobs_stonemonster",
|
||||
|
@ -27,24 +26,29 @@ mobs:register_mob("mobs:stone_monster", {
|
|||
view_range = 10,
|
||||
drops = {
|
||||
{name = "default:torch",
|
||||
chance = 2, min = 3, max = 5,},
|
||||
chance = 2, min = 3, max = 5},
|
||||
{name = "default:iron_lump",
|
||||
chance=5, min=1, max=2,},
|
||||
chance=5, min=1, max=2},
|
||||
{name = "default:coal_lump",
|
||||
chance=3, min=1, max=3,},
|
||||
chance=3, min=1, max=3},
|
||||
},
|
||||
water_damage = 0,
|
||||
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,
|
||||
},
|
||||
})
|
||||
|
||||
mobs:register_spawn("mobs:stone_monster", {"default:stone"}, 5, 0, 7000, 1, 0)
|
||||
|
||||
mobs:register_egg("mobs:stone_monster", "Stone Monster", "default_stone.png", 1)
|
||||
mobs:register_egg("mobs:stone_monster", "Stone Monster", "default_stone.png", 1)
|
|
@ -15,7 +15,6 @@ mobs:register_mob("mobs:tree_monster", {
|
|||
textures = {
|
||||
{"mobs_tree_monster.png"},
|
||||
},
|
||||
visual_size = {x=1,y=1},
|
||||
blood_texture = "default_wood.png",
|
||||
makes_footstep_sound = true,
|
||||
sounds = {
|
||||
|
@ -38,11 +37,16 @@ mobs:register_mob("mobs:tree_monster", {
|
|||
light_damage = 2,
|
||||
fall_damage = 0,
|
||||
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,
|
||||
},
|
||||
})
|
||||
|
||||
|
@ -54,4 +58,4 @@ mobs:register_egg("mobs:tree_monster", "Tree Monster", "default_tree_top.png", 1
|
|||
if not minetest.get_modpath("ethereal") then
|
||||
minetest.register_alias("ethereal:tree_sapling", "default:sapling")
|
||||
minetest.register_alias("ethereal:jungle_tree_sapling", "default:junglesapling")
|
||||
end
|
||||
end
|
19
warthog.lua
19
warthog.lua
|
@ -15,7 +15,6 @@ mobs:register_mob("mobs:pumba", {
|
|||
textures = {
|
||||
{"mobs_pumba.png"},
|
||||
},
|
||||
visual_size = {x=1,y=1},
|
||||
makes_footstep_sound = true,
|
||||
sounds = {
|
||||
random = "mobs_pig",
|
||||
|
@ -28,16 +27,19 @@ mobs:register_mob("mobs:pumba", {
|
|||
view_range = 10,
|
||||
drops = {
|
||||
{name = "mobs:pork_raw",
|
||||
chance = 1, min = 2, max = 3,},
|
||||
chance = 1, min = 2, max = 3},
|
||||
},
|
||||
water_damage = 1,
|
||||
lava_damage = 5,
|
||||
light_damage = 0,
|
||||
animation = {
|
||||
speed_normal = 15,
|
||||
stand_start = 25, stand_end = 55,
|
||||
walk_start = 70, walk_end = 100,
|
||||
punch_start = 70, punch_end = 100,
|
||||
stand_start = 25,
|
||||
stand_end = 55,
|
||||
walk_start = 70,
|
||||
walk_end = 100,
|
||||
punch_start = 70,
|
||||
punch_end = 100,
|
||||
},
|
||||
on_rightclick = function(self, clicker)
|
||||
local item = clicker:get_wielded_item()
|
||||
|
@ -69,7 +71,7 @@ mobs:register_mob("mobs:pumba", {
|
|||
minetest.sound_play("mobs_pig", {
|
||||
object = self.object,
|
||||
gain = 1.0,
|
||||
max_hear_distance = 16,
|
||||
max_hear_distance = 10,
|
||||
loop = false,
|
||||
})
|
||||
end
|
||||
|
@ -84,13 +86,14 @@ mobs:register_spawn("mobs:pumba", {"ethereal:mushroom_dirt"}, 20, 10, 15000, 1,
|
|||
|
||||
mobs:register_egg("mobs:pumba", "Warthog", "wool_pink.png", 1)
|
||||
|
||||
-- porkchop (raw and cooked)
|
||||
-- raw porkchop
|
||||
minetest.register_craftitem("mobs:pork_raw", {
|
||||
description = "Raw Porkchop",
|
||||
inventory_image = "mobs_pork_raw.png",
|
||||
on_use = minetest.item_eat(4),
|
||||
})
|
||||
|
||||
-- cooked porkchop
|
||||
minetest.register_craftitem("mobs:pork_cooked", {
|
||||
description = "Cooked Porkchop",
|
||||
inventory_image = "mobs_pork_cooked.png",
|
||||
|
@ -102,4 +105,4 @@ minetest.register_craft({
|
|||
output = "mobs:pork_cooked",
|
||||
recipe = "mobs:pork_raw",
|
||||
cooktime = 5,
|
||||
})
|
||||
})
|
Loading…
Reference in New Issue