Compare commits
32 Commits
piglin_tra
...
master
Author | SHA1 | Date |
---|---|---|
|
a23ff082a8 | |
|
f89c50300d | |
|
28b06eacb8 | |
|
84c97724b1 | |
|
680a7b8c39 | |
|
73d4243d86 | |
|
731b1aeb88 | |
|
0c9764ab74 | |
|
e5ba7b1a9d | |
|
22f50e1284 | |
|
30343f048f | |
|
2e27275fea | |
|
fba660d0e2 | |
|
061bc36037 | |
|
d2a67d3fc8 | |
|
abce481a9a | |
|
868d03420d | |
|
0c89da91e2 | |
|
f808c35694 | |
|
756e8054ca | |
|
7d864fb7b8 | |
|
36a24c6c07 | |
|
85dccd50c7 | |
|
e311781d52 | |
|
08735ad09b | |
|
5fc00ac4b0 | |
|
204fad95ef | |
|
11f7943609 | |
|
81ec69f196 | |
|
6ba517b760 | |
|
622e716c73 | |
|
9381bd9c24 |
|
@ -0,0 +1,108 @@
|
|||
--MCmobs v0.4
|
||||
--maikerumine
|
||||
--made for MC like Survival game
|
||||
--License for code WTFPL and otherwise stated in readmes
|
||||
|
||||
local pi = math.pi
|
||||
local atann = math.atan
|
||||
local atan = function(x)
|
||||
if not x or x ~= x then
|
||||
return 0
|
||||
else
|
||||
return atann(x)
|
||||
end
|
||||
end
|
||||
|
||||
local dir_to_pitch = function(dir)
|
||||
local dir2 = vector.normalize(dir)
|
||||
local xz = math.abs(dir.x) + math.abs(dir.z)
|
||||
return -math.atan2(-dir.y, xz)
|
||||
end
|
||||
|
||||
local function degrees(rad)
|
||||
return rad * 180.0 / math.pi
|
||||
end
|
||||
|
||||
local S = minetest.get_translator("extra_mobs")
|
||||
|
||||
--###################
|
||||
--################### cod
|
||||
--###################
|
||||
|
||||
local cod = {
|
||||
type = "animal",
|
||||
spawn_class = "water",
|
||||
can_despawn = true,
|
||||
passive = true,
|
||||
hp_min = 3,
|
||||
hp_max = 3,
|
||||
xp_min = 1,
|
||||
xp_max = 3,
|
||||
armor = 100,
|
||||
collisionbox = {-0.3, 0.0, -0.3, 0.3, 0.79, 0.3},
|
||||
visual = "mesh",
|
||||
mesh = "extra_mobs_cod.b3d",
|
||||
textures = {
|
||||
{"extra_mobs_cod.png"}
|
||||
},
|
||||
sounds = {
|
||||
},
|
||||
animation = {
|
||||
stand_start = 1,
|
||||
stand_end = 20,
|
||||
walk_start = 1,
|
||||
walk_end = 20,
|
||||
run_start = 1,
|
||||
run_end = 20,
|
||||
},
|
||||
drops = {
|
||||
{name = "mcl_fishing:fish_raw",
|
||||
chance = 1,
|
||||
min = 1,
|
||||
max = 1,},
|
||||
{name = "mcl_dye:white",
|
||||
chance = 20,
|
||||
min = 1,
|
||||
max = 1,},
|
||||
},
|
||||
visual_size = {x=3, y=3},
|
||||
makes_footstep_sound = false,
|
||||
fly = true,
|
||||
fly_in = { mobs_mc.items.water_source, mobs_mc.items.river_water_source },
|
||||
breathes_in_water = true,
|
||||
jump = false,
|
||||
view_range = 16,
|
||||
runaway = true,
|
||||
fear_height = 4,
|
||||
do_custom = function(self)
|
||||
self.object:set_bone_position("body", vector.new(0,1,0), vector.new(degrees(dir_to_pitch(self.object:get_velocity())) * -1 + 90,0,0))
|
||||
if minetest.get_item_group(self.standing_in, "water") ~= 0 then
|
||||
if self.object:get_velocity().y < 2.5 then
|
||||
self.object:add_velocity({ x = 0 , y = math.random(-.002, .002) , z = 0 })
|
||||
end
|
||||
end
|
||||
for _,object in pairs(minetest.get_objects_inside_radius(self.object:get_pos(), 10)) do
|
||||
local lp = object:get_pos()
|
||||
local s = self.object:get_pos()
|
||||
local vec = {
|
||||
x = lp.x - s.x,
|
||||
y = lp.y - s.y,
|
||||
z = lp.z - s.z
|
||||
}
|
||||
if not object:is_player() and object:get_luaentity().name == "extra_mobs:cod" then
|
||||
self.state = "runaway"
|
||||
self.object:set_rotation({x=0,y=(atan(vec.z / vec.x) + 3 * pi / 2) - self.rotate,z=0})
|
||||
end
|
||||
end
|
||||
end
|
||||
}
|
||||
|
||||
mobs:register_mob("extra_mobs:cod", cod)
|
||||
|
||||
|
||||
--spawning TODO: in schools
|
||||
local water = mobs_mc.spawn_height.water
|
||||
mobs:spawn_specific("extra_mobs:cod", mobs_mc.spawn.water, {mobs_mc.items.water_source}, 0, minetest.LIGHT_MAX+1, 30, 4000, 3, water-16, water)
|
||||
|
||||
--spawn egg
|
||||
mobs:register_egg("extra_mobs:cod", S("Cod"), "extra_mobs_spawn_icon_cod.png", 0)
|
|
@ -0,0 +1,97 @@
|
|||
--MCmobs v0.4
|
||||
--maikerumine
|
||||
--made for MC like Survival game
|
||||
--License for code WTFPL and otherwise stated in readmes
|
||||
|
||||
local pi = math.pi
|
||||
local atann = math.atan
|
||||
local atan = function(x)
|
||||
if not x or x ~= x then
|
||||
return 0
|
||||
else
|
||||
return atann(x)
|
||||
end
|
||||
end
|
||||
|
||||
local dir_to_pitch = function(dir)
|
||||
local dir2 = vector.normalize(dir)
|
||||
local xz = math.abs(dir.x) + math.abs(dir.z)
|
||||
return -math.atan2(-dir.y, xz)
|
||||
end
|
||||
|
||||
local function degrees(rad)
|
||||
return rad * 180.0 / math.pi
|
||||
end
|
||||
|
||||
local S = minetest.get_translator("extra_mobs")
|
||||
|
||||
--###################
|
||||
--################### dolphin
|
||||
--###################
|
||||
|
||||
local dolphin = {
|
||||
type = "monster",
|
||||
spawn_class = "water",
|
||||
can_despawn = true,
|
||||
passive = true,
|
||||
hp_min = 10,
|
||||
hp_max = 10,
|
||||
xp_min = 1,
|
||||
xp_max = 3,
|
||||
armor = 100,
|
||||
walk_chance = 100,
|
||||
breath_max = 120,
|
||||
collisionbox = {-0.3, 0.0, -0.3, 0.3, 0.79, 0.3},
|
||||
visual = "mesh",
|
||||
mesh = "extra_mobs_dolphin.b3d",
|
||||
textures = {
|
||||
{"extra_mobs_dolphin.png"}
|
||||
},
|
||||
sounds = {
|
||||
},
|
||||
animation = {
|
||||
stand_start = 20,
|
||||
stand_end = 20,
|
||||
walk_start = 0,
|
||||
walk_end = 15,
|
||||
run_start = 30,
|
||||
run_end = 45,
|
||||
},
|
||||
drops = {
|
||||
{name = "mcl_fishing:fish_raw",
|
||||
chance = 1,
|
||||
min = 0,
|
||||
max = 1,},
|
||||
},
|
||||
visual_size = {x=3, y=3},
|
||||
makes_footstep_sound = false,
|
||||
fly = true,
|
||||
fly_in = { mobs_mc.items.water_source, mobs_mc.items.river_water_source },
|
||||
breathes_in_water = true,
|
||||
jump = false,
|
||||
view_range = 16,
|
||||
fear_height = 4,
|
||||
walk_velocity = 3,
|
||||
run_velocity = 6,
|
||||
reach = 2,
|
||||
damage = 2.5,
|
||||
attack_type = "dogfight",
|
||||
do_custom = function(self)
|
||||
self.object:set_bone_position("body", vector.new(0,1,0), vector.new(degrees(dir_to_pitch(self.object:get_velocity())) * -1 + 90,0,0))
|
||||
if minetest.get_item_group(self.standing_in, "water") ~= 0 then
|
||||
if self.object:get_velocity().y < 5 then
|
||||
self.object:add_velocity({ x = 0 , y = math.random(-.007, .007), z = 0 })
|
||||
end
|
||||
end
|
||||
end,
|
||||
}
|
||||
|
||||
mobs:register_mob("extra_mobs:dolphin", dolphin)
|
||||
|
||||
|
||||
--spawning TODO: in schools
|
||||
local water = mobs_mc.spawn_height.water
|
||||
mobs:spawn_specific("extra_mobs:dolphin", mobs_mc.spawn.water, {mobs_mc.items.water_source}, 0, minetest.LIGHT_MAX+1, 30, 4000, 3, water-16, water)
|
||||
|
||||
--spawn egg
|
||||
mobs:register_egg("extra_mobs:dolphin", S("dolphin"), "extra_mobs_spawn_icon_dolphin.png", 0)
|
14
fox.lua
|
@ -18,6 +18,13 @@ local S = minetest.get_translator("extra_mobs")
|
|||
--################### fox
|
||||
--###################
|
||||
|
||||
local followitem = ""
|
||||
if minetest.get_modpath("mc_sweet_berry") then
|
||||
followitem = "mc_sweet_berry:sweet_berry"
|
||||
else
|
||||
followitem = nil
|
||||
end
|
||||
|
||||
local fox = {
|
||||
type = "monster",
|
||||
passive = false,
|
||||
|
@ -30,7 +37,7 @@ local fox = {
|
|||
attack_type = "dogfight",
|
||||
damage = 2,
|
||||
reach = 1.5,
|
||||
collisionbox = {-.6, -0.01, -.6, .6, 1.4, .6},
|
||||
collisionbox = {-0.3, -0.01, -0.3, 0.3, 0.84, 0.3},
|
||||
visual = "mesh",
|
||||
mesh = "extra_mobs_fox.b3d",
|
||||
textures = { {
|
||||
|
@ -108,14 +115,15 @@ local fox = {
|
|||
do_punch = function(self)
|
||||
self.state = "runaway"
|
||||
end,
|
||||
follow = followitem,
|
||||
fear_height = 4,
|
||||
view_range = 16,
|
||||
specific_attack = { "mobs_mc:cow", "mobs_mc:sheep", "mobs_mc:chicken" },
|
||||
specific_attack = { "mobs_mc:chicken", "extra_mobs:cod", "extra_mobs:salmon" },
|
||||
}
|
||||
|
||||
mobs:register_mob("extra_mobs:fox", fox)
|
||||
|
||||
-- Regular spawning in the Nether
|
||||
-- spawning
|
||||
mobs:spawn_specific("extra_mobs:fox", {"mcl_core:dirt_with_grass"}, {"air"}, 0, minetest.LIGHT_MAX+1, 30, 6000, 3, 0, 500)
|
||||
|
||||
mobs:spawn_specific("extra_mobs:fox", {"mcl_core:dirt_with_grass_snow"}, {"air"}, 0, minetest.LIGHT_MAX+1, 30, 6000, 3, 0, 500)
|
||||
|
|
5
init.lua
|
@ -17,3 +17,8 @@ dofile(path .. "/piglin.lua")
|
|||
--Animals
|
||||
dofile(path .. "/strider.lua")
|
||||
dofile(path .. "/fox.lua")
|
||||
dofile(path .. "/cod.lua")
|
||||
dofile(path .. "/salmon.lua")
|
||||
dofile(path .. "/dolphin.lua")
|
||||
|
||||
|
||||
|
|
4
mod.conf
|
@ -1,3 +1,3 @@
|
|||
name = extra_mobs
|
||||
depends = mcl_mobs
|
||||
optional_depends = mc
|
||||
depends = mcl_mobs, mobs_mc
|
||||
optional_depends = mc_warped_fungus_stick, mc_sweet_berry
|
||||
|
|
66
piglin.lua
|
@ -35,12 +35,12 @@ local piglin = {
|
|||
armor = {fleshy = 90},
|
||||
damage = 4,
|
||||
reach = 3,
|
||||
collisionbox = {-.6, -0.01, -.6, .6, 1.4, .6},
|
||||
collisionbox = {-0.3, -0.01, -0.3, 0.3, 1.94, 0.3},
|
||||
visual = "mesh",
|
||||
mesh = "extra_mobs_piglin.b3d",
|
||||
textures = { {
|
||||
"extra_mobs_piglin.png",
|
||||
"mcl_bows_crossbow_2.png",
|
||||
"mcl_bows_bow_2.png",
|
||||
} },
|
||||
visual_size = {x=1, y=1},
|
||||
sounds = {
|
||||
|
@ -72,10 +72,15 @@ local piglin = {
|
|||
fear_height = 4,
|
||||
view_range = 16,
|
||||
on_spawn = function(self)
|
||||
self.gold_items = 0
|
||||
self.weapon = self.base_texture[2]
|
||||
self.gold_items = 0
|
||||
end,
|
||||
do_custom = function(self)
|
||||
if self.object:get_pos().y > -100 then
|
||||
--local zog = minetest.add_entity(self.object:get_pos(), "extra_mobs:zombified_piglin")
|
||||
--zog:set_rotation(self.object:get_rotation())
|
||||
--self.object:remove()
|
||||
end
|
||||
if self.trading == true then
|
||||
self.state = "trading"
|
||||
self.object:set_bone_position("Arm_Right_Pitch_Control", vector.new(-3,5.785,0), vector.new(20,-20,18))
|
||||
|
@ -83,7 +88,7 @@ local piglin = {
|
|||
self.base_texture[2] = "default_gold_ingot.png"
|
||||
self.object:set_properties({textures = self.base_texture})
|
||||
else
|
||||
self.object:set_bone_position("Wield_Item", vector.new(-1.5,7,1.5), vector.new(170,90,90))
|
||||
self.object:set_bone_position("Wield_Item", vector.new(.5,4.5,-1.6), vector.new(90,0,20))
|
||||
self.base_texture[2] = self.weapon
|
||||
self.object:set_properties({textures = self.base_texture})
|
||||
self.object:set_bone_position("Head", vector.new(0,6.3,0), vector.new(0,0,0))
|
||||
|
@ -188,15 +193,17 @@ zombified_piglin.fire_resistant = 1
|
|||
zombified_piglin.do_custom = function()
|
||||
return
|
||||
end
|
||||
zombified_piglin.attacks_monsters = true
|
||||
zombified_piglin.on_spawn = function()
|
||||
return
|
||||
end
|
||||
zombified_piglin.on_rightclick = function()
|
||||
return
|
||||
end
|
||||
zombified_piglin.lava_damage = 0
|
||||
zombified_piglin.fire_damage = 0
|
||||
zombified_piglin.attack_animals = true
|
||||
zombified_piglin.mesh = "extra_mobs_sword_piglin.b3d"
|
||||
zombified_piglin.textures = {"extra_mobs_zombified_piglin.png", "default_tool_goldsword.png", "extra_mobs_trans.png"}
|
||||
zombified_piglin.on_spawn = function()
|
||||
return
|
||||
end
|
||||
zombified_piglin.attack_type = "dogfight"
|
||||
zombified_piglin.animation = {
|
||||
stand_speed = 30,
|
||||
|
@ -215,7 +222,50 @@ zombified_piglin.animation = {
|
|||
mobs:register_mob("extra_mobs:zombified_piglin", zombified_piglin)
|
||||
|
||||
|
||||
local piglin_brute = table.copy(piglin)
|
||||
piglin_brute.xp_min = 20
|
||||
piglin_brute.xp_max = 20
|
||||
piglin_brute.hp_min = 50
|
||||
piglin_brute.hp_max = 50
|
||||
piglin_brute.fire_resistant = 1
|
||||
piglin_brute.do_custom = function()
|
||||
return
|
||||
end
|
||||
piglin_brute.on_spawn = function()
|
||||
return
|
||||
end
|
||||
piglin_brute.on_rightclick = function()
|
||||
return
|
||||
end
|
||||
piglin_brute.attacks_monsters = true
|
||||
piglin_brute.lava_damage = 0
|
||||
piglin_brute.fire_damage = 0
|
||||
piglin_brute.attack_animals = true
|
||||
piglin_brute.mesh = "extra_mobs_sword_piglin.b3d"
|
||||
piglin_brute.textures = {"extra_mobs_piglin_brute.png", "default_tool_goldaxe.png", "extra_mobs_trans.png"}
|
||||
piglin_brute.attack_type = "dogfight"
|
||||
piglin_brute.animation = {
|
||||
stand_speed = 30,
|
||||
walk_speed = 30,
|
||||
punch_speed = 45,
|
||||
run_speed = 30,
|
||||
stand_start = 0,
|
||||
stand_end = 79,
|
||||
walk_start = 168,
|
||||
walk_end = 187,
|
||||
run_start = 440,
|
||||
run_end = 459,
|
||||
punch_start = 189,
|
||||
punch_end = 198,
|
||||
}
|
||||
piglin_brute.can_despawn = false
|
||||
piglin_brute.group_attack = { "extra_mobs:piglin", "extra_mobs:piglin_brute" }
|
||||
mobs:register_mob("extra_mobs:piglin_brute", piglin_brute)
|
||||
|
||||
|
||||
-- Regular spawning in the Nether
|
||||
mobs:spawn_specific("extra_mobs:piglin", {"mcl_nether:netherrack"}, {"air"}, 0, minetest.LIGHT_MAX+1, 30, 6000, 3, mcl_vars.mg_nether_min, mcl_vars.mg_nether_max)
|
||||
mobs:spawn_specific("extra_mobs:sword_piglin", {"mcl_nether:netherrack"}, {"air"}, 0, minetest.LIGHT_MAX+1, 30, 6000, 3, mcl_vars.mg_nether_min, mcl_vars.mg_nether_max)
|
||||
-- spawn eggs
|
||||
mobs:register_egg("extra_mobs:piglin", S("piglin"), "extra_mobs_spawn_icon_piglin.png", 0)
|
||||
mobs:register_egg("extra_mobs:piglin_brute", S("piglin Brute"), "extra_mobs_spawn_icon_piglin.png", 0)
|
||||
|
|
|
@ -0,0 +1,67 @@
|
|||
--MCmobs v0.4
|
||||
--maikerumine
|
||||
--made for MC like Survival game
|
||||
--License for code WTFPL and otherwise stated in readmes
|
||||
|
||||
local S = minetest.get_translator("extra_mobs")
|
||||
|
||||
--###################
|
||||
--################### salmon
|
||||
--###################
|
||||
|
||||
local salmon = {
|
||||
type = "animal",
|
||||
spawn_class = "water",
|
||||
can_despawn = true,
|
||||
passive = true,
|
||||
hp_min = 3,
|
||||
hp_max = 3,
|
||||
xp_min = 1,
|
||||
xp_max = 3,
|
||||
armor = 100,
|
||||
collisionbox = {-0.4, 0.0, -0.4, 0.4, 0.79, 0.4},
|
||||
visual = "mesh",
|
||||
mesh = "extra_mobs_salmon.b3d",
|
||||
textures = {
|
||||
{"extra_mobs_salmon.png"}
|
||||
},
|
||||
sounds = {
|
||||
},
|
||||
animation = {
|
||||
stand_start = 1,
|
||||
stand_end = 20,
|
||||
walk_start = 1,
|
||||
walk_end = 20,
|
||||
run_start = 1,
|
||||
run_end = 20,
|
||||
},
|
||||
drops = {
|
||||
{name = "mcl_fishing:salmon_raw",
|
||||
chance = 1,
|
||||
min = 1,
|
||||
max = 1,},
|
||||
{name = "mcl_dye:white",
|
||||
chance = 20,
|
||||
min = 1,
|
||||
max = 1,},
|
||||
},
|
||||
visual_size = {x=3, y=3},
|
||||
makes_footstep_sound = false,
|
||||
fly = true,
|
||||
fly_in = { mobs_mc.items.water_source, mobs_mc.items.river_water_source },
|
||||
breathes_in_water = true,
|
||||
jump = false,
|
||||
view_range = 16,
|
||||
runaway = true,
|
||||
fear_height = 4,
|
||||
}
|
||||
|
||||
mobs:register_mob("extra_mobs:salmon", salmon)
|
||||
|
||||
|
||||
--spawning TODO: in schools
|
||||
local water = mobs_mc.spawn_height.water
|
||||
mobs:spawn_specific("extra_mobs:salmon", mobs_mc.spawn.water, {mobs_mc.items.water_source}, 0, minetest.LIGHT_MAX+1, 30, 4000, 3, water-16, water)
|
||||
|
||||
--spawn egg
|
||||
mobs:register_egg("extra_mobs:salmon", S("Salmon"), "extra_mobs_spawn_icon_salmon.png", 0)
|
|
@ -117,7 +117,7 @@ local strider = {
|
|||
|
||||
local controlitem = ""
|
||||
if minetest.get_modpath("mc") then
|
||||
controlitem = "mc:warped_fungus_stick"
|
||||
controlitem = "mc_warped_fungus_stick:warped_fungus_stick"
|
||||
else
|
||||
controlitem = mobs_mc.items.carrot_on_a_stick
|
||||
end
|
||||
|
|
After Width: | Height: | Size: 296 B |
Before Width: | Height: | Size: 984 B After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 1.3 KiB |
After Width: | Height: | Size: 766 B |
After Width: | Height: | Size: 6.2 KiB |
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.1 KiB |
After Width: | Height: | Size: 1.6 KiB |
Before Width: | Height: | Size: 3.9 KiB After Width: | Height: | Size: 3.3 KiB |
Before Width: | Height: | Size: 9.3 KiB After Width: | Height: | Size: 13 KiB |
After Width: | Height: | Size: 14 KiB |
After Width: | Height: | Size: 830 B |
After Width: | Height: | Size: 5.8 KiB |
After Width: | Height: | Size: 6.4 KiB |
After Width: | Height: | Size: 6.1 KiB |
Before Width: | Height: | Size: 3.1 KiB After Width: | Height: | Size: 2.1 KiB |
Before Width: | Height: | Size: 6.5 KiB After Width: | Height: | Size: 2.0 KiB |
Before Width: | Height: | Size: 4.8 KiB After Width: | Height: | Size: 16 KiB |
After Width: | Height: | Size: 2.8 KiB |