From 37e943ae91f7a0292a566f60e51d69c1936594da Mon Sep 17 00:00:00 2001 From: Wuzzy Date: Thu, 6 Jul 2017 00:43:34 +0200 Subject: [PATCH] Update mobs_mc --- mods/ENTITIES/mobs_mc/0_gameconfig.lua | 14 +- mods/ENTITIES/mobs_mc/1_items_default.lua | 54 +++++- mods/ENTITIES/mobs_mc/2_throwing.lua | 9 + mods/ENTITIES/mobs_mc/4_heads.lua | 58 ++++++ mods/ENTITIES/mobs_mc/LICENSE-media.md | 2 - mods/ENTITIES/mobs_mc/README.md | 2 +- mods/ENTITIES/mobs_mc/creeper.lua | 6 +- mods/ENTITIES/mobs_mc/depends.txt | 1 + mods/ENTITIES/mobs_mc/ghast.lua | 2 +- mods/ENTITIES/mobs_mc/heads.lua | 207 ---------------------- mods/ENTITIES/mobs_mc/init.lua | 2 +- mods/ENTITIES/mobs_mc/ocelot.lua | 1 + mods/ENTITIES/mobs_mc/silverfish.lua | 2 +- mods/ENTITIES/mobs_mc/skeleton+stray.lua | 9 +- mods/ENTITIES/mobs_mc/skeleton_stray.lua | 99 ----------- mods/ENTITIES/mobs_mc/skeleton_wither.lua | 12 +- mods/ENTITIES/mobs_mc/wolf.lua | 50 +++--- mods/ENTITIES/mobs_mc/zombie.lua | 11 +- mods/ENTITIES/mobs_mc/zombiepig.lua | 4 - 19 files changed, 189 insertions(+), 356 deletions(-) create mode 100644 mods/ENTITIES/mobs_mc/4_heads.lua delete mode 100644 mods/ENTITIES/mobs_mc/heads.lua delete mode 100644 mods/ENTITIES/mobs_mc/skeleton_stray.lua diff --git a/mods/ENTITIES/mobs_mc/0_gameconfig.lua b/mods/ENTITIES/mobs_mc/0_gameconfig.lua index 7d588d28a..c52c1ce5c 100644 --- a/mods/ENTITIES/mobs_mc/0_gameconfig.lua +++ b/mods/ENTITIES/mobs_mc/0_gameconfig.lua @@ -54,9 +54,12 @@ mobs_mc.items = { nether_star = "mobs_mc:nether_star", bone = "mobs_mc:bone", slimeball = "mobs_mc:slimeball", - arrow = "mobs_mc:arrow", bow = "mobs_mc:bow_wood", + head_creeper = "mobs_mc:head_creeper", + head_zombie = "mobs_mc:head_zombie", + head_skeleton = "mobs_mc:head_skeleton", + head_wither_skeleton = "mobs_mc:head_wither_skeleton", -- External items -- Mobs Redo @@ -114,8 +117,6 @@ mobs_mc.items = { clownfish_raw = "fishing:clownfish_raw", pufferfish_raw = "fishing:pike_raw", - bone = "bonemeal:bone", - slimeball = "mesecons_materials:glue", cookie = "farming:cookie", @@ -158,10 +159,15 @@ mobs_mc.follow = { pig = { mobs_mc.items.potato, mobs_mc.items.carrot, mobs_mc.items.carrot_on_a_stick, mobs_mc.items.apple, -- Minetest Game extra }, - rabbit = { mobs_mc.items.dandelion, mobs_mc.items.carrot, mobs_mc.items.carrot_gold, "farming_plus:carrot_item", }, + rabbit = { mobs_mc.items.dandelion, mobs_mc.items.carrot, mobs_mc.items.golden_carrot, "farming_plus:carrot_item", }, ocelot = { mobs_mc.items.fish_raw, mobs_mc.items.salmon_raw, mobs_mc.items.clownfish_raw, mobs_mc.items.pufferfish_raw, mobs_mc.items.chicken_raw, -- Minetest Game extra }, + wolf = { mobs_mc.items.bone }, + dog = { mobs_mc.items.rabbit_raw, mobs_mc.items.rabbit_cooked, mobs_mc.items.mutton_raw, mobs_mc.items.mutton_cooked, mobs_mc.items.beef_raw, mobs_mc.items.beef_cooked, mobs_mc.items.chicken_raw, mobs_mc.items.chicken_cooked, mobs_mc.items.rotten_flesh, + -- Mobs Redo items + "mobs:meat", "mobs:meat_raw" }, +e } -- Contents for replace_what diff --git a/mods/ENTITIES/mobs_mc/1_items_default.lua b/mods/ENTITIES/mobs_mc/1_items_default.lua index 18acb2c68..9e7d36c32 100644 --- a/mods/ENTITIES/mobs_mc/1_items_default.lua +++ b/mods/ENTITIES/mobs_mc/1_items_default.lua @@ -61,6 +61,7 @@ end if c("chicken_raw") then minetest.register_craftitem("mobs_mc:chicken_raw", { description = S("Raw Chicken"), + _doc_items_longdesc = S("Raw chicken is a food item and can be eaten safely. Cooking it will increase its nutritional value."), inventory_image = "mcl_mobitems_chicken_raw.png", groups = { food = 2, eatable = 2 }, on_use = minetest.item_eat(2), @@ -70,6 +71,7 @@ end if c("chicken_cooked") then minetest.register_craftitem("mobs_mc:chicken_cooked", { description = S("Cooked Chicken"), + _doc_items_longdesc = S("A cooked chicken is a healthy food item which can be eaten."), inventory_image = "mcl_mobitems_chicken_cooked.png", groups = { food = 2, eatable = 6 }, on_use = minetest.item_eat(6), @@ -88,6 +90,7 @@ end if c("feather") then minetest.register_craftitem("mobs_mc:feather", { description = S("Feather"), + _doc_items_longdesc = S("Feathers are used in crafting and are dropped from chickens."), inventory_image = "mcl_mobitems_feather.png", }) end @@ -96,6 +99,7 @@ end if c("beef_raw") then minetest.register_craftitem("mobs_mc:beef_raw", { description = S("Raw Beef"), + _doc_items_longdesc = S("Raw beef is the flesh from cows and can be eaten safely. Cooking it will greatly increase its nutritional value."), inventory_image = "mcl_mobitems_beef_raw.png", groups = { food = 2, eatable = 3 }, on_use = minetest.item_eat(3), @@ -105,6 +109,7 @@ end if c("beef_cooked") then minetest.register_craftitem("mobs_mc:beef_cooked", { description = S("Steak"), + _doc_items_longdesc = S("Steak is cooked beef from cows and can be eaten."), inventory_image = "mcl_mobitems_beef_cooked.png", groups = { food = 2, eatable = 8 }, on_use = minetest.item_eat(8), @@ -125,6 +130,7 @@ if c("milk") then -- milk minetest.register_craftitem("mobs_mc:milk_bucket", { description = S("Milk"), + _doc_items_longdesc = S("Milk is a food item obtained by using a bucket on a cow."), inventory_image = "mobs_bucket_milk.png", groups = { food = 3, eatable = 1 }, on_use = minetest.item_eat(1, "bucket:bucket_empty"), @@ -135,6 +141,7 @@ end if c("bowl") then minetest.register_craftitem("mobs_mc:bowl", { description = S("Bowl"), + _doc_items_longdesc = S("Bowls are mainly used to hold tasty soups."), inventory_image = "mcl_core_bowl.png", }) @@ -156,6 +163,7 @@ end if c("mushroom_stew") then minetest.register_craftitem("mobs_mc:mushroom_stew", { description = S("Mushroom Stew"), + _doc_items_longdesc = S("Mushroom stew is a healthy soup."), inventory_image = "farming_mushroom_stew.png", groups = { food = 3, eatable = 6 }, on_use = minetest.item_eat(6, "mobs_mc:bowl"), @@ -209,11 +217,16 @@ if c("dragon_egg") then }) end +local longdesc_craftitem +if minetest.get_modpath("doc_items") then + longdesc_craftitem = doc.sub.items.temp.craftitem +end + -- Enderman if c("ender_eye") then minetest.register_craftitem("mobs_mc:ender_eye", { description = S("Eye of Ender"), - + _doc_items_longdesc = longdesc_craftitem, inventory_image = "mcl_end_ender_eye.png", groups = { craftitem = 1 }, }) @@ -243,6 +256,8 @@ if c("saddle") then -- Overwrite the saddle from Mobs Redo minetest.register_craftitem(":mobs:saddle", { description = S("Saddle"), + _doc_items_longdesc = S("Saddles can be put on horses, donkeys, mules and pigs in order to mount them."), + _doc_items_usagehelp = S("Rightclick an animal while holding a saddle to put on the saddle. You can now mount the animal by rightclicking it again."), inventory_image = "mcl_mobitems_saddle.png", stack_max = 1, }) @@ -260,10 +275,13 @@ if c("saddle") and c("lether") and c("string") and c("iron_ingot") then end -- Horse Armor +local horse_armor_use = S("Rightclick a horse to put on the horse armor. Donkeys and mules can't wear horse armor.") -- TODO: Balance the horse armor strength, compare with MC armor strength if c("iron_horse_armor") then minetest.register_craftitem("mobs_mc:iron_horse_armor", { description = S("Iron Horse Armor"), + _doc_items_longdesc = S("Iron horse armor can be worn by horses to increase their protection from harm a bit."), + _doc_items_usagehelp = horse_armor_use, inventory_image = "mobs_mc_iron_horse_armor.png", _horse_overlay_image = "mobs_mc_horse_armor_iron.png", stack_max = 1, @@ -273,6 +291,8 @@ end if c("gold_horse_armor") then minetest.register_craftitem("mobs_mc:gold_horse_armor", { description = S("Golden Horse Armor"), + _doc_items_longdesc = S("Golden horse armor can be worn by horses to increase their protection from harm."), + _doc_items_usagehelp = horse_armor_use, inventory_image = "mobs_mc_gold_horse_armor.png", _horse_overlay_image = "mobs_mc_horse_armor_gold.png", stack_max = 1, @@ -282,6 +302,8 @@ end if c("diamond_horse_armor") then minetest.register_craftitem("mobs_mc:diamond_horse_armor", { description = S("Diamond Horse Armor"), + _doc_items_longdesc = S("Diamond horse armor can be worn by horses to greatly increase their protection from harm."), + _doc_items_usagehelp = horse_armor_use, inventory_image = "mobs_mc_diamond_horse_armor.png", _horse_overlay_image = "mobs_mc_horse_armor_diamond.png", stack_max = 1, @@ -293,6 +315,7 @@ end if c("porkchop_raw") then minetest.register_craftitem("mobs_mc:porkchop_raw", { description = S("Raw Porkchop"), + _doc_items_longdesc = S("A raw porkchop is the flesh from a pig and can be eaten safely. Cooking it will greatly increase its nutritional value."), inventory_image = "mcl_mobitems_porkchop_raw.png", groups = { food = 2, eatable = 3 }, on_use = minetest.item_eat(3), @@ -302,6 +325,7 @@ end if c("porkchop_cooked") then minetest.register_craftitem("mobs_mc:porkchop_cooked", { description = S("Cooked Porkchop"), + _doc_items_longdesc = "Cooked porkchop is the cooked flesh of a pig and is used as food.", inventory_image = "mcl_mobitems_porkchop_cooked.png", groups = { food = 2, eatable = 8 }, on_use = minetest.item_eat(8), @@ -320,6 +344,8 @@ end if c("carrot_on_a_stick") then minetest.register_tool("mobs_mc:carrot_on_a_stick", { description = S("Carrot on a Stick"), + _doc_items_longdesc = S("A carrot on a stick can be used on saddled pigs to ride them. Pigs will also follow anyone who holds a carrot on a stick near them."), + _doc_items_usagehelp = S("Rightclick a saddled pig with the carrot on a stick to mount it. You can now ride it like a horse."), wield_image = "mcl_mobitems_carrot_on_a_stick.png", inventory_image = "mcl_mobitems_carrot_on_a_stick.png", sounds = { breaks = "default_tool_breaks" }, @@ -360,6 +386,7 @@ end if c("rabbit_raw") then minetest.register_craftitem("mobs_mc:rabbit_raw", { description = S("Raw Rabbit"), + _doc_items_longdesc = S("Raw rabbit is a food item from a dead rabbit. It can be eaten safely. Cooking it will increase its nutritional value."), inventory_image = "mcl_mobitems_rabbit_raw.png", groups = { food = 2, eatable = 3 }, on_use = minetest.item_eat(3), @@ -369,6 +396,7 @@ end if c("rabbit_cooked") then minetest.register_craftitem("mobs_mc:rabbit_cooked", { description = S("Cooked Rabbit"), + _doc_items_longdesc = S("This is a food item which can be eaten."), inventory_image = "mcl_mobitems_rabbit_cooked.png", groups = { food = 2, eatable = 5 }, on_use = minetest.item_eat(5), @@ -387,6 +415,7 @@ end if c("rabbit_hide") then minetest.register_craftitem("mobs_mc:rabbit_hide", { description = S("Rabbit Hide"), + _doc_items_longdesc = S("Rabbit hide is used to create leather."), inventory_image = "mcl_mobitems_rabbit_hide.png" }) end @@ -404,6 +433,7 @@ end if c("rabbit_foot") then minetest.register_craftitem("mobs_mc:rabbit_foot", { description = S("Rabbit's Foot"), + _doc_items_longdesc = S("This item is used in brewing."), inventory_image = "mcl_mobitems_rabbit_foot.png" }) end @@ -412,6 +442,7 @@ end if c("mutton_raw") then minetest.register_craftitem("mobs_mc:mutton_raw", { description = S("Raw Mutton"), + _doc_items_longdesc = S("Raw mutton is the flesh from a sheep and can be eaten safely. Cooking it will greatly increase its nutritional value."), inventory_image = "mcl_mobitems_mutton_raw.png", groups = { food = 2, eatable = 4 }, on_use = minetest.item_eat(4), @@ -421,6 +452,7 @@ end if c("mutton_cooked") then minetest.register_craftitem("mobs_mc:mutton_cooked", { description = S("Cooked Mutton"), + _doc_items_longdesc = S("Cooked mutton is the cooked flesh from a sheep and is used as food."), inventory_image = "mcl_mobitems_mutton_cooked.png", groups = { food = 2, eatable = 8 }, on_use = minetest.item_eat(8), @@ -440,6 +472,7 @@ end if c("shulker_shell") then minetest.register_craftitem("mobs_mc:shulker_shell", { description = S("Shulker Shell"), + _doc_items_longdesc = S("Shulker shells are used in crafting. They are dropped from dead shulkers."), inventory_image = "mcl_mobitems_shulker_shell.png", groups = { craftitem = 1 }, }) @@ -460,6 +493,7 @@ end if c("slimeball") then minetest.register_craftitem("mobs_mc:slimeball", { description = S("Slimeball"), + _doc_items_longdesc = S("Slimeballs are used in crafting. They are dropped from slimes."), inventory_image = "mcl_mobitems_slimeball.png" }) if minetest.get_modpath("mesecons_materials") then @@ -485,13 +519,21 @@ end -- Evoker if c("totem") then + -- TODO: Implement actual MC totem behaviour minetest.register_craftitem("mobs_mc:totem", { description = S("Totem of Undying"), + _doc_items_longdesc = S("A totem of undying is a rare artifact which may safe you from certain death."), + _doc_items_usagehelp = S("Hold it in your hand and punch once to instantly get back to full health. The totem gets destroyed in the process."), wield_image = "mcl_mobitems_totem.png", inventory_image = "mcl_mobitems_totem.png", - groups = {fleshy=3,dig_immediate=3,flammable=2}, - stack_max =1, - on_use = minetest.item_eat(20), + stack_max = 1, + on_use = function(itemstack, user, pointed_thing) + user:set_hp(20) + if not minetest.settings:get_bool("creative_mode") then + itemstack:take_item() + end + return itemstack + end, }) end @@ -499,6 +541,7 @@ end if c("rotten_flesh") then minetest.register_craftitem("mobs_mc:rotten_flesh", { description = S("Rotten Flesh"), + _doc_items_longdesc = S("Yuck! This piece of flesh clearly has seen better days. Eating it will only poison you and reduces your health by 4 hit points. But tamed wolves can eat it just fine."), inventory_image = "mcl_mobitems_rotten_flesh.png", -- Simplified poisonous food groups = { food = 2, eatable = -4 }, @@ -510,6 +553,7 @@ end if c("nether_star") then minetest.register_craftitem("mobs_mc:nether_star", { description = S("Nether Star"), + _doc_items_longdesc = S("A nether star is a crafting component. It is dropped from the Wither."), inventory_image = "mcl_mobitems_nether_star.png" }) end @@ -538,6 +582,8 @@ end if c("bone") then minetest.register_craftitem("mobs_mc:bone", { description = S("Bone"), + _doc_items_longdesc = S("Bones can be used to tame wolves so they will protect you. They are also useful as a crafting ingredient."), + _doc_items_usagehelp = S("Hold the bone in your hand near wolves to attract them. Rightclick the wolf to give it a bone and tame it."), inventory_image = "mcl_mobitems_bone.png" }) if minetest.get_modpath("bones") then diff --git a/mods/ENTITIES/mobs_mc/2_throwing.lua b/mods/ENTITIES/mobs_mc/2_throwing.lua index 94d19e7b3..98140d3e2 100644 --- a/mods/ENTITIES/mobs_mc/2_throwing.lua +++ b/mods/ENTITIES/mobs_mc/2_throwing.lua @@ -134,6 +134,8 @@ end if c("arrow") then minetest.register_craftitem("mobs_mc:arrow", { description = S("Arrow"), + _doc_items_longdesc = S("Arrows are ammunition for bows."), + _doc_items_usagehelp = S("To use arrows as ammunition for a bow, put them in the inventory slot following the bow. Slots are counted left to right, top to bottom."), inventory_image = "mcl_throwing_arrow_inv.png", }) end @@ -152,6 +154,8 @@ end if c("bow") then minetest.register_tool("mobs_mc:bow_wood", { description = S("Bow"), + _doc_items_longdesc = S("Bows are ranged weapons to shoot arrows at your foes."), + _doc_items_usagehelp = S("To use the bow, you first need to have at least one arrow in slot following the bow. Leftclick to shoot. Each hit deals 3 damage."), inventory_image = "mcl_throwing_bow.png", on_use = function(itemstack, user, pointed_thing) if throwing_shoot_arrow(itemstack, user, pointed_thing) then @@ -173,6 +177,8 @@ if c("bow") then }) end +local how_to_throw = "Hold it in your and and leftclick to throw." + -- egg throwing item -- egg entity if c("egg") then @@ -287,6 +293,8 @@ if c("egg") then minetest.register_craftitem("mobs_mc:egg", { description = S("Egg"), + _doc_items_longdesc = S("Eggs can be thrown and break on impact. There is a small chance that 1 or even 4 chicks will pop out"), + _doc_items_usagehelp = how_to_throw, inventory_image = "mobs_chicken_egg.png", on_use = mobs_shoot_egg, }) @@ -370,6 +378,7 @@ if c("snowball") then minetest.register_craftitem("mobs_mc:snowball", { description = S("Snowball"), _doc_items_longdesc = S("Snowballs can be thrown at your enemies. A snowball deals 3 damage to blazes, but is harmless to anything else."), + _doc_items_usagehelp = how_to_throw, inventory_image = "mcl_throwing_snowball.png", on_use = mobs_shoot_snowball, }) diff --git a/mods/ENTITIES/mobs_mc/4_heads.lua b/mods/ENTITIES/mobs_mc/4_heads.lua new file mode 100644 index 000000000..277a32d29 --- /dev/null +++ b/mods/ENTITIES/mobs_mc/4_heads.lua @@ -0,0 +1,58 @@ +--MC Heads for minetest +--maikerumine + +-- intllib +local MP = minetest.get_modpath(minetest.get_current_modname()) +local S, NS = dofile(MP.."/intllib.lua") + +-- Heads system + +local sounds +if minetest.get_modpath("default") then + sounds = default.node_sound_defaults({ + footstep = {name="default_hard_footstep", gain=0.3} + }) +end + +local function addhead(mobname, desc, longdesc) + minetest.register_node("mobs_mc:head_"..mobname, { + description = desc, + _doc_items_longdesc = longdesc, + drawtype = "nodebox", + is_ground_content = false, + node_box = { + type = "fixed", + fixed = { + { -0.25, -0.5, -0.25, 0.25, 0.0, 0.25, }, + }, + }, + groups = { oddly_breakable_by_hand=3, head=1, }, + -- The head textures are based off the textures of an actual mob. + -- FIXME: This code assumes 16×16 textures for the mob textures! + tiles = { + -- Note: bottom texture is overlaid over top texture to get rid of possible transparency. + -- This is required for skeleton skull and wither skeleton skull. + "[combine:16x16:-4,4=mobs_mc_"..mobname..".png", -- top + "([combine:16x16:-4,4=mobs_mc_"..mobname..".png)^([combine:16x16:-12,4=mobs_mc_"..mobname..".png)", -- bottom + "[combine:16x16:-12,0=mobs_mc_"..mobname..".png", -- left + "[combine:16x16:4,0=mobs_mc_"..mobname..".png", -- right + "[combine:16x16:-20,0=mobs_mc_"..mobname..".png", -- back + "[combine:16x16:-4,0=mobs_mc_"..mobname..".png", -- front + }, + paramtype = "light", + paramtype2 = "facedir", + sunlight_propagates = true, + walkable = true, + sounds = sounds, + selection_box = { + type = "fixed", + fixed = { -0.25, -0.5, -0.25, 0.25, 0.0, 0.25, }, + }, + }) +end + +-- Add heads +addhead("zombie", S("Zombie Head"), S("A zombie head is a small decorative block which resembles the head of a zombie.")) +addhead("creeper", S("Creeper Head"), S("A creeper head is a small decorative block which resembles the head of a creeper.")) +addhead("skeleton", S("Skeleton Skull"), S("A skeleton skull is a small decorative block which resembles the skull of a skeleton.")) +addhead("wither_skeleton", S("Wither Skeleton Skull"), S("A wither skeleton skull is a small decorative block which resembles the skull of a wither skeleton.")) diff --git a/mods/ENTITIES/mobs_mc/LICENSE-media.md b/mods/ENTITIES/mobs_mc/LICENSE-media.md index 413f80687..73b62feb7 100644 --- a/mods/ENTITIES/mobs_mc/LICENSE-media.md +++ b/mods/ENTITIES/mobs_mc/LICENSE-media.md @@ -4,7 +4,6 @@ The following media licenses are used: -* **Unknown license :-(** * [CC0](https://creativecommons.org/choose/zero/) * [CC BY 3.0](https://creativecommons.org/licenses/by/3.0/) * [CC BY-SA 4.0](https://creativecommons.org/licenses/by-sa/4.0/) @@ -28,7 +27,6 @@ Origin of those models: * Author: [XSSheep](https://www.planetminecraft.com/member/xssheep/) * License: CC BY-SA 4.0 * “Spawn egg” textures (`mobs_mc_spawn_icon_*`) by 22i -* Mob head textures: **UNKNOWN!** * Any other texture not mentioned here are licensed under the MIT License ## Sounds diff --git a/mods/ENTITIES/mobs_mc/README.md b/mods/ENTITIES/mobs_mc/README.md index f71df6d48..6803451a4 100644 --- a/mods/ENTITIES/mobs_mc/README.md +++ b/mods/ENTITIES/mobs_mc/README.md @@ -14,7 +14,7 @@ This mod adds mobs which closely resemble the mobs from the game Minecraft, vers ## Licensing * Code: GNU General Public License, version 3 (see `LICENSE`) -* Media: **WARNING!** Possibly includes non-free license (we will replace it soon). See `LICENSE_media.md` +* Media: MIT, CC0, CC BY 3.0 CC BY-SA 4.0, LGPLv2.1, GPLv3. See `LICENSE_media.md` for details ## Useful information for developers diff --git a/mods/ENTITIES/mobs_mc/creeper.lua b/mods/ENTITIES/mobs_mc/creeper.lua index 0b3319b03..1e951efee 100644 --- a/mods/ENTITIES/mobs_mc/creeper.lua +++ b/mods/ENTITIES/mobs_mc/creeper.lua @@ -89,8 +89,10 @@ mobs:register_mob("mobs_mc:creeper", { min = 0, max = 2,}, - {name = "mobs_mc:creeper_head", - chance = 200, + -- Head + -- TODO: Only drop if killed by charged creeper + {name = mobs_mc.items.head_creeper, + chance = 200, -- 0.5% min = 1, max = 1,}, }, diff --git a/mods/ENTITIES/mobs_mc/depends.txt b/mods/ENTITIES/mobs_mc/depends.txt index 07085ac37..3c2630eb5 100644 --- a/mods/ENTITIES/mobs_mc/depends.txt +++ b/mods/ENTITIES/mobs_mc/depends.txt @@ -8,3 +8,4 @@ bones? mesecons_materials? mobs_mc_gameconfig? intllib? +doc_items? diff --git a/mods/ENTITIES/mobs_mc/ghast.lua b/mods/ENTITIES/mobs_mc/ghast.lua index baf6070ba..3b71a1b06 100644 --- a/mods/ENTITIES/mobs_mc/ghast.lua +++ b/mods/ENTITIES/mobs_mc/ghast.lua @@ -83,7 +83,7 @@ mobs:spawn_specific("mobs_mc:ghast", mobs_mc.spawn.nether, {"air"},0, minetest.L mobs:register_arrow(":mobs_monster:fireball", { visual = "sprite", visual_size = {x = 0.5, y = 0.5}, - textures = {"mcl_mobitems_fire_charge.png"}, + textures = {"mcl_fire_fire_charge.png"}, velocity = 6, -- direct hit, no fire... just plenty of pain diff --git a/mods/ENTITIES/mobs_mc/heads.lua b/mods/ENTITIES/mobs_mc/heads.lua deleted file mode 100644 index e783a02c9..000000000 --- a/mods/ENTITIES/mobs_mc/heads.lua +++ /dev/null @@ -1,207 +0,0 @@ ---MC Heads for minetest ---maikerumine - --- intllib -local MP = minetest.get_modpath(minetest.get_current_modname()) -local S, NS = dofile(MP.."/intllib.lua") - -minetest.register_node( "mobs_mc:creeper_head", { - description = S("Creeper Head (WIP)"), - tiles = { - "mobs_creeper_top.png", - "mobs_creeper_top.png", --was bottom - "mobs_creeper_side.png", - "mobs_creeper_side.png", - "mobs_creeper_side.png", --was rear - "mobs_creeper_front.png" - }, - paramtype2 = "facedir", - node_box = { - type = "fixed", - fixed = {-0.25, -0.5, -0.25, 0.25, 0.00, 0.25}, - }, - - drawtype = "nodebox", - paramtype = "light", - visual_scale = 1.0, - is_ground_content = false, - groups = {cracky=2}, - --sounds = default.node_sound_stone_defaults(), - stack_max = 1, -}) - -minetest.register_node( "mobs_mc:enderman_head", { - description = S("Enderman Head (WIP)"), - tiles = { - "mobs_endermen_top.png", - "mobs_endermen_top.png", - "mobs_endermen_side.png", - "mobs_endermen_side.png", - "mobs_endermen_side.png", - "mobs_endermen_front.png" - }, - paramtype2 = "facedir", - node_box = { - type = "fixed", - fixed = {-0.25, -0.5, -0.25, 0.25, 0.00, 0.25}, - }, - - drawtype = "nodebox", - paramtype = "light", - visual_scale = 1.0, - is_ground_content = true, - groups = {cracky=2}, - --sounds = default.node_sound_stone_defaults(), - stack_max = 1, -}) - -minetest.register_node( "mobs_mc:ghast_head", { - description = S("Ghast Head (WIP)"), - tiles = { - "mobs_mc_ghast_white.png", - "mobs_mc_ghast_white.png", - "mobs_mc_ghast_white.png", - "mobs_mc_ghast_white.png", - "mobs_mc_ghast_white.png", - "mobs_mc_ghast_front.png" - }, - paramtype2 = "facedir", - node_box = { - type = "fixed", - fixed = {-0.25, -0.5, -0.25, 0.25, 0.00, 0.25}, - }, - - drawtype = "nodebox", - paramtype = "light", - visual_scale = 1.0, - is_ground_content = true, - groups = {cracky=2}, - --sounds = default.node_sound_stone_defaults(), - stack_max = 1, -}) - -minetest.register_node( "mobs_mc:skeleton_head", { - description = S("Skeleton Skull (WIP)"), - tiles = { - "mobs_skeleton_top.png", - "mobs_skeleton_top.png", - "mobs_skeleton_side.png", - "mobs_skeleton_side.png", - "mobs_skeleton_side.png", - "mobs_skeleton_front.png" - }, - paramtype2 = "facedir", - node_box = { - type = "fixed", - fixed = {-0.25, -0.5, -0.25, 0.25, 0.00, 0.25}, - }, - - drawtype = "nodebox", - paramtype = "light", - visual_scale = 1.0, - is_ground_content = false, - groups = {cracky=2}, - --sounds = default.node_sound_stone_defaults(), - stack_max = 1, -}) - -minetest.register_node( "mobs_mc:skeleton2_head", { - description = S("Wither Skeleton Skull (WIP)"), - tiles = { - "mobs_skeleton2_top.png", - "mobs_skeleton2_top.png", - "mobs_skeleton2_side.png", - "mobs_skeleton2_side.png", - "mobs_skeleton2_side.png", - "mobs_skeleton2_front.png" - }, - paramtype2 = "facedir", - node_box = { - type = "fixed", - fixed = {-0.25, -0.5, -0.25, 0.25, 0.00, 0.25}, - }, - - drawtype = "nodebox", - paramtype = "light", - visual_scale = 1.0, - is_ground_content = true, - groups = {cracky=2}, - --sounds = default.node_sound_stone_defaults(), - stack_max = 1, -}) - -minetest.register_node( "mobs_mc:spider_head", { - description = S("Spider Head (WIP)"), - tiles = { - "mobs_spider_top.png", - "mobs_spider_top.png", - "mobs_spider_side.png", - "mobs_spider_side.png", - "mobs_spider_side.png", - "mobs_spider_front.png" - }, - paramtype2 = "facedir", - node_box = { - type = "fixed", - fixed = {-0.25, -0.5, -0.25, 0.25, 0.00, 0.25}, - }, - - drawtype = "nodebox", - paramtype = "light", - visual_scale = 1.0, - is_ground_content = true, - groups = {cracky=2}, - --sounds = default.node_sound_stone_defaults(), - stack_max = 1, -}) - -minetest.register_node( "mobs_mc:zombie_head", { - description = S("Zombie Head (WIP)"), - tiles = { - "mobs_zombie_top.png", - "mobs_zombie_top.png", - "mobs_zombie_side.png", - "mobs_zombie_side.png", - "mobs_zombie_side.png", - "mobs_zombie_front.png" - }, - paramtype2 = "facedir", - node_box = { - type = "fixed", - fixed = {-0.25, -0.5, -0.25, 0.25, 0.00, 0.25}, - }, - - drawtype = "nodebox", - paramtype = "light", - visual_scale = 1.0, - is_ground_content = true, - groups = {cracky=2}, - --sounds = default.node_sound_stone_defaults(), - stack_max = 1, -}) - -minetest.register_node( "mobs_mc:zombiepig_head", { - description = S("Zombie Pigman Head (WIP)"), - tiles = { - "mobs_zombiepig_top.png", - "mobs_zombiepig_top.png", - "mobs_zombiepig_side.png", - "mobs_zombiepig_side.png", - "mobs_zombiepig_side.png", - "mobs_zombiepig_front.png" - }, - paramtype2 = "facedir", - node_box = { - type = "fixed", - fixed = {-0.25, -0.5, -0.25, 0.25, 0.00, 0.25}, - }, - - drawtype = "nodebox", - paramtype = "light", - visual_scale = 1.0, - is_ground_content = true, - groups = {cracky=2}, - --sounds = default.node_sound_stone_defaults(), - stack_max = 1, -}) - diff --git a/mods/ENTITIES/mobs_mc/init.lua b/mods/ENTITIES/mobs_mc/init.lua index 2aa465955..ff2f4405d 100644 --- a/mods/ENTITIES/mobs_mc/init.lua +++ b/mods/ENTITIES/mobs_mc/init.lua @@ -55,7 +55,7 @@ end dofile(path .. "/3_shared.lua") --Mob heads -dofile(path .. "/heads.lua") -- maikerumine +dofile(path .. "/4_heads.lua") -- Animals dofile(path .. "/bat.lua") -- Mesh and animation by toby109tt / https://github.com/22i diff --git a/mods/ENTITIES/mobs_mc/ocelot.lua b/mods/ENTITIES/mobs_mc/ocelot.lua index 4fcc752d9..05a5d4762 100644 --- a/mods/ENTITIES/mobs_mc/ocelot.lua +++ b/mods/ENTITIES/mobs_mc/ocelot.lua @@ -24,6 +24,7 @@ local is_food = function(itemstring) return true end end + return false end -- Ocelot diff --git a/mods/ENTITIES/mobs_mc/silverfish.lua b/mods/ENTITIES/mobs_mc/silverfish.lua index 60eb704ff..8fd4d5759 100644 --- a/mods/ENTITIES/mobs_mc/silverfish.lua +++ b/mods/ENTITIES/mobs_mc/silverfish.lua @@ -30,7 +30,7 @@ mobs:register_mob("mobs_mc:silverfish", { lava_damage = 4, light_damage = 0, fear_height = 4, - replace_what = mobs_mc.replace_silverfish, + replace_what = mobs_mc.replace.silverfish, replace_rate = 2, animation = { speed_normal = 25, speed_run = 50, diff --git a/mods/ENTITIES/mobs_mc/skeleton+stray.lua b/mods/ENTITIES/mobs_mc/skeleton+stray.lua index 2b33d5015..d5808fce7 100644 --- a/mods/ENTITIES/mobs_mc/skeleton+stray.lua +++ b/mods/ENTITIES/mobs_mc/skeleton+stray.lua @@ -52,9 +52,12 @@ local skeleton = { chance = 1, min = 0, max = 2,}, - {name = "mobs_mc:skeleton_head", - chance = 200, - min = 0, + + -- Head + -- TODO: Only drop if killed by charged creeper + {name = mobs_mc.items.head_skeleton, + chance = 200, -- 0.5% chance + min = 1, max = 1,}, }, animation = { diff --git a/mods/ENTITIES/mobs_mc/skeleton_stray.lua b/mods/ENTITIES/mobs_mc/skeleton_stray.lua deleted file mode 100644 index 00701d300..000000000 --- a/mods/ENTITIES/mobs_mc/skeleton_stray.lua +++ /dev/null @@ -1,99 +0,0 @@ ---MCmobs v0.4 ---maikerumine ---made for MC like Survival game ---License for code WTFPL and otherwise stated in readmes - --- intllib -local MP = minetest.get_modpath(minetest.get_current_modname()) -local S, NS = dofile(MP.."/intllib.lua") - ---dofile(minetest.get_modpath("mobs").."/api.lua") - - ---################### ---################### STRAY SKELETON ---################### - - - -mobs:register_mob("mobs_mc:stray", { - type = "monster", - hp_min = 20, - hp_max = 20, - pathfinding = 1, - group_attack = true, - collisionbox = {-0.3, -0.01, -0.3, 0.3, 1.98, 0.3}, - visual = "mesh", - mesh = "mobs_mc_stray.b3d", - textures = { - {"mobs_mc_stray.png^mobs_mc_stray_bow.png"}, - }, - visual_size = {x=3, y=3}, - makes_footstep_sound = true, - sounds = { - random = "skeleton1", - death = "skeletondeath", - damage = "skeletonhurt1", - distance = 16, - }, - walk_velocity = 1.2, - run_velocity = 2.4, - damage = 2, - drops = { - {name = mobs_mc.items.arrow, - chance = 1, - min = 0, - max = 2,}, - {name = mobs_mc.items.bow, - chance = 11, - min = 1, - max = 1,}, - {name = mobs_mc.items.bone, - chance = 1, - min = 0, - max = 2,}, - {name = "mobs_mc:skeleton_head", - chance = 50, - min = 0, - max = 1,}, - }, - animation = { - stand_start = 0, - stand_end = 40, - speed_stand = 5, - walk_start = 40, - walk_end = 60, - speed_walk = 50, - shoot_start = 70, - shoot_end = 90, - punch_start = 70, - punch_end = 90, - die_start = 120, - die_end = 130, - speed_die = 5, - hurt_start = 100, - hurt_end = 120, - }, - water_damage = 0, - lava_damage = 4, - light_damage = 1, - fear_height = 4, - view_range = 16, - attack_type = "dogshoot", - arrow = "mobs_mc:arrow_entity", - shoot_interval = 2.5, - shoot_offset = 1, - dogshoot_switch = 1, - dogshoot_count_max =3, - blood_amount = 0, -}) - ---spawn -mobs:spawn_specific("mobs_mc:stray", mobs_mc.spawn.snow, {"air"}, minetest.LIGHT_MAX+1, minetest.LIGHT_MAX+1, 20, 19000, 2, -110, 31000) - --- spawn eggs -mobs:register_egg("mobs_mc:stray", S("Stray"), "mobs_mc_spawn_icon_stray.png", 0) - -if minetest.settings:get_bool("log_mods") then - minetest.log("action", "MC Stray Skeleton loaded") -end diff --git a/mods/ENTITIES/mobs_mc/skeleton_wither.lua b/mods/ENTITIES/mobs_mc/skeleton_wither.lua index 506dfe457..ca1d3ce7f 100644 --- a/mods/ENTITIES/mobs_mc/skeleton_wither.lua +++ b/mods/ENTITIES/mobs_mc/skeleton_wither.lua @@ -48,9 +48,11 @@ mobs:register_mob("mobs_mc:witherskeleton", { chance = 1, min = 0, max = 2,}, - {name = "mobs_mc:skeleton_head2", - chance = 200, - min = 0, + + -- Head + {name = mobs_mc.items.head_wither_skeleton, + chance = 40, -- 2.5% chance + min = 1, max = 1,}, }, animation = { @@ -71,8 +73,8 @@ mobs:register_mob("mobs_mc:witherskeleton", { hurt_end = 120, }, water_damage = 0, - lava_damage = 4, - light_damage = 1, + lava_damage = 0, + light_damage = 0, view_range = 16, attack_type = "dogfight", arrow = "mobs_mc:arrow_entity", diff --git a/mods/ENTITIES/mobs_mc/wolf.lua b/mods/ENTITIES/mobs_mc/wolf.lua index c208c488e..736de544b 100644 --- a/mods/ENTITIES/mobs_mc/wolf.lua +++ b/mods/ENTITIES/mobs_mc/wolf.lua @@ -8,20 +8,15 @@ local default_walk_chance = 50 local pr = PseudoRandom(os.time()*10) -local is_flesh = function(itemstring) - -- Minecraft items - return (itemstring == mobs_mc.items.rabbit_raw or - itemstring == mobs_mc.items.rabbit_cooked or - itemstring == mobs_mc.items.mutton_raw or - itemstring == mobs_mc.items.mutton_cooked or - itemstring == mobs_mc.items.beef_raw or - itemstring == mobs_mc.items.beef_cooked or - itemstring == mobs_mc.items.chicken_raw or - itemstring == mobs_mc.items.chicken_cooked or - itemstring == mobs_mc.items.rotten_flesh or - -- Mobs Redo items - itemstring == "mobs:meat" or - itemstring == "mobs:meat_raw") +local is_food = function(itemstring) + for f=1, #mobs_mc.follow.dog do + if itemstring == mobs_mc.follow.dog[f] then + return true + elseif string.sub(itemstring, 1, 6) == "group:" and minetest.get_item_group(itemstring, string.sub(itemstring, 7, -1)) ~= 0 then + return true + end + end + return false end -- Wolf @@ -57,12 +52,13 @@ local wolf = { water_damage = 0, lava_damage = 4, light_damage = 0, + follow = mobs_mc.follow.wolf, on_rightclick = function(self, clicker) -- Try to tame wolf (intentionally does NOT use mobs:feed_tame) local tool = clicker:get_wielded_item() local dog, ent - if is_flesh(tool:get_name()) then + if tool:get_name() == mobs_mc.items.bone then if not minetest.settings:get_bool("creative_mode") then tool:take_item() @@ -135,6 +131,7 @@ dog.order = "roam" dog.owner_loyal = true -- Automatically teleport dog to owner dog.do_custom = mobs_mc.make_owner_teleport_function(12) +dog.follow = mobs_mc.follow.dog dog.on_rightclick = function(self, clicker) local item = clicker:get_wielded_item() @@ -142,15 +139,28 @@ dog.on_rightclick = function(self, clicker) return elseif item:get_name() ~= "" and mobs:capture_mob(self, clicker, 0, 2, 80, false, nil) then return - elseif is_flesh(item:get_name()) then - -- Feed - local hp = self.object:get_hp() - if hp + 4 > self.hp_max then return end + elseif is_food(item:get_name()) then + -- Feed to increase health + local hp = self.health + local hp_add = 0 + -- Use eatable group to determine health boost + local eatable = minetest.get_item_group(item, "eatable") + if eatable > 0 then + hp_add = eatable + elseif item:get_name() == mobs_mc.items.rotten_flesh then + hp_add = 4 + else + hp_add = 4 + end + local new_hp = hp + hp_add + if new_hp > self.hp_max then + new_hp = self.hp_max + end if not minetest.settings:get_bool("creative_mode") then item:take_item() clicker:set_wielded_item(item) end - self.object:set_hp(hp+4) + self.health = new_hp return elseif minetest.get_item_group(item:get_name(), "dye") == 1 then -- Dye (if possible) diff --git a/mods/ENTITIES/mobs_mc/zombie.lua b/mods/ENTITIES/mobs_mc/zombie.lua index 1267b4cf3..3dc0e05d4 100644 --- a/mods/ENTITIES/mobs_mc/zombie.lua +++ b/mods/ENTITIES/mobs_mc/zombie.lua @@ -62,6 +62,13 @@ local zombie = { chance = 11, min = 1, max = 1,}, + + -- Head + -- TODO: Only drop if killed by charged creeper + {name = mobs_mc.items.head_zombie, + chance = 200, -- 0.5% + min = 1, + max = 1,}, }, animation = { speed_normal = 25, speed_run = 50, @@ -83,7 +90,7 @@ mobs:register_mob("mobs_mc:zombie", zombie) local baby_zombie = table.copy(zombie) baby_zombie.collisionbox = {-0.25, -0.01, -0.25, 0.25, 0.94, 0.25} -baby_zombie.visual_size = {x=0.5, y=0.5} +baby_zombie.visual_size = {x=0.75, y=0.75} baby_zombie.walk_velocity = 1.2 baby_zombie.run_velocity = 2.4 baby_zombie.light_damage = 0 @@ -104,7 +111,7 @@ mobs:register_mob("mobs_mc:husk", husk) -- A smaller and more dangerous variant of the husk local baby_husk = table.copy(husk) baby_husk.collisionbox = {-0.25, -0.01, -0.25, 0.25, 0.94, 0.25} -baby_husk.visual_size = {x=0.5, y=0.5} +baby_husk.visual_size = {x=0.75, y=0.75} baby_husk.walk_velocity = 1.2 baby_husk.run_velocity = 2.4 diff --git a/mods/ENTITIES/mobs_mc/zombiepig.lua b/mods/ENTITIES/mobs_mc/zombiepig.lua index ce49fb6b7..f88a244d7 100644 --- a/mods/ENTITIES/mobs_mc/zombiepig.lua +++ b/mods/ENTITIES/mobs_mc/zombiepig.lua @@ -56,10 +56,6 @@ local pigman = { chance = 12, -- 8.333%, approximation to 8.5% min = 1, max = 1,}, - {name = "mobs_mc:zombiepig_head", - chance = 200, - min = 0, - max = 1,}, }, animation = { stnd_speed = 25, walk_speed = 25, run_speed = 50, punch_speed = 25,