-- File: codersea-morefish.lua -- Purpose: CoderSea misc.-fish support module -- Credits: See "codersea.md" -- Licenses: See "LICENSE" -- =================================================================== -- set to true to use upright sprites instead of meshes local SPRITE_VERSION = false -- local variables local l_spawn_in = { "codersea:water_flowing" , "codersea:water_source" , "default:water_flowing" , "default:water_source" , "default:water_gel" , "default:river_water_source" , "default:river_water_flowing" , } local l_spawn_near = { "darkage:silt" , "default:sand" , "default:dirt" , "ethereal:dry_dirt" , "ethereal:green_dirt" , "ethereal:grove_dirt" , "ethereal:mushroom_dirt" , "group:sand" , "group:soil" , } -- =================================================================== local spawnchance = codersea_chance_fish if spawnchance < 300 then spawnchance = 300 end local l_cc_hand = 25 local l_cc_net = 80 local l_water_level = minetest.setting_get ("water_level") - 1 local l_anims = { speed_normal = 24, speed_run = 24, stand_start = 1, stand_end = 80, walk_start = 81, walk_end = 155, run_start = 81, run_end = 155, } local l_visual = "mesh" local l_visual_size = { x=0.75, y=0.75 } local l_butter_mesh = "codersea_butterfish.obj" local l_clown_mesh = "codersea_clownfish.b3d" local l_goldfish_mesh = "codersea_goldfish.obj" local l_tropical_mesh = "codersea_tropical.b3d" local l_butter_textures = { { "codersea_butterfish_mesh.png" } , } local l_clown_textures = { { "codersea_clownfish1.png" } , { "codersea_clownfish2.png" } , } local l_goldfish_textures = { { "codersea_goldfish_mesh.png" } , } local l_tropical_textures = { { "codersea_tropical1.png" } , { "codersea_tropical2.png" } , { "codersea_tropical3.png" } , } if SPRITE_VERSION then l_visual = "upright_sprite" l_visual_size = {x=.5, y=.5} l_butter_mesh = nil l_clown_mesh = nil l_goldfish_mesh = nil l_tropical_mesh = nil l_butter_textures = {{ "codersea_butterfish_item.png" }} l_clown_textures = {{ "codersea_clownfish_item.png" }} l_goldfish_textures = {{ "codersea_goldfish_item.png" }} l_tropical_textures = {{ "codersea_tropical_item.png" }} end minetest.register_craftitem ("codersea:sushi", { description = "Sushi" , inventory_image = "codersea_sushi.png" , on_use = minetest.item_eat (6) , }) -- =================================================================== -- Copperband Butterfly Fish. mobs:register_mob ("codersea:butterfish", { do_custom = mob_custom, type = "animal", passive = true, hp_min = 1, hp_max = 4, armor = 100, collisionbox = { -0.20, -0.20, -0.20, 0.20, 0.20, 0.20 } , rotate = 270, visual = l_visual , mesh = l_butter_mesh , textures = l_butter_textures, visual_size = { x=1.5, y=1.5 } , makes_footstep_sound = false, stepheight = 0.1, fly = true, fly_in = fly_water, fall_speed = 0, view_range = 8, water_damage = 0, lava_damage = 5, light_damage = 0, -- animation = l_anims, drops = {{ name = "codersea:sushi" , chance = 1, min = 1, max = 1 , }} , on_rightclick = function (self, clicker) mobs:capture_mob (self, clicker, l_cc_hand, l_cc_net, 0, true, nil) end }) mobs:spawn_specific ("codersea:butterfish", l_spawn_in, l_spawn_near, 5, 20, 30, spawnchance, codersea_aoc_fish, -31000, l_water_level) mobs:register_egg ("codersea:butterfish", "Copperband Butterfly Fish", "codersea_butterfish_item.png", 0) -- =================================================================== -- Goldfish. mobs:register_mob ("codersea:goldfish", { do_custom = mob_custom , type = "animal" , passive = true , hp_min = 1 , hp_max = 4 , armor = 50 , collisionbox = { -0.20, -0.20, -0.20, 0.20, 0.20, 0.20 } , inventory_image = "codersea_goldfish_item.png" , rotate = 270 , mesh = l_goldfish_mesh , textures = l_goldfish_textures , visual = l_visual , visual_size = { x=1.5, y=1.5 } , makes_footstep_sound = false, stepheight = 0.1 , fly = true , fly_in = fly_water , fall_speed = 0 , view_range = 8 , water_damage = 0 , lava_damage = 5 , light_damage = 0 , drops = {{ name = "codersea:sushi" , chance = 1, min = 1, max = 1 , }} , on_rightclick = function (self, clicker) mobs:capture_mob (self, clicker, l_cc_hand, l_cc_net, 0, true, nil) end }) mobs:spawn_specific ("codersea:goldfish", l_spawn_in, l_spawn_near, 5, 20, 30, spawnchance, codersea_aoc_fish, -31000, l_water_level) mobs:register_egg ("codersea:goldfish", "Goldfish", "codersea_goldfish_item.png", 0) -- =================================================================== -- Clownfish mobs:register_mob ("codersea:clownfish", { do_custom = mob_custom, type = "animal", passive = true, hp_min = 1, hp_max = 4, armor = 100, collisionbox = {-0.25, -0.25, -0.25, 0.25, 0.25, 0.25}, rotate = 270, visual = l_visual, mesh = l_clown_mesh, textures = l_clown_textures, visual_size = l_visual_size, makes_footstep_sound = false, stepheight = 0.1, fly = true, fly_in = fly_water, fall_speed = 0, view_range = 8, water_damage = 0, lava_damage = 5, light_damage = 0, animation = l_anims, drops = {{ name = "codersea:sushi" , chance = 1, min = 1, max = 1 , }} , on_rightclick = function (self, clicker) mobs:capture_mob (self, clicker, l_cc_hand, l_cc_net, 0, true, nil) end }) mobs:spawn_specific ("codersea:clownfish", l_spawn_in, l_spawn_near, 5, 20, 30, spawnchance, codersea_aoc_fish, -31000, l_water_level) mobs:register_egg ("codersea:clownfish", "Clownfish", "codersea_clownfish_item.png", 0) -- =================================================================== mobs:register_mob ("codersea:tropical", { do_custom = mob_custom, type = "animal", passive = true, hp_min = 1, hp_max = 4, armor = 100, collisionbox = { -0.25, -0.25, -0.25, 0.25, 0.25, 0.25 } , rotate = 270 , visual = l_visual , mesh = l_tropical_mesh , textures = l_tropical_textures , visual_size = l_visual_size , makes_footstep_sound = false, stepheight = 0.1, fly = true, fly_in = fly_water, fall_speed = 0, view_range = 8, water_damage = 0, lava_damage = 5, light_damage = 0, animation = l_anims, drops = {{ name = "codersea:sushi" , chance = 1, min = 1, max = 1 , }} , on_rightclick = function (self, clicker) mobs:capture_mob (self, clicker, l_cc_hand, l_cc_net, 0, true, nil) end }) mobs:spawn_specific ("codersea:tropical", l_spawn_in, l_spawn_near, 5, 20, 30, spawnchance, codersea_aoc_fish, -31000, l_water_level) mobs:register_egg ("codersea:tropical", "Tropical fish", "codersea_tropical_item.png", 0) -- =================================================================== -- End of file.