Skip to content

Commit

Permalink
Update extra_mobs
Browse files Browse the repository at this point in the history
  • Loading branch information
TechDudie committed Apr 1, 2021
1 parent 23d8729 commit 6b52d1a
Show file tree
Hide file tree
Showing 45 changed files with 1,789 additions and 0 deletions.
625 changes: 625 additions & 0 deletions extra_mobs/LICENSE

Large diffs are not rendered by default.

3 changes: 3 additions & 0 deletions extra_mobs/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# extra_mobs

A mod that adds aditional mobs to Mineclone 2, namely mobs that were added in updates of Minecraft past 1.12 (Mineclone's goal)
39 changes: 39 additions & 0 deletions extra_mobs/TODO.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
TODO.Mobs:

Mountain Goats

Fish

Dolfins

Fox

Pandas

Zombified Piglins

Pillagers

Ravagers

Phantoms

Hoglins

Zoglins

Drowneds

Glow Squids

Axolotls

Done.Mobs:

Piglins

Strider

Herobrine (optional)

Hoglin/Zoglin
128 changes: 128 additions & 0 deletions extra_mobs/cod.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,128 @@
--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,
looting = "common",},
{name = "mcl_dye:white",
chance = 20,
min = 1,
max = 1,
looting = "common",},
},
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,
--[[on_rightclick = function(self, clicker)
local item = clicker:get_wielded_item()
if item:get_name() == mobs_mc.items.bucket and clicker:get_inventory() then
local inv = clicker:get_inventory()
inv:remove_item("main", mobs_mc.items.bucket)
self.object:remove()
if inv:room_for_item("main", {name="extra_mobs:cod_bucket"}) then
clicker:get_inventory():add_item("main", "extra_mobs:cod_bucket")
else
local pos = self.object:get_pos()
pos.y = pos.y + 0.5
minetest.add_item(pos, {name = "extra_mobs:cod_bucket"})
end
return
end
mobs:capture_mob(self, clicker, 0, 5, 60, false, nil)
end,
]]
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)
39 changes: 39 additions & 0 deletions extra_mobs/cod_bucket.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
local S = minetest.get_translator("extra_mobs")

mcl_buckets.register_liquid({
source_place = "mcl_core:water_source",
source_take = {"mcl_core:water_source"},
itemname = "extra_mobs:cod_bucket",
inventory_image = "bucket_water.png^cod_bucket.png",
name = S("Cod Bucket"),
longdesc = S("This bucket can be used to release a cod. It is filled with water."),
usagehelp = S("Place it to empty the bucket, create a water source and release a cod."),
tt_help = S("Places a water source and cod"),
extra_check = function(pos, placer)
minetest.add_entity(pos, "extra_mobs:cod")
-- Check protection
local placer_name = ""
if placer ~= nil then
placer_name = placer:get_player_name()
end
if placer and minetest.is_protected(pos, placer_name) then
minetest.record_protection_violation(pos, placer_name)
return false
end
local nn = minetest.get_node(pos).name
if minetest.get_item_group(nn, "cauldron") ~= 0 then
-- Put water into cauldron TODO: remove second source
if nn ~= "mcl_cauldrons:cauldron_3" then
minetest.set_node(pos, {name="mcl_cauldrons:cauldron_3"})
end
-- Evaporate water if used in Nether (except on cauldron)
else
local dim = mcl_worlds.pos_to_dimension(pos)
if dim == "nether" then
minetest.sound_play("fire_extinguish_flame", {pos = pos, gain = 0.25, max_hear_distance = 16}, true)
return false
end
end
end,
groups = { water_bucket = 1 },
})
3 changes: 3 additions & 0 deletions extra_mobs/credits.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Strider textures -- [NO11]
Fox textures -- [NO11]
fungus on a stick ability -- [TechDudie]
97 changes: 97 additions & 0 deletions extra_mobs/dolphin.lua
Original file line number Diff line number Diff line change
@@ -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)
Loading

0 comments on commit 6b52d1a

Please sign in to comment.