forked from mtcontrib/mobs_water
		
	added sprite version, fix shark setting
This commit is contained in:
		| @@ -1,18 +1,43 @@ | ||||
|  | ||||
| if mobs.mod and mobs.mod == "redo" then | ||||
|  | ||||
| local SPRITE_VERSION = false	-- set to true to use upright sprites instead of meshes | ||||
|  | ||||
| -- local variables | ||||
| 	local l_spawn_in		= {"default:water_source", "default:water_flowing", "default:river_water_source", "default:river_water_flowing"} | ||||
| 	local l_spawn_near		= {"default:sand","default:dirt","group:seaplants","group:seacoral"} | ||||
| 	local l_spawn_chance	= 10000 | ||||
| 	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_spawn_in		= {"default:water_source"} | ||||
| 	local l_spawn_near		= {"default:sand","default:dirt","group:seaplants","group:seacoral"} | ||||
| 	local l_spawn_chance	= 10000 | ||||
| 	local l_cc_hand			= 25 | ||||
| 	local l_cc_net			= 80 | ||||
| 	local l_visual = "mesh" | ||||
| 	local l_visual_size = {x=.75, y=.75} | ||||
| 	local l_clown_mesh = "animal_clownfish.b3d" | ||||
| 	local l_trop_mesh = "fish_blue_white.b3d"	 | ||||
| 	local l_clown_textures = { | ||||
| 		{"clownfish.png"}, | ||||
| 		{"clownfish2.png"} | ||||
| 	} | ||||
| 	local l_trop_textures = { | ||||
| 		{"fish.png"}, | ||||
| 		{"fish2.png"}, | ||||
| 		{"fish3.png"} | ||||
| 	} | ||||
|  | ||||
| 	if SPRITE_VERSION then | ||||
| 		l_visual = "upright_sprite" | ||||
| 		l_visual_size = {x=.5, y=.5} | ||||
| 		l_clown_mesh = nil | ||||
| 		l_trop_mesh = nil		 | ||||
| 		l_clown_textures = {{"animal_clownfish_clownfish_item.png"}} | ||||
| 		l_trop_textures = {{"animal_fish_blue_white_fish_blue_white_item.png"}} | ||||
| 	end | ||||
|  | ||||
| -- Clownfish | ||||
| 	mobs:register_mob("mobs_fish:clownfish", { | ||||
| @@ -22,19 +47,16 @@ if mobs.mod and mobs.mod == "redo" then | ||||
| 		hp_max = 4, | ||||
| 		armor = 100, | ||||
| 		collisionbox = {-0.25, -0.25, -0.25, 0.25, 0.25, 0.25}, | ||||
| 		visual = "mesh", | ||||
| 		mesh = "animal_clownfish.b3d", | ||||
| 		textures = { | ||||
| 			{"clownfish.png"}, | ||||
| 			{"clownfish2.png"} | ||||
| 		}, | ||||
| 		visual_size = {x=.75, y=.75}, | ||||
| 		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 = "default:water_source", | ||||
| 		fall_speed = 0, | ||||
| 		rotate = 270, | ||||
| 		view_range = 8, | ||||
| 		water_damage = 0, | ||||
| 		lava_damage = 5, | ||||
| @@ -45,7 +67,7 @@ if mobs.mod and mobs.mod == "redo" then | ||||
| 		end | ||||
| 	}) | ||||
| 	--name, nodes, neighbours, minlight, maxlight, interval, chance, active_object_count, min_height, max_height | ||||
| 	mobs:spawn_specific("mobs_fish:clownfish", l_spawn_in, l_spawn_near, 5, 20, 30, l_spawn_chance, 1, -31000, 0) | ||||
| 	mobs:spawn_specific("mobs_fish:clownfish", l_spawn_in, l_spawn_near, 5, 20, 30, l_spawn_chance, 1, -31000, l_water_level) | ||||
| 	mobs:register_egg("mobs_fish:clownfish", "Clownfish", "animal_clownfish_clownfish_item.png", 0) | ||||
|  | ||||
| -- Tropical fish | ||||
| @@ -56,20 +78,16 @@ if mobs.mod and mobs.mod == "redo" then | ||||
| 		hp_max = 4, | ||||
| 		armor = 100, | ||||
| 		collisionbox = {-0.25, -0.25, -0.25, 0.25, 0.25, 0.25}, | ||||
| 		visual = "mesh", | ||||
| 		mesh = "fish_blue_white.b3d", | ||||
| 		textures = { | ||||
| 			{"fish.png"}, | ||||
| 			{"fish2.png"}, | ||||
| 			{"fish3.png"} | ||||
| 		}, | ||||
| 		visual_size = {x=0.75, y=0.75}, | ||||
| 		rotate = 270, | ||||
| 		visual = l_visual, | ||||
| 		mesh = l_trop_mesh, | ||||
| 		textures = l_trop_textures, | ||||
| 		visual_size = l_visual_size, | ||||
| 		makes_footstep_sound = false, | ||||
| 		stepheight = 0.1, | ||||
| 		fly = true, | ||||
| 		fly_in = "default:water_source", | ||||
| 		fall_speed = 0, | ||||
| 		rotate = 270, | ||||
| 		view_range = 8, | ||||
| 		water_damage = 0, | ||||
| 		lava_damage = 5, | ||||
| @@ -80,7 +98,7 @@ if mobs.mod and mobs.mod == "redo" then | ||||
| 		end | ||||
| 	}) | ||||
| 	--name, nodes, neighbours, minlight, maxlight, interval, chance, active_object_count, min_height, max_height | ||||
| 	mobs:spawn_specific("mobs_fish:tropical", l_spawn_in, l_spawn_near, 5, 20, 30, l_spawn_chance, 1, -31000, 0) | ||||
| 	mobs:spawn_specific("mobs_fish:tropical", l_spawn_in, l_spawn_near, 5, 20, 30, l_spawn_chance, 1, -31000, l_water_level) | ||||
| 	mobs:register_egg("mobs_fish:tropical", "Tropical fish", "animal_fish_blue_white_fish_blue_white_item.png", 0) | ||||
|  | ||||
| end | ||||
|   | ||||
| @@ -5,4 +5,4 @@ ENABLE_SHARK_LARGE		= true | ||||
| ENABLE_SHARK_MEDIUM		= true | ||||
| ENABLE_SHARK_SMALL		= true | ||||
|  | ||||
| HELP_WITH_EXPERIMENT		= true | ||||
| HELP_WITH_EXPERIMENT		= false | ||||
|   | ||||
		Reference in New Issue
	
	Block a user