diff --git a/mobs_mammoth/depends.txt b/mobs_mammoth/depends.txt index cc03398..d1d8786 100644 --- a/mobs_mammoth/depends.txt +++ b/mobs_mammoth/depends.txt @@ -1,2 +1,7 @@ +3d_armor default +dye mobs +wool +water_life? +stairs? \ No newline at end of file diff --git a/mobs_mammoth/init.lua b/mobs_mammoth/init.lua index 3ed2a58..261650a 100644 --- a/mobs_mammoth/init.lua +++ b/mobs_mammoth/init.lua @@ -1,147 +1,190 @@ +local modpath = minetest.get_modpath(minetest.get_current_modname()) -local S = mobs.intllib +dofile(modpath .. "/mammoth.lua") +dofile(modpath .. "/moose.lua") +dofile(modpath .. "/reindeer.lua") -local animation_awake = { - speed_normal = 10, - speed_sprint = 30, - stand_start = 50, - stand_end = 150, - walk_start = 1, - walk_end = 40, - punch_start = 160, - punch_end = 200, - punch_loop = false, - } -local animation_sleep = { - speed_stand = 5, - speed_normal = 10, - speed_sprint = 30, - stand_start = 205, - stand_end = 230, - walk_start = 205, - walk_end = 230, - } --- Mammoth by ElCeejo -mobs:register_mob("mobs_mammoth:mammoth", { - type = "animal", - hp_min = 54, - hp_max = 54, - armor = 115, - passive = false, - walk_velocity = 0.8, - run_velocity = 3, - walk_chance = 40, - jump = true, - jump_height = 1.0, - stepheight = 1.1, - runaway = false, - pushable = false, - view_range = 8, - knock_back = 0, - damage = 13, - fear_height = 6, - fall_speed = -8, - fall_damage = 20, - water_damage = 0, - lava_damage = 3, - light_damage = 0, - suffocation = false, - floats = 1, - follow = {"default:leaves"}, - reach = 10, - owner_loyal = true, - attack_type = "dogfight", - pathfinding = 0, - makes_footstep_sound = true, - sounds = { --- random = "paleotest_mammoth", - }, - drops = { - {name = "mobs:meat_raw", chance = 1, min = 6, max = 9}, - }, - visual = "mesh", - visual_size = {x=18, y=18}, - collisionbox = {-1.2, -1.7, -1.2, 1.2, 0.8, 1.2}, - textures = { - {"paleotest_mammoth1.png"}, - {"paleotest_mammoth2.png"}, - }, - child_texture = { - {"paleotest_mammoth3.png"}, - }, - mesh = "paleotest_mammoth.b3d", - animation = { - speed_normal = 10, - speed_sprint = 30, - stand_start = 50, - stand_end = 150, - walk_start = 1, - walk_end = 40, - punch_start = 160, - punch_end = 200, - punch_loop = false, - }, - - on_rightclick = function(self, clicker) - - -- feed or tame - if mobs:feed_tame(self, clicker, 8, true, true) then return end - if mobs:protect(self, clicker) then return end - - if self.owner == "" then - self.owner = clicker:get_player_name() - else - if self.order == "follow" then - self.order = "stand" - else - self.order = "follow" - - end - - end - - end, - - replace_rate = 10, - replace_what = { - {"group:grass", "air", 0}, - }, - - do_custom = function(self, dtime) - --- Diurnal mobs sleep at night and awake at day - - if self.time_of_day > 0.2 - and self.time_of_day < 0.8 then - - self.passive = false - self.view_range = 8 - self.walk_chance = 40 - self.jump = false - self.animation = animation_awake - mobs:set_animation(self, self.animation.current) - elseif self.time_of_day > 0.0 - and self.time_of_day < 1.0 then - - self.passive = true - self.view_range = 0 - self.walk_chance = 0 - self.jump = false - self.animation = animation_sleep - mobs:set_animation(self, self.animation.current) - end - end, +minetest.register_craftitem("mobs_mammoth:leather_sheet", { + description = "Leather Sheet", + inventory_image = "leather_block.png", + groups = {leather = 1, flammable = 2}, }) -mobs:spawn({ - name = "mobs_mammoth:mammoth", - nodes = {"default:snow","default:dirt_with_snow", "default:snowblock", "default:permafrost_with_moss"}, - interval = 60, - chance = 8000, - min_height = 0, - max_height = 200, +minetest.register_node("mobs_mammoth:leather_block", { + description = "Leather Block", + tiles = {"leather_block.png"}, + drawtype = "nodebox", + paramtype2 = "facedir", + paramtype = "light", + sunlight_propagates = true, + is_ground_content = false, + groups = {cracky = 1}, + sounds = default.node_sound_wood_defaults(), }) -mobs:register_egg("mobs_mammoth:mammoth", S("Mammoth"), "default_dirt.png", 1) +minetest.register_craft({ + output = "mobs_mammoth:leather_block", + recipe = { + {"mobs_mammoth:leather_sheet", "mobs_mammoth:leather_sheet", "mobs_mammoth:leather_sheet"}, + {"mobs_mammoth:leather_sheet", "mobs_mammoth:leather_sheet", "mobs_mammoth:leather_sheet"}, + {"mobs_mammoth:leather_sheet", "mobs_mammoth:leather_sheet", "mobs_mammoth:leather_sheet"}, + }, +}) + +minetest.register_craft({ + output = "mobs_mammoth:leather_sheet 9", + recipe = { + {"mobs_mammoth:leather_block"}, + }, +}) + +minetest.register_craft({ + output = "mobs_mammoth:leather_sheet", + recipe = { + {"water_life:beaver_fur", "water_life:beaver_fur"}, + {"water_life:beaver_fur", "water_life:beaver_fur"}, + }, +}) + +minetest.register_craft({ + output = "mobs_mammoth:leather_sheet", + recipe = { + {"water_life:crocleather", "water_life:crocleather"}, + }, +}) + +minetest.register_craft({ + output = "mobs_mammoth:leather_sheet", + recipe = { + {"mobs:leather", "mobs:leather"}, + {"mobs:leather", "mobs:leather"}, + }, +}) + +minetest.register_craft({ + output = "mobs_mammoth:leather_sheet", + recipe = { + {"mobs:rabbit_hide", "mobs:rabbit_hide", "mobs:rabbit_hide"}, + {"mobs:rabbit_hide", "mobs:rabbit_hide", "mobs:rabbit_hide"}, + }, +}) + +armor:register_armor("mobs_mammoth:leather_jacket", { + description = "Leather Jacket", + inventory_image = "leather_jacket_inv.png", + groups = {armor_torso=1, armor_heal=1, armor_use=400, + physics_speed=0.2, physics_gravity=0.0}, + armor_groups = {fleshy=15}, + damage_groups = {cracky=3, snappy=2, choppy=2, crumbly=1, level=2}, +}) + +minetest.register_craft({ + output = "mobs_mammoth:leather_jacket", + recipe = { + {"mobs_mammoth:leather_sheet", "", "mobs_mammoth:leather_sheet"}, + {"mobs_mammoth:leather_sheet", "dye:black", "mobs_mammoth:leather_sheet"}, + {"mobs_mammoth:leather_sheet", "dye:black", "mobs_mammoth:leather_sheet"}, + }, +}) + +minetest.register_craft({ + type = "shapeless", + output = "default:paper 9", + recipe = {"mobs_mammoth:leather_sheet"}, +}) + +armor:register_armor("mobs_mammoth:brown_jacket", { + description = "Brown Jacket", + inventory_image = "brown_jacket_inv.png", + groups = {armor_torso=1, armor_heal=1, armor_use=400, physics_speed=0.2, physics_gravity=0.0}, + armor_groups = {fleshy=15}, + damage_groups = {cracky=3, snappy=2, choppy=2, crumbly=1, level=2}, +}) + +minetest.register_craft({ + output = "mobs_mammoth:brown_jacket", + recipe = { + {"mobs_mammoth:leather_sheet", "wool:white", "mobs_mammoth:leather_sheet"}, + {"mobs_mammoth:leather_sheet", "", "mobs_mammoth:leather_sheet"}, + {"mobs_mammoth:leather_sheet", "", "mobs_mammoth:leather_sheet"}, + }, +}) + +minetest.register_node("mobs_mammoth:snow_brick", { + description = "Snow Brick", + tiles = {"snow_brick.png"}, + groups = {crumbly = 2, cools_lava = 1, snowy = 1}, + is_ground_content = false, + sounds = default.node_sound_stone_defaults(), +}) + +minetest.register_craft({ + output = "mobs_mammoth:snow_brick 4", + recipe = { + { "default:snowblock", "default:snowblock" }, + { "default:snowblock", "default:snowblock", } + }, +}) + +minetest.register_craft({ + output = "default:snowblock 4", + recipe = { { "mobs_mammoth:snow_brick" } }, +}) + +minetest.register_node("mobs_mammoth:ice_brick", { + description = "Ice Brick", + tiles = {"ice_brick.png"}, + groups = {crumbly = 2, cools_lava = 1, snowy = 1}, + is_ground_content = false, + sounds = default.node_sound_glass_defaults(), +}) + +minetest.register_craft({ + output = "mobs_mammoth:ice_brick 4", + recipe = { + { "default:ice", "default:ice" }, + { "default:ice", "default:ice" }, + }, +}) + +minetest.register_craft({ + output = "default:ice 4", + recipe = { { "mobs_mammoth:ice_brick" } }, +}) + +default.chest.register_chest("mobs_mammoth:leather_chest", { + description = "Leather Chest", + tiles = { + "leather_block_top.png", + "leather_block_top.png", + "leather_block_side.png", + "leather_block_side.png", + "leather_block_front.png", + "default_chest_inside.png" + }, + sounds = default.node_sound_wood_defaults(), + sound_open = "default_chest_open", + sound_close = "default_chest_close", + groups = {choppy = 2, oddly_breakable_by_hand = 2}, +}) + +minetest.register_craft({ + type = "shapeless", + output = "mobs_mammoth:leather_chest", + recipe = {"default:chest", "mobs_mammoth:leather_block"}, +}) + +if minetest.get_modpath("stairs") then + stairs.register_all("ice_brick", "mobs_mammoth:ice_brick", + {choppy = 2, oddly_breakable_by_hand = 2, flammable = 3}, + {"ice_brick.png"}, + "Ice Brick", + stairs.glass) + stairs.register_all("snow_brick", "mobs_mammoth:snow_brick", + {choppy = 2, oddly_breakable_by_hand = 2, flammable = 3}, + {"snow_brick.png"}, + "Snow Brick", + default.node_sound_stone_defaults()) +end diff --git a/mobs_mammoth/mammoth.lua b/mobs_mammoth/mammoth.lua new file mode 100644 index 0000000..65ce116 --- /dev/null +++ b/mobs_mammoth/mammoth.lua @@ -0,0 +1,145 @@ +local animation_awake = { + speed_normal = 10, + speed_sprint = 30, + stand_start = 50, + stand_end = 150, + walk_start = 1, + walk_end = 40, + punch_start = 160, + punch_end = 200, + punch_loop = false, + } +local animation_sleep = { + speed_stand = 5, + speed_normal = 10, + speed_sprint = 30, + stand_start = 205, + stand_end = 230, + walk_start = 205, + walk_end = 230, + } + +-- Mammoth by ElCeejo + +mobs:register_mob("mobs_mammoth:mammoth", { + type = "animal", + hp_min = 54, + hp_max = 54, + armor = 115, + passive = false, + walk_velocity = 0.8, + run_velocity = 3, + walk_chance = 40, + jump = true, + jump_height = 1.0, + stepheight = 1.1, + runaway = false, + pushable = false, + view_range = 8, + knock_back = 0, + damage = 13, + fear_height = 6, + fall_speed = -8, + fall_damage = 20, + water_damage = 0, + lava_damage = 3, + light_damage = 0, + suffocation = false, + floats = 1, + follow = {"default:leaves", "default:apple", "farming:potato", "farming:melon_slice", "farming:cucumber", "farming:bread"}, + reach = 10, + owner_loyal = true, + attack_type = "dogfight", + pathfinding = 0, + makes_footstep_sound = true, + sounds = { +-- random = "paleotest_mammoth", + }, + drops = { + {name = "mobs:meat_raw", chance = 1, min = 6, max = 9}, + {name = "mobs:leather", chance = 1, min = 1, max = 4}, + }, + visual = "mesh", + visual_size = {x=18, y=18}, + collisionbox = {-1.2, -1.7, -1.2, 1.2, 0.8, 1.2}, + textures = { + {"paleotest_mammoth1.png"}, + {"paleotest_mammoth2.png"}, + }, + child_texture = { + {"paleotest_mammoth3.png"}, + }, + mesh = "paleotest_mammoth.b3d", + animation = { + speed_normal = 10, + speed_sprint = 30, + stand_start = 50, + stand_end = 150, + walk_start = 1, + walk_end = 40, + punch_start = 160, + punch_end = 200, + punch_loop = false, + }, + + on_rightclick = function(self, clicker) + + -- feed or tame + if mobs:feed_tame(self, clicker, 8, true, true) then return end + if mobs:protect(self, clicker) then return end + + if self.owner == "" then + self.owner = clicker:get_player_name() + else + if self.order == "follow" then + self.order = "stand" + else + self.order = "follow" + + end + + end + + end, + + replace_rate = 10, + replace_what = { + {"group:grass", "air", 0}, + }, + + do_custom = function(self, dtime) + +-- Diurnal mobs sleep at night and awake at day + + if self.time_of_day > 0.2 + and self.time_of_day < 0.8 then + + self.passive = false + self.view_range = 8 + self.walk_chance = 40 + self.jump = false + self.animation = animation_awake + mobs:set_animation(self, self.animation.current) + elseif self.time_of_day > 0.0 + and self.time_of_day < 1.0 then + + self.passive = true + self.view_range = 0 + self.walk_chance = 0 + self.jump = false + self.animation = animation_sleep + mobs:set_animation(self, self.animation.current) + end + end, +}) + +mobs:spawn({ + name = "mobs_mammoth:mammoth", + nodes = {"default:ice", "default:dirt_with_snow", "default:snowblock", "default:permafrost_with_moss", "default:permafrost_with_stones", "default:dirt_with_coniferous_litter"}, + interval = 60, + chance = 8000, + min_height = 0, + max_height = 200, +}) + +mobs:register_egg("mobs_mammoth:mammoth", "Mammoth", "default_dirt.png", 1) diff --git a/mobs_mammoth/models/Moose.b3d b/mobs_mammoth/models/Moose.b3d new file mode 100644 index 0000000..62c41a7 Binary files /dev/null and b/mobs_mammoth/models/Moose.b3d differ diff --git a/mobs_mammoth/models/Reindeer.b3d b/mobs_mammoth/models/Reindeer.b3d new file mode 100644 index 0000000..0458225 Binary files /dev/null and b/mobs_mammoth/models/Reindeer.b3d differ diff --git a/mobs_mammoth/moose.lua b/mobs_mammoth/moose.lua new file mode 100644 index 0000000..08aeca3 --- /dev/null +++ b/mobs_mammoth/moose.lua @@ -0,0 +1,74 @@ +mobs:register_mob("mobs_mammoth:moose", { + stepheight = 1, + type = "animal", + passive = false, + attack_type = "dogfight", + group_attack = true, + owner_loyal = true, + attack_npcs = false, + reach = 2, + damage = 7, + hp_min = 25, + hp_max = 60, + armor = 100, + collisionbox = {-0.6, -0.01, -0.6, 0.6, 0.95, 0.6}, + visual = "mesh", + mesh = "Moose.b3d", + textures = { + {"texturemoose.png"}, + }, + makes_footstep_sound = true, + sounds = { + random = "animalworld_moose", + attack = "animalworld_moose", + }, + walk_velocity = 1, + run_velocity = 3, + jump = false, + jump_height = 3, + pushable = true, + follow = {"default:apple", "farming:potato", "farming:melon_slice", "farming:cucumber", "farming:cabbage", "farming:lettuce", "farming:bread"}, + view_range = 10, + drops = { + {name = "mobs:meat_raw", chance = 1, min = 1, max = 1}, + {name = "mobs:leather", chance = 1, min = 0, max = 2}, + }, + water_damage = 0, + lava_damage = 5, + light_damage = 0, + fear_height = 2, + animation = { + speed_normal = 50, + stand_start = 0, + stand_end = 100, + walk_start = 100, + walk_end = 200, + punch_start = 200, + punch_end = 300, + + die_start = 1, -- we dont have a specific death animation so we will + die_end = 2, -- re-use 2 standing frames at a speed of 1 fps and + die_speed = 1, -- have mob rotate when dying. + die_loop = false, + die_rotate = true, + }, + on_rightclick = function(self, clicker) + + if mobs:feed_tame(self, clicker, 8, true, true) then return end + if mobs:protect(self, clicker) then return end + if mobs:capture_mob(self, clicker, 0, 5, 50, false, nil) then return end + end, +}) + +mobs:spawn({ + name = "mobs_mammoth:moose", + nodes = {"default:dirt_with_coniferous_litter"}, + min_light = 0, + interval = 60, + chance = 8000, -- 15000 + min_height = 0, + max_height = 120, + day_toggle = true, +}) + +mobs:register_egg("mobs_mammoth:moose", ("Moose"), "amoose.png") diff --git a/mobs_mammoth/reindeer.lua b/mobs_mammoth/reindeer.lua new file mode 100644 index 0000000..6af799f --- /dev/null +++ b/mobs_mammoth/reindeer.lua @@ -0,0 +1,72 @@ +mobs:register_mob("mobs_mammoth:reindeer", { + stepheight = 1, + type = "animal", + passive = true, + attack_type = "dogfight", + group_attack = true, + owner_loyal = true, + attack_npcs = false, + reach = 2, + damage = 2, + hp_min = 25, + hp_max = 50, + armor = 100, + collisionbox = {-0.6, -0.01, -0.6, 0.6, 0.95, 0.6}, + visual = "mesh", + mesh = "Reindeer.b3d", + textures = { + {"texturereindeer.png"}, + }, + makes_footstep_sound = true, + sounds = { + + }, + walk_velocity = 1, + run_velocity = 3, + jump = false, + jump_height = 3, + pushable = true, + follow = {"default:apple", "farming:potato", "farming:melon_slice", "farming:cucumber", "farming:cabbage", "farming:lettuce", "farming:bread"}, + view_range = 10, + drops = { + {name = "mobs:meat_raw", chance = 1, min = 1, max = 1}, + {name = "mobs:leather", chance = 1, min = 1, max = 1}, + }, + water_damage = 0, + lava_damage = 5, + light_damage = 0, + fear_height = 2, + animation = { + speed_normal = 70, + stand_start = 0, + stand_end = 100, + walk_start = 100, + walk_end = 200, + punch_start = 200, + punch_end = 300, + + die_start = 1, -- we dont have a specific death animation so we will + die_end = 2, -- re-use 2 standing frames at a speed of 1 fps and + die_speed = 1, -- have mob rotate when dying. + die_loop = false, + die_rotate = true, + }, + on_rightclick = function(self, clicker) + if mobs:feed_tame(self, clicker, 8, true, true) then return end + if mobs:protect(self, clicker) then return end + if mobs:capture_mob(self, clicker, 0, 5, 50, false, nil) then return end + end, +}) + +mobs:spawn({ + name = "mobs_mammoth:reindeer", + nodes = {"default:dirt_with_snow", "default:permafrost_with_moss", "default:permafrost_with_stones"}, + min_light = 0, + interval = 60, + chance = 8000, -- 15000 + min_height = 0, + max_height = 80, + day_toggle = true, +}) + +mobs:register_egg("mobs_mammoth:reindeer", ("Reindeer"), "areindeer.png") diff --git a/mobs_mammoth/sounds/animalworld_moose.ogg b/mobs_mammoth/sounds/animalworld_moose.ogg new file mode 100644 index 0000000..56335d1 Binary files /dev/null and b/mobs_mammoth/sounds/animalworld_moose.ogg differ diff --git a/mobs_mammoth/textures/amoose.png b/mobs_mammoth/textures/amoose.png new file mode 100644 index 0000000..481871e Binary files /dev/null and b/mobs_mammoth/textures/amoose.png differ diff --git a/mobs_mammoth/textures/areindeer.png b/mobs_mammoth/textures/areindeer.png new file mode 100644 index 0000000..5b040a1 Binary files /dev/null and b/mobs_mammoth/textures/areindeer.png differ diff --git a/mobs_mammoth/textures/brown_jacket_inv.png b/mobs_mammoth/textures/brown_jacket_inv.png new file mode 100644 index 0000000..04a4e09 Binary files /dev/null and b/mobs_mammoth/textures/brown_jacket_inv.png differ diff --git a/mobs_mammoth/textures/ice_brick.png b/mobs_mammoth/textures/ice_brick.png new file mode 100644 index 0000000..528361f Binary files /dev/null and b/mobs_mammoth/textures/ice_brick.png differ diff --git a/mobs_mammoth/textures/leather_block.png b/mobs_mammoth/textures/leather_block.png new file mode 100644 index 0000000..06ad36c Binary files /dev/null and b/mobs_mammoth/textures/leather_block.png differ diff --git a/mobs_mammoth/textures/leather_block_front.png b/mobs_mammoth/textures/leather_block_front.png new file mode 100644 index 0000000..bb132cf Binary files /dev/null and b/mobs_mammoth/textures/leather_block_front.png differ diff --git a/mobs_mammoth/textures/leather_block_side.png b/mobs_mammoth/textures/leather_block_side.png new file mode 100644 index 0000000..754492a Binary files /dev/null and b/mobs_mammoth/textures/leather_block_side.png differ diff --git a/mobs_mammoth/textures/leather_block_top.png b/mobs_mammoth/textures/leather_block_top.png new file mode 100644 index 0000000..ed1d361 Binary files /dev/null and b/mobs_mammoth/textures/leather_block_top.png differ diff --git a/mobs_mammoth/textures/leather_jacket_inv.png b/mobs_mammoth/textures/leather_jacket_inv.png new file mode 100644 index 0000000..6142c25 Binary files /dev/null and b/mobs_mammoth/textures/leather_jacket_inv.png differ diff --git a/mobs_mammoth/textures/mobs_mammoth_brown_jacket.png b/mobs_mammoth/textures/mobs_mammoth_brown_jacket.png new file mode 100644 index 0000000..6508e05 Binary files /dev/null and b/mobs_mammoth/textures/mobs_mammoth_brown_jacket.png differ diff --git a/mobs_mammoth/textures/mobs_mammoth_brown_jacket_preview.png b/mobs_mammoth/textures/mobs_mammoth_brown_jacket_preview.png new file mode 100644 index 0000000..a6c4e29 Binary files /dev/null and b/mobs_mammoth/textures/mobs_mammoth_brown_jacket_preview.png differ diff --git a/mobs_mammoth/textures/mobs_mammoth_leather_jacket.png b/mobs_mammoth/textures/mobs_mammoth_leather_jacket.png new file mode 100644 index 0000000..128f3a0 Binary files /dev/null and b/mobs_mammoth/textures/mobs_mammoth_leather_jacket.png differ diff --git a/mobs_mammoth/textures/mobs_mammoth_leather_jacket_preview.png b/mobs_mammoth/textures/mobs_mammoth_leather_jacket_preview.png new file mode 100644 index 0000000..2d052dd Binary files /dev/null and b/mobs_mammoth/textures/mobs_mammoth_leather_jacket_preview.png differ diff --git a/mobs_mammoth/textures/snow_brick.png b/mobs_mammoth/textures/snow_brick.png new file mode 100644 index 0000000..a01501c Binary files /dev/null and b/mobs_mammoth/textures/snow_brick.png differ diff --git a/mobs_mammoth/textures/texturemoose.png b/mobs_mammoth/textures/texturemoose.png new file mode 100644 index 0000000..3ff9312 Binary files /dev/null and b/mobs_mammoth/textures/texturemoose.png differ diff --git a/mobs_mammoth/textures/texturereindeer.png b/mobs_mammoth/textures/texturereindeer.png new file mode 100644 index 0000000..98584b7 Binary files /dev/null and b/mobs_mammoth/textures/texturereindeer.png differ