1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2024-12-24 01:30:38 +01:00

Update mobs mod

- Bunnies eat savage carrots
- Now, you need mobs:shears(ciseaux) if you want take the sheep’s wool,
- Kittens now follow rat and be tamed if they eat 4 fish_raw (obtained
when fishing)
- Kittens now can be picked with right click, and stored in inventory
(like chickens)

—> SYNC WITHOUT API.LUA <—
This commit is contained in:
Ombridride 2015-03-20 22:57:10 +01:00
parent 739c854de0
commit 7c27dda103
18 changed files with 72 additions and 94 deletions

View File

@ -43,7 +43,11 @@ mobs:register_mob("mobs:bunny", {
},
-- follows carrot from farming redo
follow = "farming:carrot",
view_range = 8,
view_range = 8,
-- 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)
@ -68,4 +72,4 @@ mobs:register_mob("mobs:bunny", {
})
mobs:register_spawn("mobs:bunny", {"default:dirt_with_grass"}, 20, 8, 12000, 1, 31000)
mobs:register_egg("mobs:bunny", "bunny", "mobs_bunny_inv.png", 0)
mobs:register_egg("mobs:bunny", "Bunny", "mobs_bunny_inv.png", 0)

View File

@ -72,10 +72,11 @@ mobs:register_mob("mobs:chicken", {
end
self.food = (self.food or 0) + 1
if self.food >= 4 then
-- I dont know what do you want she make
self.food = 0
self.food = 0
if self.child == false then self.horny = true end
self.gotten = false -- reset
self.tamed = true
minetest.sound_play("mobs_chicken", {object = self.object,gain = 1.0,max_hear_distance = 32,loop = false,})
minetest.sound_play("mobs_chicken", {object = self.object,gain = 1.0,max_hear_distance = 16,loop = false,})
end
return tool
else

View File

@ -2,7 +2,7 @@
dofile(minetest.get_modpath("mobs").."/api.lua")
-- Animals inc. Krupnovpavel's warthog/bee, JKmurray's chicken, ExeterDad's bunny
-- Animals inc. Krupnovpavel's warthog/bee, JKmurray's chicken, ExeterDad's bunny, Jordach/BFD's kitten
dofile(minetest.get_modpath("mobs").."/chicken.lua")
dofile(minetest.get_modpath("mobs").."/cow.lua")
@ -11,8 +11,6 @@ dofile(minetest.get_modpath("mobs").."/sheep.lua")
dofile(minetest.get_modpath("mobs").."/warthog.lua")
dofile(minetest.get_modpath("mobs").."/bee.lua")
dofile(minetest.get_modpath("mobs").."/bunny.lua")
-- Animals/Kittens from Jordach BFD subgame
dofile(minetest.get_modpath("mobs").."/kitten.lua")
-- Monsters
@ -38,7 +36,6 @@ dofile(minetest.get_modpath("mobs").."/spider.lua")
dofile(minetest.get_modpath("mobs").."/npc.lua")
-- Creeper (fast impl by davedevils)
dofile(minetest.get_modpath("mobs").."/creeper.lua")
-- Meat & Cooked Meat

View File

@ -1,65 +1,14 @@
local kitten_nodes = {
"wool:black",
"wool:blue",
"wool:brown",
"wool:cyan",
"wool:dark_green",
"wool:dark_grey",
"wool:green",
"wool:grey",
"wool:magenta",
"wool:orange",
"wool:pink",
"wool:red",
"wool:violet",
"wool:white",
"wool:yellow",
"carpet:black",
"carpet:blue",
"carpet:brown",
"carpet:cyan",
"carpet:dark_green",
"carpet:dark_grey",
"carpet:green",
"carpet:grey",
"carpet:magenta",
"carpet:orange",
"carpet:pink",
"carpet:red",
"carpet:violet",
"carpet:white",
"carpet:yellow",
"deco:furnace_active",
"beds:bed_bottom",
"beds:bed_top",
"beds:bed_top_red",
"beds:bed_top_orange",
"beds:bed_top_yellow",
"beds:bed_top_green",
"beds:bed_top_blue",
"beds:bed_top_violet",
"beds:bed_top_black",
"beds:bed_top_grey",
"beds:bed_top_white",
"beds:bed_bottom_red",
"beds:bed_bottom_orange",
"beds:bed_bottom_yellow",
"beds:bed_bottom_green",
"beds:bed_bottom_blue",
"beds:bed_bottom_violet",
"beds:bed_bottom_black",
"beds:bed_bottom_grey",
"beds:bed_bottom_white",
}
mobs:register_spawn("mobs:kitten", {"default:dirt_with_grass"}, 20, 0, 12000, 1, 31000)
-- Kitten by Jordach / BFD
mobs:register_mob("mobs:kitten", {
-- animal, monster, npc
type = "animal",
hp_min = 5,
hp_max = 10,
-- is it aggressive
passive = true,
-- health & armor
hp_min = 5, hp_max = 10, armor = 200,
-- textures and model
collisionbox = {-0.3, -0.3, -0.3, 0.3, 0.1, 0.3},
visual = "mesh",
visual_size = {x=0.5, y=0.5},
@ -71,40 +20,38 @@ mobs:register_mob("mobs:kitten", {
texture_3 = {"mobs_kitten_ginger.png"},
texture_4 = {"mobs_kitten_sandy.png"},
},
blood_texture = "mobs_blood.png",
-- sounds
makes_footstep_sound = false,
view_range = 16,
sounds = {
random = "mobs_kitten",
},
-- speed and jump
walk_velocity = 0.6,
jump = false,
-- drops sometimes coins
drops = {
{name = "maptools:copper_coin",
chance = 10,
min = 1,
max = 1,},
},
-- damaged by
water_damage = 1,
lava_damage = 5,
on_rightclick = nil,
armor = 200,
sounds = {
random = "mobs_kitten",
},
-- model animation
animation = {
stand_start = 97,
stand_end = 192,
walk_start = 0,
walk_end = 96,
speed_normal = 42,
stand_start = 97, stand_end = 192,
walk_start = 0, walk_end = 96,
},
-- follows rat
follow = "mobs:rat",
view_range = 8,
-- jump = true,
-- step = 0.5,
passive = true,
blood_texture = "mobs_blood.png",
-- feed with raw fish to tame or right click to pick up
on_rightclick = function(self, clicker)
local item = clicker:get_wielded_item()
if item:get_name() == "fishing:fish_raw" then
if item:get_name() == "fishing:fish_raw" or item:get_name() == "ethereal:fish_raw" then
if not minetest.setting_getbool("creative_mode") then
item:take_item()
clicker:set_wielded_item(item)
@ -117,5 +64,12 @@ mobs:register_mob("mobs:kitten", {
end
return
end
if clicker:is_player() and clicker:get_inventory() then
clicker:get_inventory():add_item("main", "mobs:kitten")
self.object:remove()
end
end
})
mobs:register_spawn("mobs:kitten", {"default:dirt_with_grass"}, 20, 0, 12000, 1, 31000)
mobs:register_egg("mobs:kitten", "Kitten", "mobs_kitten_inv.png", 0)

View File

@ -75,16 +75,18 @@ mobs:register_mob("mobs:sheep", {
end
return
end
if clicker:get_inventory() and not self.gotten and self.child == false then
-- need shears to get wool from sheep
if clicker:get_inventory() and item:get_name() == "mobs:shears" and not self.gotten and self.child == false then
self.gotten = true -- shaved
if minetest.registered_items["wool:white"] then
clicker:get_inventory():add_item("main", ItemStack("wool:white "..math.random(1,3)))
item:add_wear(65535/100)
clicker:set_wielded_item(item)
end
self.object:set_properties({
textures = {"mobs_sheep_shaved.png"},
mesh = "mobs_sheep_shaved.x",
})
else print ("shaved already!")
end
end,
})
@ -92,3 +94,25 @@ mobs:register_mob("mobs:sheep", {
mobs:register_spawn("mobs:sheep", {"default:dirt_with_grass"}, 20, 8, 9000, 1, 31000)
-- register spawn egg
mobs:register_egg("mobs:sheep", "Sheep", "wool_white.png", 1)
-- shears tool (right click sheep to shear)
minetest.register_tool("mobs:shears", {
description = "Steel Shears (right-click sheep to shear)",
inventory_image = "mobs_shears.png",
tool_capabilities = {
full_punch_interval = 1,
max_drop_level=1,
groupcaps={
snappy={times={[1]=2.5, [2]=1.20, [3]=0.35}, uses=30, maxlevel=2},
},
damage_groups = {fleshy=0},
}
})
minetest.register_craft({
output = 'mobs:shears',
recipe = {
{'', 'default:steel_ingot', ''},
{'', 'group:stick', 'default:steel_ingot'},
}
})

View File

@ -38,7 +38,7 @@ mobs:register_mob("mobs:spider", {
-- drops string with a chance of sandstone or crystal spike if Ethereal installed
drops = {
{name = "farming:string",
chance = 2, min = 2, max = 3,},
chance = 2, min = 1, max = 3,},
{name = "mobs:meat_raw",
chance = 4, min = 1, max = 2,},
{name = "maptools:copper_coin",
@ -89,7 +89,7 @@ minetest.register_node("mobs:spider_cobweb", {
sounds = default.node_sound_leaves_defaults(),
})
-- Spider Cobweb craft
-- Spider Cobweb craft (MFF : indentation modifié)
minetest.register_craft( {
output = "mobs:spider_cobweb",
recipe = {

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.4 KiB

After

Width:  |  Height:  |  Size: 999 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 771 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.4 KiB

After

Width:  |  Height:  |  Size: 466 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.0 KiB

After

Width:  |  Height:  |  Size: 809 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 3.0 KiB

After

Width:  |  Height:  |  Size: 1.0 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 440 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 377 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.1 KiB

After

Width:  |  Height:  |  Size: 404 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.5 KiB

After

Width:  |  Height:  |  Size: 456 B

Binary file not shown.

Before

Width:  |  Height:  |  Size: 1.3 KiB

After

Width:  |  Height:  |  Size: 416 B

View File

@ -4,10 +4,10 @@
mobs:register_mob("mobs:tree_monster", {
-- animal, monster, npc, barbarian
type = "monster",
-- aggressive, deals 6 damage to player when hit
-- aggressive, deals 8 damage to player when hit
passive = false,
attack_type = "dogfight",
damage = 6,
damage = 8,
-- health & armor
hp_min = 40, hp_max = 50, armor = 80,
-- textures and model
@ -41,9 +41,7 @@ mobs:register_mob("mobs:tree_monster", {
{name = "default:apple",
chance = 2, min = 1, max = 3,},
{name = "maptools:silver_coin",
chance = 2,
min = 1,
max = 1,},
chance = 2, min = 1, max = 1,},
},
-- damaged by
water_damage = 1,

View File

@ -4,7 +4,7 @@
mobs:register_mob("mobs:pumba", {
-- animal, monster, npc, barbarian
type = "animal",
-- aggressive, deals 2 damage to player when threatened
-- aggressive, deals 4 damage to player when threatened
passive = false,
attack_type = "dogfight",
damage = 4,