forked from mtcontrib/mobs_monster
		
	Merge remote-tracking branch 'upstream/master'
This commit is contained in:
		| @@ -1,6 +1,8 @@ | |||||||
| -- Translation support |  | ||||||
| local S = minetest.get_translator("mobs_monster") | local S = minetest.get_translator("mobs_monster") | ||||||
|  |  | ||||||
|  | -- custom dirt monster type | ||||||
|  |  | ||||||
| local dirt_types = { | local dirt_types = { | ||||||
|  |  | ||||||
| 	{	nodes = {"ethereal:dry_dirt"}, | 	{	nodes = {"ethereal:dry_dirt"}, | ||||||
| @@ -11,7 +13,6 @@ local dirt_types = { | |||||||
| 	} | 	} | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
| -- Dirt Monster by PilzAdam | -- Dirt Monster by PilzAdam | ||||||
|  |  | ||||||
| mobs:register_mob("mobs_monster:dirt_monster", { | mobs:register_mob("mobs_monster:dirt_monster", { | ||||||
| @@ -33,9 +34,7 @@ mobs:register_mob("mobs_monster:dirt_monster", { | |||||||
| 	}, | 	}, | ||||||
| 	blood_texture = "default_dirt.png", | 	blood_texture = "default_dirt.png", | ||||||
| 	makes_footstep_sound = true, | 	makes_footstep_sound = true, | ||||||
| 	sounds = { | 	sounds = {random = "mobs_dirtmonster"}, | ||||||
| 		random = "mobs_dirtmonster" |  | ||||||
| 	}, |  | ||||||
| 	view_range = 15, | 	view_range = 15, | ||||||
| 	walk_velocity = 1, | 	walk_velocity = 1, | ||||||
| 	run_velocity = 3, | 	run_velocity = 3, | ||||||
| @@ -49,16 +48,11 @@ mobs:register_mob("mobs_monster:dirt_monster", { | |||||||
| 	light_damage = 3, | 	light_damage = 3, | ||||||
| 	fear_height = 4, | 	fear_height = 4, | ||||||
| 	animation = { | 	animation = { | ||||||
| 		speed_normal = 15, | 		speed_normal = 15, speed_run = 15, | ||||||
| 		speed_run = 15, | 		stand_start = 0, stand_end = 14, | ||||||
| 		stand_start = 0, | 		walk_start = 15, walk_end = 38, | ||||||
| 		stand_end = 14, | 		run_start = 40, run_end = 63, | ||||||
| 		walk_start = 15, | 		punch_start = 40, punch_end = 63 | ||||||
| 		walk_end = 38, |  | ||||||
| 		run_start = 40, |  | ||||||
| 		run_end = 63, |  | ||||||
| 		punch_start = 40, |  | ||||||
| 		punch_end = 63 |  | ||||||
| 	}, | 	}, | ||||||
|  |  | ||||||
| 	-- check surrounding nodes and spawn a specific monster | 	-- check surrounding nodes and spawn a specific monster | ||||||
| @@ -76,9 +70,7 @@ mobs:register_mob("mobs_monster:dirt_monster", { | |||||||
| 				self.base_texture = tmp.skins | 				self.base_texture = tmp.skins | ||||||
| 				self.object:set_properties({textures = tmp.skins}) | 				self.object:set_properties({textures = tmp.skins}) | ||||||
|  |  | ||||||
| 				if tmp.drops then | 				if tmp.drops then self.drops = tmp.drops end | ||||||
| 					self.drops = tmp.drops |  | ||||||
| 				end |  | ||||||
|  |  | ||||||
| 				return true | 				return true | ||||||
| 			end | 			end | ||||||
| @@ -88,6 +80,7 @@ mobs:register_mob("mobs_monster:dirt_monster", { | |||||||
| 	end | 	end | ||||||
| }) | }) | ||||||
|  |  | ||||||
|  | -- where to spawn | ||||||
|  |  | ||||||
| if not mobs.custom_spawn_monster then | if not mobs.custom_spawn_monster then | ||||||
|  |  | ||||||
| @@ -103,8 +96,10 @@ if not mobs.custom_spawn_monster then | |||||||
| 	}) | 	}) | ||||||
| end | end | ||||||
|  |  | ||||||
|  | -- spawn egg | ||||||
|  |  | ||||||
| mobs:register_egg("mobs_monster:dirt_monster", S("Dirt Monster"), "default_dirt.png", 1) | mobs:register_egg("mobs_monster:dirt_monster", S("Dirt Monster"), "default_dirt.png", 1) | ||||||
|  |  | ||||||
|  | -- compatibility with older mobs mod | ||||||
|  |  | ||||||
| mobs:alias_mob("mobs:dirt_monster", "mobs_monster:dirt_monster") -- compatibility | mobs:alias_mob("mobs:dirt_monster", "mobs_monster:dirt_monster") | ||||||
|   | |||||||
| @@ -1,6 +1,8 @@ | |||||||
| -- Translation support |  | ||||||
| local S = minetest.get_translator("mobs_monster") | local S = minetest.get_translator("mobs_monster") | ||||||
|  |  | ||||||
|  | -- custom dungeon master types | ||||||
|  |  | ||||||
| local master_types = { | local master_types = { | ||||||
|  |  | ||||||
| 	{	nodes = {"nether:rack"}, | 	{	nodes = {"nether:rack"}, | ||||||
| @@ -11,7 +13,6 @@ local master_types = { | |||||||
| 	} | 	} | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
| -- Dungeon Master by PilzAdam | -- Dungeon Master by PilzAdam | ||||||
|  |  | ||||||
| mobs:register_mob("mobs_monster:dungeon_master", { | mobs:register_mob("mobs_monster:dungeon_master", { | ||||||
| @@ -62,16 +63,11 @@ mobs:register_mob("mobs_monster:dungeon_master", { | |||||||
| 	light_damage = 0, | 	light_damage = 0, | ||||||
| 	fear_height = 3, | 	fear_height = 3, | ||||||
| 	animation = { | 	animation = { | ||||||
| 		stand_start = 0, | 		stand_start = 0, stand_end = 19, | ||||||
| 		stand_end = 19, | 		walk_start = 20, walk_end = 35, | ||||||
| 		walk_start = 20, | 		punch_start = 36, punch_end = 48, | ||||||
| 		walk_end = 35, | 		shoot_start = 36, shoot_end = 48, | ||||||
| 		punch_start = 36, | 		speed_normal = 15, speed_run = 15 | ||||||
| 		punch_end = 48, |  | ||||||
| 		shoot_start = 36, |  | ||||||
| 		shoot_end = 48, |  | ||||||
| 		speed_normal = 15, |  | ||||||
| 		speed_run = 15 |  | ||||||
| 	}, | 	}, | ||||||
|  |  | ||||||
| 	-- check surrounding nodes and spawn a specific monster | 	-- check surrounding nodes and spawn a specific monster | ||||||
| @@ -89,9 +85,7 @@ mobs:register_mob("mobs_monster:dungeon_master", { | |||||||
| 				self.base_texture = tmp.skins | 				self.base_texture = tmp.skins | ||||||
| 				self.object:set_properties({textures = tmp.skins}) | 				self.object:set_properties({textures = tmp.skins}) | ||||||
|  |  | ||||||
| 				if tmp.drops then | 				if tmp.drops then self.drops = tmp.drops end | ||||||
| 					self.drops = tmp.drops |  | ||||||
| 				end |  | ||||||
|  |  | ||||||
| 				return true | 				return true | ||||||
| 			end | 			end | ||||||
| @@ -101,6 +95,7 @@ mobs:register_mob("mobs_monster:dungeon_master", { | |||||||
| 	end | 	end | ||||||
| }) | }) | ||||||
|  |  | ||||||
|  | -- where to spawn | ||||||
|  |  | ||||||
| if not mobs.custom_spawn_monster then | if not mobs.custom_spawn_monster then | ||||||
| 	mobs:spawn({ | 	mobs:spawn({ | ||||||
| @@ -113,14 +108,17 @@ if not mobs.custom_spawn_monster then | |||||||
| 	}) | 	}) | ||||||
| end | end | ||||||
|  |  | ||||||
|  | -- spawn egg | ||||||
|  |  | ||||||
| mobs:register_egg("mobs_monster:dungeon_master", S("Dungeon Master"), "fire_basic_flame.png", 1, true) | mobs:register_egg("mobs_monster:dungeon_master", S("Dungeon Master"), | ||||||
|  | 		"fire_basic_flame.png", 1, true) | ||||||
|  |  | ||||||
|  | -- old mobs mod compatibility | ||||||
|  |  | ||||||
| mobs:alias_mob("mobs:dungeon_master", "mobs_monster:dungeon_master") -- compatibility | mobs:alias_mob("mobs:dungeon_master", "mobs_monster:dungeon_master") | ||||||
|  |  | ||||||
|  | -- fireball arrow | ||||||
|  |  | ||||||
| -- fireball (weapon) |  | ||||||
| mobs:register_arrow("mobs_monster:fireball", { | mobs:register_arrow("mobs_monster:fireball", { | ||||||
| 	visual = "sprite", | 	visual = "sprite", | ||||||
| 	visual_size = {x = 1, y = 1}, | 	visual_size = {x = 1, y = 1}, | ||||||
| @@ -161,6 +159,7 @@ mobs:register_arrow("mobs_monster:fireball", { | |||||||
|  |  | ||||||
| 	-- direct hit, no fire... just plenty of pain | 	-- direct hit, no fire... just plenty of pain | ||||||
| 	hit_player = function(self, player) | 	hit_player = function(self, player) | ||||||
|  |  | ||||||
| 		player:punch(self.object, 1.0, { | 		player:punch(self.object, 1.0, { | ||||||
| 			full_punch_interval = 1.0, | 			full_punch_interval = 1.0, | ||||||
| 			damage_groups = {fleshy = 8} | 			damage_groups = {fleshy = 8} | ||||||
| @@ -168,6 +167,7 @@ mobs:register_arrow("mobs_monster:fireball", { | |||||||
| 	end, | 	end, | ||||||
|  |  | ||||||
| 	hit_mob = function(self, player) | 	hit_mob = function(self, player) | ||||||
|  |  | ||||||
| 		player:punch(self.object, 1.0, { | 		player:punch(self.object, 1.0, { | ||||||
| 			full_punch_interval = 1.0, | 			full_punch_interval = 1.0, | ||||||
| 			damage_groups = {fleshy = 8} | 			damage_groups = {fleshy = 8} | ||||||
|   | |||||||
| @@ -1,4 +1,6 @@ | |||||||
| -- Translation support |  | ||||||
|  | -- transpation and drops | ||||||
|  |  | ||||||
| local S = minetest.get_translator("mobs_monster") | local S = minetest.get_translator("mobs_monster") | ||||||
|  |  | ||||||
| local mob_drops = { | local mob_drops = { | ||||||
| @@ -26,9 +28,7 @@ mobs:register_mob("mobs_monster:fire_spirit", { | |||||||
| 	collisionbox = {-0.1, -0.1, -0.1, 0.1, 0.1, 0.1}, | 	collisionbox = {-0.1, -0.1, -0.1, 0.1, 0.1, 0.1}, | ||||||
| 	visual_scale = {x = 0.5, y = 0.5, z = 0.5}, | 	visual_scale = {x = 0.5, y = 0.5, z = 0.5}, | ||||||
| 	visual = "sprite", | 	visual = "sprite", | ||||||
| 	textures = { | 	textures = {{"mobs_fire_spirit.png"}}, | ||||||
| 		{"mobs_fire_spirit.png"} |  | ||||||
| 	}, |  | ||||||
| 	glow = 14, | 	glow = 14, | ||||||
| 	blood_texture = "fire_basic_flame.png", | 	blood_texture = "fire_basic_flame.png", | ||||||
| 	immune_to = { | 	immune_to = { | ||||||
| @@ -67,9 +67,7 @@ mobs:register_mob("mobs_monster:fire_spirit", { | |||||||
|  |  | ||||||
| 		self.flame_timer = (self.flame_timer or 0) + dtime | 		self.flame_timer = (self.flame_timer or 0) + dtime | ||||||
|  |  | ||||||
| 		if self.flame_timer < 0.25 then | 		if self.flame_timer < 0.25 then return end | ||||||
| 			return |  | ||||||
| 		end |  | ||||||
|  |  | ||||||
| 		self.flame_timer = 0 | 		self.flame_timer = 0 | ||||||
|  |  | ||||||
| @@ -80,6 +78,7 @@ mobs:register_mob("mobs_monster:fire_spirit", { | |||||||
| 	end | 	end | ||||||
| }) | }) | ||||||
|  |  | ||||||
|  | -- where to spawn | ||||||
|  |  | ||||||
| if not mobs.custom_spawn_monster then | if not mobs.custom_spawn_monster then | ||||||
|  |  | ||||||
| @@ -95,5 +94,6 @@ if not mobs.custom_spawn_monster then | |||||||
| 	}) | 	}) | ||||||
| end | end | ||||||
|  |  | ||||||
|  | -- spawn egg | ||||||
|  |  | ||||||
| mobs:register_egg("mobs_monster:fire_spirit", S("Fire Spirit"), "fire_basic_flame.png", 1) | mobs:register_egg("mobs_monster:fire_spirit", S("Fire Spirit"), "fire_basic_flame.png", 1) | ||||||
|   | |||||||
							
								
								
									
										15
									
								
								init.lua
									
									
									
									
									
								
							
							
						
						
									
										15
									
								
								init.lua
									
									
									
									
									
								
							| @@ -1,11 +1,10 @@ | |||||||
|  |  | ||||||
| -- Load support for intllib. | -- transpation and get mod path | ||||||
|  | local S = minetest.get_translator("mobs_monster") | ||||||
| local path = minetest.get_modpath(minetest.get_current_modname()) .. "/" | local path = minetest.get_modpath(minetest.get_current_modname()) .. "/" | ||||||
|  |  | ||||||
| -- Translation support |  | ||||||
| local S = minetest.get_translator("mobs_monster") |  | ||||||
|  |  | ||||||
| -- Check for custom mob spawn file | -- Check for custom mob spawn file | ||||||
|  |  | ||||||
| local input = io.open(path .. "spawn.lua", "r") | local input = io.open(path .. "spawn.lua", "r") | ||||||
|  |  | ||||||
| if input then | if input then | ||||||
| @@ -14,8 +13,8 @@ if input then | |||||||
| 	input = nil | 	input = nil | ||||||
| end | end | ||||||
|  |  | ||||||
|  |  | ||||||
| -- helper function | -- helper function | ||||||
|  |  | ||||||
| local function ddoo(mob) | local function ddoo(mob) | ||||||
|  |  | ||||||
| 	if minetest.settings:get_bool("mobs_monster." .. mob) == false then | 	if minetest.settings:get_bool("mobs_monster." .. mob) == false then | ||||||
| @@ -27,6 +26,7 @@ local function ddoo(mob) | |||||||
| end | end | ||||||
|  |  | ||||||
| -- Monsters | -- Monsters | ||||||
|  |  | ||||||
| ddoo("dirt_monster") -- PilzAdam | ddoo("dirt_monster") -- PilzAdam | ||||||
| ddoo("dungeon_master") | ddoo("dungeon_master") | ||||||
| ddoo("oerkki") | ddoo("oerkki") | ||||||
| @@ -40,17 +40,16 @@ ddoo("land_guard") | |||||||
| ddoo("fire_spirit") | ddoo("fire_spirit") | ||||||
| dofile(path .. "minotaur.lua") -- NALC(sys4 fork MFF) Kalabasa | dofile(path .. "minotaur.lua") -- NALC(sys4 fork MFF) Kalabasa | ||||||
|  |  | ||||||
|  | -- Load custom spawning if found | ||||||
|  |  | ||||||
| -- Load custom spawning |  | ||||||
| if mobs.custom_spawn_monster then | if mobs.custom_spawn_monster then | ||||||
| 	dofile(path .. "spawn.lua") | 	dofile(path .. "spawn.lua") | ||||||
| end | end | ||||||
|  |  | ||||||
|  |  | ||||||
| -- Lucky Blocks | -- Lucky Blocks | ||||||
|  |  | ||||||
| if minetest.get_modpath("lucky_block") then | if minetest.get_modpath("lucky_block") then | ||||||
| 	dofile(path .. "lucky_block.lua") | 	dofile(path .. "lucky_block.lua") | ||||||
| end | end | ||||||
|  |  | ||||||
|  |  | ||||||
| print ("[MOD] Mobs Monster loaded") | print ("[MOD] Mobs Monster loaded") | ||||||
|   | |||||||
| @@ -1,4 +1,6 @@ | |||||||
| -- Translation support |  | ||||||
|  | -- translation and custom land guard types | ||||||
|  |  | ||||||
| local S = minetest.get_translator("mobs_monster") | local S = minetest.get_translator("mobs_monster") | ||||||
|  |  | ||||||
| local guard_types = { | local guard_types = { | ||||||
| @@ -50,9 +52,7 @@ mobs:register_mob("mobs_monster:land_guard", { | |||||||
| 		{"mobs_land_guard3.png"} | 		{"mobs_land_guard3.png"} | ||||||
| 	}, | 	}, | ||||||
| 	makes_footstep_sound = true, | 	makes_footstep_sound = true, | ||||||
| 	sounds = { | 	sounds = {random = "mobs_dungeonmaster"}, | ||||||
| 		random = "mobs_dungeonmaster", |  | ||||||
| 	}, |  | ||||||
| 	walk_velocity = 1.5, | 	walk_velocity = 1.5, | ||||||
| 	run_velocity = 3.4, | 	run_velocity = 3.4, | ||||||
| 	jump = true, | 	jump = true, | ||||||
| @@ -69,14 +69,10 @@ mobs:register_mob("mobs_monster:land_guard", { | |||||||
| 	light_damage = 0, | 	light_damage = 0, | ||||||
| 	fear_height = 8, | 	fear_height = 8, | ||||||
| 	animation = { | 	animation = { | ||||||
| 		stand_start = 0, | 		stand_start = 0, stand_end = 19, | ||||||
| 		stand_end = 19, | 		walk_start = 20, walk_end = 35, | ||||||
| 		walk_start = 20, | 		punch_start = 36, punch_end = 48, | ||||||
| 		walk_end = 35, | 		speed_normal = 15, speed_run = 20, | ||||||
| 		punch_start = 36, |  | ||||||
| 		punch_end = 48, |  | ||||||
| 		speed_normal = 15, |  | ||||||
| 		speed_run = 20, |  | ||||||
| 	}, | 	}, | ||||||
|  |  | ||||||
| 	-- check surrounding nodes and spawn a specific guard | 	-- check surrounding nodes and spawn a specific guard | ||||||
| @@ -95,9 +91,7 @@ mobs:register_mob("mobs_monster:land_guard", { | |||||||
| 				self.object:set_properties({textures = self.base_texture}) | 				self.object:set_properties({textures = self.base_texture}) | ||||||
| 				self.docile_by_day = tmp.docile | 				self.docile_by_day = tmp.docile | ||||||
|  |  | ||||||
| 				if tmp.drops then | 				if tmp.drops then self.drops = tmp.drops end | ||||||
| 					self.drops = tmp.drops |  | ||||||
| 				end |  | ||||||
|  |  | ||||||
| 				return true | 				return true | ||||||
| 			end | 			end | ||||||
| @@ -107,20 +101,23 @@ mobs:register_mob("mobs_monster:land_guard", { | |||||||
| 	end, | 	end, | ||||||
| }) | }) | ||||||
|  |  | ||||||
|  | -- where to spawn | ||||||
|  |  | ||||||
| if not mobs.custom_spawn_monster then | if not mobs.custom_spawn_monster then | ||||||
| mobs:spawn({ |  | ||||||
| 	name = "mobs_monster:land_guard", | 	mobs:spawn({ | ||||||
| 	nodes = { | 		name = "mobs_monster:land_guard", | ||||||
| 		"default:snow", "default:ice", "default:stone", | 		nodes = { | ||||||
| 		"default:dry_dirt_with_dry_grass", "ethereal:dry_dirt" | 			"default:snow", "default:ice", "default:stone", | ||||||
| 	}, | 			"default:dry_dirt_with_dry_grass", "ethereal:dry_dirt" | ||||||
| 	max_light = 7, | 		}, | ||||||
| 	chance = 25000, | 		max_light = 7, | ||||||
| 	min_height = 0, | 		chance = 25000, | ||||||
| 	active_object_count = 1, | 		min_height = 0, | ||||||
| }) | 		active_object_count = 1, | ||||||
|  | 	}) | ||||||
| end | end | ||||||
|  |  | ||||||
|  | -- spawn egg | ||||||
|  |  | ||||||
| mobs:register_egg("mobs_monster:land_guard", S("Land Guard"), "default_ice.png", 1) | mobs:register_egg("mobs_monster:land_guard", S("Land Guard"), "default_ice.png", 1) | ||||||
|   | |||||||
							
								
								
									
										145
									
								
								lava_flan.lua
									
									
									
									
									
								
							
							
						
						
									
										145
									
								
								lava_flan.lua
									
									
									
									
									
								
							| @@ -1,4 +1,4 @@ | |||||||
| -- Translation support |  | ||||||
| local S = minetest.get_translator("mobs_monster") | local S = minetest.get_translator("mobs_monster") | ||||||
|  |  | ||||||
| -- Lava Flan by Zeg9 (additional textures by JurajVajda) | -- Lava Flan by Zeg9 (additional textures by JurajVajda) | ||||||
| @@ -79,8 +79,8 @@ mobs:register_mob("mobs_monster:lava_flan", { | |||||||
| 			mobs:effect(pos, 40, "fire_basic_flame.png", 2, 3, 2, 5, 10, nil) | 			mobs:effect(pos, 40, "fire_basic_flame.png", 2, 3, 2, 5, 10, nil) | ||||||
|  |  | ||||||
| 			local nods = minetest.find_nodes_in_area( | 			local nods = minetest.find_nodes_in_area( | ||||||
| 				{x = pos.x, y = pos.y + 1, z = pos.z}, | 					{x = pos.x, y = pos.y + 1, z = pos.z}, | ||||||
| 				{x = pos.x, y = pos.y, z = pos.z}, "air") | 					{x = pos.x, y = pos.y, z = pos.z}, "air") | ||||||
|  |  | ||||||
| 			 -- place flame if position empty and flame exists | 			 -- place flame if position empty and flame exists | ||||||
| 			if nods and #nods > 0 | 			if nods and #nods > 0 | ||||||
| @@ -96,27 +96,29 @@ mobs:register_mob("mobs_monster:lava_flan", { | |||||||
| 	glow = 10 | 	glow = 10 | ||||||
| }) | }) | ||||||
|  |  | ||||||
|  | -- where to spawn | ||||||
|  |  | ||||||
| if not mobs.custom_spawn_monster then | if not mobs.custom_spawn_monster then | ||||||
| mobs:spawn({ |  | ||||||
| 	name = "mobs_monster:lava_flan", | 	mobs:spawn({ | ||||||
| 	nodes = {"default:lava_source"}, | 		name = "mobs_monster:lava_flan", | ||||||
| 	chance = 1500, | 		nodes = {"default:lava_source"}, | ||||||
| 	active_object_count = 1, | 		chance = 1500, | ||||||
| 	max_height = 0 | 		active_object_count = 1, | ||||||
| }) | 		max_height = 0 | ||||||
|  | 	}) | ||||||
| end | end | ||||||
|  |  | ||||||
|  | -- spawn egg | ||||||
|  |  | ||||||
| -- add spawn egg |  | ||||||
| mobs:register_egg("mobs_monster:lava_flan", S("Lava Flan"), "default_lava.png", 1) | mobs:register_egg("mobs_monster:lava_flan", S("Lava Flan"), "default_lava.png", 1) | ||||||
|  |  | ||||||
|  | -- compatibility for old mobs mod | ||||||
|  |  | ||||||
| -- compatibility alias, only needed for servers who used the old mobs mod |  | ||||||
| mobs:alias_mob("mobs:lava_flan", "mobs_monster:lava_flan") | mobs:alias_mob("mobs:lava_flan", "mobs_monster:lava_flan") | ||||||
|  |  | ||||||
|  |  | ||||||
| -- lava orb | -- lava orb | ||||||
|  |  | ||||||
| minetest.register_craftitem(":mobs:lava_orb", { | minetest.register_craftitem(":mobs:lava_orb", { | ||||||
| 	description = S("Lava orb"), | 	description = S("Lava orb"), | ||||||
| 	inventory_image = "zmobs_lava_orb.png", | 	inventory_image = "zmobs_lava_orb.png", | ||||||
| @@ -131,57 +133,60 @@ minetest.register_craft({ | |||||||
| 	burntime = 80 | 	burntime = 80 | ||||||
| }) | }) | ||||||
|  |  | ||||||
|  | -- backup and replace old function | ||||||
| -- Lava Pick (digs and smelts at same time) |  | ||||||
|  |  | ||||||
| local old_handle_node_drops = minetest.handle_node_drops | local old_handle_node_drops = minetest.handle_node_drops | ||||||
|  |  | ||||||
| function minetest.handle_node_drops(pos, drops, digger) | function minetest.handle_node_drops(pos, drops, digger) | ||||||
|  |  | ||||||
| 	-- does player exist? | 	-- are we a player using the lava pick? | ||||||
| 	if not digger then return end | 	if digger and digger:get_wielded_item():get_name() == ("mobs:pick_lava") then | ||||||
|  |  | ||||||
| 	-- are we holding Lava Pick? | 		local hot_drops = {} | ||||||
| 	if digger:get_wielded_item():get_name() ~= ("mobs:pick_lava") then | 		local is_cooked | ||||||
| 		return old_handle_node_drops(pos, drops, digger) |  | ||||||
| 	end |  | ||||||
|  |  | ||||||
| 	-- reset new smelted drops | 		for _, drop in ipairs(drops) do | ||||||
| 	local hot_drops = {} |  | ||||||
|  |  | ||||||
| 	-- loop through current node drops | 			local stack = ItemStack(drop) | ||||||
| 	for _, drop in ipairs(drops) do |  | ||||||
|  |  | ||||||
| 		-- get cooked output of current drops | 			while not stack:is_empty() do | ||||||
| 		local stack = ItemStack(drop) |  | ||||||
|  |  | ||||||
| 		while not stack:is_empty() do | 				local output, decremented_input = minetest.get_craft_result({ | ||||||
|  | 						method = "cooking", width = 1, items = {stack}}) | ||||||
|  |  | ||||||
| 			local output, decremented_input = minetest.get_craft_result({ | 				if output.item:is_empty() then | ||||||
| 				method = "cooking", | 					table.insert_all(hot_drops, decremented_input.items) | ||||||
| 				width = 1, | 					break | ||||||
| 				items = {stack} | 				else | ||||||
| 			}) | 					is_cooked = true | ||||||
|  |  | ||||||
| 			if output.item:is_empty() then | 					if not output.item:is_empty() then | ||||||
|  | 						table.insert(hot_drops, output.item) | ||||||
|  | 					end | ||||||
|  |  | ||||||
| 				table.insert_all(hot_drops, decremented_input.items) | 					table.insert_all(hot_drops, output.replacements) | ||||||
| 				break |  | ||||||
| 			else | 					stack = decremented_input.items[1] or ItemStack() | ||||||
| 				if not output.item:is_empty() then |  | ||||||
| 					table.insert(hot_drops, output.item) |  | ||||||
| 				end | 				end | ||||||
|  |  | ||||||
| 				table.insert_all(hot_drops, output.replacements) |  | ||||||
|  |  | ||||||
| 				stack = decremented_input.items[1] or ItemStack() |  | ||||||
| 			end | 			end | ||||||
| 		end | 		end | ||||||
|  |  | ||||||
|  | 		drops = hot_drops -- replace normal drops with cooked versions | ||||||
|  |  | ||||||
|  | 		if is_cooked then | ||||||
|  |  | ||||||
|  | 			mobs:effect(pos, 1, "tnt_smoke.png", 3, 5, 2, 0.5, nil, false) | ||||||
|  |  | ||||||
|  | 			minetest.sound_play("fire_extinguish_flame", | ||||||
|  | 					{pos = pos, max_hear_distance = 8, gain = 0.15}, true) | ||||||
|  | 		end | ||||||
| 	end | 	end | ||||||
|  |  | ||||||
| 	return old_handle_node_drops(pos, hot_drops, digger) | 	return old_handle_node_drops(pos, drops, digger) | ||||||
| end | end | ||||||
|  |  | ||||||
|  | -- lava pick, smelts nodes when you dig | ||||||
|  |  | ||||||
| minetest.register_tool(":mobs:pick_lava", { | minetest.register_tool(":mobs:pick_lava", { | ||||||
| 	description = S("Lava Pickaxe"), | 	description = S("Lava Pickaxe"), | ||||||
| 	inventory_image = "mobs_pick_lava.png", | 	inventory_image = "mobs_pick_lava.png", | ||||||
| @@ -190,9 +195,7 @@ minetest.register_tool(":mobs:pick_lava", { | |||||||
| 		max_drop_level = 3, | 		max_drop_level = 3, | ||||||
| 		groupcaps = { | 		groupcaps = { | ||||||
| 			cracky = { | 			cracky = { | ||||||
| 				times = {[1] = 1.80, [2] = 0.80, [3] = 0.40}, | 				times = {[1] = 1.80, [2] = 0.80, [3] = 0.40}, uses = 40, maxlevel = 3 | ||||||
| 				uses = 40, |  | ||||||
| 				maxlevel = 3 |  | ||||||
| 			} | 			} | ||||||
| 		}, | 		}, | ||||||
| 		damage_groups = {fleshy = 6, fire = 1}, | 		damage_groups = {fleshy = 6, fire = 1}, | ||||||
| @@ -201,6 +204,8 @@ minetest.register_tool(":mobs:pick_lava", { | |||||||
| 	light_source = 14 | 	light_source = 14 | ||||||
| }) | }) | ||||||
|  |  | ||||||
|  | -- recipe | ||||||
|  |  | ||||||
| minetest.register_craft({ | minetest.register_craft({ | ||||||
| 	output = "mobs:pick_lava", | 	output = "mobs:pick_lava", | ||||||
| 	recipe = { | 	recipe = { | ||||||
| @@ -210,16 +215,16 @@ minetest.register_craft({ | |||||||
| 	} | 	} | ||||||
| }) | }) | ||||||
|  |  | ||||||
| -- Add [toolranks] mod support if found | -- Add [toolranks] mod support | ||||||
|  |  | ||||||
| if minetest.get_modpath("toolranks") then | if minetest.get_modpath("toolranks") then | ||||||
|  |  | ||||||
| minetest.override_item("mobs:pick_lava", { | 	minetest.override_item("mobs:pick_lava", { | ||||||
| 	original_description = "Lava Pickaxe", | 		original_description = "Lava Pickaxe", | ||||||
| 	description = toolranks.create_description("Lava Pickaxe", 0, 1), | 		description = toolranks.create_description("Lava Pickaxe", 0, 1), | ||||||
| 	after_use = toolranks.new_afteruse}) | 		after_use = toolranks.new_afteruse}) | ||||||
| end | end | ||||||
|  |  | ||||||
|  |  | ||||||
| -- obsidian flan | -- obsidian flan | ||||||
|  |  | ||||||
| mobs:register_mob("mobs_monster:obsidian_flan", { | mobs:register_mob("mobs_monster:obsidian_flan", { | ||||||
| @@ -238,14 +243,10 @@ mobs:register_mob("mobs_monster:obsidian_flan", { | |||||||
| 	collisionbox = {-0.3, -0.3, -0.3, 0.3, 0.8, 0.3}, | 	collisionbox = {-0.3, -0.3, -0.3, 0.3, 0.8, 0.3}, | ||||||
| 	visual = "mesh", | 	visual = "mesh", | ||||||
| 	mesh = "zmobs_lava_flan.x", | 	mesh = "zmobs_lava_flan.x", | ||||||
| 	textures = { | 	textures = {{"mobs_obsidian_flan.png"}}, | ||||||
| 		{"mobs_obsidian_flan.png"} |  | ||||||
| 	}, |  | ||||||
| 	blood_texture = "default_obsidian.png", | 	blood_texture = "default_obsidian.png", | ||||||
| 	makes_footstep_sound = true, | 	makes_footstep_sound = true, | ||||||
| 	sounds = { | 	sounds = {random = "mobs_lavaflan"}, | ||||||
| 		random = "mobs_lavaflan" |  | ||||||
| 	}, |  | ||||||
| 	walk_velocity = 0.1, | 	walk_velocity = 0.1, | ||||||
| 	run_velocity = 0.5, | 	run_velocity = 0.5, | ||||||
| 	jump = false, | 	jump = false, | ||||||
| @@ -260,28 +261,22 @@ mobs:register_mob("mobs_monster:obsidian_flan", { | |||||||
| 	fire_damage = 0, | 	fire_damage = 0, | ||||||
| 	light_damage = 0, | 	light_damage = 0, | ||||||
| 	animation = { | 	animation = { | ||||||
| 		speed_normal = 15, | 		speed_normal = 15, speed_run = 15, | ||||||
| 		speed_run = 15, | 		stand_start = 0, stand_end = 8, | ||||||
| 		stand_start = 0, | 		walk_start = 10, walk_end = 18, | ||||||
| 		stand_end = 8, | 		run_start = 20, run_end = 28, | ||||||
| 		walk_start = 10, | 		punch_start = 20, punch_end = 28 | ||||||
| 		walk_end = 18, |  | ||||||
| 		run_start = 20, |  | ||||||
| 		run_end = 28, |  | ||||||
| 		punch_start = 20, |  | ||||||
| 		punch_end = 28 |  | ||||||
| 	} | 	} | ||||||
| }) | }) | ||||||
|  |  | ||||||
|  | -- spawn egg | ||||||
| -- add spawn egg |  | ||||||
| mobs:register_egg("mobs_monster:obsidian_flan", S("Obsidian Flan"), | mobs:register_egg("mobs_monster:obsidian_flan", S("Obsidian Flan"), | ||||||
| 		"default_obsidian.png", 1) | 		"default_obsidian.png", 1) | ||||||
|  |  | ||||||
|  | -- obsidian arrow and grief setting check | ||||||
|  |  | ||||||
| local mobs_griefing = minetest.settings:get_bool("mobs_griefing") ~= false | local mobs_griefing = minetest.settings:get_bool("mobs_griefing") ~= false | ||||||
|  |  | ||||||
| -- mese arrow (weapon) |  | ||||||
| mobs:register_arrow("mobs_monster:obsidian_arrow", { | mobs:register_arrow("mobs_monster:obsidian_arrow", { | ||||||
| 	visual = "sprite", | 	visual = "sprite", | ||||||
| 	visual_size = {x = 0.5, y = 0.5}, | 	visual_size = {x = 0.5, y = 0.5}, | ||||||
| @@ -289,6 +284,7 @@ mobs:register_arrow("mobs_monster:obsidian_arrow", { | |||||||
| 	velocity = 6, | 	velocity = 6, | ||||||
|  |  | ||||||
| 	hit_player = function(self, player) | 	hit_player = function(self, player) | ||||||
|  |  | ||||||
| 		player:punch(self.object, 1.0, { | 		player:punch(self.object, 1.0, { | ||||||
| 			full_punch_interval = 1.0, | 			full_punch_interval = 1.0, | ||||||
| 			damage_groups = {fleshy = 8}, | 			damage_groups = {fleshy = 8}, | ||||||
| @@ -296,6 +292,7 @@ mobs:register_arrow("mobs_monster:obsidian_arrow", { | |||||||
| 	end, | 	end, | ||||||
|  |  | ||||||
| 	hit_mob = function(self, player) | 	hit_mob = function(self, player) | ||||||
|  |  | ||||||
| 		player:punch(self.object, 1.0, { | 		player:punch(self.object, 1.0, { | ||||||
| 			full_punch_interval = 1.0, | 			full_punch_interval = 1.0, | ||||||
| 			damage_groups = {fleshy = 8}, | 			damage_groups = {fleshy = 8}, | ||||||
| @@ -312,9 +309,7 @@ mobs:register_arrow("mobs_monster:obsidian_arrow", { | |||||||
| 		local radius = 1 | 		local radius = 1 | ||||||
| 		local def = node and minetest.registered_nodes[node.name] | 		local def = node and minetest.registered_nodes[node.name] | ||||||
|  |  | ||||||
| 		if not def then | 		if not def then return end | ||||||
| 			return |  | ||||||
| 		end |  | ||||||
|  |  | ||||||
| 		if def and def.tiles and def.tiles[1] then | 		if def and def.tiles and def.tiles[1] then | ||||||
| 			texture = def.tiles[1] | 			texture = def.tiles[1] | ||||||
|   | |||||||
| @@ -1,3 +1,6 @@ | |||||||
|  |  | ||||||
|  | -- web trap schematic | ||||||
|  |  | ||||||
| local web = {name = "mobs:cobweb"} | local web = {name = "mobs:cobweb"} | ||||||
| local web_trap = { | local web_trap = { | ||||||
| 	size = {x = 3, y = 3, z = 3}, | 	size = {x = 3, y = 3, z = 3}, | ||||||
| @@ -20,6 +23,8 @@ lucky_block:add_schematics({ | |||||||
| 	{"webtrap", web_trap, {x = 1, y = 0, z = 1}}, | 	{"webtrap", web_trap, {x = 1, y = 0, z = 1}}, | ||||||
| }) | }) | ||||||
|  |  | ||||||
|  | -- add lucky blocks | ||||||
|  |  | ||||||
| lucky_block:add_blocks({ | lucky_block:add_blocks({ | ||||||
| 	{"sch", "webtrap", 1, true}, | 	{"sch", "webtrap", 1, true}, | ||||||
| 	{"spw", "mobs:dungeon_master", 1, nil, nil, 3, "Billy"}, | 	{"spw", "mobs:dungeon_master", 1, nil, nil, 3, "Billy"}, | ||||||
|   | |||||||
							
								
								
									
										298
									
								
								mese_monster.lua
									
									
									
									
									
								
							
							
						
						
									
										298
									
								
								mese_monster.lua
									
									
									
									
									
								
							| @@ -1,140 +1,139 @@ | |||||||
| -- Translation support |  | ||||||
|  | -- translation and custom mese monster types | ||||||
|  |  | ||||||
| local S = minetest.get_translator("mobs_monster") | local S = minetest.get_translator("mobs_monster") | ||||||
|  |  | ||||||
| local mese_monster_types = { | local mese_monster_types = { | ||||||
|  |  | ||||||
| -- mese_monster_red | 	{ -- red | ||||||
| { | 		y_min = -20, | ||||||
| 	y_min = -20, | 		y_max = -1000, | ||||||
| 	y_max = -1000, | 		damage = 2, | ||||||
| 	damage = 2, | 		reach = 3, | ||||||
| 	reach = 3, | 		hp_min = 15, | ||||||
| 	hp_min = 15, | 		hp_max = 25, | ||||||
| 	hp_max = 25, | 		armor = 80, | ||||||
| 	armor = 80, | 		skins = {"mobs_mese_monster_red.png"}, | ||||||
| 	skins = {"mobs_mese_monster_red.png"}, | 		immune_to = { | ||||||
| 	immune_to = { | 			{"default:pick_wood", 0}, | ||||||
| 		{"default:pick_wood", 0}, | 			{"default:shovel_wood", 0}, | ||||||
| 		{"default:shovel_wood", 0}, | 			{"default:axe_wood", 0}, | ||||||
| 		{"default:axe_wood", 0}, | 			{"default:sword_wood", 0} | ||||||
| 		{"default:sword_wood", 0} | 		}, | ||||||
|  | 		drops = { | ||||||
|  | 			{name = "default:mese_crystal", chance = 15, min = 0, max = 1}, | ||||||
|  | 			{name = "default:mese_crystal_fragment", chance = 2, min = 0, max = 1} | ||||||
|  | 		}, | ||||||
|  | 		arrow_override = function(self) | ||||||
|  | 			self.velocity = 6 | ||||||
|  | 			self.damage = 2 | ||||||
|  | 		end | ||||||
| 	}, | 	}, | ||||||
| 	drops = { |  | ||||||
| 		{name = "default:mese_crystal", chance = 15, min = 0, max = 1}, |  | ||||||
| 		{name = "default:mese_crystal_fragment", chance = 2, min = 0, max = 1} |  | ||||||
| 	}, |  | ||||||
| 	arrow_override = function(self) |  | ||||||
| 		self.velocity = 6 |  | ||||||
| 		self.damage = 2 |  | ||||||
| 	end |  | ||||||
| }, |  | ||||||
|  |  | ||||||
| -- mese_monster_green | 	{ -- green | ||||||
| { | 		y_min = -1001, | ||||||
| 	y_min = -1001, | 		y_max = -2000, | ||||||
| 	y_max = -2000, | 		damage = 3, | ||||||
| 	damage = 3, | 		reach = 3, | ||||||
| 	reach = 3, | 		hp_min = 20, | ||||||
| 	hp_min = 20, | 		hp_max = 30, | ||||||
| 	hp_max = 30, | 		armor = 75, | ||||||
| 	armor = 75, | 		skins = {"mobs_mese_monster_green.png"}, | ||||||
| 	skins = {"mobs_mese_monster_green.png"}, | 		immune_to = { | ||||||
| 	immune_to = { | 			{"default:pick_wood", 0}, | ||||||
| 		{"default:pick_wood", 0}, | 			{"default:shovel_wood", 0}, | ||||||
| 		{"default:shovel_wood", 0}, | 			{"default:axe_wood", 0}, | ||||||
| 		{"default:axe_wood", 0}, | 			{"default:sword_wood", 0}, | ||||||
| 		{"default:sword_wood", 0}, | 			{"default:pick_stone", 0}, | ||||||
| 		{"default:pick_stone", 0}, | 			{"default:shovel_stone", 0}, | ||||||
| 		{"default:shovel_stone", 0}, | 			{"default:axe_stone", 0}, | ||||||
| 		{"default:axe_stone", 0}, | 			{"default:sword_stone", 0} | ||||||
| 		{"default:sword_stone", 0} | 		}, | ||||||
|  | 		drops = { | ||||||
|  | 			{name = "default:mese_crystal", chance = 12, min = 0, max = 1}, | ||||||
|  | 			{name = "default:mese_crystal_fragment", chance = 1, min = 0, max = 1} | ||||||
|  | 		}, | ||||||
|  | 		arrow_override = function(self) | ||||||
|  | 			self.velocity = 6 | ||||||
|  | 			self.damage = 2 | ||||||
|  | 		end | ||||||
| 	}, | 	}, | ||||||
| 	drops = { |  | ||||||
| 		{name = "default:mese_crystal", chance = 12, min = 0, max = 1}, |  | ||||||
| 		{name = "default:mese_crystal_fragment", chance = 1, min = 0, max = 1} |  | ||||||
| 	}, |  | ||||||
| 	arrow_override = function(self) |  | ||||||
| 		self.velocity = 6 |  | ||||||
| 		self.damage = 2 |  | ||||||
| 	end |  | ||||||
| }, |  | ||||||
|  |  | ||||||
| -- mese_monster_blue | 	{ -- blue | ||||||
| { | 		y_min = -2001, | ||||||
| 	y_min = -2001, | 		y_max = -3000, | ||||||
| 	y_max = -3000, | 		damage = 3, | ||||||
| 	damage = 3, | 		reach = 4, | ||||||
| 	reach = 4, | 		hp_min = 25, | ||||||
| 	hp_min = 25, | 		hp_max = 35, | ||||||
| 	hp_max = 35, | 		armor = 70, | ||||||
| 	armor = 70, | 		skins = {"mobs_mese_monster_blue.png"}, | ||||||
| 	skins = {"mobs_mese_monster_blue.png"}, | 		immune_to = { | ||||||
| 	immune_to = { | 			{"default:pick_wood", 0}, | ||||||
| 		{"default:pick_wood", 0}, | 			{"default:shovel_wood", 0}, | ||||||
| 		{"default:shovel_wood", 0}, | 			{"default:axe_wood", 0}, | ||||||
| 		{"default:axe_wood", 0}, | 			{"default:sword_wood", 0}, | ||||||
| 		{"default:sword_wood", 0}, | 			{"default:pick_stone", 0}, | ||||||
| 		{"default:pick_stone", 0}, | 			{"default:shovel_stone", 0}, | ||||||
| 		{"default:shovel_stone", 0}, | 			{"default:axe_stone", 0}, | ||||||
| 		{"default:axe_stone", 0}, | 			{"default:sword_stone", 0}, | ||||||
| 		{"default:sword_stone", 0}, | 			{"default:pick_bronze", 0}, | ||||||
| 		{"default:pick_bronze", 0}, | 			{"default:shovel_bronze", 0}, | ||||||
| 		{"default:shovel_bronze", 0}, | 			{"default:axe_bronze", 0}, | ||||||
| 		{"default:axe_bronze", 0}, | 			{"default:sword_bronze", 0} | ||||||
| 		{"default:sword_bronze", 0} | 		}, | ||||||
|  | 		drops = { | ||||||
|  | 			{name = "default:mese", chance = 15, min = 0, max = 1}, | ||||||
|  | 			{name = "default:mese_crystal", chance = 9, min = 0, max = 2}, | ||||||
|  | 			{name = "default:mese_crystal_fragment", chance = 1, min = 0, max = 2} | ||||||
|  | 		}, | ||||||
|  | 		arrow_override = function(self) | ||||||
|  | 			self.velocity = 7 | ||||||
|  | 			self.damage = 3 | ||||||
|  | 		end | ||||||
| 	}, | 	}, | ||||||
| 	drops = { |  | ||||||
| 		{name = "default:mese", chance = 15, min = 0, max = 1}, |  | ||||||
| 		{name = "default:mese_crystal", chance = 9, min = 0, max = 2}, |  | ||||||
| 		{name = "default:mese_crystal_fragment", chance = 1, min = 0, max = 2} |  | ||||||
| 	}, |  | ||||||
| 	arrow_override = function(self) |  | ||||||
| 		self.velocity = 7 |  | ||||||
| 		self.damage = 3 |  | ||||||
| 	end |  | ||||||
| }, |  | ||||||
|  |  | ||||||
| -- mese_monster_purple |  | ||||||
| { |  | ||||||
| 	y_min = -3000, |  | ||||||
| 	y_max = -31000, |  | ||||||
| 	damage = 4, |  | ||||||
| 	reach = 5, |  | ||||||
| 	hp_min = 30, |  | ||||||
| 	hp_max = 40, |  | ||||||
| 	armor = 60, |  | ||||||
| 	skins = {"mobs_mese_monster_purple.png"}, |  | ||||||
| 	immune_to = { |  | ||||||
| 		{"default:pick_wood", 0}, |  | ||||||
| 		{"default:shovel_wood", 0}, |  | ||||||
| 		{"default:axe_wood", 0}, |  | ||||||
| 		{"default:sword_wood", 0}, |  | ||||||
| 		{"default:pick_stone", 0}, |  | ||||||
| 		{"default:shovel_stone", 0}, |  | ||||||
| 		{"default:axe_stone", 0}, |  | ||||||
| 		{"default:sword_stone", 0}, |  | ||||||
| 		{"default:pick_bronze", 0}, |  | ||||||
| 		{"default:shovel_bronze", 0}, |  | ||||||
| 		{"default:axe_bronze", 0}, |  | ||||||
| 		{"default:sword_bronze", 0}, |  | ||||||
| 		{"default:pick_steel", 0}, |  | ||||||
| 		{"default:shovel_steel", 0}, |  | ||||||
| 		{"default:axe_steel", 0}, |  | ||||||
| 		{"default:sword_steel", 0} |  | ||||||
| 	}, |  | ||||||
| 	drops = { |  | ||||||
| 		{name = "default:mese", chance = 9, min = 0, max = 1}, |  | ||||||
| 		{name = "default:mese_crystal", chance = 6, min = 0, max = 2}, |  | ||||||
| 		{name = "default:mese_crystal_fragment", chance = 1, min = 0, max = 3} |  | ||||||
| 	}, |  | ||||||
| 	arrow_override = function(self) |  | ||||||
| 		self.velocity = 8 |  | ||||||
| 		self.damage = 4 |  | ||||||
| 	end |  | ||||||
| }} |  | ||||||
|  |  | ||||||
|  | 	{ -- purple | ||||||
|  | 		y_min = -3000, | ||||||
|  | 		y_max = -31000, | ||||||
|  | 		damage = 4, | ||||||
|  | 		reach = 5, | ||||||
|  | 		hp_min = 30, | ||||||
|  | 		hp_max = 40, | ||||||
|  | 		armor = 60, | ||||||
|  | 		skins = {"mobs_mese_monster_purple.png"}, | ||||||
|  | 		immune_to = { | ||||||
|  | 			{"default:pick_wood", 0}, | ||||||
|  | 			{"default:shovel_wood", 0}, | ||||||
|  | 			{"default:axe_wood", 0}, | ||||||
|  | 			{"default:sword_wood", 0}, | ||||||
|  | 			{"default:pick_stone", 0}, | ||||||
|  | 			{"default:shovel_stone", 0}, | ||||||
|  | 			{"default:axe_stone", 0}, | ||||||
|  | 			{"default:sword_stone", 0}, | ||||||
|  | 			{"default:pick_bronze", 0}, | ||||||
|  | 			{"default:shovel_bronze", 0}, | ||||||
|  | 			{"default:axe_bronze", 0}, | ||||||
|  | 			{"default:sword_bronze", 0}, | ||||||
|  | 			{"default:pick_steel", 0}, | ||||||
|  | 			{"default:shovel_steel", 0}, | ||||||
|  | 			{"default:axe_steel", 0}, | ||||||
|  | 			{"default:sword_steel", 0} | ||||||
|  | 		}, | ||||||
|  | 		drops = { | ||||||
|  | 			{name = "default:mese", chance = 9, min = 0, max = 1}, | ||||||
|  | 			{name = "default:mese_crystal", chance = 6, min = 0, max = 2}, | ||||||
|  | 			{name = "default:mese_crystal_fragment", chance = 1, min = 0, max = 3} | ||||||
|  | 		}, | ||||||
|  | 		arrow_override = function(self) | ||||||
|  | 			self.velocity = 8 | ||||||
|  | 			self.damage = 4 | ||||||
|  | 		end | ||||||
|  | 	} | ||||||
|  | } | ||||||
|  |  | ||||||
| -- Mese Monster by SirrobZeroone | -- Mese Monster by SirrobZeroone | ||||||
|  |  | ||||||
| mobs:register_mob("mobs_monster:mese_monster", { | mobs:register_mob("mobs_monster:mese_monster", { | ||||||
| 	type = "monster", | 	type = "monster", | ||||||
| 	visual_size = {x = 10, y = 10},  -- Got scale wrong in blender by factor of 10 - S01 | 	visual_size = {x = 10, y = 10},  -- Got scale wrong in blender by factor of 10 - S01 | ||||||
| @@ -155,9 +154,7 @@ mobs:register_mob("mobs_monster:mese_monster", { | |||||||
| 	collisionbox = {-0.75, -0.5, -0.75, 0.75, 2.5, 0.75}, | 	collisionbox = {-0.75, -0.5, -0.75, 0.75, 2.5, 0.75}, | ||||||
| 	visual = "mesh", | 	visual = "mesh", | ||||||
| 	mesh = "mobs_mese_monster.b3d", | 	mesh = "mobs_mese_monster.b3d", | ||||||
| 	textures = { | 	textures = {{"mobs_mese_monster_purple.png"}}, | ||||||
| 		{"mobs_mese_monster_purple.png"} |  | ||||||
| 	}, |  | ||||||
| 	blood_texture = "default_mese_crystal_fragment.png", | 	blood_texture = "default_mese_crystal_fragment.png", | ||||||
| 	makes_footstep_sound = false, | 	makes_footstep_sound = false, | ||||||
| 	sounds = { | 	sounds = { | ||||||
| @@ -189,36 +186,21 @@ mobs:register_mob("mobs_monster:mese_monster", { | |||||||
| 	lava_damage = 1, | 	lava_damage = 1, | ||||||
| 	light_damage = 0, | 	light_damage = 0, | ||||||
| 	animation = { | 	animation = { | ||||||
| 		speed_normal = 18, | 		speed_normal = 18, speed_run = 18, | ||||||
| 		speed_run    = 18, | 		walk_start = 10, walk_end = 41, walk_speed = 20, | ||||||
| 		walk_start   = 10, | 		run_start = 10, run_end = 41, run_speed = 30, | ||||||
| 		walk_end     = 41, | 		stand_start = 60, stand_end = 83, | ||||||
| 		walk_speed   = 20, | 		shoot_start = 100, shoot_end = 113, | ||||||
| 		run_start    = 10, | 		die_start = 125, die_end = 141, death_speed = 25, die_loop = false, | ||||||
| 		run_end      = 41, | 		jump_start = 150 , jump_end = 168, jump_loop = false, | ||||||
| 		run_speed    = 30, | 		punch_start = 175, punch_end = 189 | ||||||
| 		stand_start  = 60, |  | ||||||
| 		stand_end    = 83, |  | ||||||
| 		shoot_start  = 100, |  | ||||||
| 		shoot_end    = 113, |  | ||||||
| 		die_start    = 125, |  | ||||||
| 		die_end      = 141, |  | ||||||
| 		death_speed  = 25, |  | ||||||
| 		die_loop     = false, |  | ||||||
| 		jump_start   = 150 , |  | ||||||
| 		jump_end     = 168, |  | ||||||
| 		jump_loop    = false, |  | ||||||
| 		punch_start  = 175, |  | ||||||
| 		punch_end    = 189 |  | ||||||
| 	}, | 	}, | ||||||
|  |  | ||||||
| 	after_activate = function(self, staticdata, def, dtime) | 	after_activate = function(self, staticdata, def, dtime) | ||||||
|  |  | ||||||
| 		local tex = self and self.textures and self.textures[1] | 		local tex = self and self.textures and self.textures[1] | ||||||
|  |  | ||||||
| 		if tex == "zmobs_mese_monster.png" then | 		if tex == "zmobs_mese_monster.png" then self.object:remove() end | ||||||
| 			self.object:remove() |  | ||||||
| 		end |  | ||||||
| 	end, | 	end, | ||||||
|  |  | ||||||
| 	on_spawn = function(self) | 	on_spawn = function(self) | ||||||
| @@ -289,14 +271,15 @@ mobs:register_mob("mobs_monster:mese_monster", { | |||||||
| 	end | 	end | ||||||
| }) | }) | ||||||
|  |  | ||||||
|  | -- mese arrow item | ||||||
|  |  | ||||||
| -- mese arrow (weapon) |  | ||||||
| minetest.register_craftitem("mobs_monster:mese_crystal_fragment_arrow", { | minetest.register_craftitem("mobs_monster:mese_crystal_fragment_arrow", { | ||||||
| 	description = S("Mese Monster Arrow"), | 	description = S("Mese Monster Arrow"), | ||||||
| 	inventory_image = "mobs_mese_arrow.png", | 	inventory_image = "mobs_mese_arrow.png", | ||||||
| 	groups = {not_in_creative_inventory = 1} | 	groups = {not_in_creative_inventory = 1} | ||||||
| }) | }) | ||||||
|  |  | ||||||
|  | -- mese arrow | ||||||
|  |  | ||||||
| mobs:register_arrow("mobs_monster:mese_arrow", { | mobs:register_arrow("mobs_monster:mese_arrow", { | ||||||
| 	visual = "wielditem", | 	visual = "wielditem", | ||||||
| @@ -307,6 +290,7 @@ mobs:register_arrow("mobs_monster:mese_arrow", { | |||||||
| 	damage = 2, | 	damage = 2, | ||||||
|  |  | ||||||
| 	hit_player = function(self, player) | 	hit_player = function(self, player) | ||||||
|  |  | ||||||
| 		player:punch(self.object, 1.0, { | 		player:punch(self.object, 1.0, { | ||||||
| 			full_punch_interval = 1.0, | 			full_punch_interval = 1.0, | ||||||
| 			damage_groups = {fleshy = self.damage} | 			damage_groups = {fleshy = self.damage} | ||||||
| @@ -314,6 +298,7 @@ mobs:register_arrow("mobs_monster:mese_arrow", { | |||||||
| 	end, | 	end, | ||||||
|  |  | ||||||
| 	hit_mob = function(self, player) | 	hit_mob = function(self, player) | ||||||
|  |  | ||||||
| 		player:punch(self.object, 1.0, { | 		player:punch(self.object, 1.0, { | ||||||
| 			full_punch_interval = 1.0, | 			full_punch_interval = 1.0, | ||||||
| 			damage_groups = {fleshy = self.damage} | 			damage_groups = {fleshy = self.damage} | ||||||
| @@ -324,6 +309,7 @@ mobs:register_arrow("mobs_monster:mese_arrow", { | |||||||
| 	end | 	end | ||||||
| }) | }) | ||||||
|  |  | ||||||
|  | -- where to spawn | ||||||
|  |  | ||||||
| if not mobs.custom_spawn_monster then | if not mobs.custom_spawn_monster then | ||||||
| 	mobs:spawn({ | 	mobs:spawn({ | ||||||
| @@ -336,14 +322,16 @@ if not mobs.custom_spawn_monster then | |||||||
| 	}) | 	}) | ||||||
| end | end | ||||||
|  |  | ||||||
|  | -- spawn egg | ||||||
|  |  | ||||||
| mobs:register_egg("mobs_monster:mese_monster", S("Mese Monster"), "default_mese_block.png", 1) | mobs:register_egg("mobs_monster:mese_monster", S("Mese Monster"), "default_mese_block.png", 1) | ||||||
|  |  | ||||||
|  | -- compatibility with older mobs mod | ||||||
|  |  | ||||||
| mobs:alias_mob("mobs:mese_monster", "mobs_monster:mese_monster") -- compatiblity | mobs:alias_mob("mobs:mese_monster", "mobs_monster:mese_monster") | ||||||
|  |  | ||||||
|  | -- 9x mese crystal fragments = 1x mese crystal recipe | ||||||
|  |  | ||||||
| -- 9x mese crystal fragments = 1x mese crystal |  | ||||||
| local f = "default:mese_crystal_fragment" | local f = "default:mese_crystal_fragment" | ||||||
|  |  | ||||||
| minetest.register_craft({ | minetest.register_craft({ | ||||||
|   | |||||||
										
											Binary file not shown.
										
									
								
							
							
								
								
									
										26
									
								
								oerkki.lua
									
									
									
									
									
								
							
							
						
						
									
										26
									
								
								oerkki.lua
									
									
									
									
									
								
							| @@ -1,4 +1,4 @@ | |||||||
| -- Translation support |  | ||||||
| local S = minetest.get_translator("mobs_monster") | local S = minetest.get_translator("mobs_monster") | ||||||
|  |  | ||||||
| -- Oerkki by PilzAdam | -- Oerkki by PilzAdam | ||||||
| @@ -22,9 +22,7 @@ mobs:register_mob("mobs_monster:oerkki", { | |||||||
| 		{"mobs_oerkki3.png"} | 		{"mobs_oerkki3.png"} | ||||||
| 	}, | 	}, | ||||||
| 	makes_footstep_sound = false, | 	makes_footstep_sound = false, | ||||||
| 	sounds = { | 	sounds = {random = "mobs_oerkki"}, | ||||||
| 		random = "mobs_oerkki" |  | ||||||
| 	}, |  | ||||||
| 	walk_velocity = 1, | 	walk_velocity = 1, | ||||||
| 	run_velocity = 3, | 	run_velocity = 3, | ||||||
| 	view_range = 10, | 	view_range = 10, | ||||||
| @@ -39,16 +37,11 @@ mobs:register_mob("mobs_monster:oerkki", { | |||||||
| 	light_damage = 1, | 	light_damage = 1, | ||||||
| 	fear_height = 4, | 	fear_height = 4, | ||||||
| 	animation = { | 	animation = { | ||||||
| 		stand_start = 0, | 		stand_start = 0, stand_end = 23, | ||||||
| 		stand_end = 23, | 		walk_start = 24, walk_end = 36, | ||||||
| 		walk_start = 24, | 		run_start = 37, run_end = 49, | ||||||
| 		walk_end = 36, | 		punch_start = 37, punch_end = 49, | ||||||
| 		run_start = 37, | 		speed_normal = 15, speed_run = 15 | ||||||
| 		run_end = 49, |  | ||||||
| 		punch_start = 37, |  | ||||||
| 		punch_end = 49, |  | ||||||
| 		speed_normal = 15, |  | ||||||
| 		speed_run = 15 |  | ||||||
| 	}, | 	}, | ||||||
| 	replace_rate = 5, | 	replace_rate = 5, | ||||||
| 	replace_what = {"default:torch"}, | 	replace_what = {"default:torch"}, | ||||||
| @@ -60,6 +53,7 @@ mobs:register_mob("mobs_monster:oerkki", { | |||||||
| 	}, | 	}, | ||||||
| }) | }) | ||||||
|  |  | ||||||
|  | -- where to spawn | ||||||
|  |  | ||||||
| if not mobs.custom_spawn_monster then | if not mobs.custom_spawn_monster then | ||||||
|  |  | ||||||
| @@ -72,8 +66,10 @@ if not mobs.custom_spawn_monster then | |||||||
| 	}) | 	}) | ||||||
| end | end | ||||||
|  |  | ||||||
|  | -- spawn egg | ||||||
|  |  | ||||||
| mobs:register_egg("mobs_monster:oerkki", S("Oerkki"), "default_obsidian.png", 1) | mobs:register_egg("mobs_monster:oerkki", S("Oerkki"), "default_obsidian.png", 1) | ||||||
|  |  | ||||||
|  | -- compatibility with older mobs mod | ||||||
|  |  | ||||||
| mobs:alias_mob("mobs:oerkki", "mobs_monster:oerkki") -- compatiblity | mobs:alias_mob("mobs:oerkki", "mobs_monster:oerkki") | ||||||
|   | |||||||
| @@ -1,7 +1,8 @@ | |||||||
| -- Translation support |  | ||||||
| local S = minetest.get_translator("mobs_monster") | local S = minetest.get_translator("mobs_monster") | ||||||
|  |  | ||||||
| -- custom particle effects | -- custom particle effects | ||||||
|  |  | ||||||
| local effect = function(pos, amount, texture, min_size, max_size, radius, gravity, glow) | local effect = function(pos, amount, texture, min_size, max_size, radius, gravity, glow) | ||||||
|  |  | ||||||
| 	radius = radius or 2 | 	radius = radius or 2 | ||||||
| @@ -28,7 +29,6 @@ local effect = function(pos, amount, texture, min_size, max_size, radius, gravit | |||||||
| 	}) | 	}) | ||||||
| end | end | ||||||
|  |  | ||||||
|  |  | ||||||
| -- Sand Monster by PilzAdam | -- Sand Monster by PilzAdam | ||||||
|  |  | ||||||
| mobs:register_mob("mobs_monster:sand_monster", { | mobs:register_mob("mobs_monster:sand_monster", { | ||||||
| @@ -52,9 +52,7 @@ mobs:register_mob("mobs_monster:sand_monster", { | |||||||
| 	}, | 	}, | ||||||
| 	blood_texture = "default_desert_sand.png", | 	blood_texture = "default_desert_sand.png", | ||||||
| 	makes_footstep_sound = true, | 	makes_footstep_sound = true, | ||||||
| 	sounds = { | 	sounds = {random = "mobs_sandmonster"}, | ||||||
| 		random = "mobs_sandmonster" |  | ||||||
| 	}, |  | ||||||
| 	walk_velocity = 1.5, | 	walk_velocity = 1.5, | ||||||
| 	run_velocity = 4, | 	run_velocity = 4, | ||||||
| 	view_range = 8, | 	view_range = 8, | ||||||
| @@ -69,16 +67,11 @@ mobs:register_mob("mobs_monster:sand_monster", { | |||||||
| 	light_damage = 0, | 	light_damage = 0, | ||||||
| 	fear_height = 4, | 	fear_height = 4, | ||||||
| 	animation = { | 	animation = { | ||||||
| 		speed_normal = 15, | 		speed_normal = 15, speed_run = 15, | ||||||
| 		speed_run = 15, | 		stand_start = 0, stand_end = 39, | ||||||
| 		stand_start = 0, | 		walk_start = 41, walk_end = 72, | ||||||
| 		stand_end = 39, | 		run_start = 74, run_end = 105, | ||||||
| 		walk_start = 41, | 		punch_start = 74, punch_end = 105 | ||||||
| 		walk_end = 72, |  | ||||||
| 		run_start = 74, |  | ||||||
| 		run_end = 105, |  | ||||||
| 		punch_start = 74, |  | ||||||
| 		punch_end = 105 |  | ||||||
| 	}, | 	}, | ||||||
| 	immune_to = { | 	immune_to = { | ||||||
| 		{"default:shovel_wood", 3}, -- shovels deal more damage to sand monster | 		{"default:shovel_wood", 3}, -- shovels deal more damage to sand monster | ||||||
| @@ -117,6 +110,8 @@ mobs:register_mob("mobs_monster:sand_monster", { | |||||||
| ]] | ]] | ||||||
| }) | }) | ||||||
|  |  | ||||||
|  | -- where to spawn | ||||||
|  |  | ||||||
| if not mobs.custom_spawn_monster then | if not mobs.custom_spawn_monster then | ||||||
|  |  | ||||||
| 	mobs:spawn({ | 	mobs:spawn({ | ||||||
| @@ -128,9 +123,11 @@ if not mobs.custom_spawn_monster then | |||||||
| 	}) | 	}) | ||||||
| end | end | ||||||
|  |  | ||||||
|  | -- spawn egg | ||||||
|  |  | ||||||
| mobs:register_egg("mobs_monster:sand_monster", S("Sand Monster"), | mobs:register_egg("mobs_monster:sand_monster", S("Sand Monster"), | ||||||
| 		"default_desert_sand.png", 1) | 		"default_desert_sand.png", 1) | ||||||
|  |  | ||||||
|  | -- compatibility with older mobs mod | ||||||
|  |  | ||||||
| mobs:alias_mob("mobs:sand_monster", "mobs_monster:sand_monster") -- compatibility | mobs:alias_mob("mobs:sand_monster", "mobs_monster:sand_monster") | ||||||
|   | |||||||
							
								
								
									
										49
									
								
								spider.lua
									
									
									
									
									
								
							
							
						
						
									
										49
									
								
								spider.lua
									
									
									
									
									
								
							| @@ -1,6 +1,8 @@ | |||||||
| -- Translation support | -- Translation support | ||||||
| local S = minetest.get_translator("mobs_monster") | local S = minetest.get_translator("mobs_monster") | ||||||
|  |  | ||||||
|  | -- helper function | ||||||
|  |  | ||||||
| local get_velocity = function(self) | local get_velocity = function(self) | ||||||
|  |  | ||||||
| 	local v = self.object:get_velocity() | 	local v = self.object:get_velocity() | ||||||
| @@ -11,6 +13,7 @@ local get_velocity = function(self) | |||||||
| 	return (v.x * v.x + v.z * v.z) ^ 0.5 | 	return (v.x * v.x + v.z * v.z) ^ 0.5 | ||||||
| end | end | ||||||
|  |  | ||||||
|  | -- custom spider types | ||||||
|  |  | ||||||
| local spider_types = { | local spider_types = { | ||||||
|  |  | ||||||
| @@ -51,7 +54,6 @@ local spider_types = { | |||||||
| 	} | 	} | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
| -- Spider by AspireMint (CC-BY-SA 3.0 license) | -- Spider by AspireMint (CC-BY-SA 3.0 license) | ||||||
|  |  | ||||||
| mobs:register_mob("mobs_monster:spider", { | mobs:register_mob("mobs_monster:spider", { | ||||||
| @@ -93,17 +95,13 @@ mobs:register_mob("mobs_monster:spider", { | |||||||
| 	water_damage = 5, | 	water_damage = 5, | ||||||
| 	lava_damage = 5, | 	lava_damage = 5, | ||||||
| 	light_damage = 0, | 	light_damage = 0, | ||||||
|  | 	node_damage = false, -- disable damage_per_second node damage | ||||||
| 	animation = { | 	animation = { | ||||||
| 		speed_normal = 15, | 		speed_normal = 15, speed_run = 20, | ||||||
| 		speed_run = 20, | 		stand_start = 0, stand_end = 0, | ||||||
| 		stand_start = 0, | 		walk_start = 1, walk_end = 21, | ||||||
| 		stand_end = 0, | 		run_start = 1, run_end = 21, | ||||||
| 		walk_start = 1, | 		punch_start = 25, punch_end = 45 | ||||||
| 		walk_end = 21, |  | ||||||
| 		run_start = 1, |  | ||||||
| 		run_end = 21, |  | ||||||
| 		punch_start = 25, |  | ||||||
| 		punch_end = 45 |  | ||||||
| 	}, | 	}, | ||||||
|  |  | ||||||
| 	-- check surrounding nodes and spawn a specific spider | 	-- check surrounding nodes and spawn a specific spider | ||||||
| @@ -122,9 +120,7 @@ mobs:register_mob("mobs_monster:spider", { | |||||||
| 				self.object:set_properties({textures = tmp.skins}) | 				self.object:set_properties({textures = tmp.skins}) | ||||||
| 				self.docile_by_day = tmp.docile | 				self.docile_by_day = tmp.docile | ||||||
|  |  | ||||||
| 				if tmp.drops then | 				if tmp.drops then self.drops = tmp.drops end | ||||||
| 					self.drops = tmp.drops |  | ||||||
| 				end |  | ||||||
|  |  | ||||||
| 				if tmp.shoot then | 				if tmp.shoot then | ||||||
| 					self.attack_type = "dogshoot" | 					self.attack_type = "dogshoot" | ||||||
| @@ -137,6 +133,7 @@ mobs:register_mob("mobs_monster:spider", { | |||||||
| 				end | 				end | ||||||
|  |  | ||||||
| 				if tmp.small then | 				if tmp.small then | ||||||
|  |  | ||||||
| 					self.object:set_properties({ | 					self.object:set_properties({ | ||||||
| 						collisionbox = {-0.2, -0.2, -0.2, 0.2, 0, 0.2}, | 						collisionbox = {-0.2, -0.2, -0.2, 0.2, 0, 0.2}, | ||||||
| 						visual_size = {x = 0.25, y = 0.25} | 						visual_size = {x = 0.25, y = 0.25} | ||||||
| @@ -155,9 +152,7 @@ mobs:register_mob("mobs_monster:spider", { | |||||||
|  |  | ||||||
| 		-- quarter second timer | 		-- quarter second timer | ||||||
| 		self.spider_timer = (self.spider_timer or 0) + dtime | 		self.spider_timer = (self.spider_timer or 0) + dtime | ||||||
| 		if self.spider_timer < 0.25 then | 		if self.spider_timer < 0.25 then return end | ||||||
| 			return |  | ||||||
| 		end |  | ||||||
| 		self.spider_timer = 0 | 		self.spider_timer = 0 | ||||||
|  |  | ||||||
| 		-- need to be stopped to go onwards | 		-- need to be stopped to go onwards | ||||||
| @@ -167,11 +162,7 @@ mobs:register_mob("mobs_monster:spider", { | |||||||
| 		end | 		end | ||||||
|  |  | ||||||
| 		local pos = self.object:get_pos() | 		local pos = self.object:get_pos() | ||||||
| 		local yaw = self.object:get_yaw() | 		local yaw = self.object:get_yaw() ; if not yaw then return end | ||||||
|  |  | ||||||
| 		-- sanity check |  | ||||||
| 		if not yaw then return end |  | ||||||
|  |  | ||||||
| 		local prop = self.object:get_properties() | 		local prop = self.object:get_properties() | ||||||
|  |  | ||||||
| 		pos.y = pos.y + prop.collisionbox[2] - 0.2 | 		pos.y = pos.y + prop.collisionbox[2] - 0.2 | ||||||
| @@ -227,6 +218,7 @@ mobs:register_mob("mobs_monster:spider", { | |||||||
| 	end | 	end | ||||||
| }) | }) | ||||||
|  |  | ||||||
|  | -- where to spawn | ||||||
|  |  | ||||||
| if not mobs.custom_spawn_monster then | if not mobs.custom_spawn_monster then | ||||||
|  |  | ||||||
| @@ -258,15 +250,17 @@ if not mobs.custom_spawn_monster then | |||||||
| 	}) | 	}) | ||||||
| end | end | ||||||
|  |  | ||||||
|  | -- spawn egg | ||||||
|  |  | ||||||
| mobs:register_egg("mobs_monster:spider", S("Spider"), "mobs_cobweb.png", 1) | mobs:register_egg("mobs_monster:spider", S("Spider"), "mobs_cobweb.png", 1) | ||||||
|  |  | ||||||
|  | -- compatibility with older mobs mod | ||||||
|  |  | ||||||
| mobs:alias_mob("mobs_monster:spider2", "mobs_monster:spider") -- compatibility | mobs:alias_mob("mobs_monster:spider2", "mobs_monster:spider") | ||||||
| mobs:alias_mob("mobs:spider", "mobs_monster:spider") | mobs:alias_mob("mobs:spider", "mobs_monster:spider") | ||||||
|  |  | ||||||
|  | -- cobweb and recipe | ||||||
|  |  | ||||||
| -- cobweb |  | ||||||
| minetest.register_node(":mobs:cobweb", { | minetest.register_node(":mobs:cobweb", { | ||||||
| 	description = S("Cobweb"), | 	description = S("Cobweb"), | ||||||
| 	drawtype = "plantlike", | 	drawtype = "plantlike", | ||||||
| @@ -283,8 +277,9 @@ minetest.register_node(":mobs:cobweb", { | |||||||
| 	liquid_range = 0, | 	liquid_range = 0, | ||||||
| 	walkable = false, | 	walkable = false, | ||||||
| 	groups = {snappy = 1, disable_jump = 1}, | 	groups = {snappy = 1, disable_jump = 1}, | ||||||
|  | 	is_ground_content = false, | ||||||
| 	drop = "farming:string", | 	drop = "farming:string", | ||||||
| 	sounds = default and default.node_sound_leaves_defaults() | 	sounds = mobs.node_sound_leaves_defaults() | ||||||
| }) | }) | ||||||
|  |  | ||||||
| minetest.register_craft({ | minetest.register_craft({ | ||||||
| @@ -296,6 +291,8 @@ minetest.register_craft({ | |||||||
| 	} | 	} | ||||||
| }) | }) | ||||||
|  |  | ||||||
|  | -- cobweb place function | ||||||
|  |  | ||||||
| local web_place = function(pos) | local web_place = function(pos) | ||||||
|  |  | ||||||
| 	if minetest.find_node_near(pos, 1, {"ignore"}) then return end | 	if minetest.find_node_near(pos, 1, {"ignore"}) then return end | ||||||
| @@ -307,6 +304,8 @@ local web_place = function(pos) | |||||||
| 	end | 	end | ||||||
| end | end | ||||||
|  |  | ||||||
|  | -- cobweb arrow | ||||||
|  |  | ||||||
| mobs:register_arrow("mobs_monster:cobweb", { | mobs:register_arrow("mobs_monster:cobweb", { | ||||||
| 	visual = "sprite", | 	visual = "sprite", | ||||||
| 	visual_size = {x = 1, y = 1}, | 	visual_size = {x = 1, y = 1}, | ||||||
|   | |||||||
| @@ -1,4 +1,6 @@ | |||||||
| -- Translation support |  | ||||||
|  | -- translation and custom stone monster types | ||||||
|  |  | ||||||
| local S = minetest.get_translator("mobs_monster") | local S = minetest.get_translator("mobs_monster") | ||||||
|  |  | ||||||
| local stone_types = { | local stone_types = { | ||||||
| @@ -22,7 +24,6 @@ local stone_types = { | |||||||
| 	} | 	} | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
| -- Stone Monster by PilzAdam | -- Stone Monster by PilzAdam | ||||||
|  |  | ||||||
| mobs:register_mob("mobs_monster:stone_monster", { | mobs:register_mob("mobs_monster:stone_monster", { | ||||||
| @@ -43,9 +44,7 @@ mobs:register_mob("mobs_monster:stone_monster", { | |||||||
| 		{"mobs_stone_monster2.png"} -- by AMMOnym | 		{"mobs_stone_monster2.png"} -- by AMMOnym | ||||||
| 	}, | 	}, | ||||||
| 	makes_footstep_sound = true, | 	makes_footstep_sound = true, | ||||||
| 	sounds = { | 	sounds = {random = "mobs_stonemonster"}, | ||||||
| 		random = "mobs_stonemonster" |  | ||||||
| 	}, |  | ||||||
| 	walk_velocity = 1, | 	walk_velocity = 1, | ||||||
| 	run_velocity = 2, | 	run_velocity = 2, | ||||||
| 	jump_height = 0, | 	jump_height = 0, | ||||||
| @@ -63,16 +62,11 @@ mobs:register_mob("mobs_monster:stone_monster", { | |||||||
| 	lava_damage = 1, | 	lava_damage = 1, | ||||||
| 	light_damage = 0, | 	light_damage = 0, | ||||||
| 	animation = { | 	animation = { | ||||||
| 		speed_normal = 15, | 		speed_normal = 15, speed_run = 15, | ||||||
| 		speed_run = 15, | 		stand_start = 0, stand_end = 14, | ||||||
| 		stand_start = 0, | 		walk_start = 15, walk_end = 38, | ||||||
| 		stand_end = 14, | 		run_start = 40, run_end = 63, | ||||||
| 		walk_start = 15, | 		punch_start = 40, punch_end = 63 | ||||||
| 		walk_end = 38, |  | ||||||
| 		run_start = 40, |  | ||||||
| 		run_end = 63, |  | ||||||
| 		punch_start = 40, |  | ||||||
| 		punch_end = 63 |  | ||||||
| 	}, | 	}, | ||||||
| 	immune_to = { | 	immune_to = { | ||||||
| 		{"default:pick_wood", 0}, -- wooden pick doesnt hurt stone monster | 		{"default:pick_wood", 0}, -- wooden pick doesnt hurt stone monster | ||||||
| @@ -98,9 +92,7 @@ mobs:register_mob("mobs_monster:stone_monster", { | |||||||
| 				self.base_texture = tmp.skins | 				self.base_texture = tmp.skins | ||||||
| 				self.object:set_properties({textures = tmp.skins}) | 				self.object:set_properties({textures = tmp.skins}) | ||||||
|  |  | ||||||
| 				if tmp.drops then | 				if tmp.drops then self.drops = tmp.drops end | ||||||
| 					self.drops = tmp.drops |  | ||||||
| 				end |  | ||||||
|  |  | ||||||
| 				return true | 				return true | ||||||
| 			end | 			end | ||||||
| @@ -110,6 +102,7 @@ mobs:register_mob("mobs_monster:stone_monster", { | |||||||
| 	end | 	end | ||||||
| }) | }) | ||||||
|  |  | ||||||
|  | -- where to spawn | ||||||
|  |  | ||||||
| if not mobs.custom_spawn_monster then | if not mobs.custom_spawn_monster then | ||||||
|  |  | ||||||
| @@ -122,8 +115,10 @@ if not mobs.custom_spawn_monster then | |||||||
| 	}) | 	}) | ||||||
| end | end | ||||||
|  |  | ||||||
|  | -- spawn egg | ||||||
|  |  | ||||||
| mobs:register_egg("mobs_monster:stone_monster", S("Stone Monster"), "default_stone.png", 1) | mobs:register_egg("mobs_monster:stone_monster", S("Stone Monster"), "default_stone.png", 1) | ||||||
|  |  | ||||||
|  | -- compatibility with older mobs mod | ||||||
|  |  | ||||||
| mobs:alias_mob("mobs:stone_monster", "mobs_monster:stone_monster") -- compatibility | mobs:alias_mob("mobs:stone_monster", "mobs_monster:stone_monster") | ||||||
|   | |||||||
| Before Width: | Height: | Size: 9.2 KiB After Width: | Height: | Size: 9.2 KiB | 
										
											Binary file not shown.
										
									
								
							| Before Width: | Height: | Size: 1.4 KiB After Width: | Height: | Size: 1.3 KiB | 
| @@ -1,4 +1,6 @@ | |||||||
| -- Translation support |  | ||||||
|  | -- translation and custom tree monster types | ||||||
|  |  | ||||||
| local S = minetest.get_translator("mobs_monster") | local S = minetest.get_translator("mobs_monster") | ||||||
|  |  | ||||||
| local tree_types = { | local tree_types = { | ||||||
| @@ -44,7 +46,6 @@ local tree_types = { | |||||||
| 	} | 	} | ||||||
| } | } | ||||||
|  |  | ||||||
|  |  | ||||||
| -- Tree Monster (or Tree Gollum) by PilzAdam | -- Tree Monster (or Tree Gollum) by PilzAdam | ||||||
|  |  | ||||||
| mobs:register_mob("mobs_monster:tree_monster", { | mobs:register_mob("mobs_monster:tree_monster", { | ||||||
| @@ -67,9 +68,7 @@ mobs:register_mob("mobs_monster:tree_monster", { | |||||||
| 	}, | 	}, | ||||||
| 	blood_texture = "default_wood.png", | 	blood_texture = "default_wood.png", | ||||||
| 	makes_footstep_sound = true, | 	makes_footstep_sound = true, | ||||||
| 	sounds = { | 	sounds = {random = "mobs_treemonster"}, | ||||||
| 		random = "mobs_treemonster" |  | ||||||
| 	}, |  | ||||||
| 	walk_velocity = 1, | 	walk_velocity = 1, | ||||||
| 	run_velocity = 3, | 	run_velocity = 3, | ||||||
| 	jump = true, | 	jump = true, | ||||||
| @@ -98,16 +97,11 @@ mobs:register_mob("mobs_monster:tree_monster", { | |||||||
| --		{"all", 0}, -- only weapons on list deal damage | --		{"all", 0}, -- only weapons on list deal damage | ||||||
| 	}, | 	}, | ||||||
| 	animation = { | 	animation = { | ||||||
| 		speed_normal = 15, | 		speed_normal = 15, speed_run = 15, | ||||||
| 		speed_run = 15, | 		stand_start = 0, stand_end = 24, | ||||||
| 		stand_start = 0, | 		walk_start = 25, walk_end = 47, | ||||||
| 		stand_end = 24, | 		run_start = 48, run_end = 62, | ||||||
| 		walk_start = 25, | 		punch_start = 48, punch_end = 62 | ||||||
| 		walk_end = 47, |  | ||||||
| 		run_start = 48, |  | ||||||
| 		run_end = 62, |  | ||||||
| 		punch_start = 48, |  | ||||||
| 		punch_end = 62 |  | ||||||
| 	}, | 	}, | ||||||
|  |  | ||||||
| 	-- check surrounding nodes and spawn a specific tree monster | 	-- check surrounding nodes and spawn a specific tree monster | ||||||
| @@ -127,11 +121,10 @@ mobs:register_mob("mobs_monster:tree_monster", { | |||||||
| 				self.base_texture = tmp.skins | 				self.base_texture = tmp.skins | ||||||
| 				self.object:set_properties({textures = tmp.skins}) | 				self.object:set_properties({textures = tmp.skins}) | ||||||
|  |  | ||||||
| 				if tmp.drops then | 				if tmp.drops then self.drops = tmp.drops end | ||||||
| 					self.drops = tmp.drops |  | ||||||
| 				end |  | ||||||
|  |  | ||||||
| 				if tmp.explode then | 				if tmp.explode then | ||||||
|  |  | ||||||
| 					self.attack_type = "explode" | 					self.attack_type = "explode" | ||||||
| 					self.explosion_radius = 3 | 					self.explosion_radius = 3 | ||||||
| 					self.explosion_timer = 3 | 					self.explosion_timer = 3 | ||||||
| @@ -158,6 +151,7 @@ mobs:register_mob("mobs_monster:tree_monster", { | |||||||
| 	end | 	end | ||||||
| }) | }) | ||||||
|  |  | ||||||
|  | -- where to spawn | ||||||
|  |  | ||||||
| if not mobs.custom_spawn_monster then | if not mobs.custom_spawn_monster then | ||||||
|  |  | ||||||
| @@ -171,8 +165,10 @@ if not mobs.custom_spawn_monster then | |||||||
| 	}) | 	}) | ||||||
| end | end | ||||||
|  |  | ||||||
|  | -- spawn egg | ||||||
|  |  | ||||||
| mobs:register_egg("mobs_monster:tree_monster", S("Tree Monster"), "default_tree_top.png", 1) | mobs:register_egg("mobs_monster:tree_monster", S("Tree Monster"), "default_tree_top.png", 1) | ||||||
|  |  | ||||||
|  | -- compatibility with older mobs mod | ||||||
|  |  | ||||||
| mobs:alias_mob("mobs:tree_monster", "mobs_monster:tree_monster") -- compatibility | mobs:alias_mob("mobs:tree_monster", "mobs_monster:tree_monster") | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user