2022-02-10 18:00:06 -08:00
|
|
|
----------
|
|
|
|
-- Fish --
|
|
|
|
----------
|
|
|
|
|
|
|
|
creatura.register_mob("animalia:tropical_fish", {
|
2022-08-27 20:15:57 -07:00
|
|
|
-- Stats
|
|
|
|
max_health = 5,
|
|
|
|
armor_groups = {fleshy = 150},
|
|
|
|
damage = 0,
|
|
|
|
speed = 2,
|
2022-02-10 18:00:06 -08:00
|
|
|
tracking_range = 6,
|
2022-08-27 20:15:57 -07:00
|
|
|
despawn_after = 2500,
|
2022-02-10 18:00:06 -08:00
|
|
|
-- Entity Physics
|
|
|
|
stepheight = 0.1,
|
2022-08-12 22:17:42 -07:00
|
|
|
max_fall = 0,
|
2022-02-10 18:00:06 -08:00
|
|
|
turn_rate = 8,
|
|
|
|
boid_seperation = 0.3,
|
|
|
|
bouyancy_multiplier = 0,
|
2022-08-27 20:15:57 -07:00
|
|
|
-- Visuals
|
|
|
|
mesh = "animalia_clownfish.b3d",
|
2022-02-10 18:00:06 -08:00
|
|
|
hitbox = {
|
|
|
|
width = 0.15,
|
|
|
|
height = 0.3
|
|
|
|
},
|
2022-08-27 20:15:57 -07:00
|
|
|
visual_size = {x = 7, y = 7},
|
2022-02-10 18:00:06 -08:00
|
|
|
textures = {
|
|
|
|
"animalia_clownfish.png",
|
|
|
|
"animalia_blue_tang.png",
|
|
|
|
"animalia_angelfish.png"
|
|
|
|
},
|
2022-08-27 20:15:57 -07:00
|
|
|
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},
|
|
|
|
},
|
2022-08-27 20:15:57 -07:00
|
|
|
-- Misc
|
2022-08-12 22:17:42 -07:00
|
|
|
step_delay = 0.25,
|
2022-02-10 18:00:06 -08:00
|
|
|
catch_with_net = true,
|
2022-02-20 11:45:25 -08:00
|
|
|
catch_with_lasso = false,
|
2022-02-10 18:00:06 -08:00
|
|
|
makes_footstep_sound = false,
|
2022-08-27 20:15:57 -07:00
|
|
|
-- Function
|
2022-02-10 18:00:06 -08:00
|
|
|
utility_stack = {
|
|
|
|
{
|
2022-08-12 22:17:42 -07:00
|
|
|
utility = "animalia:aquatic_wander_school",
|
|
|
|
step_delay = 0.25,
|
2022-02-10 18:00:06 -08:00
|
|
|
get_score = function(self)
|
|
|
|
return 0.1, {self}
|
|
|
|
end
|
|
|
|
},
|
|
|
|
{
|
|
|
|
utility = "animalia:flop",
|
2022-08-12 22:17:42 -07:00
|
|
|
step_delay = 0.25,
|
2022-02-10 18:00:06 -08:00
|
|
|
get_score = function(self)
|
|
|
|
if not self.in_liquid then
|
|
|
|
self:hurt(1)
|
|
|
|
return 1, {self}
|
|
|
|
end
|
|
|
|
return 0
|
|
|
|
end
|
|
|
|
},
|
|
|
|
},
|
2022-08-27 20:15:57 -07:00
|
|
|
activate_func = function(self)
|
2022-02-10 18:00:06 -08:00
|
|
|
animalia.initialize_api(self)
|
|
|
|
animalia.initialize_lasso(self)
|
|
|
|
if self.texture_no == 3 then
|
|
|
|
self.object:set_properties({
|
|
|
|
mesh = "animalia_angelfish.b3d",
|
|
|
|
})
|
|
|
|
end
|
2022-08-27 20:15:57 -07:00
|
|
|
end,
|
|
|
|
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)
|
2022-08-27 20:15:57 -07:00
|
|
|
end,
|
|
|
|
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
|
2022-08-27 20:15:57 -07:00
|
|
|
end,
|
2022-02-10 18:00:06 -08:00
|
|
|
on_rightclick = function(self, clicker)
|
2022-03-31 19:18:56 -07:00
|
|
|
if animalia.set_nametag(self, clicker) then
|
|
|
|
return
|
|
|
|
end
|
2022-02-10 18:00:06 -08:00
|
|
|
end,
|
|
|
|
on_punch = function(self, puncher, time_from_last_punch, tool_capabilities, direction, damage)
|
|
|
|
creatura.basic_punch_func(self, puncher, time_from_last_punch, tool_capabilities, direction, damage)
|
|
|
|
end
|
|
|
|
})
|
|
|
|
|
|
|
|
creatura.register_spawn_egg("animalia:tropical_fish", "e28821", "f6e5d2")
|
|
|
|
|
|
|
|
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")
|