animalia/mobs/tropical_fish.lua

91 lines
1.8 KiB
Lua
Raw Permalink Normal View History

2022-02-10 18:00:06 -08:00
----------
-- Fish --
----------
creatura.register_mob("animalia:tropical_fish", {
2023-03-15 14:27:40 -07:00
-- Engine Props
visual_size = {x = 10, y = 10},
2022-12-11 17:21:49 -08:00
meshes = {
"animalia_clownfish.b3d",
"animalia_angelfish.b3d"
},
mesh_textures = {
{
"animalia_clownfish.png",
"animalia_blue_tang.png"
},
{
"animalia_angelfish.png"
}
2022-02-10 18:00:06 -08:00
},
2023-03-15 14:27:40 -07:00
-- Creatura Props
max_health = 5,
armor_groups = {fleshy = 150},
damage = 0,
max_breath = 0,
speed = 2,
tracking_range = 6,
max_boids = 6,
boid_seperation = 0.3,
despawn_after = 200,
2023-12-28 21:28:05 -08:00
max_fall = 0,
2023-03-15 14:27:40 -07:00
stepheight = 1.1,
hitbox = {
width = 0.15,
height = 0.3
},
animations = {
2022-02-10 18:00:06 -08:00
swim = {range = {x = 1, y = 20}, speed = 20, frame_blend = 0.3, loop = true},
flop = {range = {x = 30, y = 40}, speed = 20, frame_blend = 0.3, loop = true},
},
2023-12-28 21:28:05 -08:00
liquid_submergence = 1,
liquid_drag = 0,
-- Animalia Behaviors
is_aquatic_mob = true,
2023-03-15 14:27:40 -07:00
-- Animalia Props
flee_puncher = false,
2022-02-10 18:00:06 -08:00
catch_with_net = true,
catch_with_lasso = false,
2023-03-15 14:27:40 -07:00
-- Functions
2022-02-10 18:00:06 -08:00
utility_stack = {
2024-01-04 11:15:02 -08:00
animalia.mob_ai.swim_wander
2022-02-10 18:00:06 -08:00
},
2023-03-15 14:27:40 -07:00
activate_func = function(self)
2022-02-10 18:00:06 -08:00
animalia.initialize_api(self)
animalia.initialize_lasso(self)
end,
2023-03-15 14:27:40 -07:00
step_func = function(self)
2022-02-10 18:00:06 -08:00
animalia.step_timers(self)
animalia.do_growth(self, 60)
animalia.update_lasso_effects(self)
end,
2023-03-15 14:27:40 -07:00
death_func = function(self)
2022-02-10 18:00:06 -08:00
if self:get_utility() ~= "animalia:die" then
self:initiate_utility("animalia:die", self)
end
end,
2023-03-15 14:27:40 -07:00
2022-02-10 18:00:06 -08:00
on_rightclick = function(self, clicker)
if animalia.set_nametag(self, clicker) then
return
end
2022-02-10 18:00:06 -08:00
end,
2023-03-15 14:27:40 -07:00
2022-10-17 17:23:26 -07:00
on_punch = animalia.punch
2022-02-10 18:00:06 -08:00
})
2023-03-15 14:27:40 -07:00
creatura.register_spawn_item("animalia:tropical_fish", {
col1 = "e28821",
col2 = "f6e5d2"
})
2022-02-10 18:00:06 -08:00
animalia.alias_mob("animalia:clownfish", "animalia:tropical_fish")
animalia.alias_mob("animalia:blue_tang", "animalia:tropical_fish")
animalia.alias_mob("animalia:angelfish", "animalia:tropical_fish")