Add an optional mob

This commit is contained in:
epCode 2021-04-29 14:37:23 -07:00
parent dbdcbb9ad6
commit bfe5c2aa1e
7 changed files with 79 additions and 3 deletions

77
golum.lua Normal file
View File

@ -0,0 +1,77 @@
--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")
--###################
--################### gollum
--###################
local gollum = {
description = S("gollum"),
type = "monster",
spawn_class = "hostile",
passive = true,
hostile = true,
always_climb = true,
docile_by_day = true,
attack_type = "punch",
punch_timer_cooloff = 0.5,
rotate = 270,
damage = 2,
reach = 2,
hp_min = 20,
hp_max = 20,
xp_min = 5,
xp_max = 5,
eye_height = 0.475,
armor = {fleshy = 100},
collisionbox = {-0.45, 0, -0.45, 0.45, 0.9, 0.45},
visual = "mesh",
mesh = "mobs_mc_golum.b3d",
textures = {
{"mobs_mc_golum.png"},
},
visual_size = {x=5, y=5},
makes_footstep_sound = false,
sounds = {
attack = "mobs_mc_golum",
damage = "mobs_mc_golum_hiss",
death = "mobs_mc_golum_death",
-- TODO: sounds: walk
distance = 16,
},
walk_velocity = 4,
run_velocity = 6, --gollum can become extremely difficult if any higher
jump = true,
jump_height = 4,
view_range = 16,
floats = 1,
do_custom = function(self)
if self.health < 5 and self.state ~= "runaway" then
self.state = "runaway"
--[[
self.object:set_yaw(self.object:get_yaw())]]
end
end,
fear_height = 4,
animation = {
stand_speed = 25,
walk_speed = 25,
run_speed = 50,
stand_start = 1,
stand_end = 40,
walk_start = 41,
walk_end = 70,
run_start = 41,
run_end = 70,
jump_start = 72,
jump_end = 107,
jump_loop = false,
},
}
mobs:register_mob("extra_mobs:gollum", gollum)

View File

@ -13,10 +13,11 @@ end
dofile(path .. "/herobrine.lua") dofile(path .. "/herobrine.lua")
dofile(path .. "/hoglin+zoglin.lua") dofile(path .. "/hoglin+zoglin.lua")
dofile(path .. "/piglin.lua") dofile(path .. "/piglin.lua")
dofile(path .. "/golum.lua")
--Animals --Animals
dofile(path .. "/strider.lua") dofile(path .. "/strider.lua")
dofile(path .. "/fox.lua") --dofile(path .. "/fox.lua")
dofile(path .. "/cod.lua") dofile(path .. "/cod.lua")
dofile(path .. "/salmon.lua") dofile(path .. "/salmon.lua")
dofile(path .. "/dolphin.lua") dofile(path .. "/dolphin.lua")
@ -24,5 +25,3 @@ dofile(path .. "/glow_squid.lua")
--Items --Items
dofile(path .. "/glow_squid_items.lua") dofile(path .. "/glow_squid_items.lua")

BIN
models/mobs_mc_golum.b3d Normal file

Binary file not shown.

BIN
sounds/mobs_mc_golum.ogg Normal file

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
textures/mobs_mc_golum.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.8 KiB