mirror of
https://codeberg.org/tenplus1/mobs_animal.git
synced 2025-07-21 09:32:39 +02:00
Compare commits
27 Commits
master
...
cac5e8328f
Author | SHA1 | Date | |
---|---|---|---|
cac5e8328f | |||
bcb158d241 | |||
99cf81611a | |||
a7b08928c5 | |||
630c73cdd7 | |||
eba1ac7f10 | |||
86987aadde | |||
5293673547 | |||
0873ef4119 | |||
498b3fbf10 | |||
01bdea97c7 | |||
620bdfe33d | |||
061cbb10b7 | |||
ba305db9ca | |||
e3ca168e7e | |||
66be327567 | |||
8ef65e2292 | |||
03acd94c3b | |||
a5ed775333 | |||
b98fc2186f | |||
a14d29bd55 | |||
0aa7224ebc | |||
9776d5dfd4 | |||
4a8cd67f6d | |||
ad864bd1c8 | |||
99794a8cdc | |||
24bf26253c |
32
cow.lua
32
cow.lua
@ -33,6 +33,7 @@ mobs:register_mob("mobs_animal:cow", {
|
|||||||
drops = {
|
drops = {
|
||||||
{name = "mobs:meat_raw", chance = 1, min = 1, max = 3},
|
{name = "mobs:meat_raw", chance = 1, min = 1, max = 3},
|
||||||
{name = "mobs:leather", chance = 1, min = 0, max = 2},
|
{name = "mobs:leather", chance = 1, min = 0, max = 2},
|
||||||
|
{name = "maptools:silver_coin", chance = 10, min = 0, max = 1,},
|
||||||
},
|
},
|
||||||
water_damage = 0,
|
water_damage = 0,
|
||||||
lava_damage = 5,
|
lava_damage = 5,
|
||||||
@ -65,7 +66,7 @@ mobs:register_mob("mobs_animal:cow", {
|
|||||||
view_range = 8,
|
view_range = 8,
|
||||||
replace_rate = 10,
|
replace_rate = 10,
|
||||||
replace_what = {
|
replace_what = {
|
||||||
{"group:grass", "air", 0},
|
{"group:grass", "mobs:dung", 0},
|
||||||
{"default:dirt_with_grass", "default:dirt", -1}
|
{"default:dirt_with_grass", "default:dirt", -1}
|
||||||
},
|
},
|
||||||
-- stay_near = {{"farming:straw", "group:grass"}, 10},
|
-- stay_near = {{"farming:straw", "group:grass"}, 10},
|
||||||
@ -262,3 +263,32 @@ minetest.register_craft({
|
|||||||
{"mobs:cheeseblock"},
|
{"mobs:cheeseblock"},
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
-- Dung (from factory's fertilizer)
|
||||||
|
minetest.register_node(
|
||||||
|
":mobs:dung",
|
||||||
|
{
|
||||||
|
tiles = {"default_dirt.png"},
|
||||||
|
inventory_image = "mobs_dung.png",
|
||||||
|
description = "Cow dung",
|
||||||
|
drawtype = "nodebox",
|
||||||
|
paramtype = "light",
|
||||||
|
is_ground_content = true,
|
||||||
|
groups = {snappy = 3, attached_node = 1},
|
||||||
|
node_box = {
|
||||||
|
type = "fixed",
|
||||||
|
fixed = {
|
||||||
|
{-0.1875, -0.5, -0.1875, 0.1875, -0.4375, 0.1875},
|
||||||
|
{-0.125, -0.4375, -0.125, 0.125, -0.375, 0.125},
|
||||||
|
{0, -0.375, -0.0625, 0.0625, -0.3125, 0.0625},
|
||||||
|
{0, -0.3125, -0.0625, 0.0625, -0.25, 0},
|
||||||
|
{-0.0625, -0.375, -0.0625, 0, -0.3125, 0},
|
||||||
|
}
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
type = "fuel",
|
||||||
|
recipe = "mobs:dung",
|
||||||
|
burntime = "8",
|
||||||
|
})
|
||||||
|
107
goat.lua
Executable file
107
goat.lua
Executable file
@ -0,0 +1,107 @@
|
|||||||
|
|
||||||
|
-- Goat by DonBatman
|
||||||
|
|
||||||
|
mobs:register_mob("mobs_animal:goat", {
|
||||||
|
-- animal, monster, npc, barbarian
|
||||||
|
type = "animal",
|
||||||
|
-- aggressive, does 5 damage to player when threatened
|
||||||
|
passive = false,
|
||||||
|
group_attack = true,
|
||||||
|
attack_type = "dogfight",
|
||||||
|
reach = 2,
|
||||||
|
damage = 3,
|
||||||
|
-- health & armor
|
||||||
|
hp_min = 10,
|
||||||
|
hp_max = 20,
|
||||||
|
armor = 200,
|
||||||
|
-- textures and model
|
||||||
|
collisionbox = {-0.3, -0.01, -0.3, 0.3, 0.75, 0.3},
|
||||||
|
visual = "mesh",
|
||||||
|
mesh = "mobs_goat.b3d",
|
||||||
|
drawtype = "front",
|
||||||
|
textures = {
|
||||||
|
{"mobs_goat_white.png"},
|
||||||
|
{"mobs_goat_brown.png"},
|
||||||
|
{"mobs_goat_grey.png"},
|
||||||
|
},
|
||||||
|
blood_texture = "mobs_blood.png",
|
||||||
|
visual_size = {x=2,y=2},
|
||||||
|
-- sounds
|
||||||
|
makes_footstep_sound = true,
|
||||||
|
sounds = {
|
||||||
|
random = "mobs_sheep",
|
||||||
|
},
|
||||||
|
-- speed and jump
|
||||||
|
walk_velocity = 1.5,
|
||||||
|
run_velocity = 3,
|
||||||
|
jump = true,
|
||||||
|
-- drops raw meat when dead
|
||||||
|
drops = {
|
||||||
|
{name = "mobs:meat_raw",
|
||||||
|
chance = 1, min = 2, max = 4},
|
||||||
|
{name = "maptools:silver_coin",
|
||||||
|
chance = 10, min = 1, max = 1,},
|
||||||
|
},
|
||||||
|
-- damaged by
|
||||||
|
water_damage = 1,
|
||||||
|
lava_damage = 5,
|
||||||
|
light_damage = 0,
|
||||||
|
-- model animation
|
||||||
|
animation = {
|
||||||
|
speed_normal = 25, speed_run = 30,
|
||||||
|
stand_start = 0, stand_end = 60, -- head down/up
|
||||||
|
walk_start = 80, walk_end = 110, -- walk
|
||||||
|
run_start = 160, run_end = 198, -- walk
|
||||||
|
punch_start = 120, punch_end = 150, -- attack
|
||||||
|
},
|
||||||
|
-- follows wheat
|
||||||
|
follow = {"farming:wheat"},
|
||||||
|
view_range = 10,
|
||||||
|
-- replace grass/wheat with air (eat)
|
||||||
|
replace_rate = 50,
|
||||||
|
replace_what = {"group:flora"},
|
||||||
|
replace_with = "air",
|
||||||
|
on_rightclick = function(self, clicker)
|
||||||
|
-- feed or tame
|
||||||
|
if mobs:feed_tame(self, clicker, 8, true, true) then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local tool = clicker:get_wielded_item()
|
||||||
|
|
||||||
|
-- milk goat with empty bucket
|
||||||
|
if tool:get_name() == "bucket:bucket_empty" then
|
||||||
|
if self.child == true then
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
if self.gotten == true then
|
||||||
|
minetest.chat_send_player(clicker:get_player_name(),
|
||||||
|
"Goat already milked!")
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
local inv = clicker:get_inventory()
|
||||||
|
|
||||||
|
inv:remove_item("main", "bucket:bucket_empty")
|
||||||
|
|
||||||
|
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()
|
||||||
|
pos.y = pos.y + 0.5
|
||||||
|
minetest.add_item(pos, {name = "mobs:bucket_milk"})
|
||||||
|
end
|
||||||
|
|
||||||
|
self.gotten = true -- milked
|
||||||
|
return
|
||||||
|
end
|
||||||
|
|
||||||
|
mobs:capture_mob(self, clicker, 0, 5, 60, false, nil)
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
-- spawn on dirt_with_grass between -1 and 20 light, 1 in 20000 chance, 1 goat in area up to 31000 in height
|
||||||
|
mobs:spawn_specific("mobs_animal:goat", {"default:dirt_with_grass"}, {"air"}, -1, 20, 30, 20000, 1, -31000, 31000, true)
|
||||||
|
-- register spawn egg
|
||||||
|
mobs:register_egg("mobs_animal:goat", "Goat", "mobs_goat_inv.png", 1)
|
||||||
|
mobs:alias_mob("mobs:goat", "mobs_animal:goat")
|
2
init.lua
2
init.lua
@ -29,6 +29,7 @@ dofile(path .. "bunny.lua") -- ExeterDad
|
|||||||
dofile(path .. "kitten.lua") -- Jordach/BFD
|
dofile(path .. "kitten.lua") -- Jordach/BFD
|
||||||
dofile(path .. "penguin.lua") -- D00Med
|
dofile(path .. "penguin.lua") -- D00Med
|
||||||
dofile(path .. "panda.lua") -- AspireMint
|
dofile(path .. "panda.lua") -- AspireMint
|
||||||
|
dofile(path .. "goat.lua") -- NALC(sys4 fork MFF)
|
||||||
|
|
||||||
|
|
||||||
-- Load custom spawning
|
-- Load custom spawning
|
||||||
@ -36,7 +37,6 @@ if mobs.custom_spawn_animal then
|
|||||||
dofile(path .. "spawn.lua")
|
dofile(path .. "spawn.lua")
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
-- Lucky Blocks
|
-- Lucky Blocks
|
||||||
dofile(path .. "lucky_block.lua")
|
dofile(path .. "lucky_block.lua")
|
||||||
|
|
||||||
|
@ -54,7 +54,8 @@ stepheight = 1.1,
|
|||||||
},
|
},
|
||||||
follow = {
|
follow = {
|
||||||
"mobs_animal:rat", "group:food_fish_raw",
|
"mobs_animal:rat", "group:food_fish_raw",
|
||||||
"mobs_fish:tropical", "xocean:fish_edible"
|
"mobs_fish:tropical", "xocean:fish_edible",
|
||||||
|
"group:fishraw" -- NALC: Group from fishing mod
|
||||||
},
|
},
|
||||||
view_range = 8,
|
view_range = 8,
|
||||||
|
|
||||||
|
BIN
models/mobs_goat.b3d
Normal file
BIN
models/mobs_goat.b3d
Normal file
Binary file not shown.
@ -47,7 +47,8 @@ stepheight = 0.6,
|
|||||||
floats = 0,
|
floats = 0,
|
||||||
follow = {
|
follow = {
|
||||||
"group:food_fish_raw", "mobs_fish:clownfish", "mobs_fish:tropical",
|
"group:food_fish_raw", "mobs_fish:clownfish", "mobs_fish:tropical",
|
||||||
"mobs_fish:clownfish_set", "mobs_fish:tropical_set", "xocean:fish_edible"
|
"mobs_fish:clownfish_set", "mobs_fish:tropical_set", "xocean:fish_edible",
|
||||||
|
"group:fishraw" -- Edit from NALC: Group from fishing mod
|
||||||
},
|
},
|
||||||
view_range = 5,
|
view_range = 5,
|
||||||
|
|
||||||
|
BIN
textures/mobs_dung.png
Executable file
BIN
textures/mobs_dung.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 635 B |
BIN
textures/mobs_goat_brown.png
Executable file
BIN
textures/mobs_goat_brown.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 4.4 KiB |
BIN
textures/mobs_goat_grey.png
Executable file
BIN
textures/mobs_goat_grey.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 4.5 KiB |
BIN
textures/mobs_goat_inv.png
Normal file
BIN
textures/mobs_goat_inv.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.6 KiB |
BIN
textures/mobs_goat_white.png
Executable file
BIN
textures/mobs_goat_white.png
Executable file
Binary file not shown.
After Width: | Height: | Size: 4.8 KiB |
@ -37,6 +37,7 @@ mobs:register_mob("mobs_animal:pumba", {
|
|||||||
view_range = 10,
|
view_range = 10,
|
||||||
drops = {
|
drops = {
|
||||||
{name = "mobs:pork_raw", chance = 1, min = 1, max = 3},
|
{name = "mobs:pork_raw", chance = 1, min = 1, max = 3},
|
||||||
|
{name = "maptools:silver_coin", chance = 10, min = 0, max = 1,},
|
||||||
},
|
},
|
||||||
water_damage = 0,
|
water_damage = 0,
|
||||||
lava_damage = 5,
|
lava_damage = 5,
|
||||||
|
Reference in New Issue
Block a user