diff --git a/mods/ENTITIES/mobs_mc/README.md b/mods/ENTITIES/mobs_mc/README.md index 4ee435d72..881f56619 100644 --- a/mods/ENTITIES/mobs_mc/README.md +++ b/mods/ENTITIES/mobs_mc/README.md @@ -58,6 +58,7 @@ This mod adds mobs which closely resemble the mobs from the game Minecraft, vers ### Peaceful mobs +* Axolotl * Chicken * Cow * Pig diff --git a/mods/ENTITIES/mobs_mc/axolotl.lua b/mods/ENTITIES/mobs_mc/axolotl.lua new file mode 100644 index 000000000..51f1ae152 --- /dev/null +++ b/mods/ENTITIES/mobs_mc/axolotl.lua @@ -0,0 +1,233 @@ +--MCmobs v0.4 +--maikerumine +--made for MC like Survival game +--License for code WTFPL and otherwise stated in readmes + +local pi = math.pi +local atann = math.atan +local atan = function(x) + if not x or x ~= x then + return 0 + else + return atann(x) + end +end + +local dir_to_pitch = function(dir) + local dir2 = vector.normalize(dir) + local xz = math.abs(dir.x) + math.abs(dir.z) + return -math.atan2(-dir.y, xz) +end + +local function degrees(rad) + return rad * 180.0 / math.pi +end + +local S = minetest.get_translator(minetest.get_current_modname()) + +--################### +--################### axolotl +--################### + +local axolotl = { + type = "animal", + spawn_class = "water", + can_despawn = true, + passive = false, + hp_min = 14, + hp_max = 14, + xp_min = 1, + xp_max = 7, + + head_swivel = "head.control", + bone_eye_height = -1, + head_eye_height = -0.5, + horrizonatal_head_height = 0, + curiosity = 10, + head_yaw="z", + + armor = 100, + rotate = 180, + spawn_in_group_min = 1, + spawn_in_group = 4, + tilt_swim = true, + collisionbox = {-0.5, 0.0, -0.5, 0.5, 0.8, 0.5}, + visual = "mesh", + mesh = "mobs_mc_axolotl.b3d", + textures = { + {"mobs_mc_axolotl_brown.png"}, + {"mobs_mc_axolotl_yellow.png"}, + {"mobs_mc_axolotl_green.png"}, + {"mobs_mc_axolotl_pink.png"}, + {"mobs_mc_axolotl_black.png"}, + {"mobs_mc_axolotl_purple.png"}, + {"mobs_mc_axolotl_white.png"} + }, + sounds = { + random = "mobs_mc_axolotl", + damage = "mobs_mc_axolotl_hurt", + distance = 16, + }, + animation = {-- Stand: 1-20; Walk: 20-60; Swim: 61-81 + stand_start = 61, stand_end = 81, stand_speed = 15, + walk_start = 61, walk_end = 81, walk_speed = 15, + run_start = 61, run_end = 81, run_speed = 20, + }, + + -- This should should make axolotls breedable, but it doesn't. + follow = { + "mcl_fishing:clownfish_raw" + }, + + view_range = 16, + fear_height = 4, + + on_rightclick = function(self, clicker) + if mcl_mobs:feed_tame(self, clicker, 1, true, false) then return end + if mcl_mobs:protect(self, clicker) then return end + if mcl_mobs:capture_mob(self, clicker, 0, 60, 5, false, nil) then return end + end, + + makes_footstep_sound = false, + fly = true, + fly_in = { "mcl_core:water_source", "mclx_core:river_water_source" }, + breathes_in_water = true, + jump = true, + damage = 2, + reach = 2, + attack_type = "dogfight", + attack_animals = true, + specific_attack = { + "extra_mobs_cod", + "mobs_mc:sheep", + "extra_mobs_glow_squid", + "extra_mobs_salmon", + "extra_mobs_tropical_fish", + "mobs_mc_squid" + }, + runaway = true, + do_custom = function(self) + --[[ this is supposed to make them jump out the water but doesn't appear to work very well + self.object:set_bone_position("body", vector.new(0,1,0), vector.new(degrees(dir_to_pitch(self.object:get_velocity())) * -1 + 90,0,0)) + if minetest.get_item_group(self.standing_in, "water") ~= 0 then + if self.object:get_velocity().y < 5 then + self.object:add_velocity({ x = 0 , y = math.random(-.007, .007), z = 0 }) + end + end +--]] + for _,object in pairs(minetest.get_objects_inside_radius(self.object:get_pos(), 10)) do + local lp = object:get_pos() + local s = self.object:get_pos() + local vec = { + x = lp.x - s.x, + y = lp.y - s.y, + z = lp.z - s.z + } + if object and not object:is_player() and object:get_luaentity() and object:get_luaentity().name == "extra_mobs_tropical_fish" then + self.state = "runaway" + self.object:set_rotation({x=0,y=(atan(vec.z / vec.x) + 3 * pi / 2) - self.rotate,z=0}) + end + end + end, + on_rightclick = function(self, clicker) + if clicker:get_wielded_item():get_name() == "mcl_buckets:bucket_water" then + self.object:remove() + clicker:set_wielded_item("mcl_buckets:bucket_axolotl") + awards.unlock(clicker:get_player_name(), "mcl:cutestPredator") + end + end +} + +mcl_mobs:register_mob("mobs_mc:axolotl", axolotl) + + +local water = 0 + +mcl_mobs:spawn_specific( +"mobs_mc:axolotl", +"overworld", +"water", +{ +"Swampland", +"MushroomIsland", +"RoofedForest", +"FlowerForest_beach", +"Forest_beach", +"StoneBeach", +"Taiga_beach", +"Savanna_beach", +"Plains_beach", +"ExtremeHills_beach", +"Swampland_shore", +"MushroomIslandShore", +"JungleM_shore", +"Jungle_shore", +"RoofedForest_ocean", +"JungleEdgeM_ocean", +"BirchForestM_ocean", +"BirchForest_ocean", +"IcePlains_deep_ocean", +"Jungle_deep_ocean", +"Savanna_ocean", +"MesaPlateauF_ocean", +"SunflowerPlains_ocean", +"Swampland_ocean", +"ExtremeHillsM_ocean", +"Mesa_ocean", +"StoneBeach_ocean", +"Plains_ocean", +"MesaPlateauFM_ocean", +"MushroomIsland_ocean", +"MegaTaiga_ocean", +"StoneBeach_deep_ocean", +"SavannaM_ocean", +"ExtremeHills_ocean", +"Forest_ocean", +"JungleEdge_ocean", +"MesaBryce_ocean", +"MegaSpruceTaiga_ocean", +"ExtremeHills+_ocean", +"Jungle_ocean", +"FlowerForest_ocean", +"Desert_ocean", +"Taiga_ocean", +"JungleM_ocean", +"FlowerForest_underground", +"JungleEdge_underground", +"StoneBeach_underground", +"MesaBryce_underground", +"Mesa_underground", +"RoofedForest_underground", +"Jungle_underground", +"Swampland_underground", +"MushroomIsland_underground", +"BirchForest_underground", +"Plains_underground", +"MesaPlateauF_underground", +"ExtremeHills_underground", +"MegaSpruceTaiga_underground", +"BirchForestM_underground", +"SavannaM_underground", +"MesaPlateauFM_underground", +"Desert_underground", +"Savanna_underground", +"Forest_underground", +"SunflowerPlains_underground", +"MegaTaiga_underground", +"Taiga_underground", +"ExtremeHills+_underground", +"JungleM_underground", +"ExtremeHillsM_underground", +"JungleEdgeM_underground", +"LushCaves", +}, +0, +minetest.LIGHT_MAX+1, +30, +4000, +3, +water-16, +water+1) + +-- spawn eggs +mcl_mobs:register_egg("mobs_mc:axolotl", S("Axolotl"), "#e890bf", "#b83D7e", 0) diff --git a/mods/ENTITIES/mobs_mc/init.lua b/mods/ENTITIES/mobs_mc/init.lua index a84a8c321..c2b3d8ed0 100644 --- a/mods/ENTITIES/mobs_mc/init.lua +++ b/mods/ENTITIES/mobs_mc/init.lua @@ -96,6 +96,7 @@ mobs_mc.water_level = tonumber(minetest.settings:get("water_level")) or 0 -- Animals local path = minetest.get_modpath("mobs_mc") +dofile(path .. "/axolotl.lua") -- Mesh and animation by JoeEnderman, Textures by Nova Wustra, modified by JoeEnderman dofile(path .. "/bat.lua") -- Mesh and animation by toby109tt / https://github.com/22i dofile(path .. "/rabbit.lua") -- Mesh and animation byExeterDad dofile(path .. "/chicken.lua") -- Mesh and animation by Pavel_S diff --git a/mods/ENTITIES/mobs_mc/locale/template.txt b/mods/ENTITIES/mobs_mc/locale/template.txt index 493e2cb6e..38c6111b5 100644 --- a/mods/ENTITIES/mobs_mc/locale/template.txt +++ b/mods/ENTITIES/mobs_mc/locale/template.txt @@ -1,5 +1,6 @@ # textdomain: mobs_mc Agent= +Axolotl= Bat= Blaze= Chicken= diff --git a/mods/ENTITIES/mobs_mc/models/mobs_mc_axolotl.b3d b/mods/ENTITIES/mobs_mc/models/mobs_mc_axolotl.b3d new file mode 100644 index 000000000..3e4c8119e Binary files /dev/null and b/mods/ENTITIES/mobs_mc/models/mobs_mc_axolotl.b3d differ diff --git a/mods/ENTITIES/mobs_mc/sounds/mobs_mc_axolotl1.ogg b/mods/ENTITIES/mobs_mc/sounds/mobs_mc_axolotl1.ogg new file mode 100644 index 000000000..b3d9c5967 Binary files /dev/null and b/mods/ENTITIES/mobs_mc/sounds/mobs_mc_axolotl1.ogg differ diff --git a/mods/ENTITIES/mobs_mc/sounds/mobs_mc_axolotl2.ogg b/mods/ENTITIES/mobs_mc/sounds/mobs_mc_axolotl2.ogg new file mode 100644 index 000000000..11141f6cc Binary files /dev/null and b/mods/ENTITIES/mobs_mc/sounds/mobs_mc_axolotl2.ogg differ diff --git a/mods/ENTITIES/mobs_mc/sounds/mobs_mc_axolotl_hurt.ogg b/mods/ENTITIES/mobs_mc/sounds/mobs_mc_axolotl_hurt.ogg new file mode 100644 index 000000000..dddf298b6 Binary files /dev/null and b/mods/ENTITIES/mobs_mc/sounds/mobs_mc_axolotl_hurt.ogg differ diff --git a/mods/ENTITIES/mobs_mc/textures/mobs_mc_axolotl_black.png b/mods/ENTITIES/mobs_mc/textures/mobs_mc_axolotl_black.png new file mode 100644 index 000000000..8f13938f8 Binary files /dev/null and b/mods/ENTITIES/mobs_mc/textures/mobs_mc_axolotl_black.png differ diff --git a/mods/ENTITIES/mobs_mc/textures/mobs_mc_axolotl_brown.png b/mods/ENTITIES/mobs_mc/textures/mobs_mc_axolotl_brown.png new file mode 100644 index 000000000..b90ba3c88 Binary files /dev/null and b/mods/ENTITIES/mobs_mc/textures/mobs_mc_axolotl_brown.png differ diff --git a/mods/ENTITIES/mobs_mc/textures/mobs_mc_axolotl_green.png b/mods/ENTITIES/mobs_mc/textures/mobs_mc_axolotl_green.png new file mode 100644 index 000000000..4dca4fdf5 Binary files /dev/null and b/mods/ENTITIES/mobs_mc/textures/mobs_mc_axolotl_green.png differ diff --git a/mods/ENTITIES/mobs_mc/textures/mobs_mc_axolotl_pink.png b/mods/ENTITIES/mobs_mc/textures/mobs_mc_axolotl_pink.png new file mode 100644 index 000000000..193a8e087 Binary files /dev/null and b/mods/ENTITIES/mobs_mc/textures/mobs_mc_axolotl_pink.png differ diff --git a/mods/ENTITIES/mobs_mc/textures/mobs_mc_axolotl_purple.png b/mods/ENTITIES/mobs_mc/textures/mobs_mc_axolotl_purple.png new file mode 100644 index 000000000..bd7f67c6f Binary files /dev/null and b/mods/ENTITIES/mobs_mc/textures/mobs_mc_axolotl_purple.png differ diff --git a/mods/ENTITIES/mobs_mc/textures/mobs_mc_axolotl_white.png b/mods/ENTITIES/mobs_mc/textures/mobs_mc_axolotl_white.png new file mode 100644 index 000000000..15b3ba43d Binary files /dev/null and b/mods/ENTITIES/mobs_mc/textures/mobs_mc_axolotl_white.png differ diff --git a/mods/ENTITIES/mobs_mc/textures/mobs_mc_axolotl_yellow.png b/mods/ENTITIES/mobs_mc/textures/mobs_mc_axolotl_yellow.png new file mode 100644 index 000000000..6b3fd6157 Binary files /dev/null and b/mods/ENTITIES/mobs_mc/textures/mobs_mc_axolotl_yellow.png differ diff --git a/mods/HUD/mcl_achievements/init.lua b/mods/HUD/mcl_achievements/init.lua index 952fc1789..53116c183 100644 --- a/mods/HUD/mcl_achievements/init.lua +++ b/mods/HUD/mcl_achievements/init.lua @@ -302,6 +302,14 @@ awards.register_achievement("mcl:tacticalFishing", { group = "Husbandry", }) +awards.register_achievement("mcl:cutestPredator", { + title = S("The Cutest Predator"), + description = S("Catch an Axolotl with a bucket!"), + icon = "axolotl_bucket.png", + type = "Advancement", + group = "Husbandry", +}) + awards.register_achievement("mcl:witheringHeights", { title = S("Withering Heights"), description = S("Summon the wither from the dead."), diff --git a/mods/HUD/mcl_achievements/locale/template.txt b/mods/HUD/mcl_achievements/locale/template.txt index 3420a39dc..f229b2152 100644 --- a/mods/HUD/mcl_achievements/locale/template.txt +++ b/mods/HUD/mcl_achievements/locale/template.txt @@ -65,6 +65,8 @@ What A Deal!= Successfully trade with a Villager.= Withering Heights= Summon the wither from the dead.= +The Cutest Predator= +Catch an Axolotl with a bucket! Fishy Business= Catch a fish.@nHint: Catch a fish, salmon, clownfish, or pufferfish.= Country Lode,@nTake Me Home= diff --git a/mods/ITEMS/mcl_buckets/locale/template.txt b/mods/ITEMS/mcl_buckets/locale/template.txt index 86b7b10b5..29aaeace9 100644 --- a/mods/ITEMS/mcl_buckets/locale/template.txt +++ b/mods/ITEMS/mcl_buckets/locale/template.txt @@ -15,10 +15,11 @@ Collects liquids= Places a lava source= Places a water source= Places a river water source= +Axolotl= Cod= Salmon= Tropical Fish= Bucket of @1= This bucket is filled with water and @1.= -Place it to empty the bucket and place a @1. Obtain by right clicking on a @2 fish with a bucket of water.= -Places a water source and a @1 fish.= +Place it to empty the bucket and place a @1. Obtain by right clicking on a @2 with a bucket of water.= +Places a water source and a @1.= diff --git a/mods/ITEMS/mcl_buckets/register.lua b/mods/ITEMS/mcl_buckets/register.lua index b54d0d2bf..daaa3116a 100644 --- a/mods/ITEMS/mcl_buckets/register.lua +++ b/mods/ITEMS/mcl_buckets/register.lua @@ -123,6 +123,7 @@ minetest.register_craft({ fish_names = { { techname = "cod", name = "Cod" }, { techname = "salmon", name = "Salmon" }, + { techname = "axolotl", name = "Axolotl" }, --{ techname = "pufferfish", name = "Pufferfish" } FIXME: Uncomment when pufferfish mobs are added. { techname = "tropical_fish", name = "Tropical Fish" } } @@ -138,8 +139,8 @@ for _, fish in pairs(fish_names) do inventory_image = fish.techname .. "_bucket.png", name = S("Bucket of @1", S(fish.name)), longdesc = S("This bucket is filled with water and @1.", S(fish.name)), - usagehelp = S("Place it to empty the bucket and place a @1. Obtain by right clicking on a @2 fish with a bucket of water.", S(fish.name), S(fish.name)), - tt_help = S("Places a water source and a @1 fish.", S(fish.name)), + usagehelp = S("Place it to empty the bucket and place a @1. Obtain by right clicking on a @2 with a bucket of water.", S(fish.name), S(fish.name)), + tt_help = S("Places a water source and a @1.", S(fish.name)), extra_check = function(pos, placer) local dim = mcl_worlds.pos_to_dimension(pos) if dim == "nether" then diff --git a/mods/ITEMS/mcl_buckets/textures/axolotl_bucket.png b/mods/ITEMS/mcl_buckets/textures/axolotl_bucket.png new file mode 100644 index 000000000..1923991c1 Binary files /dev/null and b/mods/ITEMS/mcl_buckets/textures/axolotl_bucket.png differ