warthogs attack, code tidy, api changes

master
tenplus1 2015-03-05 19:20:51 +00:00
parent b3b19b0ed9
commit f56d969d00
17 changed files with 579 additions and 599 deletions

View File

@ -28,6 +28,7 @@ This mod contains the following additions:
Changelog:
1.02- Sheared sheep are remembered and spawn shaven, Warthogs will attack when threatened, Api additions
1.01- Mobs that suffer fall damage or die in water/lava/sunlight will now drop items
1.0 - more work on Api so that certain mobs can float in water while some sink like a brick :)
0.9 - Spawn eggs added for all mobs (admin only, cannot be placed in protected areas)... Api tweaked

View File

@ -1,4 +1,4 @@
-- Mobs Api (1st March 2015)
-- Mobs Api (5th March 2015)
mobs = {}
-- Set global for other mod checks (e.g. Better HUD uses this)
@ -45,8 +45,6 @@ function mobs:register_mob(name, def)
animation = def.animation,
follow = def.follow,
jump = def.jump or true,
exp_min = def.exp_min or 0,
exp_max = def.exp_max or 0,
walk_chance = def.walk_chance or 50,
attacks_monsters = def.attacks_monsters or false,
group_attack = def.group_attack or false,

51
bee.lua
View File

@ -1,32 +1,40 @@
-- Bee
-- Bee by KrupnoPavel
mobs:register_mob("mobs:bee", {
-- animal, monster, npc, barbarian
type = "animal",
hp_min = 1,
hp_max = 2,
-- it is aggressive
passive = true,
-- health & armor
hp_min = 1, hp_max = 2, armor = 200,
-- textures and model
collisionbox = {-0.2, -0.01, -0.2, 0.2, 0.2, 0.2},
visual = "mesh",
mesh = "mobs_bee.x",
--textures = {"mobs_bee.png"},
drawtype = "front",
available_textures = {
total = 1,
texture_1 = {"mobs_bee.png"},
},
-- sounds
makes_footstep_sound = false,
sounds = {
random = "mobs_bee",
},
-- speed and jump
walk_velocity = 1,
armor = 200,
jump = true,
-- drops honey when killed
drops = {
{name = "mobs:med_cooked",
chance = 1,
min = 1,
max = 2,},
{name = "mobs:honey",
chance = 1, min = 1, max = 2,},
},
drawtype = "front",
-- damage
water_damage = 1,
lava_damage = 1,
light_damage = 0,
-- model animation
animation = {
speed_normal = 15,
stand_start = 0,
@ -34,39 +42,28 @@ mobs:register_mob("mobs:bee", {
walk_start = 35,
walk_end = 65,
},
sounds = {
random = "mobs_bee",
},
-- right click to pick up bee
on_rightclick = function(self, clicker)
if clicker:is_player() and clicker:get_inventory() then
clicker:get_inventory():add_item("main", "mobs:bee")
self.object:remove()
end
end,
jump = true,
step = 1,
passive = true,
})
-- spawn on group:flowers between 4 and 20 light, 1 in 5000 chance, 1 bee in area up to 31000 in height
mobs:register_spawn("mobs:bee", {"group:flower"}, 20, 4, 5000, 1, 31000)
-- register spawn egg
mobs:register_egg("mobs:bee", "Bee", "mobs_bee_inv.png", 0)
-- Honey
minetest.register_craftitem("mobs:honey", {
description = "Honey",
inventory_image = "mobs_honey_inv.png",
on_use = minetest.item_eat(6),
})
minetest.register_craft({
type = "cooking",
output = "mobs:med_cooked",
recipe = "mobs:bee",
cooktime = 5,
})
-- Beehive
-- Beehive (when placed, bee appears)
minetest.register_node("mobs:beehive", {
description = "Beehive",
drawtype = "plantlike",

View File

@ -1,15 +1,18 @@
--= Chicken (thanks to JK Murray for his chicken model)
-- Chicken by JK Murray
mobs:register_mob("mobs:chicken", {
-- animal, monster, npc, barbarian
type = "animal",
hp_min = 5,
hp_max = 10,
animaltype = "clucky",
-- is it aggressive
passive = true,
-- health & armor
hp_min = 5, hp_max = 10, armor = 200,
-- textures and model
collisionbox = {-0.3, -0.75, -0.3, 0.3, 0.1, 0.3},
visual = "mesh",
mesh = "chicken.x",
-- textures look repetative but they fix the wrapping bug
drawtype = "front",
available_textures = {
total = 2,
texture_1 = {"mobs_chicken.png", "mobs_chicken.png", "mobs_chicken.png",
@ -19,19 +22,25 @@ mobs:register_mob("mobs:chicken", {
"mobs_chicken_black.png", "mobs_chicken_black.png", "mobs_chicken_black.png",
"mobs_chicken_black.png", "mobs_chicken_black.png", "mobs_chicken_black.png"},
},
--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"},
blood_texture = "mobs_blood.png",
-- sounds
makes_footstep_sound = true,
walk_velocity = 1,
armor = 200,
drops = {
{name = "mobs:chicken_raw", chance = 1, min = 2, max = 2,},
sounds = {
random = "mobs_chicken",
},
drawtype = "front",
-- speed and jump
walk_velocity = 1,
jump = true,
-- drops raw chicken when dead
drops = {
{name = "mobs:chicken_raw",
chance = 1, min = 2, max = 2},
},
-- damaged by
water_damage = 1,
lava_damage = 5,
light_damage = 0,
jump = false,
-- model animation
animation = {
speed_normal = 15,
stand_start = 0,
@ -39,52 +48,46 @@ mobs:register_mob("mobs:chicken", {
walk_start = 20,
walk_end = 40,
},
follow = "farming:wheat",
view_range = 5,
on_rightclick = function(self, clicker)
-- follows wheat
follow = "farming:wheat", view_range = 5,
-- right click to pick up chicken
on_rightclick = function(self, clicker)
if clicker:is_player() and clicker:get_inventory() then
clicker:get_inventory():add_item("main", "mobs:chicken")
self.object:remove()
end
end,
sounds = {
random = "mobs_chicken",
},
jump = true,
step = 1,
blood_texture = "mobs_blood.png",
passive = true,
})
-- spawn on default or bamboo grass between 8 and 20 light, 1 in 9000 change, 1 chicken in area up to 31000 in height
mobs:register_spawn("mobs:chicken", {"default:dirt_with_grass", "ethereal:bamboo_dirt"}, 20, 8, 9000, 1, 31000)
-- register spawn egg
mobs:register_egg("mobs:chicken", "Chicken", "mobs_chicken_inv.png", 0)
-- Egg (can be fried in furnace)
minetest.register_node("mobs:egg",
{
description = "Chicken Egg",
tiles = {"mobs_chicken_egg.png"},
inventory_image = "mobs_chicken_egg.png",
visual_scale = 0.7,
drawtype = "plantlike",
wield_image = "mobs_chicken_egg.png",
paramtype = "light",
walkable = false,
is_ground_content = true,
sunlight_propagates = true,
selection_box = {
type = "fixed",
fixed = {-0.2, -0.5, -0.2, 0.2, 0, 0.2}
},
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})
end
-- Egg
minetest.register_node("mobs:egg", {
description = "Chicken Egg",
tiles = {"mobs_chicken_egg.png"},
inventory_image = "mobs_chicken_egg.png",
visual_scale = 0.7,
drawtype = "plantlike",
wield_image = "mobs_chicken_egg.png",
paramtype = "light",
walkable = false,
is_ground_content = true,
sunlight_propagates = true,
selection_box = {
type = "fixed",
fixed = {-0.2, -0.5, -0.2, 0.2, 0, 0.2}
},
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})
end
end
})
-- Fried egg
minetest.register_craftitem("mobs:chicken_egg_fried", {
description = "Fried Egg",
inventory_image = "mobs_chicken_egg_fried.png",
@ -98,7 +101,6 @@ minetest.register_craft({
})
-- Chicken (raw and cooked)
minetest.register_craftitem("mobs:chicken_raw", {
description = "Raw Chicken",
inventory_image = "mobs_chicken_raw.png",

76
cow.lua
View File

@ -2,37 +2,52 @@
-- Cow by Krupnovpavel
mobs:register_mob("mobs:cow", {
-- animal, monster, npc, barbarian
type = "animal",
hp_min = 5,
hp_max = 20,
-- aggressive, does 5 damage to player when threatened
passive = false,
attack_type = "dogfight",
damage = 5,
-- health & armor
hp_min = 5, hp_max = 20, armor = 200,
-- textures and model
collisionbox = {-0.4, -0.01, -0.4, 0.4, 1, 0.4},
--textures = {"mobs_cow.png"},
visual = "mesh",
mesh = "mobs_cow.x",
drawtype = "front",
available_textures = {
total = 1,
texture_1 = {"mobs_cow.png"},
},
visual = "mesh",
mesh = "mobs_cow.x",
blood_texture = "mobs_blood.png",
-- sounds
makes_footstep_sound = true,
view_range = 7,
walk_velocity = 1,
run_velocity = 2,
damage = 10,
armor = 200,
drops = {
{name = "mobs:meat_raw",
chance = 1,
min = 5,
max = 10,},
},
drawtype = "front",
water_damage = 1,
lava_damage = 5,
light_damage = 0,
follow = "farming:wheat",
sounds = {
random = "mobs_cow",
},
-- speed and jump
walk_velocity = 1,
run_velocity = 2,
jump = true,
-- drops raw meat when dead
drops = {
{name = "mobs:meat_raw",
chance = 1, min = 5, max = 10},
},
-- damaged by
water_damage = 1,
lava_damage = 5,
light_damage = 0,
-- model animation
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,
},
-- follows wheat
follow = "farming:wheat", view_range = 7,
-- right-click cow with empty bucket to get milk, then feed 8 wheat to replenish milk
on_rightclick = function(self, clicker)
local tool = clicker:get_wielded_item()
@ -42,7 +57,6 @@ mobs:register_mob("mobs:cow", {
clicker:get_inventory():add_item("main", "mobs:bucket_milk")
self.gotten = true -- milked
end
if tool:get_name() == "farming:wheat" and self.gotten then
if not minetest.setting_getbool("creative_mode") then
tool:take_item(1)
@ -59,25 +73,13 @@ mobs:register_mob("mobs:cow", {
end
end,
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,
},
jump = true,
step = 1,
blood_texture = "mobs_blood.png",
passive = true,
})
-- spawn on default;green;prairie grass between 0 and 20 light, 1 in 11000 chance, 1 cow in area up to 31000 in height
mobs:register_spawn("mobs:cow", {"default:dirt_with_grass", "ethereal:green_dirt_top", "ethereal:prairie_dirt"}, 20, 0, 11000, 1, 31000)
-- register spawn egg
mobs:register_egg("mobs:cow", "Cow", "default_grass.png", 1)
-- Bucket of Milk
minetest.register_craftitem("mobs:bucket_milk", {
description = "Bucket of Milk",
inventory_image = "mobs_bucket_milk.png",
@ -86,7 +88,6 @@ minetest.register_craftitem("mobs:bucket_milk", {
})
-- Cheese Wedge
minetest.register_craftitem("mobs:cheese", {
description = "Cheese",
inventory_image = "mobs_cheese.png",
@ -102,7 +103,6 @@ minetest.register_craft({
})
-- Cheese Block
minetest.register_node("mobs:cheeseblock", {
description = "Cheese Block",
tiles = {"mobs_cheeseblock.png"},

View File

@ -1,54 +1,55 @@
-- Dirt Monster
-- Dirt Monster by PilzAdam
mobs:register_mob("mobs:dirt_monster", {
-- animal, monster, npc, barbarian
type = "monster",
hp_min = 3,
hp_max = 27,
-- aggressive, deals 2 damage to player when hit
passive = false,
attack_type = "dogfight",
damage = 2,
-- health & armor
hp_min = 3, hp_max = 27, armor = 100,
-- textures and model
collisionbox = {-0.4, -0.01, -0.4, 0.4, 1.9, 0.4},
visual = "mesh",
mesh = "mobs_stone_monster.x",
--textures = {"mobs_dirt_monster.png"},
drawtype = "front",
available_textures = {
total = 1,
texture_1 = {"mobs_dirt_monster.png"},
},
visual_size = {x=3, y=2.6},
blood_texture = "default_dirt.png",
-- sounds
makes_footstep_sound = true,
view_range = 15,
walk_velocity = 1,
run_velocity = 3,
damage = 2,
drops = {
{name = "default:dirt",
chance = 1,
min = 3,
max = 5,},
},
armor = 100,
drawtype = "front",
water_damage = 1,
lava_damage = 5,
light_damage = 2,
on_rightclick = nil,
attack_type = "dogfight",
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,
},
sounds = {
random = "mobs_dirtmonster",
},
-- speed and jump
view_range = 15,
walk_velocity = 1,
run_velocity = 3,
jump = true,
step = 0.5,
blood_texture = "default_dirt.png",
-- drops dirt when dead
drops = {
{name = "default:dirt",
chance = 1, min = 3, max = 5},
},
-- damaged by
water_damage = 1,
lava_damage = 5,
light_damage = 2,
-- model animation
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,
},
})
mobs:register_spawn("mobs:dirt_monster", {"default:dirt_with_grass", "ethereal:gray_dirt_top"}, 5, -1, 7000, 1, 31000)
-- spawn on normal;grey dirt between 0 and 5 light, 1 in 7000 change, 1 dirt monster in area up to 31000 in height
mobs:register_spawn("mobs:dirt_monster", {"default:dirt_with_grass", "ethereal:gray_dirt_top"}, 5, 0, 7000, 1, 31000)
-- register spawn egg
mobs:register_egg("mobs:dirt_monster", "Dirt Monster", "default_dirt.png", 1)

View File

@ -1,14 +1,23 @@
-- Dungeon Master (This one spits out fireballs at you)
-- Dungeon Master by PilzAdam
mobs:register_mob("mobs:dungeon_master", {
-- animal, monster, npc, barbarian
type = "monster",
hp_min = 12,
hp_max = 35,
-- aggressive, shoots fireballs at player
passive = false,
damage = 4,
attack_type = "shoot",
shoot_interval = 2.5,
arrow = "mobs:fireball",
shoot_offset = 0,
-- health & armor
hp_min = 12, hp_max = 35, armor = 60,
-- textures and model
collisionbox = {-0.7, -0.01, -0.7, 0.7, 2.6, 0.7},
visual = "mesh",
mesh = "mobs_dungeon_master.x",
--textures = {"mobs_dungeon_master.png"},
drawtype = "front",
available_textures = {
total = 3,
texture_1 = {"mobs_dungeon_master.png"},
@ -16,64 +25,46 @@ mobs:register_mob("mobs:dungeon_master", {
texture_3 = {"mobs_dungeon_master3.png"},
},
visual_size = {x=8, y=8},
blood_texture = "mobs_blood.png",
-- sounds
makes_footstep_sound = true,
view_range = 15,
walk_velocity = 1,
run_velocity = 3,
damage = 4,
drops = {
{name = "default:mese_crystal_fragment",
chance = 1,
min = 1,
max = 3,},
{name = "default:diamond",
chance = 4,
min = 1,
max = 1,},
{name = "default:mese_crystal",
chance = 2,
min = 1,
max = 2,},
{name = "default:diamond_block",
chance = 30,
min = 1,
max = 1,},
},
armor = 60,
drawtype = "front",
water_damage = 1,
lava_damage = 1,
light_damage = 0,
on_rightclick = nil,
attack_type = "shoot",
arrow = "mobs:fireball",
shoot_interval = 2.5,
sounds = {
attack = "mobs_fireball",
},
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,
},
sounds = {
random = "mobs_dungeonmaster",
},
-- speed and jump
walk_velocity = 1,
run_velocity = 3,
jump = true,
step = 0.5,
shoot_offset = 0,
blood_texture = "mobs_blood.png",
view_range = 15,
-- drops mese or diamond when dead
drops = {
{name = "default:mese_crystal_fragment",
chance = 1, min = 1, max = 3,},
{name = "default:diamond",
chance = 4, min = 1, max = 1,},
{name = "default:mese_crystal",
chance = 2, min = 1, max = 2,},
{name = "default:diamond_block",
chance = 30, min = 1, max = 1,},
},
-- damaged by
water_damage = 1,
lava_damage = 1,
light_damage = 0,
-- model animation
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,
},
})
mobs:register_spawn("mobs:dungeon_master", {"default:stone"}, 5, -1, 7000, 1, -70)
-- spawn on stone between 0 and 5 light, 1 in 7000 chance, 1 dungeon master in area starting at -70 and below
mobs:register_spawn("mobs:dungeon_master", {"default:stone"}, 5, 0, 7000, 1, -70)
-- register spawn egg
mobs:register_egg("mobs:dungeon_master", "Dungeon Master", "fire_basic_flame.png", 1)
-- Fireball (weapon)
-- Fireball (dungeon masters weapon)
mobs:register_arrow("mobs:fireball", {
visual = "sprite",
visual_size = {x=1, y=1},
@ -87,12 +78,11 @@ mobs:register_arrow("mobs:fireball", {
player:punch(self.object, 1.0, {
full_punch_interval=1.0,
damage_groups = {fleshy=8},
}, 0) -- {x=s.x-p.x, y=s.y-p.y, z=s.z-p.z})
}, 0)
end,
-- node hit, bursts into flame (cannot blast through obsidian)
-- node hit, bursts into flame (cannot blast through obsidian or protection redo mod items)
hit_node = function(self, pos, node)
for dx=-1,1 do
for dy=-1,1 do
for dz=-1,1 do

View File

@ -1,67 +1,65 @@
--= Lava Flan by Zeg9
minetest.register_craftitem("mobs:lava_orb", {
description = "Lava orb",
inventory_image = "zmobs_lava_orb.png",
on_place = function(itemstack, placer, pointed_thing)
end,
})
minetest.register_alias("zmobs:lava_orb", "mobs:lava_orb")
-- Lava Flan by Zeg9
mobs:register_mob("mobs:lava_flan", {
-- animal, monster, npc, barbarian
type = "monster",
hp_min = 10,
hp_max = 35,
-- aggressive, deals 3 damage to player when hit
passive = false,
attack_type = "dogfight",
damage = 3,
-- health and armor
hp_min = 10, hp_max = 35, armor = 80,
-- textures and model
collisionbox = {-0.5, -0.5, -0.5, 0.5, 1.5, 0.5},
visual = "mesh",
mesh = "zmobs_lava_flan.x",
--textures = {"zmobs_lava_flan.png"},
drawtype = "front",
available_textures = {
total = 1,
texture_1 = {"zmobs_lava_flan.png"},
},
blood_texture = "fire_basic_flame.png",
visual_size = {x=1, y=1},
-- sounds
makes_footstep_sound = true,
view_range = 10,
walk_velocity = 0.5,
run_velocity = 2,
damage = 3,
drops = {
{name = "mobs:lava_orb",
chance = 15,
min = 1,
max = 1,},
},
light_resistant = true,
armor = 80,
drawtype = "front",
water_damage = 5,
lava_damage = 0,
light_damage = 0,
attack_type = "dogfight",
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,
},
sounds = {
random = "mobs_lavaflan",
war_cry = "mobs_lavaflan",
death = nil,
},
-- speed and jump, sinks in water
walk_velocity = 0.5,
run_velocity = 2,
jump = true,
step = 0.5,
view_range = 10,
floats = 0,
blood_texture = "fire_basic_flame.png",
-- chance of dropping lava orb when dead
drops = {
{name = "mobs:lava_orb",
chance = 15, min = 1, max = 1,},
},
-- damaged by
water_damage = 5,
lava_damage = 0,
light_damage = 0,
-- model animation
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,
},
})
mobs:register_spawn("mobs:lava_flan", {"default:lava_source"}, 15, -1, 1000, 3, 0)
-- spawns in lava between 0 and 15 light, 1 in 1000 chance, 3 in area below 0 in height
mobs:register_spawn("mobs:lava_flan", {"default:lava_source"}, 15, 0, 1000, 3, 0)
-- register spawn egg
mobs:register_egg("mobs:lava_flan", "Lava Flan", "default_lava.png", 1)
-- Lava Orb
minetest.register_craftitem("mobs:lava_orb", {
description = "Lava orb",
inventory_image = "zmobs_lava_orb.png",
})
minetest.register_alias("zmobs:lava_orb", "mobs:lava_orb")

View File

@ -1,79 +1,66 @@
--= Mese Monster by Zeg9
-- Mese Monster by Zeg9
-- 9 mese crystal fragments = 1 mese crystal
minetest.register_craft({
output = "default:mese_crystal",
recipe = {
{"default:mese_crystal_fragment", "default:mese_crystal_fragment", "default:mese_crystal_fragment"},
{"default:mese_crystal_fragment", "default:mese_crystal_fragment", "default:mese_crystal_fragment"},
{"default:mese_crystal_fragment", "default:mese_crystal_fragment", "default:mese_crystal_fragment"},
}
})
-- Mese Monster
mobs:register_mob("mobs:mese_monster", {
-- animal, monster, npc, barbarian
type = "monster",
hp_min = 10,
hp_max = 25,
-- agressive, deals 3 damage to player when hit
passive = false,
damage = 3,
attack_type = "shoot",
shoot_interval = .5,
arrow = "mobs:mese_arrow",
shoot_offset = 2,
-- health & armor
hp_min = 10, hp_max = 25, armor = 80,
-- textures and model
collisionbox = {-0.5, -1.5, -0.5, 0.5, 0.5, 0.5},
visual = "mesh",
mesh = "zmobs_mese_monster.x",
--textures = {"zmobs_mese_monster.png"},
available_textures = {
total = 1,
texture_1 = {"zmobs_mese_monster.png"},
},
visual_size = {x=1, y=1},
makes_footstep_sound = true,
view_range = 10,
walk_velocity = 0.5,
run_velocity = 2,
damage = 3,
drops = {
{name = "default:mese_crystal",
chance = 9,
min = 1,
max = 3,},
{name = "default:mese_crystal_fragment",
chance = 1,
min = 1,
max = 9,},
},
light_resistant = true,
armor = 80,
drawtype = "front",
water_damage = 0,
lava_damage = 0,
light_damage = 0,
attack_type = "shoot",
arrow = "mobs:mese_arrow",
shoot_interval = .5,
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, -- 40
punch_end = 38, -- 63
},
blood_texture = "default_mese_crystal_fragment.png",
-- sounds
makes_footstep_sound = true,
sounds = {
random = "mobs_mesemonster",
},
-- speed and jump
view_range = 10,
walk_velocity = 0.5,
run_velocity = 2,
jump = true,
step = 0.5,
shoot_offset = 2,
blood_texture = "default_mese_crystal_fragment.png",
fall_damage = false,
-- drops mese when dead
drops = {
{name = "default:mese_crystal",
chance = 9, min = 1, max = 3,},
{name = "default:mese_crystal_fragment",
chance = 1, min = 1, max = 9,},
},
-- damaged by
water_damage = 0,
lava_damage = 0,
light_damage = 0,
-- model animation
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
},
})
mobs:register_spawn("mobs:mese_monster", {"default:stone"}, 5, -1, 5000, 1, -20)
-- spawn on stone between 0 and 5 light, 1 in 5000 chance, 1 in area below -20
mobs:register_spawn("mobs:mese_monster", {"default:stone"}, 5, 0, 5000, 1, -20)
-- register spawn egg
mobs:register_egg("mobs:mese_monster", "Mese Monster", "default_mese_block.png", 1)
-- Mese Monster Crystal Shards (weapon)
mobs:register_arrow("mobs:mese_arrow", {
visual = "sprite",
visual_size = {x=.5, y=.5},
@ -87,9 +74,19 @@ mobs:register_arrow("mobs:mese_arrow", {
player:punch(self.object, 1.0, {
full_punch_interval=1.0,
damage_groups = {fleshy=1},
}, 0) -- {x=s.x-p.x, y=s.y-p.y, z=s.z-p.z})
}, 0)
end,
hit_node = function(self, pos, node)
end
})
-- 9 mese crystal fragments = 1 mese crystal
minetest.register_craft({
output = "default:mese_crystal",
recipe = {
{"default:mese_crystal_fragment", "default:mese_crystal_fragment", "default:mese_crystal_fragment"},
{"default:mese_crystal_fragment", "default:mese_crystal_fragment", "default:mese_crystal_fragment"},
{"default:mese_crystal_fragment", "default:mese_crystal_fragment", "default:mese_crystal_fragment"},
}
})

View File

@ -1,56 +1,56 @@
-- Oerkki
-- Oerkki by PilzAdam
mobs:register_mob("mobs:oerkki", {
-- animal, monster, npc, barbarian
type = "monster",
hp_min = 8,
hp_max = 34,
-- aggressive, deals 4 damage when player hit
passive = false,
attack_type = "dogfight",
damage = 4,
-- health & armor
hp_min = 8, hp_max = 34, armor = 100,
-- textures and model
collisionbox = {-0.4, -0.01, -0.4, 0.4, 1.9, 0.4},
visual = "mesh",
mesh = "mobs_oerkki.x",
--textures = {"mobs_oerkki.png"},
drawtype = "front",
available_textures = {
total = 2,
texture_1 = {"mobs_oerkki.png"},
texture_2 = {"mobs_oerkki2.png"},
},
visual_size = {x=5, y=5},
blood_texture = "mobs_blood.png",
-- sounds
makes_footstep_sound = false,
view_range = 15,
walk_velocity = 1,
run_velocity = 3,
damage = 4,
drops = {
{name = "default:obsidian",
chance = 3,
min = 1,
max = 2,},
},
armor = 100,
drawtype = "front",
light_resistant = true,
water_damage = 1,
lava_damage = 1,
light_damage = 1,
attack_type = "dogfight",
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,
},
sounds = {
random = "mobs_oerkki",
},
-- speed and jump
walk_velocity = 1,
run_velocity = 3,
view_range = 15,
jump = true,
step = 0.5,
blood_texture = "mobs_blood.png",
-- chance of dropping obsidian
drops = {
{name = "default:obsidian",
chance = 3, min = 1, max = 2,},
},
-- damaged by
water_damage = 1,
lava_damage = 1,
light_damage = 1,
-- model animation
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,
},
})
-- spawns on stone between 0 and 5 light, 1 in 7000 chance, 1 in area starting at -10 and below
mobs:register_spawn("mobs:oerkki", {"default:stone"}, 5, -1, 7000, 1, -10)
-- register spawn egg
mobs:register_egg("mobs:oerkki", "Oerkki", "default_obsidian.png", 1)

40
rat.lua
View File

@ -1,34 +1,38 @@
-- Rat
-- Rat by PilzAdam
mobs:register_mob("mobs:rat", {
-- animal, monster, npc, barbarian
type = "animal",
hp_min = 1,
hp_max = 4, -- 1
-- not aggressive
passive = true,
-- health & armor
hp_min = 1, hp_max = 4, armor = 200,
-- textures and model
collisionbox = {-0.2, -0.01, -0.2, 0.2, 0.2, 0.2},
visual = "mesh",
mesh = "mobs_rat.x",
--textures = {"mobs_rat.png"},
drawtype = "front",
available_textures = {
total = 2,
texture_1 = {"mobs_rat.png"},
texture_2 = {"mobs_rat2.png"},
},
-- sounds
makes_footstep_sound = false,
walk_velocity = 1,
armor = 200,
drops = {},
drawtype = "front",
water_damage = 0,
lava_damage = 1,
light_damage = 0,
jump = true,
step = 1,
passive = true,
sounds = {
random = "mobs_rat",
},
-- speed and jump
walk_velocity = 1,
jump = true,
-- no drops
drops = {},
-- damaged by
water_damage = 0,
lava_damage = 1,
light_damage = 0,
-- right click to pick up rat
on_rightclick = function(self, clicker)
if clicker:is_player() and clicker:get_inventory() then
clicker:get_inventory():add_item("main", "mobs:rat")
@ -36,15 +40,15 @@ passive = true,
end
end,
})
mobs:register_spawn("mobs:rat", {"default:stone"}, 20, -1, 7000, 1, 31000)
-- spawn on stone between 1 and 20 light, 1 in 7000 chance, 1 per area up to 31000 in height
mobs:register_spawn("mobs:rat", {"default:stone"}, 20, 0, 7000, 1, 31000)
-- register spawn egg
mobs:register_egg("mobs:rat", "Rat", "mobs_rat_inventory.png", 0)
-- Cooked Rat, yummy!
minetest.register_craftitem("mobs:rat_cooked", {
description = "Cooked Rat",
inventory_image = "mobs_cooked_rat.png",
on_use = minetest.item_eat(3),
})

View File

@ -1,56 +1,56 @@
-- Sand Monster
-- Sand Monster by PilzAdam
mobs:register_mob("mobs:sand_monster", {
-- animal, monster, npc, barbarian
type = "monster",
hp_min = 4,
hp_max = 20,
-- aggressive, deals 1 damage to player when hit
passive = false,
attack_type = "dogfight",
damage = 1,
-- health & armor
hp_min = 4, hp_max = 20, armor = 100,
-- textures and model
collisionbox = {-0.4, -0.01, -0.4, 0.4, 1.9, 0.4},
visual = "mesh",
mesh = "mobs_sand_monster.x",
--textures = {"mobs_sand_monster.png"},
drawtype = "front",
available_textures = {
total = 1,
texture_1 = {"mobs_sand_monster.png"},
},
visual_size = {x=8,y=8},
blood_texture = "mobs_blood.png",
-- sounds
makes_footstep_sound = true,
view_range = 15,
walk_velocity = 1.5,
run_velocity = 4,
damage = 1,
drops = {
{name = "default:desert_sand",
chance = 1,
min = 3,
max = 5,},
},
light_resistant = true,
armor = 100,
drawtype = "front",
water_damage = 3,
lava_damage = 1,
light_damage = 0,
attack_type = "dogfight",
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,
},
sounds = {
random = "mobs_sandmonster",
},
-- speed and jump, sinks in water
walk_velocity = 1.5,
run_velocity = 4,
view_range = 15,
jump = true,
step = 0.5,
blood_texture = "mobs_blood.png",
floats = 0,
-- drops desert sand when dead
drops = {
{name = "default:desert_sand",
chance = 1, min = 3, max = 5,},
},
-- damaged by
water_damage = 3,
lava_damage = 1,
light_damage = 0,
-- model animation
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,
},
})
mobs:register_spawn("mobs:sand_monster", {"default:desert_sand"}, 20, -1, 7000, 1, 31000)
-- spawns on desert sand between 0 and 20 light, 1 in 7000 chance, 1 sand monster in area up to 31000 in height
mobs:register_spawn("mobs:sand_monster", {"default:desert_sand"}, 20, 0, 7000, 1, 31000)
-- register spawn egg
mobs:register_egg("mobs:sand_monster", "Sand Monster", "default_desert_sand.png", 1)

View File

@ -1,47 +1,50 @@
-- Sheep
-- Sheep by PilzAdam
mobs:register_mob("mobs:sheep", {
-- animal, monster, npc, barbarian
type = "animal",
hp_min = 8,
hp_max = 10,
-- not aggressive
passive = true,
-- health & armor
hp_min = 8, hp_max = 10, armor = 200,
-- textures and model
collisionbox = {-0.4, -0.01, -0.4, 0.4, 1, 0.4},
--textures = {"mobs_sheep.png"},
visual = "mesh",
mesh = "mobs_sheep.x",
drawtype = "front",
available_textures = {
total = 1,
texture_1 = {"mobs_sheep.png"},
},
visual = "mesh",
mesh = "mobs_sheep.x",
blood_texture = "mobs_blood.png",
-- sounds
makes_footstep_sound = true,
walk_velocity = 1,
armor = 200,
drops = {
{name = "mobs:meat_raw",
chance = 1,
min = 2,
max = 3,},
},
drawtype = "front",
water_damage = 1,
lava_damage = 5,
light_damage = 0,
sounds = {
random = "mobs_sheep",
},
animation = {
speed_normal = 15,
stand_start = 0,
stand_end = 80,
walk_start = 81,
walk_end = 100,
},
-- speed and jump
walk_velocity = 1,
jump = true,
step = 1,
blood_texture = "mobs_blood.png",
passive = true,
-- drops raw meat when dead
drops = {
{name = "mobs:meat_raw",
chance = 1, min = 2, max = 3,},
},
-- damaged by
water_damage = 1,
lava_damage = 5,
light_damage = 0,
-- model animation
animation = {
speed_normal = 15, speed_run = 15,
stand_start = 0, stand_end = 80,
walk_start = 81, walk_end = 100,
},
-- follows wheat
follow = "farming:wheat",
view_range = 5,
-- right click sheep to shear sheep and get wood, feed 8 wheat for wool to grow back
on_rightclick = function(self, clicker)
local item = clicker:get_wielded_item()
if item:get_name() == "farming:wheat" then
@ -75,5 +78,7 @@ mobs:register_mob("mobs:sheep", {
end
end,
})
-- spawn on default;green grass between 8 and 20 light, 1 in 9000 chance, 1 sheep in area up to 31000 in height
mobs:register_spawn("mobs:sheep", {"default:dirt_with_grass", "ethereal:green_dirt_top"}, 20, 8, 9000, 1, 31000)
-- register spawn egg
mobs:register_egg("mobs:sheep", "Sheep", "wool_white.png", 1)

View File

@ -1,73 +1,67 @@
-- Glowtest Spider
-- Spider by fishyWET (borrowed from Lord of the Test [game])
mobs:register_mob("mobs:spider", {
-- animal, monster, npc, barbarian
type = "monster",
hp_min = 20,
hp_max = 40,
-- agressive, does 3 damage to player when hit
passive = false,
attack_type = "dogfight",
damage = 3,
-- health & armor
hp_min = 20, hp_max = 40, armor = 200,
-- textures and model
collisionbox = {-0.9, -0.01, -0.7, 0.7, 0.6, 0.7},
--textures = {"mobs_spider.png"},
visual = "mesh",
mesh = "mobs_spider.x",
drawtype = "front",
available_textures = {
total = 1,
texture_1 = {"mobs_spider.png"},
},
visual_size = {x=7,y=7},
visual = "mesh",
mesh = "mobs_spider.x",
-- sounds
makes_footstep_sound = true,
view_range = 15,
walk_velocity = 1,
run_velocity = 3,
armor = 200,
damage = 3,
drops = {
{name = "farming:string",
chance = 1,
min = 1,
max = 5,},
{name = "ethereal:crystal_spike",
chance = 15,
min = 1,
max = 2,},
},
light_resistant = false,
drawtype = "front",
water_damage = 5,
lava_damage = 5,
light_damage = 0,
on_rightclick = nil,
attack_type = "dogfight",
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,
},
sounds = {
random = "mobs_spider",
},
-- speed and jump, sinks in water
walk_velocity = 1,
run_velocity = 3,
jump = true,
sounds = {},
step = 1,
view_range = 15,
floats = 0,
-- drops string with a chance of sandstone or crystal spike if Ethereal installed
drops = {
{name = "farming:string",
chance = 1, min = 1, max = 5,},
{name = "ethereal:crystal_spike",
chance = 15, min = 1, max = 2,},
},
-- damaged by
water_damage = 5,
lava_damage = 5,
light_damage = 0,
-- model animation
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,
},
})
mobs:register_spawn("mobs:spider", {"default:desert_stone", "ethereal:crystal_topped_dirt"}, 5, -1, 7000, 1, 71)
-- spawn on desert stone/crystal dirt, between 0 and 5 light, 1 in 7000 chance, 1 in area up to 71 in height
mobs:register_spawn("mobs:spider", {"default:desert_stone", "ethereal:crystal_topped_dirt"}, 5, 0, 7000, 1, 71)
-- register spawn egg
mobs:register_egg("mobs:spider", "Spider", "mobs_cobweb.png", 1)
-- Ethereal crystal spike compatibility
if not minetest.get_modpath("ethereal") then
minetest.register_alias("ethereal:crystal_spike", "default:sandstone")
end
-- Cobweb
minetest.register_node("mobs:cobweb", {
description = "Cobweb",
drawtype = "plantlike",

View File

@ -1,64 +1,60 @@
-- Stone Monster
-- Stone Monster by PilzAdam
mobs:register_mob("mobs:stone_monster", {
-- animal, monster, npc, barbarian
type = "monster",
hp_min = 12,
hp_max = 35,
-- aggressive, deals 3 damage to player when hit
passive = false,
attack_type = "dogfight",
damage = 3,
-- health & armor
hp_min = 12, hp_max = 35, armor = 80,
-- textures and model
collisionbox = {-0.4, -0.01, -0.4, 0.4, 1.9, 0.4},
visual = "mesh",
mesh = "mobs_stone_monster.x",
--textures = {"mobs_stone_monster.png"},
drawtype = "front",
available_textures = {
total = 1,
texture_1 = {"mobs_stone_monster.png"},
},
visual_size = {x=3, y=2.6},
blood_texture = "mobs_blood.png",
-- sounds
makes_footstep_sound = true,
view_range = 10,
walk_velocity = 0.5,
run_velocity = 2,
damage = 3,
drops = {
{name = "default:torch",
chance = 2,
min = 3,
max = 5,},
{name = "default:iron_lump",
chance=5,
min=1,
max=2,},
{name = "default:coal_lump",
chance=3,
min=1,
max=3,},
},
light_resistant = true,
armor = 80,
drawtype = "front",
water_damage = 0,
lava_damage = 0,
light_damage = 0,
attack_type = "dogfight",
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,
},
sounds = {
random = "mobs_stonemonster",
},
-- speed and jump, sinks in water
walk_velocity = 0.5,
run_velocity = 2,
jump = true,
step = 0.5,
blood_texture = "mobs_blood.png",
floats = 0,
view_range = 10,
-- chance of dropping torch, iron or coal lump
drops = {
{name = "default:torch",
chance = 2, min = 3, max = 5,},
{name = "default:iron_lump",
chance=5, min=1, max=2,},
{name = "default:coal_lump",
chance=3, min=1, max=3,},
},
-- damaged by
water_damage = 0,
lava_damage = 0,
light_damage = 0,
-- model animation
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,
},
})
mobs:register_spawn("mobs:stone_monster", {"default:stone"}, 5, -1, 7000, 1, 0)
-- spawns on stone between 0 and 5 light, 1 in 7000 chance, 1 in area below 0
mobs:register_spawn("mobs:stone_monster", {"default:stone"}, 5, 0, 7000, 1, 0)
-- register spawn egg
mobs:register_egg("mobs:stone_monster", "Stone Monster", "default_stone.png", 1)

View File

@ -1,71 +1,65 @@
-- Tree Monster (or Tree Gollum as I like to call it)
-- Tree Monster (or Tree Gollum) by PilzAdam
mobs:register_mob("mobs:tree_monster", {
-- animal, monster, npc, barbarian
type = "monster",
hp_min = 7,
hp_max = 33,
-- aggressive, deals 2 damage to player when hit
passive = false,
attack_type = "dogfight",
damage = 2,
-- health & armor
hp_min = 7, hp_max = 33, armor = 100,
-- textures and model
collisionbox = {-0.4, -0.01, -0.4, 0.4, 1.9, 0.4},
visual = "mesh",
mesh = "mobs_tree_monster.x",
--textures = {"mobs_tree_monster.png"},
drawtype = "front",
available_textures = {
total = 1,
texture_1 = {"mobs_tree_monster.png"},
},
visual_size = {x=4.5,y=4.5},
blood_texture = "default_wood.png",
-- sounds
makes_footstep_sound = true,
view_range = 15,
walk_velocity = 1,
run_velocity = 3,
damage = 2,
drops = {
{name = "ethereal:tree_sapling",
chance = 3,
min = 1,
max = 2,},
{name = "ethereal:jungle_tree_sapling",
chance = 3,
min = 1,
max = 2,},
{name = "default:apple",
chance = 2,
min = 1,
max=3,
},
},
light_resistant = true,
armor = 100,
drawtype = "front",
water_damage = 1,
lava_damage = 5,
light_damage = 2,
disable_fall_damage = true,
attack_type = "dogfight",
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,
},
sounds = {
random = "mobs_treemonster",
},
step = 0.5,
-- speed and jumop
walk_velocity = 1,
run_velocity = 3,
jump = true,
blood_texture = "default_wood.png",
view_range = 15,
-- drops saplings or apple
drops = {
{name = "ethereal:tree_sapling",
chance = 3, min = 1, max = 2},
{name = "ethereal:jungle_tree_sapling",
chance = 3, min = 1, max = 2},
{name = "default:apple",
chance = 2, min = 1, max=3},
},
-- damaged by
water_damage = 1,
lava_damage = 5,
light_damage = 2,
fall_damage = false,
-- model animation
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,
},
})
mobs:register_spawn("mobs:tree_monster", {"default:leaves", "default:jungleleaves"}, 5, -1, 7000, 1, 31000)
-- spawn on leaves, between 0 and 5 light, 1 in 7000 chance, 1 in area up to 31000 in height
mobs:register_spawn("mobs:tree_monster", {"default:leaves", "default:jungleleaves"}, 5, 0, 7000, 1, 31000)
-- register spawn egg
mobs:register_egg("mobs:tree_monster", "Tree Monster", "default_tree_top.png", 1)
-- Ethereal sapling compatibility
if not minetest.get_modpath("ethereal") then
minetest.register_alias("ethereal:tree_sapling", "default:sapling")
minetest.register_alias("ethereal:jungle_tree_sapling", "default:junglesapling")

View File

@ -1,50 +1,53 @@
-- Warthog
-- Warthog by KrupnoPavel
mobs:register_mob("mobs:pumba", {
-- animal, monster, npc, barbarian
type = "animal",
hp_min = 5,
hp_max = 15,
-- aggressive, deals 2 damage to player when threatened
passive = false,
attack_type = "dogfight",
damage = 2,
-- health & armor
hp_min = 5, hp_max = 15, armor = 200,
-- textures and model
collisionbox = {-0.4, -0.01, -0.4, 0.4, 1, 0.4},
--textures = {"mobs_pumba.png"},
visual = "mesh",
mesh = "mobs_pumba.x",
drawtype = "front",
available_textures = {
total = 1,
texture_1 = {"mobs_pumba.png"},
},
visual = "mesh",
mesh = "mobs_pumba.x",
-- sounds
makes_footstep_sound = true,
walk_velocity = 2,
run_velocity = 3,
damage = 1,
attack_type = "dogfight",
armor = 200,
drops = {
{name = "mobs:pork_raw",
chance = 1,
min = 2,
max = 3,},
},
drawtype = "front",
water_damage = 1,
lava_damage = 5,
light_damage = 0,
sounds = {
random = "mobs_pig",
},
animation = {
speed_normal = 15,
stand_start = 25,
stand_end = 55,
walk_start = 70,
walk_end = 100,
punch_start = 70,
punch_end = 100,
},
-- speed and jump
walk_velocity = 2,
run_velocity = 3,
jump = true,
-- follows wheat
follow = "farming:wheat",
view_range = 5,
jump = true,
step = 1,
-- drops raw pork when dead
drops = {
{name = "mobs:pork_raw",
chance = 1, min = 2, max = 3,},
},
-- damaged by
water_damage = 1,
lava_damage = 5,
light_damage = 0,
-- model animation
animation = {
speed_normal = 15,
stand_start = 25, stand_end = 55,
walk_start = 70, walk_end = 100,
punch_start = 70, punch_end = 100,
},
-- can be tamed by feeding 8 wheat (will not attack when tamed)
on_rightclick = function(self, clicker)
local item = clicker:get_wielded_item()
if item:get_name() == "farming:wheat" then
@ -61,13 +64,13 @@ step = 1,
return
end
end,
})
-- spawns on normal or shroom dirt, between 8 and 20 light, 1 in 9000 chance, 1 in area up to 31000 in height
mobs:register_spawn("mobs:pumba", {"ethereal:mushroom_dirt", "default:dirt"}, 20, 8, 9000, 1, 31000)
-- register spawn egg
mobs:register_egg("mobs:pumba", "Warthog", "wool_pink.png", 1)
-- Porkchops
-- Porkchops (raw and cooked)
minetest.register_craftitem("mobs:pork_raw", {
description = "Raw Porkchop",
inventory_image = "mobs_pork_raw.png",