animalia/mobs/rat.lua

83 lines
1.7 KiB
Lua
Raw Normal View History

2022-10-17 17:23:26 -07:00
----------
-- Mice --
----------
creatura.register_mob("animalia:rat", {
2023-03-15 14:27:40 -07:00
-- Engine Props
visual_size = {x = 10, y = 10},
mesh = "animalia_rat.b3d",
textures = {
"animalia_rat_1.png",
"animalia_rat_2.png",
"animalia_rat_3.png"
},
-- Creatura Props
2022-10-17 17:23:26 -07:00
max_health = 5,
damage = 0,
2023-03-15 14:27:40 -07:00
speed = 1,
tracking_range = 8,
despawn_after = 200,
2022-10-17 17:23:26 -07:00
stepheight = 1.1,
2023-03-15 14:27:40 -07:00
--sound = {},
2022-10-17 17:23:26 -07:00
hitbox = {
width = 0.15,
height = 0.3
},
animations = {
stand = {range = {x = 1, y = 39}, speed = 20, frame_blend = 0.3, loop = true},
walk = {range = {x = 51, y = 69}, speed = 20, frame_blend = 0.3, loop = true},
run = {range = {x = 81, y = 99}, speed = 45, frame_blend = 0.3, loop = true},
eat = {range = {x = 111, y = 119}, speed = 20, frame_blend = 0.1, loop = false}
},
drops = {
{name = "animalia:rat_raw", min = 1, max = 1, chance = 1}
},
2023-03-15 14:27:40 -07:00
2023-12-28 21:28:05 -08:00
-- Behavior Parameters
is_skittish_mob = true,
2023-03-15 14:27:40 -07:00
-- Animalia Props
flee_puncher = true,
catch_with_net = true,
catch_with_lasso = false,
-- Functions
2022-10-17 17:23:26 -07:00
utility_stack = {
2024-01-04 11:15:02 -08:00
animalia.mob_ai.basic_wander,
animalia.mob_ai.swim_seek_land,
animalia.mob_ai.basic_seek_crop,
animalia.mob_ai.rat_seek_chest,
animalia.mob_ai.basic_flee
2022-10-17 17:23:26 -07:00
},
2023-03-15 14:27:40 -07:00
2022-10-17 17:23:26 -07:00
activate_func = function(self)
animalia.initialize_api(self)
animalia.initialize_lasso(self)
end,
2023-03-15 14:27:40 -07:00
2022-10-17 17:23:26 -07:00
step_func = function(self)
animalia.step_timers(self)
animalia.do_growth(self, 60)
end,
2023-03-15 14:27:40 -07:00
2022-10-17 17:23:26 -07:00
death_func = function(self)
if self:get_utility() ~= "animalia:die" then
self:initiate_utility("animalia:die", self)
end
end,
2023-03-15 14:27:40 -07:00
2022-10-17 17:23:26 -07:00
on_rightclick = function(self, clicker)
if animalia.set_nametag(self, clicker) then
return
end
end,
2023-03-15 14:27:40 -07:00
2022-10-17 17:23:26 -07:00
on_punch = animalia.punch
})
2023-03-15 14:27:40 -07:00
creatura.register_spawn_item("animalia:rat", {
col1 = "605a55",
col2 = "ff936f"
2024-01-04 11:15:02 -08:00
})