mirror of
https://git.minetest.land/MineClone2/MineClone2.git
synced 2024-11-23 11:23:45 +01:00
Merge branch 'newmobs'
commit
42d377047f
@ -43,6 +43,7 @@ Please read <http://minecraft.gamepedia.com/Breaking> to learn how digging times
|
||||
* `soil_sapling=1`: Artificial soil (such as farmland) for saplings. Some saplings will not grow on this
|
||||
* `soil_sugarcane=1`: Sugar canes will grow on this near water
|
||||
* `soil_nether_wart=1`: Nether wart will grow on this
|
||||
* `enderman_takable=1`: Block can be taken and placed by endermen
|
||||
* `disable_suffocation=1`: Disables suffocation for full solid cubes (1)
|
||||
* `destroys_items=1`: If an item happens to be *inside* this node, the item will be destroyed
|
||||
* `no_eat_delay=1`: Only for foodstuffs. When eating this, all eating delays are ignored.
|
||||
|
284
mods/ENTITIES/mobs_mc/0_gameconfig.lua
Normal file
284
mods/ENTITIES/mobs_mc/0_gameconfig.lua
Normal file
@ -0,0 +1,284 @@
|
||||
--[[ This table contains the concrete itemstrings to be used by this mod.
|
||||
All mobs in this mod must use variables in this table, instead
|
||||
of hardcoding the itemstring.
|
||||
This way, external mods are enabled to replace the itemstrings to provide
|
||||
their own items and subgame integration is made much simpler.
|
||||
|
||||
An item IDs is supposed to be overwritten by adding
|
||||
mobs_mc.override.items["example:item"] in a subgame mod
|
||||
with name "mobs_mc_gameconfig". ]]
|
||||
|
||||
|
||||
-- Standard items
|
||||
|
||||
-- If true, mobs_mc adds the monster egg nodes (needs default mod).
|
||||
-- Set to false in your gameconfig mod if you create your own monster egg nodes.
|
||||
mobs_mc.create_monster_egg_nodes = true
|
||||
|
||||
mobs_mc.items = {}
|
||||
|
||||
mobs_mc.items = {
|
||||
-- Items defined in mobs_mc
|
||||
blaze_rod = "mobs_mc:blaze_rod",
|
||||
blaze_powder = "mobs_mc:blaze_powder",
|
||||
chicken_raw = "mobs_mc:chicken_raw",
|
||||
chicken_cooked = "mobs_mc:chicken_cooked",
|
||||
feather = "mobs_mc:feather",
|
||||
beef_raw = "mobs_mc:beef_raw",
|
||||
beef_cooked = "mobs_mc:beef_cooked",
|
||||
bowl = "mobs_mc:bowl",
|
||||
mushroom_stew = "mobs_mc:mushroom_stew",
|
||||
milk = "mobs_mc:milk_bucket",
|
||||
dragon_egg = "mobs_mc:dragon_egg",
|
||||
egg = "mobs_mc:egg",
|
||||
ender_eye = "mobs_mc:ender_eye",
|
||||
ghast_tear = "mobs_mc:ghast_tear",
|
||||
saddle = "mobs:saddle",
|
||||
iron_horse_armor = "mobs_mc:iron_horse_armor",
|
||||
gold_horse_armor = "mobs_mc:gold_horse_armor",
|
||||
diamond_horse_armor = "mobs_mc:diamond_horse_armor",
|
||||
porkchop_raw = "mobs_mc:porkchop_raw",
|
||||
porkchop_cooked = "mobs_mc:porkchop_cooked",
|
||||
carrot_on_a_stick = "mobs_mc:carrot_on_a_stick",
|
||||
rabbit_raw = "mobs_mc:rabbit_raw",
|
||||
rabbit_cooked = "mobs_mc:rabbit_cooked",
|
||||
rabbit_hide = "mobs_mc:rabbit_hide",
|
||||
mutton_raw = "mobs_mc:mutton_raw",
|
||||
mutton_cooked = "mobs_mc:mutton_cooked",
|
||||
shulker_shell = "mobs_mc:shulker_shell",
|
||||
magma_cream = "mobs_mc:magma_cream",
|
||||
spider_eye = "mobs_mc:spider_eye",
|
||||
snowball = "mobs_mc:snowball",
|
||||
totem = "mobs_mc:totem",
|
||||
rotten_flesh = "mobs_mc:rotten_flesh",
|
||||
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
|
||||
leather = "mobs:leather",
|
||||
shears = "mobs:shears",
|
||||
|
||||
-- Minetest Game
|
||||
top_snow = "default:snow",
|
||||
snow_block = "default:snowblock",
|
||||
mushroom_red = "flowers:mushroom_red",
|
||||
bucket = "bucket:bucket_empty",
|
||||
grass_block = "default:dirt_with_grass",
|
||||
string = "farming:string",
|
||||
stick = "default:stick",
|
||||
flint = "default:flint",
|
||||
iron_ingot = "default:steel_ingot",
|
||||
iron_block = "default:steelblock",
|
||||
fire = "fire:basic_flame",
|
||||
gunpowder = "tnt:gunpowder",
|
||||
flint_and_steel = "fire:flint_and_steel",
|
||||
water_source = "default:water_source",
|
||||
black_dye = "dye:black",
|
||||
poppy = "flowers:rose",
|
||||
dandelion = "flowers:dandelion_yellow",
|
||||
coal = "default:coal_lump",
|
||||
emerald = "default:diamond",
|
||||
iron_axe = "default:axe_steel",
|
||||
gold_sword = "default:sword_mese",
|
||||
gold_ingot = "default:gold_ingot",
|
||||
gold_nugget = "default:gold_lump",
|
||||
glowstone_dust = "default:mese_crystal_fragment",
|
||||
redstone = "default:mese_crystal_fragment",
|
||||
glass_bottle = "vessels:glass_bottle",
|
||||
sugar = "default:papyrus",
|
||||
wheat = "farming:wheat",
|
||||
hay_bale = "farming:straw",
|
||||
prismarine_shard = "default:mese_crystal_fragment",
|
||||
prismarine_crystals = "default:mese_crystal",
|
||||
apple = "default:apple",
|
||||
golden_apple = "default:apple",
|
||||
rabbit_foot = "mobs_mc:rabbit_foot",
|
||||
|
||||
-- Boss items
|
||||
wet_sponge = "default:gold_block", -- only dropped by elder guardian; there is no equivalent block in Minetest Game
|
||||
|
||||
-- Other
|
||||
nether_brick_block = "nether:brick",
|
||||
mycelium = "ethereal:mushroom_dirt",
|
||||
carrot = "farming:carrot",
|
||||
potato = "farming:potato",
|
||||
golden_carrot = "farming:carrot_gold",
|
||||
fishing_rod = "fishing:pole_wood",
|
||||
fish_raw = "fishing:fish_raw",
|
||||
salmon_raw = "fishing:carp_raw",
|
||||
clownfish_raw = "fishing:clownfish_raw",
|
||||
pufferfish_raw = "fishing:pike_raw",
|
||||
|
||||
cookie = "farming:cookie",
|
||||
|
||||
|
||||
-- TODO: Add actual ender pearl
|
||||
ender_pearl = "farorb:farorb",
|
||||
|
||||
nether_portal = "nether:portal",
|
||||
netherrack = "nether:rack",
|
||||
nether_brick_block = "nether:brick",
|
||||
|
||||
-- Wool (Minecraft color scheme)
|
||||
wool_white = "wool:white",
|
||||
wool_light_grey = "wool:grey",
|
||||
wool_grey = "wool:dark_grey",
|
||||
wool_blue = "wool:blue",
|
||||
wool_lime = "wool:green",
|
||||
wool_green = "wool:dark_green",
|
||||
wool_purple = "wool:violet",
|
||||
wool_pink = "wool:pink",
|
||||
wool_yellow = "wool:yellow",
|
||||
wool_orange = "wool:orange",
|
||||
wool_brown = "wool:brown",
|
||||
wool_red = "wool:red",
|
||||
wool_cyan = "wool:cyan",
|
||||
wool_magenta = "wool:magenta",
|
||||
wool_black = "wool:black",
|
||||
-- Light blue intentionally missing
|
||||
|
||||
-- Special items
|
||||
music_discs = {}, -- No music discs by default; used by creeper. Override this if your subgame has music discs.
|
||||
}
|
||||
|
||||
-- Tables for attracting, feeding and breeding mobs
|
||||
mobs_mc.follow = {
|
||||
sheep = { mobs_mc.items.wheat },
|
||||
cow = { mobs_mc.items.wheat },
|
||||
chicken = { "farming:seed_wheat", "farming:seed_cotton" }, -- seeds in general
|
||||
parrot = { "farming:seed_wheat", "farming:seed_cotton" }, -- seeds in general
|
||||
horse = { mobs_mc.items.apple, mobs_mc.items.sugar, mobs_mc.items.wheat, mobs_mc.items.hay_bale, mobs_mc.items.golden_apple, mobs_mc.items.golden_carrot },
|
||||
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.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
|
||||
mobs_mc.replace = {
|
||||
-- Rabbits reduce carrot growth stage by 1
|
||||
rabbit = {
|
||||
-- Farming Redo carrots
|
||||
{"farming:carrot_8", "farming:carrot_7", 0},
|
||||
{"farming:carrot_7", "farming:carrot_6", 0},
|
||||
{"farming:carrot_6", "farming:carrot_5", 0},
|
||||
{"farming:carrot_5", "farming:carrot_4", 0},
|
||||
{"farming:carrot_4", "farming:carrot_3", 0},
|
||||
{"farming:carrot_3", "farming:carrot_2", 0},
|
||||
{"farming:carrot_2", "farming:carrot_1", 0},
|
||||
{"farming:carrot_1", "air", 0},
|
||||
-- Farming Plus carrots
|
||||
{"farming_plus:carrot", "farming_plus:carrot_7", 0},
|
||||
{"farming_plus:carrot_6", "farming_plus:carrot_5", 0},
|
||||
{"farming_plus:carrot_5", "farming_plus:carrot_4", 0},
|
||||
{"farming_plus:carrot_4", "farming_plus:carrot_3", 0},
|
||||
{"farming_plus:carrot_3", "farming_plus:carrot_2", 0},
|
||||
{"farming_plus:carrot_2", "farming_plus:carrot_1", 0},
|
||||
{"farming_plus:carrot_1", "air", 0},
|
||||
},
|
||||
-- Sheep eat grass
|
||||
sheep = {
|
||||
-- Grass Block
|
||||
{ "default:dirt_with_grass", "default:dirt", -1 },
|
||||
-- “Tall Grass”
|
||||
{ "default:grass_5", "air", 0 },
|
||||
{ "default:grass_4", "air", 0 },
|
||||
{ "default:grass_3", "air", 0 },
|
||||
{ "default:grass_2", "air", 0 },
|
||||
{ "default:grass_1", "air", 0 },
|
||||
},
|
||||
-- Silverfish populate stone, etc. with monster eggs
|
||||
silverfish = {
|
||||
{"default:stone", "mobs_mc:monster_egg_stone", -1},
|
||||
{"default:cobble", "mobs_mc:monster_egg_cobble", -1},
|
||||
{"default:mossycobble", "mobs_mc:monster_egg_mossycobble", -1},
|
||||
{"default:stonebrick", "mobs_mc:monster_egg_stonebrick", -1},
|
||||
{"default:stone_block", "mobs_mc:monster_egg_stone_block", -1},
|
||||
},
|
||||
}
|
||||
|
||||
-- List of nodes which endermen can take
|
||||
mobs_mc.enderman_takable = {
|
||||
-- Generic handling, useful for entensions
|
||||
"group:enderman_takable",
|
||||
|
||||
-- Generic nodes
|
||||
"group:sand",
|
||||
"group:flower",
|
||||
|
||||
-- Minetest Game
|
||||
"default:dirt",
|
||||
"default:dirt_with_grass",
|
||||
"default:dirt_with_dry_grass",
|
||||
"default:dirt_with_snow",
|
||||
"default:dirt_with_rainforest_litter",
|
||||
"default:dirt_with_grass_footsteps",
|
||||
"default:cactus",
|
||||
"default:gravel",
|
||||
"default:clay",
|
||||
"flowers:mushroom_red",
|
||||
"flowers:mushroom_brown",
|
||||
"tnt:tnt",
|
||||
|
||||
-- Nether mod
|
||||
"nether:rack",
|
||||
}
|
||||
|
||||
-- List of nodes on which mobs can spawn
|
||||
mobs_mc.spawn = {
|
||||
solid = { "group:cracky", "group:crumbly", "group:shovely", "group:pickaxey" }, -- spawn on "solid" nodes (this is mostly just guessing)
|
||||
|
||||
grassland = { mobs_mc.items.grass_block, "ethereal:prairie_dirt" },
|
||||
savanna = { "default:dirt_with_dry_grass" },
|
||||
grassland_savanna = { mobs_mc.items.grass_block, "default:dirt_with_dry_grass" },
|
||||
desert = { "default:desert_sand", "group:sand" },
|
||||
jungle = { "default:dirt_with_rainforest_litter", "default:jungleleaves", "default:junglewood", "mcl_core:jungleleaves", "mcl_core:junglewood" },
|
||||
snow = { "default:snow", "default:snowblock", "default:dirt_with_snow" },
|
||||
end_city = { "default:cobble", "mcl_end:purpur_block", "mcl_end:end_stone", "mcl_portals:void"},
|
||||
wolf = { mobs_mc.items.grass_block, "default:dirt_with_rainforest_litter", "default:dirt", "default:dirt_with_snow", "default:snow", "default:snowblock" },
|
||||
|
||||
-- These probably don't need overrides
|
||||
mushroom_island = { mobs_mc.items.mycelium, "mcl_core:mycelium" },
|
||||
nether_fortress = { mobs_mc.items.nether_brick_block, "mcl_nether:nether_brick", "mcl_portals:nether_air" },
|
||||
nether = { mobs_mc.items.netherrack, "mcl_nether:netherrack", "mcl_portals:nether_air" },
|
||||
nether_portal = { mobs_mc.items.nether_portal, "mcl_portals:portal" },
|
||||
water = { mobs_mc.items.water_source, "mcl_core:water_source", "default:water_source" },
|
||||
}
|
||||
|
||||
mobs_mc.misc = {
|
||||
shears_wear = 276, -- Wear to add per shears usage (238 uses)
|
||||
}
|
||||
|
||||
-- Item name overrides from mobs_mc_gameconfig (if present)
|
||||
if minetest.get_modpath("mobs_mc_gameconfig") and mobs_mc.override then
|
||||
local tables = {"items", "follow", "replace", "spawn", "misc"}
|
||||
for t=1, #tables do
|
||||
local tbl = tables[t]
|
||||
if mobs_mc.override[tbl] then
|
||||
for k, v in pairs(mobs_mc.override[tbl]) do
|
||||
mobs_mc[tbl][k] = v
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if mobs_mc.override.enderman_takable then
|
||||
mobs_mc.enderman_takable = mobs_mc.override.enderman_takable
|
||||
end
|
||||
end
|
||||
|
595
mods/ENTITIES/mobs_mc/1_items_default.lua
Normal file
595
mods/ENTITIES/mobs_mc/1_items_default.lua
Normal file
@ -0,0 +1,595 @@
|
||||
--MCmobs v0.5
|
||||
--maikerumine
|
||||
--made for MC like Survival game
|
||||
--License for code WTFPL and otherwise stated in readmes
|
||||
|
||||
|
||||
--dofile(minetest.get_modpath("mobs").."/api.lua")
|
||||
--THIS IS THE MASTER ITEM LIST TO USE WITH DEFAULT
|
||||
|
||||
-- intllib
|
||||
local MP = minetest.get_modpath(minetest.get_current_modname())
|
||||
local S, NS = dofile(MP.."/intllib.lua")
|
||||
|
||||
local c = mobs_mc.is_item_variable_overridden
|
||||
|
||||
-- Blaze
|
||||
if c("blaze_rod") then
|
||||
minetest.register_craftitem("mobs_mc:blaze_rod", {
|
||||
description = S("Blaze Rod"),
|
||||
_doc_items_longdesc = S("This is a crafting component dropped from dead blazes."),
|
||||
wield_image = "mcl_mobitems_blaze_rod.png",
|
||||
inventory_image = "mcl_mobitems_blaze_rod.png",
|
||||
})
|
||||
|
||||
-- Make blaze rod furnace-burnable. 1.5 times the burn time of a coal lump
|
||||
local coalcraft, burntime
|
||||
if minetest.get_modpath("default") then
|
||||
coalcraft = minetest.get_craft_result({method="fuel", width=1, items={"default:coal_lump"}})
|
||||
end
|
||||
if coalcraft then
|
||||
burntime = math.floor(coalcraft.time * 1.5)
|
||||
end
|
||||
if burntime == nil or burntime == 0 then
|
||||
burntime = 60
|
||||
end
|
||||
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
burntime = burntime,
|
||||
recipe = "mobs_mc:blaze_rod",
|
||||
})
|
||||
end
|
||||
|
||||
if c("blaze_powder") then
|
||||
minetest.register_craftitem("mobs_mc:blaze_powder", {
|
||||
description = S("Blaze Powder"),
|
||||
_doc_items_longdesc = S("This item is mainly used for brewing potions and crafting."),
|
||||
wield_image = "mcl_mobitems_blaze_powder.png",
|
||||
inventory_image = "mcl_mobitems_blaze_powder.png",
|
||||
})
|
||||
end
|
||||
|
||||
if c("blaze_rod") and c("blaze_powder") then
|
||||
minetest.register_craft({
|
||||
output = "mobs_mc:blaze_powder 2",
|
||||
recipe = {{ "mobs_mc:blaze_rod" }},
|
||||
})
|
||||
end
|
||||
|
||||
-- Chicken
|
||||
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),
|
||||
})
|
||||
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),
|
||||
})
|
||||
end
|
||||
|
||||
if c("chicken_raw") and c("chicken_cooked") then
|
||||
minetest.register_craft({
|
||||
type = "cooking",
|
||||
output = "mobs_mc:chicken_cooked",
|
||||
recipe = "mobs_mc:chicken_raw",
|
||||
cooktime = 5,
|
||||
})
|
||||
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
|
||||
|
||||
-- Cow and mooshroom
|
||||
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),
|
||||
})
|
||||
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),
|
||||
})
|
||||
end
|
||||
|
||||
if c("beef_raw") and c("beef_cooked") then
|
||||
minetest.register_craft({
|
||||
type = "cooking",
|
||||
output = "mobs_mc:beef_cooked",
|
||||
recipe = "mobs_mc:beef_raw",
|
||||
cooktime = 5,
|
||||
})
|
||||
end
|
||||
|
||||
|
||||
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"),
|
||||
stack_max = 1,
|
||||
})
|
||||
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",
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "mobs_mc:bowl",
|
||||
recipe = {
|
||||
{ "group:wood", "", "group:wood" },
|
||||
{ "", "group:wood", "", },
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "fuel",
|
||||
recipe = "mobs_mc:bowl",
|
||||
burntime = 5,
|
||||
})
|
||||
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"),
|
||||
stack_max = 1,
|
||||
})
|
||||
end
|
||||
|
||||
-- Ender dragon
|
||||
if c("dragon_egg") then
|
||||
|
||||
local dragon_egg_sounds
|
||||
if minetest.get_modpath("default") then
|
||||
dragon_egg_sounds = default.node_sound_stone_defaults()
|
||||
end
|
||||
|
||||
--ender dragon
|
||||
minetest.register_node("mobs_mc:dragon_egg", {
|
||||
description = S("Dragon Egg"),
|
||||
tiles = {
|
||||
"mcl_end_dragon_egg.png",
|
||||
"mcl_end_dragon_egg.png",
|
||||
"mcl_end_dragon_egg.png",
|
||||
"mcl_end_dragon_egg.png",
|
||||
"mcl_end_dragon_egg.png",
|
||||
"mcl_end_dragon_egg.png",
|
||||
},
|
||||
drawtype = "nodebox",
|
||||
is_ground_content = false,
|
||||
paramtype = "light",
|
||||
light_source = 1,
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.375, -0.5, -0.375, 0.375, -0.4375, 0.375},
|
||||
{-0.5, -0.4375, -0.5, 0.5, -0.1875, 0.5},
|
||||
{-0.4375, -0.1875, -0.4375, 0.4375, 0, 0.4375},
|
||||
{-0.375, 0, -0.375, 0.375, 0.125, 0.375},
|
||||
{-0.3125, 0.125, -0.3125, 0.3125, 0.25, 0.3125},
|
||||
{-0.25, 0.25, -0.25, 0.25, 0.3125, 0.25},
|
||||
{-0.1875, 0.3125, -0.1875, 0.1875, 0.375, 0.1875},
|
||||
{-0.125, 0.375, -0.125, 0.125, 0.4375, 0.125},
|
||||
{-0.0625, 0.4375, -0.0625, 0.0625, 0.5, 0.0625},
|
||||
}
|
||||
},
|
||||
selection_box = {
|
||||
type = "regular",
|
||||
},
|
||||
groups = {snappy = 1, falling_node = 1, deco_block = 1, not_in_creative_inventory = 1, dig_by_piston = 1 },
|
||||
sounds = dragon_egg_sounds,
|
||||
-- TODO: Make dragon egg teleport on punching
|
||||
})
|
||||
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 },
|
||||
})
|
||||
end
|
||||
|
||||
if c("ender_eye") and c("blaze_powder") and c("blaze_rod") then
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = 'mobs_mc:ender_eye',
|
||||
recipe = { 'mobs_mc:blaze_powder', 'mobs_mc:blaze_rod'},
|
||||
})
|
||||
end
|
||||
|
||||
-- Ghast
|
||||
if c("ghast_tear") then
|
||||
minetest.register_craftitem("mobs_mc:ghast_tear", {
|
||||
description = S("Ghast Tear"),
|
||||
_doc_items_longdesc = S("A ghast tear is an item used in potion brewing. It is dropped from dead ghasts."),
|
||||
wield_image = "mcl_mobitems_ghast_tear.png",
|
||||
inventory_image = "mcl_mobitems_ghast_tear.png",
|
||||
groups = { brewitem = 1 },
|
||||
})
|
||||
end
|
||||
|
||||
-- Saddle
|
||||
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,
|
||||
})
|
||||
end
|
||||
|
||||
if c("saddle") and c("lether") and c("string") and c("iron_ingot") then
|
||||
minetest.register_craft({
|
||||
output = "mobs_mc:saddle",
|
||||
recipe = {
|
||||
{"mobs:leather", "mobs:leather", "mobs:leather"},
|
||||
{"farming:string", "", "farming:string"},
|
||||
{"default:steel_ingot", "", "default:steel_ingot"}
|
||||
},
|
||||
})
|
||||
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,
|
||||
groups = { horse_armor = 85 },
|
||||
})
|
||||
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,
|
||||
groups = { horse_armor = 60 },
|
||||
})
|
||||
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,
|
||||
groups = { horse_armor = 45 },
|
||||
})
|
||||
end
|
||||
|
||||
-- Pig
|
||||
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),
|
||||
})
|
||||
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),
|
||||
})
|
||||
end
|
||||
|
||||
if c("porkchop_raw") and c("porkchop_cooked") then
|
||||
minetest.register_craft({
|
||||
type = "cooking",
|
||||
output = "mobs_mc:porkchop_raw",
|
||||
recipe = "mobs_mc:porkchop_cooked",
|
||||
cooktime = 5,
|
||||
})
|
||||
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" },
|
||||
})
|
||||
end
|
||||
|
||||
-- Poor-man's recipes for carrot on a stick
|
||||
if c("carrot_on_a_stick") and c("stick") and c("string") and minetest.get_modpath("farming") then
|
||||
minetest.register_craft({
|
||||
output = "mobs_mc:carrot_on_a_stick",
|
||||
recipe = {
|
||||
{"", "", "farming:string" },
|
||||
{"", "group:stick", "farming:string" },
|
||||
{"group:stick", "", "farming:bread" },
|
||||
}
|
||||
})
|
||||
|
||||
-- FIXME: Identify correct farming mod (check if it includes the carrot item)
|
||||
minetest.register_craft({
|
||||
output = "mobs_mc:carrot_on_a_stick",
|
||||
recipe = {
|
||||
{"", "", "farming:string" },
|
||||
{"", "group:stick", "farming:string" },
|
||||
{"group:stick", "", "farming:carrot" },
|
||||
}
|
||||
})
|
||||
end
|
||||
|
||||
if c("carrot_on_a_stick") and c("stick") and c("string") and minetest.get_modpath("fishing") and minetest.get_modpath("farming") then
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "mobs_mc:carrot_on_a_stick",
|
||||
recipe = {"fishing:pole_wood", "farming:carrot"},
|
||||
})
|
||||
end
|
||||
|
||||
-- Rabbit
|
||||
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),
|
||||
})
|
||||
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),
|
||||
})
|
||||
end
|
||||
|
||||
if c("rabbit_raw") and c("rabbit_cooked") then
|
||||
minetest.register_craft({
|
||||
type = "cooking",
|
||||
output = "mobs_mc:rabbit_cooked",
|
||||
recipe = "mobs_mc:rabbit_raw",
|
||||
cooktime = 5,
|
||||
})
|
||||
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
|
||||
|
||||
if c("leather") and c("rabbit_hide") then
|
||||
minetest.register_craft({
|
||||
output = "mobs:leather",
|
||||
recipe = {
|
||||
{ "mobs_mc:rabbit_hide", "mobs_mc:rabbit_hide" },
|
||||
{ "mobs_mc:rabbit_hide", "mobs_mc:rabbit_hide" },
|
||||
}
|
||||
})
|
||||
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
|
||||
|
||||
-- Sheep
|
||||
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),
|
||||
})
|
||||
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),
|
||||
})
|
||||
end
|
||||
|
||||
if c("mutton_raw") and c("mutton_cooked") then
|
||||
minetest.register_craft({
|
||||
type = "cooking",
|
||||
output = "mobs_mc:mutton_cooked",
|
||||
recipe = "mobs_mc:mutton_raw",
|
||||
cooktime = 5,
|
||||
})
|
||||
end
|
||||
|
||||
-- Shulker
|
||||
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 },
|
||||
})
|
||||
end
|
||||
|
||||
-- Magma cube
|
||||
if c("magma_cream") then
|
||||
minetest.register_craftitem("mobs_mc:magma_cream", {
|
||||
description = S("Magma Cream"),
|
||||
_doc_items_longdesc = S("Magma cream is a crafting component."),
|
||||
wield_image = "mcl_mobitems_magma_cream.png",
|
||||
inventory_image = "mcl_mobitems_magma_cream.png",
|
||||
groups = { brewitem = 1 },
|
||||
})
|
||||
end
|
||||
|
||||
-- Slime
|
||||
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
|
||||
minetest.register_craft({
|
||||
output = "mesecons_materials:glue",
|
||||
recipe = {{ "mobs_mc:slimeball" }},
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
-- Spider
|
||||
if c("spider_eye") then
|
||||
minetest.register_craftitem("mobs_mc:spider_eye", {
|
||||
description = S("Spider Eye"),
|
||||
_doc_items_longdesc = S("Spider eyes are used mainly in crafting and brewing. Spider eyes can be eaten, but they poison you and reduce your health by 2 hit points."),
|
||||
inventory_image = "mcl_mobitems_spider_eye.png",
|
||||
wield_image = "mcl_mobitems_spider_eye.png",
|
||||
-- Simplified poisonous food
|
||||
groups = { food = 2, eatable = -2 },
|
||||
on_use = minetest.item_eat(-2),
|
||||
})
|
||||
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",
|
||||
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
|
||||
|
||||
-- Rotten flesh
|
||||
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 },
|
||||
on_use = minetest.item_eat(-4),
|
||||
})
|
||||
end
|
||||
|
||||
-- Misc.
|
||||
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
|
||||
|
||||
if c("snowball") and minetest.get_modpath("default") then
|
||||
minetest.register_craft({
|
||||
output = "mobs_mc:snowball 2",
|
||||
recipe = {
|
||||
{"default:snow"},
|
||||
},
|
||||
})
|
||||
minetest.register_craft({
|
||||
output = "default:snow 2",
|
||||
recipe = {
|
||||
{"mobs_mc:snowball", "mobs_mc:snowball"},
|
||||
{"mobs_mc:snowball", "mobs_mc:snowball"},
|
||||
},
|
||||
})
|
||||
-- Change the appearance of default snow to avoid confusion with snowball
|
||||
minetest.override_item("default:snow", {
|
||||
inventory_image = "",
|
||||
wield_image = "",
|
||||
})
|
||||
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
|
||||
minetest.register_craft({
|
||||
output = "mobs_mc:bone 3",
|
||||
recipe = {{ "bones:bones" }},
|
||||
})
|
||||
end
|
||||
end
|
393
mods/ENTITIES/mobs_mc/2_throwing.lua
Normal file
393
mods/ENTITIES/mobs_mc/2_throwing.lua
Normal file
@ -0,0 +1,393 @@
|
||||
--MCmobs v0.5
|
||||
--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")
|
||||
|
||||
--maikerumines throwing code
|
||||
--arrow (weapon)
|
||||
|
||||
local c = mobs_mc.is_item_variable_overridden
|
||||
|
||||
minetest.register_node("mobs_mc:arrow_box", {
|
||||
drawtype = "nodebox",
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
-- Shaft
|
||||
{-6.5/17, -1.5/17, -1.5/17, 6.5/17, 1.5/17, 1.5/17},
|
||||
--Spitze
|
||||
{-4.5/17, 2.5/17, 2.5/17, -3.5/17, -2.5/17, -2.5/17},
|
||||
{-8.5/17, 0.5/17, 0.5/17, -6.5/17, -0.5/17, -0.5/17},
|
||||
--Federn
|
||||
{6.5/17, 1.5/17, 1.5/17, 7.5/17, 2.5/17, 2.5/17},
|
||||
{7.5/17, -2.5/17, 2.5/17, 6.5/17, -1.5/17, 1.5/17},
|
||||
{7.5/17, 2.5/17, -2.5/17, 6.5/17, 1.5/17, -1.5/17},
|
||||
{6.5/17, -1.5/17, -1.5/17, 7.5/17, -2.5/17, -2.5/17},
|
||||
|
||||
{7.5/17, 2.5/17, 2.5/17, 8.5/17, 3.5/17, 3.5/17},
|
||||
{8.5/17, -3.5/17, 3.5/17, 7.5/17, -2.5/17, 2.5/17},
|
||||
{8.5/17, 3.5/17, -3.5/17, 7.5/17, 2.5/17, -2.5/17},
|
||||
{7.5/17, -2.5/17, -2.5/17, 8.5/17, -3.5/17, -3.5/17},
|
||||
}
|
||||
},
|
||||
tiles = {"mcl_throwing_arrow.png^[transformFX", "mcl_throwing_arrow.png^[transformFX", "mcl_throwing_arrow_back.png", "mcl_throwing_arrow_front.png", "mcl_throwing_arrow.png", "mcl_throwing_arrow.png^[transformFX"},
|
||||
groups = {not_in_creative_inventory=1},
|
||||
})
|
||||
|
||||
local THROWING_ARROW_ENTITY={
|
||||
physical = false,
|
||||
timer=0,
|
||||
visual = "wielditem",
|
||||
visual_size = {x=0.1, y=0.1},
|
||||
textures = {"mobs_mc:arrow_box"},
|
||||
velocity = 10,
|
||||
lastpos={},
|
||||
collisionbox = {0,0,0,0,0,0},
|
||||
}
|
||||
|
||||
--ARROW CODE
|
||||
THROWING_ARROW_ENTITY.on_step = function(self, dtime)
|
||||
self.timer=self.timer+dtime
|
||||
local pos = self.object:getpos()
|
||||
local node = minetest.get_node(pos)
|
||||
|
||||
minetest.add_particle({
|
||||
pos = pos,
|
||||
vel = {x=0, y=0, z=0},
|
||||
acc = {x=0, y=0, z=0},
|
||||
expirationtime = .3,
|
||||
size = 1,
|
||||
collisiondetection = false,
|
||||
vertical = false,
|
||||
texture = "mobs_mc_arrow_particle.png",
|
||||
})
|
||||
|
||||
if self.timer>0.2 then
|
||||
local objs = minetest.get_objects_inside_radius({x=pos.x,y=pos.y,z=pos.z}, 1.5)
|
||||
for k, obj in pairs(objs) do
|
||||
if obj:get_luaentity() ~= nil then
|
||||
if obj:get_luaentity().name ~= "mobs_mc:arrow_entity" and obj:get_luaentity().name ~= "__builtin:item" then
|
||||
local damage = 3
|
||||
minetest.sound_play("damage", {pos = pos})
|
||||
obj:punch(self.object, 1.0, {
|
||||
full_punch_interval=1.0,
|
||||
damage_groups={fleshy=damage},
|
||||
}, nil)
|
||||
self.object:remove()
|
||||
end
|
||||
else
|
||||
local damage = 3
|
||||
minetest.sound_play("damage", {pos = pos})
|
||||
obj:punch(self.object, 1.0, {
|
||||
full_punch_interval=1.0,
|
||||
damage_groups={fleshy=damage},
|
||||
}, nil)
|
||||
self.object:remove()
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if self.lastpos.x~=nil then
|
||||
if node.name ~= "air" then
|
||||
minetest.sound_play("bowhit1", {pos = pos})
|
||||
minetest.add_item(self.lastpos, 'mobs_mc:arrow')
|
||||
self.object:remove()
|
||||
end
|
||||
end
|
||||
self.lastpos={x=pos.x, y=pos.y, z=pos.z}
|
||||
end
|
||||
|
||||
minetest.register_entity("mobs_mc:arrow_entity", THROWING_ARROW_ENTITY)
|
||||
|
||||
arrows = {
|
||||
{"mobs_mc:arrow", "mobs_mc:arrow_entity" },
|
||||
}
|
||||
|
||||
local throwing_shoot_arrow = function(itemstack, player)
|
||||
for _,arrow in ipairs(arrows) do
|
||||
if player:get_inventory():get_stack("main", player:get_wield_index()+1):get_name() == arrow[1] then
|
||||
if not minetest.settings:get_bool("creative_mode") then
|
||||
player:get_inventory():remove_item("main", arrow[1])
|
||||
end
|
||||
local playerpos = player:getpos()
|
||||
--local obj = minetest.env:add_entity({x=playerpos.x,y=playerpos.y+1.5,z=playerpos.z}, arrow[2]) --current
|
||||
local obj = minetest.add_entity({x=playerpos.x,y=playerpos.y+1.5,z=playerpos.z}, arrow[2]) --mc
|
||||
local dir = player:get_look_dir()
|
||||
obj:setvelocity({x=dir.x*22, y=dir.y*22, z=dir.z*22})
|
||||
obj:setacceleration({x=dir.x*-3, y=-10, z=dir.z*-3})
|
||||
obj:setyaw(player:get_look_yaw()+math.pi)
|
||||
minetest.sound_play("throwing_sound", {pos=playerpos})
|
||||
if obj:get_luaentity().player == "" then
|
||||
obj:get_luaentity().player = player
|
||||
end
|
||||
obj:get_luaentity().node = player:get_inventory():get_stack("main", 1):get_name()
|
||||
return true
|
||||
end
|
||||
end
|
||||
return false
|
||||
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
|
||||
|
||||
if c("arrow") and c("flint") and c("feather") and c("stick") then
|
||||
minetest.register_craft({
|
||||
output = 'mobs_mc:arrow 4',
|
||||
recipe = {
|
||||
{mobs_mc.items.flint},
|
||||
{mobs_mc.items.stick},
|
||||
{mobs_mc.items.feather},
|
||||
}
|
||||
})
|
||||
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
|
||||
if not minetest.settings:get_bool("creative_mode") then
|
||||
itemstack:add_wear(65535/50)
|
||||
end
|
||||
end
|
||||
return itemstack
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = 'mobs_mc:bow_wood',
|
||||
recipe = {
|
||||
{mobs_mc.items.string, mobs_mc.items.stick, ''},
|
||||
{mobs_mc.items.string, '', mobs_mc.items.stick},
|
||||
{mobs_mc.items.string, mobs_mc.items.stick, ''},
|
||||
}
|
||||
})
|
||||
end
|
||||
|
||||
local how_to_throw = "Hold it in your and and leftclick to throw."
|
||||
|
||||
-- egg throwing item
|
||||
-- egg entity
|
||||
if c("egg") then
|
||||
local egg_GRAVITY = 9
|
||||
local egg_VELOCITY = 19
|
||||
|
||||
mobs:register_arrow("mobs_mc:egg_entity", {
|
||||
visual = "sprite",
|
||||
visual_size = {x=.5, y=.5},
|
||||
textures = {"mobs_chicken_egg.png"},
|
||||
velocity = egg_velocity,
|
||||
|
||||
hit_player = function(self, player)
|
||||
player:punch(minetest.get_player_by_name(self.playername) or self.object, 1.0, {
|
||||
full_punch_interval = 1.0,
|
||||
damage_groups = {},
|
||||
}, nil)
|
||||
end,
|
||||
|
||||
hit_mob = function(self, player)
|
||||
player:punch(minetest.get_player_by_name(self.playername) or self.object, 1.0, {
|
||||
full_punch_interval = 1.0,
|
||||
damage_groups = {},
|
||||
}, nil)
|
||||
end,
|
||||
|
||||
hit_node = function(self, pos, node)
|
||||
|
||||
if math.random(1, 10) > 1 then
|
||||
return
|
||||
end
|
||||
|
||||
pos.y = pos.y + 1
|
||||
|
||||
local nod = minetest.get_node_or_nil(pos)
|
||||
|
||||
if not nod
|
||||
or not minetest.registered_nodes[nod.name]
|
||||
or minetest.registered_nodes[nod.name].walkable == true then
|
||||
return
|
||||
end
|
||||
|
||||
local mob = minetest.add_entity(pos, "mobs_mc:chicken")
|
||||
local ent2 = mob:get_luaentity()
|
||||
|
||||
mob:set_properties({
|
||||
visual_size = {
|
||||
x = ent2.base_size.x / 2,
|
||||
y = ent2.base_size.y / 2
|
||||
},
|
||||
collisionbox = {
|
||||
ent2.base_colbox[1] / 2,
|
||||
ent2.base_colbox[2] / 2,
|
||||
ent2.base_colbox[3] / 2,
|
||||
ent2.base_colbox[4] / 2,
|
||||
ent2.base_colbox[5] / 2,
|
||||
ent2.base_colbox[6] / 2
|
||||
},
|
||||
})
|
||||
|
||||
ent2.child = true
|
||||
ent2.tamed = true
|
||||
ent2.owner = self.playername
|
||||
end
|
||||
})
|
||||
|
||||
-- shoot egg
|
||||
local mobs_shoot_egg = function (item, player, pointed_thing)
|
||||
|
||||
local playerpos = player:getpos()
|
||||
|
||||
minetest.sound_play("default_place_node_hard", {
|
||||
pos = playerpos,
|
||||
gain = 1.0,
|
||||
max_hear_distance = 5,
|
||||
})
|
||||
|
||||
local obj = minetest.add_entity({
|
||||
x = playerpos.x,
|
||||
y = playerpos.y +1.5,
|
||||
z = playerpos.z
|
||||
}, "mobs_mc:egg_entity")
|
||||
|
||||
local ent = obj:get_luaentity()
|
||||
local dir = player:get_look_dir()
|
||||
|
||||
ent.velocity = egg_VELOCITY -- needed for api internal timing
|
||||
ent.switch = 1 -- needed so that egg doesn't despawn straight away
|
||||
|
||||
obj:setvelocity({
|
||||
x = dir.x * egg_VELOCITY,
|
||||
y = dir.y * egg_VELOCITY,
|
||||
z = dir.z * egg_VELOCITY
|
||||
})
|
||||
|
||||
obj:setacceleration({
|
||||
x = dir.x * -3,
|
||||
y = -egg_GRAVITY,
|
||||
z = dir.z * -3
|
||||
})
|
||||
|
||||
-- pass player name to egg for chick ownership
|
||||
local ent2 = obj:get_luaentity()
|
||||
ent2.playername = player:get_player_name()
|
||||
|
||||
if not minetest.settings:get_bool("creative_mode") then
|
||||
item:take_item()
|
||||
end
|
||||
|
||||
return item
|
||||
end
|
||||
|
||||
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,
|
||||
})
|
||||
end
|
||||
|
||||
-- Snowball
|
||||
|
||||
local snowball_GRAVITY = 9
|
||||
local snowball_VELOCITY = 19
|
||||
|
||||
mobs:register_arrow("mobs_mc:snowball_entity", {
|
||||
visual = "sprite",
|
||||
visual_size = {x=.5, y=.5},
|
||||
textures = {"mcl_throwing_snowball.png"},
|
||||
velocity = snowball_VELOCITY,
|
||||
|
||||
hit_player = function(self, player)
|
||||
-- FIXME: No knockback
|
||||
player:punch(self.object, 1.0, {
|
||||
full_punch_interval = 1.0,
|
||||
damage_groups = {},
|
||||
}, nil)
|
||||
end,
|
||||
|
||||
hit_mob = function(self, mob)
|
||||
-- Hurt blazes, but not damage to anything else
|
||||
local dmg = {}
|
||||
if mob:get_luaentity().name == "mobs_mc:blaze" then
|
||||
dmg = {fleshy = 3}
|
||||
end
|
||||
-- FIXME: No knockback
|
||||
mob:punch(self.object, 1.0, {
|
||||
full_punch_interval = 1.0,
|
||||
damage_groups = dmg,
|
||||
}, nil)
|
||||
end,
|
||||
|
||||
})
|
||||
|
||||
if c("snowball") then
|
||||
-- shoot snowball
|
||||
local mobs_shoot_snowball = function (item, player, pointed_thing)
|
||||
|
||||
local playerpos = player:getpos()
|
||||
|
||||
local obj = minetest.add_entity({
|
||||
x = playerpos.x,
|
||||
y = playerpos.y +1.5,
|
||||
z = playerpos.z
|
||||
}, "mobs_mc:snowball_entity")
|
||||
|
||||
local ent = obj:get_luaentity()
|
||||
local dir = player:get_look_dir()
|
||||
|
||||
ent.velocity = snowball_VELOCITY -- needed for api internal timing
|
||||
ent.switch = 1 -- needed so that egg doesn't despawn straight away
|
||||
|
||||
obj:setvelocity({
|
||||
x = dir.x * snowball_VELOCITY,
|
||||
y = dir.y * snowball_VELOCITY,
|
||||
z = dir.z * snowball_VELOCITY
|
||||
})
|
||||
|
||||
obj:setacceleration({
|
||||
x = dir.x * -3,
|
||||
y = -snowball_GRAVITY,
|
||||
z = dir.z * -3
|
||||
})
|
||||
|
||||
-- pass player name to egg for chick ownership
|
||||
local ent2 = obj:get_luaentity()
|
||||
ent2.playername = player:get_player_name()
|
||||
|
||||
if not minetest.settings:get_bool("creative_mode") then
|
||||
item:take_item()
|
||||
end
|
||||
|
||||
return item
|
||||
end
|
||||
|
||||
|
||||
-- Snowball
|
||||
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,
|
||||
})
|
||||
end
|
||||
|
||||
--end maikerumine code
|
||||
|
||||
if minetest.settings:get_bool("log_mods") then
|
||||
minetest.log("action", "MC mobs loaded")
|
||||
end
|
63
mods/ENTITIES/mobs_mc/3_shared.lua
Normal file
63
mods/ENTITIES/mobs_mc/3_shared.lua
Normal file
@ -0,0 +1,63 @@
|
||||
local pr = PseudoRandom(os.time()*5)
|
||||
|
||||
local offsets = {}
|
||||
for x=-2, 2 do
|
||||
for z=-2, 2 do
|
||||
table.insert(offsets, {x=x, y=0, z=z})
|
||||
end
|
||||
end
|
||||
|
||||
--[[ Periodically check and teleport mob to owner if not sitting (order ~= "sit") and
|
||||
the owner is too far away. To be used with do_custom. Note: Optimized for mobs smaller than 1×1×1.
|
||||
Larger mobs might have space problems after teleportation.
|
||||
|
||||
* dist: Minimum required distance from owner to teleport. Default: 12
|
||||
* teleport_check_interval: Optional. Interval in seconds to check the mob teleportation. Default: 4 ]]
|
||||
mobs_mc.make_owner_teleport_function = function(dist, teleport_check_interval)
|
||||
return function(self, dtime)
|
||||
-- No teleportation if no owner or if sitting
|
||||
if not self.owner or self.order == "sit" then
|
||||
return
|
||||
end
|
||||
if not teleport_check_interval then
|
||||
teleport_check_interval = 4
|
||||
end
|
||||
if not dist then
|
||||
dist = 12
|
||||
end
|
||||
if self._teleport_timer == nil then
|
||||
self._teleport_timer = teleport_check_interval
|
||||
return
|
||||
end
|
||||
self._teleport_timer = self._teleport_timer - dtime
|
||||
if self._teleport_timer <= 0 then
|
||||
self._teleport_timer = teleport_check_interval
|
||||
local mob_pos = self.object:getpos()
|
||||
local owner = minetest.get_player_by_name(self.owner)
|
||||
if not owner then
|
||||
-- No owner found, no teleportation
|
||||
return
|
||||
end
|
||||
local owner_pos = owner:getpos()
|
||||
local dist_from_owner = vector.distance(owner_pos, mob_pos)
|
||||
if dist_from_owner > dist then
|
||||
-- Check for nodes below air in a 5×1×5 area around the owner position
|
||||
local check_offsets = table.copy(offsets)
|
||||
-- Attempt to place mob near player. Must be placed on walkable node below a non-walkable one. Place inside that air node.
|
||||
while #check_offsets > 0 do
|
||||
local r = pr:next(1, #check_offsets)
|
||||
local telepos = vector.add(owner_pos, check_offsets[r])
|
||||
local telepos_below = {x=telepos.x, y=telepos.y-1, z=telepos.z}
|
||||
table.remove(check_offsets, r)
|
||||
-- Long story short, spawn on a platform
|
||||
if minetest.registered_nodes[minetest.get_node(telepos).name].walkable == false and
|
||||
minetest.registered_nodes[minetest.get_node(telepos_below).name].walkable == true then
|
||||
-- Correct position found! Let's teleport.
|
||||
self.object:setpos(telepos)
|
||||
return
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
61
mods/ENTITIES/mobs_mc/4_heads.lua
Normal file
61
mods/ENTITIES/mobs_mc/4_heads.lua
Normal file
@ -0,0 +1,61 @@
|
||||
--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)
|
||||
if not mobs_mc.is_item_variable_overridden("head_"..mobname) then
|
||||
return
|
||||
end
|
||||
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."))
|
674
mods/ENTITIES/mobs_mc/LICENSE
Normal file
674
mods/ENTITIES/mobs_mc/LICENSE
Normal file
@ -0,0 +1,674 @@
|
||||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright (C) 2007 Free Software Foundation, Inc. <http://fsf.org/>
|
||||
Everyone is permitted to copy and distribute verbatim copies
|
||||
of this license document, but changing it is not allowed.
|
||||
|
||||
Preamble
|
||||
|
||||
The GNU General Public License is a free, copyleft license for
|
||||
software and other kinds of works.
|
||||
|
||||
The licenses for most software and other practical works are designed
|
||||
to take away your freedom to share and change the works. By contrast,
|
||||
the GNU General Public License is intended to guarantee your freedom to
|
||||
share and change all versions of a program--to make sure it remains free
|
||||
software for all its users. We, the Free Software Foundation, use the
|
||||
GNU General Public License for most of our software; it applies also to
|
||||
any other work released this way by its authors. You can apply it to
|
||||
your programs, too.
|
||||
|
||||
When we speak of free software, we are referring to freedom, not
|
||||
price. Our General Public Licenses are designed to make sure that you
|
||||
have the freedom to distribute copies of free software (and charge for
|
||||
them if you wish), that you receive source code or can get it if you
|
||||
want it, that you can change the software or use pieces of it in new
|
||||
free programs, and that you know you can do these things.
|
||||
|
||||
To protect your rights, we need to prevent others from denying you
|
||||
these rights or asking you to surrender the rights. Therefore, you have
|
||||
certain responsibilities if you distribute copies of the software, or if
|
||||
you modify it: responsibilities to respect the freedom of others.
|
||||
|
||||
For example, if you distribute copies of such a program, whether
|
||||
gratis or for a fee, you must pass on to the recipients the same
|
||||
freedoms that you received. You must make sure that they, too, receive
|
||||
or can get the source code. And you must show them these terms so they
|
||||
know their rights.
|
||||
|
||||
Developers that use the GNU GPL protect your rights with two steps:
|
||||
(1) assert copyright on the software, and (2) offer you this License
|
||||
giving you legal permission to copy, distribute and/or modify it.
|
||||
|
||||
For the developers' and authors' protection, the GPL clearly explains
|
||||
that there is no warranty for this free software. For both users' and
|
||||
authors' sake, the GPL requires that modified versions be marked as
|
||||
changed, so that their problems will not be attributed erroneously to
|
||||
authors of previous versions.
|
||||
|
||||
Some devices are designed to deny users access to install or run
|
||||
modified versions of the software inside them, although the manufacturer
|
||||
can do so. This is fundamentally incompatible with the aim of
|
||||
protecting users' freedom to change the software. The systematic
|
||||
pattern of such abuse occurs in the area of products for individuals to
|
||||
use, which is precisely where it is most unacceptable. Therefore, we
|
||||
have designed this version of the GPL to prohibit the practice for those
|
||||
products. If such problems arise substantially in other domains, we
|
||||
stand ready to extend this provision to those domains in future versions
|
||||
of the GPL, as needed to protect the freedom of users.
|
||||
|
||||
Finally, every program is threatened constantly by software patents.
|
||||
States should not allow patents to restrict development and use of
|
||||
software on general-purpose computers, but in those that do, we wish to
|
||||
avoid the special danger that patents applied to a free program could
|
||||
make it effectively proprietary. To prevent this, the GPL assures that
|
||||
patents cannot be used to render the program non-free.
|
||||
|
||||
The precise terms and conditions for copying, distribution and
|
||||
modification follow.
|
||||
|
||||
TERMS AND CONDITIONS
|
||||
|
||||
0. Definitions.
|
||||
|
||||
"This License" refers to version 3 of the GNU General Public License.
|
||||
|
||||
"Copyright" also means copyright-like laws that apply to other kinds of
|
||||
works, such as semiconductor masks.
|
||||
|
||||
"The Program" refers to any copyrightable work licensed under this
|
||||
License. Each licensee is addressed as "you". "Licensees" and
|
||||
"recipients" may be individuals or organizations.
|
||||
|
||||
To "modify" a work means to copy from or adapt all or part of the work
|
||||
in a fashion requiring copyright permission, other than the making of an
|
||||
exact copy. The resulting work is called a "modified version" of the
|
||||
earlier work or a work "based on" the earlier work.
|
||||
|
||||
A "covered work" means either the unmodified Program or a work based
|
||||
on the Program.
|
||||
|
||||
To "propagate" a work means to do anything with it that, without
|
||||
permission, would make you directly or secondarily liable for
|
||||
infringement under applicable copyright law, except executing it on a
|
||||
computer or modifying a private copy. Propagation includes copying,
|
||||
distribution (with or without modification), making available to the
|
||||
public, and in some countries other activities as well.
|
||||
|
||||
To "convey" a work means any kind of propagation that enables other
|
||||
parties to make or receive copies. Mere interaction with a user through
|
||||
a computer network, with no transfer of a copy, is not conveying.
|
||||
|
||||
An interactive user interface displays "Appropriate Legal Notices"
|
||||
to the extent that it includes a convenient and prominently visible
|
||||
feature that (1) displays an appropriate copyright notice, and (2)
|
||||
tells the user that there is no warranty for the work (except to the
|
||||
extent that warranties are provided), that licensees may convey the
|
||||
work under this License, and how to view a copy of this License. If
|
||||
the interface presents a list of user commands or options, such as a
|
||||
menu, a prominent item in the list meets this criterion.
|
||||
|
||||
1. Source Code.
|
||||
|
||||
The "source code" for a work means the preferred form of the work
|
||||
for making modifications to it. "Object code" means any non-source
|
||||
form of a work.
|
||||
|
||||
A "Standard Interface" means an interface that either is an official
|
||||
standard defined by a recognized standards body, or, in the case of
|
||||
interfaces specified for a particular programming language, one that
|
||||
is widely used among developers working in that language.
|
||||
|
||||
The "System Libraries" of an executable work include anything, other
|
||||
than the work as a whole, that (a) is included in the normal form of
|
||||
packaging a Major Component, but which is not part of that Major
|
||||
Component, and (b) serves only to enable use of the work with that
|
||||
Major Component, or to implement a Standard Interface for which an
|
||||
implementation is available to the public in source code form. A
|
||||
"Major Component", in this context, means a major essential component
|
||||
(kernel, window system, and so on) of the specific operating system
|
||||
(if any) on which the executable work runs, or a compiler used to
|
||||
produce the work, or an object code interpreter used to run it.
|
||||
|
||||
The "Corresponding Source" for a work in object code form means all
|
||||
the source code needed to generate, install, and (for an executable
|
||||
work) run the object code and to modify the work, including scripts to
|
||||
control those activities. However, it does not include the work's
|
||||
System Libraries, or general-purpose tools or generally available free
|
||||
programs which are used unmodified in performing those activities but
|
||||
which are not part of the work. For example, Corresponding Source
|
||||
includes interface definition files associated with source files for
|
||||
the work, and the source code for shared libraries and dynamically
|
||||
linked subprograms that the work is specifically designed to require,
|
||||
such as by intimate data communication or control flow between those
|
||||
subprograms and other parts of the work.
|
||||
|
||||
The Corresponding Source need not include anything that users
|
||||
can regenerate automatically from other parts of the Corresponding
|
||||
Source.
|
||||
|
||||
The Corresponding Source for a work in source code form is that
|
||||
same work.
|
||||
|
||||
2. Basic Permissions.
|
||||
|
||||
All rights granted under this License are granted for the term of
|
||||
copyright on the Program, and are irrevocable provided the stated
|
||||
conditions are met. This License explicitly affirms your unlimited
|
||||
permission to run the unmodified Program. The output from running a
|
||||
covered work is covered by this License only if the output, given its
|
||||
content, constitutes a covered work. This License acknowledges your
|
||||
rights of fair use or other equivalent, as provided by copyright law.
|
||||
|
||||
You may make, run and propagate covered works that you do not
|
||||
convey, without conditions so long as your license otherwise remains
|
||||
in force. You may convey covered works to others for the sole purpose
|
||||
of having them make modifications exclusively for you, or provide you
|
||||
with facilities for running those works, provided that you comply with
|
||||
the terms of this License in conveying all material for which you do
|
||||
not control copyright. Those thus making or running the covered works
|
||||
for you must do so exclusively on your behalf, under your direction
|
||||
and control, on terms that prohibit them from making any copies of
|
||||
your copyrighted material outside their relationship with you.
|
||||
|
||||
Conveying under any other circumstances is permitted solely under
|
||||
the conditions stated below. Sublicensing is not allowed; section 10
|
||||
makes it unnecessary.
|
||||
|
||||
3. Protecting Users' Legal Rights From Anti-Circumvention Law.
|
||||
|
||||
No covered work shall be deemed part of an effective technological
|
||||
measure under any applicable law fulfilling obligations under article
|
||||
11 of the WIPO copyright treaty adopted on 20 December 1996, or
|
||||
similar laws prohibiting or restricting circumvention of such
|
||||
measures.
|
||||
|
||||
When you convey a covered work, you waive any legal power to forbid
|
||||
circumvention of technological measures to the extent such circumvention
|
||||
is effected by exercising rights under this License with respect to
|
||||
the covered work, and you disclaim any intention to limit operation or
|
||||
modification of the work as a means of enforcing, against the work's
|
||||
users, your or third parties' legal rights to forbid circumvention of
|
||||
technological measures.
|
||||
|
||||
4. Conveying Verbatim Copies.
|
||||
|
||||
You may convey verbatim copies of the Program's source code as you
|
||||
receive it, in any medium, provided that you conspicuously and
|
||||
appropriately publish on each copy an appropriate copyright notice;
|
||||
keep intact all notices stating that this License and any
|
||||
non-permissive terms added in accord with section 7 apply to the code;
|
||||
keep intact all notices of the absence of any warranty; and give all
|
||||
recipients a copy of this License along with the Program.
|
||||
|
||||
You may charge any price or no price for each copy that you convey,
|
||||
and you may offer support or warranty protection for a fee.
|
||||
|
||||
5. Conveying Modified Source Versions.
|
||||
|
||||
You may convey a work based on the Program, or the modifications to
|
||||
produce it from the Program, in the form of source code under the
|
||||
terms of section 4, provided that you also meet all of these conditions:
|
||||
|
||||
a) The work must carry prominent notices stating that you modified
|
||||
it, and giving a relevant date.
|
||||
|
||||
b) The work must carry prominent notices stating that it is
|
||||
released under this License and any conditions added under section
|
||||
7. This requirement modifies the requirement in section 4 to
|
||||
"keep intact all notices".
|
||||
|
||||
c) You must license the entire work, as a whole, under this
|
||||
License to anyone who comes into possession of a copy. This
|
||||
License will therefore apply, along with any applicable section 7
|
||||
additional terms, to the whole of the work, and all its parts,
|
||||
regardless of how they are packaged. This License gives no
|
||||
permission to license the work in any other way, but it does not
|
||||
invalidate such permission if you have separately received it.
|
||||
|
||||
d) If the work has interactive user interfaces, each must display
|
||||
Appropriate Legal Notices; however, if the Program has interactive
|
||||
interfaces that do not display Appropriate Legal Notices, your
|
||||
work need not make them do so.
|
||||
|
||||
A compilation of a covered work with other separate and independent
|
||||
works, which are not by their nature extensions of the covered work,
|
||||
and which are not combined with it such as to form a larger program,
|
||||
in or on a volume of a storage or distribution medium, is called an
|
||||
"aggregate" if the compilation and its resulting copyright are not
|
||||
used to limit the access or legal rights of the compilation's users
|
||||
beyond what the individual works permit. Inclusion of a covered work
|
||||
in an aggregate does not cause this License to apply to the other
|
||||
parts of the aggregate.
|
||||
|
||||
6. Conveying Non-Source Forms.
|
||||
|
||||
You may convey a covered work in object code form under the terms
|
||||
of sections 4 and 5, provided that you also convey the
|
||||
machine-readable Corresponding Source under the terms of this License,
|
||||
in one of these ways:
|
||||
|
||||
a) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by the
|
||||
Corresponding Source fixed on a durable physical medium
|
||||
customarily used for software interchange.
|
||||
|
||||
b) Convey the object code in, or embodied in, a physical product
|
||||
(including a physical distribution medium), accompanied by a
|
||||
written offer, valid for at least three years and valid for as
|
||||
long as you offer spare parts or customer support for that product
|
||||
model, to give anyone who possesses the object code either (1) a
|
||||
copy of the Corresponding Source for all the software in the
|
||||
product that is covered by this License, on a durable physical
|
||||
medium customarily used for software interchange, for a price no
|
||||
more than your reasonable cost of physically performing this
|
||||
conveying of source, or (2) access to copy the
|
||||
Corresponding Source from a network server at no charge.
|
||||
|
||||
c) Convey individual copies of the object code with a copy of the
|
||||
written offer to provide the Corresponding Source. This
|
||||
alternative is allowed only occasionally and noncommercially, and
|
||||
only if you received the object code with such an offer, in accord
|
||||
with subsection 6b.
|
||||
|
||||
d) Convey the object code by offering access from a designated
|
||||
place (gratis or for a charge), and offer equivalent access to the
|
||||
Corresponding Source in the same way through the same place at no
|
||||
further charge. You need not require recipients to copy the
|
||||
Corresponding Source along with the object code. If the place to
|
||||
copy the object code is a network server, the Corresponding Source
|
||||
may be on a different server (operated by you or a third party)
|
||||
that supports equivalent copying facilities, provided you maintain
|
||||
clear directions next to the object code saying where to find the
|
||||
Corresponding Source. Regardless of what server hosts the
|
||||
Corresponding Source, you remain obligated to ensure that it is
|
||||
available for as long as needed to satisfy these requirements.
|
||||
|
||||
e) Convey the object code using peer-to-peer transmission, provided
|
||||
you inform other peers where the object code and Corresponding
|
||||
Source of the work are being offered to the general public at no
|
||||
charge under subsection 6d.
|
||||
|
||||
A separable portion of the object code, whose source code is excluded
|
||||
from the Corresponding Source as a System Library, need not be
|
||||
included in conveying the object code work.
|
||||
|
||||
A "User Product" is either (1) a "consumer product", which means any
|
||||
tangible personal property which is normally used for personal, family,
|
||||
or household purposes, or (2) anything designed or sold for incorporation
|
||||
into a dwelling. In determining whether a product is a consumer product,
|
||||
doubtful cases shall be resolved in favor of coverage. For a particular
|
||||
product received by a particular user, "normally used" refers to a
|
||||
typical or common use of that class of product, regardless of the status
|
||||
of the particular user or of the way in which the particular user
|
||||
actually uses, or expects or is expected to use, the product. A product
|
||||
is a consumer product regardless of whether the product has substantial
|
||||
commercial, industrial or non-consumer uses, unless such uses represent
|
||||
the only significant mode of use of the product.
|
||||
|
||||
"Installation Information" for a User Product means any methods,
|
||||
procedures, authorization keys, or other information required to install
|
||||
and execute modified versions of a covered work in that User Product from
|
||||
a modified version of its Corresponding Source. The information must
|
||||
suffice to ensure that the continued functioning of the modified object
|
||||
code is in no case prevented or interfered with solely because
|
||||
modification has been made.
|
||||
|
||||
If you convey an object code work under this section in, or with, or
|
||||
specifically for use in, a User Product, and the conveying occurs as
|
||||
part of a transaction in which the right of possession and use of the
|
||||
User Product is transferred to the recipient in perpetuity or for a
|
||||
fixed term (regardless of how the transaction is characterized), the
|
||||
Corresponding Source conveyed under this section must be accompanied
|
||||
by the Installation Information. But this requirement does not apply
|
||||
if neither you nor any third party retains the ability to install
|
||||
modified object code on the User Product (for example, the work has
|
||||
been installed in ROM).
|
||||
|
||||
The requirement to provide Installation Information does not include a
|
||||
requirement to continue to provide support service, warranty, or updates
|
||||
for a work that has been modified or installed by the recipient, or for
|
||||
the User Product in which it has been modified or installed. Access to a
|
||||
network may be denied when the modification itself materially and
|
||||
adversely affects the operation of the network or violates the rules and
|
||||
protocols for communication across the network.
|
||||
|
||||
Corresponding Source conveyed, and Installation Information provided,
|
||||
in accord with this section must be in a format that is publicly
|
||||
documented (and with an implementation available to the public in
|
||||
source code form), and must require no special password or key for
|
||||
unpacking, reading or copying.
|
||||
|
||||
7. Additional Terms.
|
||||
|
||||
"Additional permissions" are terms that supplement the terms of this
|
||||
License by making exceptions from one or more of its conditions.
|
||||
Additional permissions that are applicable to the entire Program shall
|
||||
be treated as though they were included in this License, to the extent
|
||||
that they are valid under applicable law. If additional permissions
|
||||
apply only to part of the Program, that part may be used separately
|
||||
under those permissions, but the entire Program remains governed by
|
||||
this License without regard to the additional permissions.
|
||||
|
||||
When you convey a copy of a covered work, you may at your option
|
||||
remove any additional permissions from that copy, or from any part of
|
||||
it. (Additional permissions may be written to require their own
|
||||
removal in certain cases when you modify the work.) You may place
|
||||
additional permissions on material, added by you to a covered work,
|
||||
for which you have or can give appropriate copyright permission.
|
||||
|
||||
Notwithstanding any other provision of this License, for material you
|
||||
add to a covered work, you may (if authorized by the copyright holders of
|
||||
that material) supplement the terms of this License with terms:
|
||||
|
||||
a) Disclaiming warranty or limiting liability differently from the
|
||||
terms of sections 15 and 16 of this License; or
|
||||
|
||||
b) Requiring preservation of specified reasonable legal notices or
|
||||
author attributions in that material or in the Appropriate Legal
|
||||
Notices displayed by works containing it; or
|
||||
|
||||
c) Prohibiting misrepresentation of the origin of that material, or
|
||||
requiring that modified versions of such material be marked in
|
||||
reasonable ways as different from the original version; or
|
||||
|
||||
d) Limiting the use for publicity purposes of names of licensors or
|
||||
authors of the material; or
|
||||
|
||||
e) Declining to grant rights under trademark law for use of some
|
||||
trade names, trademarks, or service marks; or
|
||||
|
||||
f) Requiring indemnification of licensors and authors of that
|
||||
material by anyone who conveys the material (or modified versions of
|
||||
it) with contractual assumptions of liability to the recipient, for
|
||||
any liability that these contractual assumptions directly impose on
|
||||
those licensors and authors.
|
||||
|
||||
All other non-permissive additional terms are considered "further
|
||||
restrictions" within the meaning of section 10. If the Program as you
|
||||
received it, or any part of it, contains a notice stating that it is
|
||||
governed by this License along with a term that is a further
|
||||
restriction, you may remove that term. If a license document contains
|
||||
a further restriction but permits relicensing or conveying under this
|
||||
License, you may add to a covered work material governed by the terms
|
||||
of that license document, provided that the further restriction does
|
||||
not survive such relicensing or conveying.
|
||||
|
||||
If you add terms to a covered work in accord with this section, you
|
||||
must place, in the relevant source files, a statement of the
|
||||
additional terms that apply to those files, or a notice indicating
|
||||
where to find the applicable terms.
|
||||
|
||||
Additional terms, permissive or non-permissive, may be stated in the
|
||||
form of a separately written license, or stated as exceptions;
|
||||
the above requirements apply either way.
|
||||
|
||||
8. Termination.
|
||||
|
||||
You may not propagate or modify a covered work except as expressly
|
||||
provided under this License. Any attempt otherwise to propagate or
|
||||
modify it is void, and will automatically terminate your rights under
|
||||
this License (including any patent licenses granted under the third
|
||||
paragraph of section 11).
|
||||
|
||||
However, if you cease all violation of this License, then your
|
||||
license from a particular copyright holder is reinstated (a)
|
||||
provisionally, unless and until the copyright holder explicitly and
|
||||
finally terminates your license, and (b) permanently, if the copyright
|
||||
holder fails to notify you of the violation by some reasonable means
|
||||
prior to 60 days after the cessation.
|
||||
|
||||
Moreover, your license from a particular copyright holder is
|
||||
reinstated permanently if the copyright holder notifies you of the
|
||||
violation by some reasonable means, this is the first time you have
|
||||
received notice of violation of this License (for any work) from that
|
||||
copyright holder, and you cure the violation prior to 30 days after
|
||||
your receipt of the notice.
|
||||
|
||||
Termination of your rights under this section does not terminate the
|
||||
licenses of parties who have received copies or rights from you under
|
||||
this License. If your rights have been terminated and not permanently
|
||||
reinstated, you do not qualify to receive new licenses for the same
|
||||
material under section 10.
|
||||
|
||||
9. Acceptance Not Required for Having Copies.
|
||||
|
||||
You are not required to accept this License in order to receive or
|
||||
run a copy of the Program. Ancillary propagation of a covered work
|
||||
occurring solely as a consequence of using peer-to-peer transmission
|
||||
to receive a copy likewise does not require acceptance. However,
|
||||
nothing other than this License grants you permission to propagate or
|
||||
modify any covered work. These actions infringe copyright if you do
|
||||
not accept this License. Therefore, by modifying or propagating a
|
||||
covered work, you indicate your acceptance of this License to do so.
|
||||
|
||||
10. Automatic Licensing of Downstream Recipients.
|
||||
|
||||
Each time you convey a covered work, the recipient automatically
|
||||
receives a license from the original licensors, to run, modify and
|
||||
propagate that work, subject to this License. You are not responsible
|
||||
for enforcing compliance by third parties with this License.
|
||||
|
||||
An "entity transaction" is a transaction transferring control of an
|
||||
organization, or substantially all assets of one, or subdividing an
|
||||
organization, or merging organizations. If propagation of a covered
|
||||
work results from an entity transaction, each party to that
|
||||
transaction who receives a copy of the work also receives whatever
|
||||
licenses to the work the party's predecessor in interest had or could
|
||||
give under the previous paragraph, plus a right to possession of the
|
||||
Corresponding Source of the work from the predecessor in interest, if
|
||||
the predecessor has it or can get it with reasonable efforts.
|
||||
|
||||
You may not impose any further restrictions on the exercise of the
|
||||
rights granted or affirmed under this License. For example, you may
|
||||
not impose a license fee, royalty, or other charge for exercise of
|
||||
rights granted under this License, and you may not initiate litigation
|
||||
(including a cross-claim or counterclaim in a lawsuit) alleging that
|
||||
any patent claim is infringed by making, using, selling, offering for
|
||||
sale, or importing the Program or any portion of it.
|
||||
|
||||
11. Patents.
|
||||
|
||||
A "contributor" is a copyright holder who authorizes use under this
|
||||
License of the Program or a work on which the Program is based. The
|
||||
work thus licensed is called the contributor's "contributor version".
|
||||
|
||||
A contributor's "essential patent claims" are all patent claims
|
||||
owned or controlled by the contributor, whether already acquired or
|
||||
hereafter acquired, that would be infringed by some manner, permitted
|
||||
by this License, of making, using, or selling its contributor version,
|
||||
but do not include claims that would be infringed only as a
|
||||
consequence of further modification of the contributor version. For
|
||||
purposes of this definition, "control" includes the right to grant
|
||||
patent sublicenses in a manner consistent with the requirements of
|
||||
this License.
|
||||
|
||||
Each contributor grants you a non-exclusive, worldwide, royalty-free
|
||||
patent license under the contributor's essential patent claims, to
|
||||
make, use, sell, offer for sale, import and otherwise run, modify and
|
||||
propagate the contents of its contributor version.
|
||||
|
||||
In the following three paragraphs, a "patent license" is any express
|
||||
agreement or commitment, however denominated, not to enforce a patent
|
||||
(such as an express permission to practice a patent or covenant not to
|
||||
sue for patent infringement). To "grant" such a patent license to a
|
||||
party means to make such an agreement or commitment not to enforce a
|
||||
patent against the party.
|
||||
|
||||
If you convey a covered work, knowingly relying on a patent license,
|
||||
and the Corresponding Source of the work is not available for anyone
|
||||
to copy, free of charge and under the terms of this License, through a
|
||||
publicly available network server or other readily accessible means,
|
||||
then you must either (1) cause the Corresponding Source to be so
|
||||
available, or (2) arrange to deprive yourself of the benefit of the
|
||||
patent license for this particular work, or (3) arrange, in a manner
|
||||
consistent with the requirements of this License, to extend the patent
|
||||
license to downstream recipients. "Knowingly relying" means you have
|
||||
actual knowledge that, but for the patent license, your conveying the
|
||||
covered work in a country, or your recipient's use of the covered work
|
||||
in a country, would infringe one or more identifiable patents in that
|
||||
country that you have reason to believe are valid.
|
||||
|
||||
If, pursuant to or in connection with a single transaction or
|
||||
arrangement, you convey, or propagate by procuring conveyance of, a
|
||||
covered work, and grant a patent license to some of the parties
|
||||
receiving the covered work authorizing them to use, propagate, modify
|
||||
or convey a specific copy of the covered work, then the patent license
|
||||
you grant is automatically extended to all recipients of the covered
|
||||
work and works based on it.
|
||||
|
||||
A patent license is "discriminatory" if it does not include within
|
||||
the scope of its coverage, prohibits the exercise of, or is
|
||||
conditioned on the non-exercise of one or more of the rights that are
|
||||
specifically granted under this License. You may not convey a covered
|
||||
work if you are a party to an arrangement with a third party that is
|
||||
in the business of distributing software, under which you make payment
|
||||
to the third party based on the extent of your activity of conveying
|
||||
the work, and under which the third party grants, to any of the
|
||||
parties who would receive the covered work from you, a discriminatory
|
||||
patent license (a) in connection with copies of the covered work
|
||||
conveyed by you (or copies made from those copies), or (b) primarily
|
||||
for and in connection with specific products or compilations that
|
||||
contain the covered work, unless you entered into that arrangement,
|
||||
or that patent license was granted, prior to 28 March 2007.
|
||||
|
||||
Nothing in this License shall be construed as excluding or limiting
|
||||
any implied license or other defenses to infringement that may
|
||||
otherwise be available to you under applicable patent law.
|
||||
|
||||
12. No Surrender of Others' Freedom.
|
||||
|
||||
If conditions are imposed on you (whether by court order, agreement or
|
||||
otherwise) that contradict the conditions of this License, they do not
|
||||
excuse you from the conditions of this License. If you cannot convey a
|
||||
covered work so as to satisfy simultaneously your obligations under this
|
||||
License and any other pertinent obligations, then as a consequence you may
|
||||
not convey it at all. For example, if you agree to terms that obligate you
|
||||
to collect a royalty for further conveying from those to whom you convey
|
||||
the Program, the only way you could satisfy both those terms and this
|
||||
License would be to refrain entirely from conveying the Program.
|
||||
|
||||
13. Use with the GNU Affero General Public License.
|
||||
|
||||
Notwithstanding any other provision of this License, you have
|
||||
permission to link or combine any covered work with a work licensed
|
||||
under version 3 of the GNU Affero General Public License into a single
|
||||
combined work, and to convey the resulting work. The terms of this
|
||||
License will continue to apply to the part which is the covered work,
|
||||
but the special requirements of the GNU Affero General Public License,
|
||||
section 13, concerning interaction through a network will apply to the
|
||||
combination as such.
|
||||
|
||||
14. Revised Versions of this License.
|
||||
|
||||
The Free Software Foundation may publish revised and/or new versions of
|
||||
the GNU General Public License from time to time. Such new versions will
|
||||
be similar in spirit to the present version, but may differ in detail to
|
||||
address new problems or concerns.
|
||||
|
||||
Each version is given a distinguishing version number. If the
|
||||
Program specifies that a certain numbered version of the GNU General
|
||||
Public License "or any later version" applies to it, you have the
|
||||
option of following the terms and conditions either of that numbered
|
||||
version or of any later version published by the Free Software
|
||||
Foundation. If the Program does not specify a version number of the
|
||||
GNU General Public License, you may choose any version ever published
|
||||
by the Free Software Foundation.
|
||||
|
||||
If the Program specifies that a proxy can decide which future
|
||||
versions of the GNU General Public License can be used, that proxy's
|
||||
public statement of acceptance of a version permanently authorizes you
|
||||
to choose that version for the Program.
|
||||
|
||||
Later license versions may give you additional or different
|
||||
permissions. However, no additional obligations are imposed on any
|
||||
author or copyright holder as a result of your choosing to follow a
|
||||
later version.
|
||||
|
||||
15. Disclaimer of Warranty.
|
||||
|
||||
THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY
|
||||
APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT
|
||||
HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY
|
||||
OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,
|
||||
THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
|
||||
PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM
|
||||
IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF
|
||||
ALL NECESSARY SERVICING, REPAIR OR CORRECTION.
|
||||
|
||||
16. Limitation of Liability.
|
||||
|
||||
IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
|
||||
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS
|
||||
THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY
|
||||
GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
|
||||
USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF
|
||||
DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD
|
||||
PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),
|
||||
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
||||
SUCH DAMAGES.
|
||||
|
||||
17. Interpretation of Sections 15 and 16.
|
||||
|
||||
If the disclaimer of warranty and limitation of liability provided
|
||||
above cannot be given local legal effect according to their terms,
|
||||
reviewing courts shall apply local law that most closely approximates
|
||||
an absolute waiver of all civil liability in connection with the
|
||||
Program, unless a warranty or assumption of liability accompanies a
|
||||
copy of the Program in return for a fee.
|
||||
|
||||
END OF TERMS AND CONDITIONS
|
||||
|
||||
How to Apply These Terms to Your New Programs
|
||||
|
||||
If you develop a new program, and you want it to be of the greatest
|
||||
possible use to the public, the best way to achieve this is to make it
|
||||
free software which everyone can redistribute and change under these terms.
|
||||
|
||||
To do so, attach the following notices to the program. It is safest
|
||||
to attach them to the start of each source file to most effectively
|
||||
state the exclusion of warranty; and each file should have at least
|
||||
the "copyright" line and a pointer to where the full notice is found.
|
||||
|
||||
{one line to give the program's name and a brief idea of what it does.}
|
||||
Copyright (C) {year} {name of author}
|
||||
|
||||
This program is free software: you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
the Free Software Foundation, either version 3 of the License, or
|
||||
(at your option) any later version.
|
||||
|
||||
This program is distributed in the hope that it will be useful,
|
||||
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
GNU General Public License for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Also add information on how to contact you by electronic and paper mail.
|
||||
|
||||
If the program does terminal interaction, make it output a short
|
||||
notice like this when it starts in an interactive mode:
|
||||
|
||||
{project} Copyright (C) {year} {fullname}
|
||||
This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
|
||||
This is free software, and you are welcome to redistribute it
|
||||
under certain conditions; type `show c' for details.
|
||||
|
||||
The hypothetical commands `show w' and `show c' should show the appropriate
|
||||
parts of the General Public License. Of course, your program's commands
|
||||
might be different; for a GUI interface, you would use an "about box".
|
||||
|
||||
You should also get your employer (if you work as a programmer) or school,
|
||||
if any, to sign a "copyright disclaimer" for the program, if necessary.
|
||||
For more information on this, and how to apply and follow the GNU GPL, see
|
||||
<http://www.gnu.org/licenses/>.
|
||||
|
||||
The GNU General Public License does not permit incorporating your program
|
||||
into proprietary programs. If your program is a subroutine library, you
|
||||
may consider it more useful to permit linking proprietary applications with
|
||||
the library. If this is what you want to do, use the GNU Lesser General
|
||||
Public License instead of this License. But first, please read
|
||||
<http://www.gnu.org/philosophy/why-not-lgpl.html>.
|
70
mods/ENTITIES/mobs_mc/LICENSE-media.md
Normal file
70
mods/ENTITIES/mobs_mc/LICENSE-media.md
Normal file
@ -0,0 +1,70 @@
|
||||
# Credits licensing for media files in `mobs_mc`
|
||||
|
||||
## Licenses used
|
||||
|
||||
The following media licenses are used:
|
||||
|
||||
* [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/)
|
||||
* [GPL v3](https://www.gnu.org/licenses/gpl-3.0.html])
|
||||
* [MIT License](https://opensource.org/licenses/MIT)
|
||||
* [LGPL v2.1](https://www.gnu.org/licenses/lgpl-2.1.html)
|
||||
|
||||
Note: A “`*`” in a file name below is a placeholder which can stand for any text.
|
||||
|
||||
## Models
|
||||
All models were done by [22i](https://github.com/22i) and are licensed under GPLv3.
|
||||
|
||||
Origin of those models:
|
||||
|
||||
* [Mod “amc”](https://github.com/22i/amc/)
|
||||
* [Repository with Blender source files for models](https://github.com/22i/minecraft-voxel-blender-models)
|
||||
|
||||
## Textures
|
||||
|
||||
* Most mob and item textures from [Pixel Perfection](https://www.planetminecraft.com/texture_pack/131pixel-perfection/), a texture pack for Minecraft.
|
||||
* Author: [XSSheep](https://www.planetminecraft.com/member/xssheep/)
|
||||
* License: CC BY-SA 4.0
|
||||
* “Spawn egg” textures (`mobs_mc_spawn_icon_*`) by 22i
|
||||
* Any other texture not mentioned here are licensed under the MIT License
|
||||
|
||||
## Sounds
|
||||
|
||||
* PilzAdam and Wuzzy (CC0)
|
||||
* `mobs_mc_chicken_lay_egg.ogg`
|
||||
* Randomation (CC0)
|
||||
* `green_slime_damage.ogg`
|
||||
* `green_slime_attack.ogg`
|
||||
* Source: <http://www.freesound.org/people/RandomationPictures/sounds/138481/>
|
||||
* [Dr. Minky](http://www.freesound.org/people/DrMinky/sounds/) (CC BY 3.0)
|
||||
* `green_slime_jump.ogg`
|
||||
* `green_slime_land.ogg`
|
||||
* `green_slime_death.ogg`
|
||||
* Zozzy from Freesound.org (CC0)
|
||||
* `mobs_mc_cow.ogg`
|
||||
* Source: <https://www.freesound.org/people/Zozzy/sounds/59245/>
|
||||
* [NPXcoot](https://github.com/NPXcoot1) (CC BY-SA 4.0)
|
||||
* `mobs_mc_ender_dragon_*`
|
||||
* Blender Foundation (CC BY 3.0)
|
||||
* `mobs_sheep.ogg`,
|
||||
* daufinsyd (MIT License)
|
||||
* `mobs_mc_blaze_breath.ogg`
|
||||
* `mobs_mc_blaze_died.ogg`
|
||||
* `mobs_mc_squid_hurt.ogg`
|
||||
* [thefilmbakery](https://freesound.org/people/thefilmbakery/) (CC0)
|
||||
* `mobs_mc_blaze_hurt.ogg`
|
||||
* Source: <https://freesound.org/people/thefilmbakery/sounds/137836/>
|
||||
* TenPlus1, from `mobs_monster` or `mobs_animal` mod (MIT License)
|
||||
* `mobs_chicken.ogg`
|
||||
* `mobs_fireball.ogg`
|
||||
* `mobs_kitten.ogg`
|
||||
* `mobs_mc_llama.ogg`
|
||||
* `mobs_pig.ogg`
|
||||
* `mobs_pig_angry.ogg`
|
||||
* `mobs_rat.ogg`
|
||||
* `mobs_sandmonster.ogg`
|
||||
* `mobs_spider.ogg`
|
||||
* BrandonReese (LGPL v2.1)
|
||||
* `mobs_eerie.ogg`
|
||||
|
@ -1,64 +1,88 @@
|
||||
MC MOBS
|
||||
WIP
|
||||
assembled by maikerumine
|
||||
compatable with Mobs Redo API
|
||||
# MC-like mobs [`mobs_mc`]
|
||||
|
||||
## LICENSING
|
||||
Note: In the following file name lists, the asterisk (“`*`”) is a placeholder which stands for any sequence of characters.
|
||||
Everything not explicitly mentioned or with no license mentioned falls under the license of the MineClone 2 project (see README.md in the top directory of MineClone 2).
|
||||
This mod adds mobs which closely resemble the mobs from the game Minecraft, version 1.12.
|
||||
|
||||
### Code
|
||||
MIT License
|
||||
## Credits
|
||||
|
||||
by PilzAdam and others
|
||||
* [maikerumine](https://github.com/maikerumine): Coding behaviour, spawning, drops, and misc.
|
||||
* [Wuzzy2](https://github.com/Wuzzy2): Zombies, husks, item textures, and code
|
||||
* [toby109tt](https://github.com/tobyplowy): Mapping fixes - better 2D planes
|
||||
* [22i](https://github.com/22i): Models (done in Blender) and mob icons for spawn eggs
|
||||
* [XSSheep](https://www.planetminecraft.com/member/xssheep/): Mob and item textures (from [Pixel Perfection](https://www.planetminecraft.com/texture_pack/131pixel-perfection/)
|
||||
* See `LICENSE_media.md` for detailed credits about each file
|
||||
|
||||
### Sound files
|
||||
## Licensing
|
||||
|
||||
- `mobs_mc_squid_hurt.ogg`
|
||||
- Author: daufinsyd
|
||||
- `mobs_mc_chicken_lay_egg.ogg`
|
||||
- WTFPL, by PilzAdam and Wuzzy
|
||||
- `mobs_mc_cow.ogg`
|
||||
- CC0, by Freesound.org user Zozzy
|
||||
- Source: <https://www.freesound.org/people/Zozzy/sounds/59245/>
|
||||
- `mobs_*.ogg` (except the files above)
|
||||
- MIT License, from `mobs_animal` and `mobs_monster` by TenPlus1
|
||||
- `blaze_breath.ogg`
|
||||
- `blaze_died1.ogg`
|
||||
- Author: daufinsyd
|
||||
- `blaze_hurt1.ogg`
|
||||
- CC0, by freesound.org user thefilmbakery
|
||||
- Source: <https://freesound.org/people/thefilmbakery/sounds/137836/>
|
||||
- `green_slime_death.ogg`
|
||||
- CC BY 3.0 <http://creativecommons.org/licenses/by/3.0/>
|
||||
- By freesound.org user DrMinky
|
||||
- Source: <https://freesound.org/people/DrMinky/sounds/167074/>
|
||||
- `green_slime_*.ogg`
|
||||
- MIT License
|
||||
- `mobs_sheep.ogg`
|
||||
- [CC BY 3.0](https://creativecommons.org/licenses/by/3.0/), created by the Blender Foundation
|
||||
* Code: GNU General Public License, version 3 (see `LICENSE`)
|
||||
* Media: MIT, CC0, CC BY 3.0 CC BY-SA 4.0, LGPLv2.1, GPLv3. See `LICENSE_media.md` for details
|
||||
|
||||
### Textures
|
||||
## Useful information for developers
|
||||
|
||||
- `mobs_squid.png`
|
||||
- `mobs_blaze.png`
|
||||
- GPLv3 by 22i
|
||||
- `mobs_bunny_*.png`
|
||||
- MIT License, by ExeterDad
|
||||
- `spawn_egg_squid.png`
|
||||
- `spawn_egg_blaze.png`
|
||||
- Author: daufinsyd
|
||||
- `spawn_egg_rabbit.png`
|
||||
- MIT License, by Wuzzy
|
||||
- `mobs_skeleton2.png`
|
||||
- MIT License, originally from Faithful texture pack
|
||||
(see MineClone 2 main readme file), edited by kingoscargames
|
||||
### Subgame integration
|
||||
Want to include this mod in your subgame? Read `gameconfig.md`.
|
||||
|
||||
### Models
|
||||
- `mobs_bunny.b3d`
|
||||
- MIT License, by ExeterDad
|
||||
### Links
|
||||
|
||||
Everything else:
|
||||
* [`mobs_mc`](https://github.com/maikerumine/mobs_mc)
|
||||
* [Blender models](https://github.com/22i/minecraft-voxel-blender-models)
|
||||
* [How to recreate mobs from textures with Blender and Gimp](http://imgur.com/a/Iqg88)
|
||||
|
||||
Faithful 1.11
|
||||
- MIT License, by Vattic, xMrVizzy and contributors
|
||||
## List of mobs
|
||||
|
||||
**Note**: Many of these are incomplete.
|
||||
|
||||
### Monsters
|
||||
|
||||
* Zombie
|
||||
* Husk
|
||||
* Skeleton
|
||||
* Stray
|
||||
* Creeper
|
||||
* Slime
|
||||
* Spider
|
||||
* Cave Spider
|
||||
* Enderman
|
||||
* Zombie Villager
|
||||
* Zombie Pigman
|
||||
* Wither Skeleton
|
||||
* Magma Cube
|
||||
* Blaze
|
||||
* Ghast
|
||||
* Evoker
|
||||
* Vex
|
||||
* Vindicator
|
||||
* Witch
|
||||
* Guardian
|
||||
* Silverfish
|
||||
* Endermite
|
||||
* Shulker
|
||||
* Ender Dragon
|
||||
* Wither
|
||||
* Elder Guardian
|
||||
|
||||
### Peaceful mobs
|
||||
|
||||
* Chicken
|
||||
* Cow
|
||||
* Pig
|
||||
* Rabbit
|
||||
* Sheep
|
||||
* Squid
|
||||
* Polar Bear
|
||||
* Bat
|
||||
* Mooshroom
|
||||
* Horse
|
||||
* Donkey
|
||||
* Llama
|
||||
* Mule
|
||||
* Skeleton Horse
|
||||
* Zombie Horse
|
||||
|
||||
### Helpful mobs
|
||||
|
||||
* Wolf
|
||||
* Villager
|
||||
* Iron golem
|
||||
* Snow golem
|
||||
* Ocelot/Cat
|
||||
* Parrot
|
||||
|
66
mods/ENTITIES/mobs_mc/bat.lua
Normal file
66
mods/ENTITIES/mobs_mc/bat.lua
Normal file
@ -0,0 +1,66 @@
|
||||
--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")
|
||||
|
||||
mobs:register_mob("mobs_mc:bat", {
|
||||
type = "animal",
|
||||
passive = true,
|
||||
hp_min = 6,
|
||||
hp_max = 6,
|
||||
collisionbox = {-0.25, -0.01, -0.25, 0.25, 0.89, 0.25},
|
||||
visual = "mesh",
|
||||
mesh = "mobs_mc_bat.b3d",
|
||||
textures = {
|
||||
{"mobs_mc_bat.png"},
|
||||
},
|
||||
visual_size = {x=1, y=1},
|
||||
sounds = {
|
||||
random = "mobs_rat", -- TODO: This sound is supposed to be very high-pitched and scary
|
||||
distance = 16,
|
||||
},
|
||||
walk_velocity = 4.5,
|
||||
run_velocity = 6.0,
|
||||
-- TODO: Hang upside down
|
||||
animation = {
|
||||
walk_speed = 80, stand_speed = 80, run_speed = 80,
|
||||
stand_start = 0, stand_end = 40,
|
||||
walk_start = 0, walk_end = 40,
|
||||
run_start = 0, run_end = 40,
|
||||
},
|
||||
|
||||
water_damage = 1,
|
||||
lava_damage = 4,
|
||||
light_damage = 0,
|
||||
fall_damage = 0,
|
||||
view_range = 16,
|
||||
|
||||
fly = true,
|
||||
fly_in = "air",
|
||||
})
|
||||
|
||||
|
||||
-- Spawning
|
||||
|
||||
--[[ If the game has been launched between the 20th of October and the 3rd of November system time,
|
||||
-- the maximum spawn light level is increased. ]]
|
||||
local date = os.date("*t")
|
||||
local maxlight
|
||||
if (date.month == 10 and date.day >= 20) or (date.month == 11 and date.day <= 3) then
|
||||
maxlight = 6
|
||||
else
|
||||
maxlight = 3
|
||||
end
|
||||
|
||||
-- Spawn on solid blocks at or below Sea level and the selected light level
|
||||
mobs:spawn_specific("mobs_mc:bat", mobs_mc.spawn.solid,{"air"},0, maxlight, 20, 5000, 2, -500, 0)
|
||||
|
||||
|
||||
-- spawn eggs
|
||||
mobs:register_egg("mobs_mc:bat", S("Bat"), "mobs_mc_spawn_icon_bat.png", 0)
|
||||
|
||||
|
||||
if minetest.settings:get_bool("log_mods") then
|
||||
minetest.log("action", "MC Bat loaded")
|
||||
end
|
@ -3,37 +3,40 @@
|
||||
-- Model and mobs_blaze.png see https://github.com/22i/minecraft-voxel-blender-models
|
||||
-- blaze.lua partial copy of mobs_mc/ghast.lua
|
||||
|
||||
|
||||
-- intllib
|
||||
local MP = minetest.get_modpath(minetest.get_current_modname())
|
||||
local S, NS = dofile(MP.."/intllib.lua")
|
||||
|
||||
--dofile(minetest.get_modpath("mobs").."/api.lua")
|
||||
|
||||
--###################
|
||||
--################### BLAZE
|
||||
--###################
|
||||
|
||||
|
||||
mobs:register_mob("mobs_mc:blaze", {
|
||||
type = "monster",
|
||||
hp_min = 20,
|
||||
hp_max = 20,
|
||||
collisionbox = {-0.4, 0.4, -0.4, 0.4, 1.9, 0.4},
|
||||
textures = {
|
||||
{"mobs_blaze.png"}
|
||||
},
|
||||
collisionbox = {-0.3, -0.01, -0.3, 0.3, 1.79, 0.3},
|
||||
rotate = -180,
|
||||
visual = "mesh",
|
||||
mesh = "mobs_blaze.b3d",
|
||||
makes_footstep_sound = true,
|
||||
mesh = "mobs_mc_blaze.b3d",
|
||||
textures = {
|
||||
{"mobs_mc_blaze.png"},
|
||||
},
|
||||
visual_size = {x=3, y=3},
|
||||
sounds = {
|
||||
random = "blaze_breath",
|
||||
death = "blaze_died",
|
||||
damage = "blaze_hurt1",
|
||||
attack = "default_punch3",
|
||||
random = "mobs_mc_blaze_breath",
|
||||
death = "mobs_mc_blaze_died",
|
||||
damage = "mobs_mc_blaze_hurt",
|
||||
distance = 16,
|
||||
},
|
||||
walk_velocity = .8,
|
||||
run_velocity = 1.6,
|
||||
damage = 2.5,
|
||||
damage = 6,
|
||||
pathfinding = 1,
|
||||
group_attack = true,
|
||||
armor = 80,
|
||||
drops = {
|
||||
{name = "mcl_mobitems:blaze_rod",
|
||||
{name = mobs_mc.items.blaze_rod,
|
||||
chance = 1,
|
||||
min = 0,
|
||||
max = 1,},
|
||||
@ -48,26 +51,26 @@ mobs:register_mob("mobs_mc:blaze", {
|
||||
shoot_start = 1,
|
||||
shoot_end = 40,
|
||||
},
|
||||
drawtype = "front",
|
||||
-- MC Wiki: 1 damage every half second
|
||||
-- MC Wiki: takes 1 damage every half second while in water
|
||||
water_damage = 2,
|
||||
lava_damage = 0,
|
||||
fall_damage = 0,
|
||||
fall_speed = -2.25,
|
||||
light_damage = 0,
|
||||
view_range = 16,
|
||||
attack_type = "shoot",
|
||||
attack_type = "dogshoot",
|
||||
arrow = "mobs_mc:blaze_fireball",
|
||||
shoot_interval = 3.5,
|
||||
passive = false,
|
||||
jump = true,
|
||||
jump_height = 4,
|
||||
floats = 1,
|
||||
fly = true,
|
||||
jump_chance = 98,
|
||||
fear_height = 120,
|
||||
blood_amount = 0,
|
||||
})
|
||||
|
||||
mobs:register_spawn("mobs_mc:blaze", {"mcl_core:lava_flowing", "mcl_nether:netherrack","air"}, 30, -1, 5000, 1, -1000)
|
||||
mobs:register_spawn("mobs_mc:blaze", mobs_mc.spawn.nether_fortress, minetest.LIGHT_MAX+1, 0, 5000, 1, -1000, true)
|
||||
|
||||
-- Blaze fireball
|
||||
mobs:register_arrow("mobs_mc:blaze_fireball", {
|
||||
@ -82,7 +85,6 @@ mobs:register_arrow("mobs_mc:blaze_fireball", {
|
||||
full_punch_interval = 1.0,
|
||||
damage_groups = {fleshy = 5},
|
||||
}, nil)
|
||||
mcl_hunger.exhaust(player:get_player_name(), mcl_hunger.EXHAUST_DAMAGE)
|
||||
end,
|
||||
|
||||
hit_mob = function(self, player)
|
||||
@ -96,15 +98,19 @@ mobs:register_arrow("mobs_mc:blaze_fireball", {
|
||||
hit_node = function(self, pos, node)
|
||||
local pos_above = {x=pos.x, y=pos.y+1, z=pos.z}
|
||||
if minetest.registered_nodes[minetest.get_node(pos_above).name].buildable_to then
|
||||
minetest.set_node(pos_above, {name="mcl_fire:fire"})
|
||||
minetest.set_node(pos_above, {name=mobs_mc.items.fire})
|
||||
end
|
||||
end
|
||||
})
|
||||
|
||||
-- spawn eggs
|
||||
mobs:register_egg("mobs_mc:blaze", "Spawn Blaze", "spawn_egg_blaze.png")
|
||||
mobs:register_egg("mobs_mc:blaze", S("Blaze"), "mobs_mc_spawn_icon_blaze.png", 0)
|
||||
|
||||
|
||||
if minetest.setting_get("log_mods") then
|
||||
|
||||
|
||||
|
||||
|
||||
if minetest.settings:get_bool("log_mods") then
|
||||
minetest.log("action", "MC Blaze loaded")
|
||||
end
|
||||
|
@ -1,107 +1,105 @@
|
||||
--MCmobs v0.2
|
||||
--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")
|
||||
|
||||
--###################
|
||||
--################### CHICKEN
|
||||
--###################
|
||||
|
||||
|
||||
|
||||
mobs:register_mob("mobs_mc:chicken", {
|
||||
type = "animal",
|
||||
|
||||
hp_min = 4,
|
||||
hp_max = 4,
|
||||
-- The x/z size is slightly bigger than in Minecraft (MC: 0.4×0.4; MCL2: 0.5×0.5)
|
||||
collisionbox = {-0.25, -0.01, -0.25, 0.25, 0.69, 0.25},
|
||||
|
||||
collisionbox = {-0.2, -0.01, -0.2, 0.2, 0.69, 0.2},
|
||||
runaway = true,
|
||||
floats = 1,
|
||||
visual = "mesh",
|
||||
visual_size = {x=0.7, y=0.7},
|
||||
mesh = "mobs_mc_chicken.x",
|
||||
mesh = "mobs_mc_chicken.b3d",
|
||||
textures = {
|
||||
{"mobs_mc_chicken.png"}
|
||||
{"mobs_mc_chicken.png"},
|
||||
},
|
||||
visual_size = {x=2.2, y=2.2},
|
||||
|
||||
makes_footstep_sound = true,
|
||||
walk_velocity = 1,
|
||||
armor = 100,
|
||||
drops = {
|
||||
{name = "mcl_mobitems:chicken",
|
||||
{name = mobs_mc.items.chicken_raw,
|
||||
chance = 1,
|
||||
min = 1,
|
||||
max = 1,},
|
||||
{name = "mcl_mobitems:feather",
|
||||
{name = mobs_mc.items.feather,
|
||||
chance = 1,
|
||||
min = 0,
|
||||
max = 2,},
|
||||
},
|
||||
drawtype = "front",
|
||||
lava_damage = minetest.registered_nodes["mcl_core:lava_source"].damage_per_second,
|
||||
water_damage = 1,
|
||||
lava_damage = 4,
|
||||
light_damage = 0,
|
||||
fall_damage = false,
|
||||
fear_height = 4,
|
||||
jump_height = 4.5,
|
||||
fall_damage = 0,
|
||||
fall_speed = -2.25,
|
||||
sounds = {
|
||||
random = "mobs_chicken",
|
||||
death = "Chickenhurt1",
|
||||
hurt = "Chickenhurt1",
|
||||
death = "Chickenhurt1", -- TODO: replace
|
||||
damage = "Chickenhurt1", -- TODO: replace
|
||||
distance = 16,
|
||||
},
|
||||
animation = {
|
||||
speed_normal = 24,
|
||||
stand_start = 0,
|
||||
stand_end = 23,
|
||||
walk_start = 24,
|
||||
walk_end = 49,
|
||||
hurt_start = 118,
|
||||
hurt_end = 154,
|
||||
death_start = 154,
|
||||
death_end = 179,
|
||||
eat_start = 49,
|
||||
eat_end = 78,
|
||||
look_start = 78,
|
||||
look_end = 108,
|
||||
fly_start = 181,
|
||||
fly_end = 187,
|
||||
stand_speed = 25, walk_speed = 25, run_speed = 50,
|
||||
stand_start = 0, stand_end = 0,
|
||||
walk_start = 0, walk_end = 40,
|
||||
run_start = 0, run_end = 40,
|
||||
},
|
||||
--from mobs_animals
|
||||
follow = {"mcl_farming:wheat_seeds", "mcl_farming:beetroot_seeds", "mcl_farming:pumpkin_seeds", "mcl_farming:melon_seeds"},
|
||||
view_range = 5,
|
||||
|
||||
follow = mobs_mc.follow.chicken,
|
||||
view_range = 16,
|
||||
fear_height = 4,
|
||||
|
||||
on_rightclick = function(self, clicker)
|
||||
|
||||
if mobs:feed_tame(self, clicker, 1, true, true) then
|
||||
return
|
||||
end
|
||||
if mobs:feed_tame(self, clicker, 1, true, true) then return end
|
||||
if mobs:protect(self, clicker) then return end
|
||||
if mobs:capture_mob(self, clicker, 0, 60, 5, false, nil) then return end
|
||||
end,
|
||||
|
||||
do_custom = function(self)
|
||||
do_custom = function(self, dtime)
|
||||
|
||||
self.egg_timer = (self.egg_timer or 0) + dtime
|
||||
if self.egg_timer < 10 then
|
||||
return
|
||||
end
|
||||
self.egg_timer = 0
|
||||
|
||||
if self.child
|
||||
or math.random(1, 5000) > 1 then
|
||||
or math.random(1, 100) > 1 then
|
||||
return
|
||||
end
|
||||
|
||||
local pos = self.object:getpos()
|
||||
|
||||
minetest.add_item(pos, "mcl_throwing:egg")
|
||||
minetest.add_item(pos, mobs_mc.items.egg)
|
||||
|
||||
minetest.sound_play("mobs_mc_chicken_lay_egg", {
|
||||
pos = pos,
|
||||
gain = 1.0,
|
||||
max_hear_distance = 5,
|
||||
max_hear_distance = 16,
|
||||
})
|
||||
end,
|
||||
|
||||
})
|
||||
|
||||
mobs:register_spawn("mobs_mc:chicken", {"mcl_core:dirt_with_grass"}, 20, 9, 7000, 1, 31000)
|
||||
|
||||
|
||||
-- compatibility
|
||||
mobs:alias_mob("mobs:chicken", "mobs_mc:chicken")
|
||||
--spawn
|
||||
mobs:register_spawn("mobs_mc:chicken", mobs_mc.spawn.grassland, minetest.LIGHT_MAX+1, 9, 17000, 3, 31000)
|
||||
|
||||
-- spawn eggs
|
||||
mobs:register_egg("mobs_mc:chicken", "Spawn Chicken", "spawn_egg_chicken.png")
|
||||
mobs:register_egg("mobs_mc:chicken", S("Chicken"), "mobs_mc_spawn_icon_chicken.png", 0)
|
||||
|
||||
|
||||
if minetest.setting_get("log_mods") then
|
||||
if minetest.settings:get_bool("log_mods") then
|
||||
minetest.log("action", "MC chicken loaded")
|
||||
end
|
||||
|
150
mods/ENTITIES/mobs_mc/cow+mooshroom.lua
Normal file
150
mods/ENTITIES/mobs_mc/cow+mooshroom.lua
Normal file
@ -0,0 +1,150 @@
|
||||
--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")
|
||||
|
||||
local cow_def = {
|
||||
type = "animal",
|
||||
hp_min = 10,
|
||||
hp_max = 10,
|
||||
collisionbox = {-0.45, -0.01, -0.45, 0.45, 1.39, 0.45},
|
||||
visual = "mesh",
|
||||
mesh = "mobs_mc_cow.b3d",
|
||||
textures = {
|
||||
{"mobs_mc_cow.png"},
|
||||
},
|
||||
visual_size = {x=2.8, y=2.8},
|
||||
makes_footstep_sound = true,
|
||||
walk_velocity = 1,
|
||||
drops = {
|
||||
{name = mobs_mc.items.beef_raw,
|
||||
chance = 1,
|
||||
min = 1,
|
||||
max = 3,},
|
||||
{name = mobs_mc.items.leather,
|
||||
chance = 1,
|
||||
min = 0,
|
||||
max = 2,},
|
||||
},
|
||||
water_damage = 1,
|
||||
lava_damage = 5,
|
||||
light_damage = 0,
|
||||
runaway = true,
|
||||
sounds = {
|
||||
random = "mobs_mc_cow",
|
||||
death = "Cowhurt1", -- TODO: Replace
|
||||
damage = "Cowhurt1", -- TODO: Replace
|
||||
distance = 16,
|
||||
},
|
||||
animation = {
|
||||
stand_speed = 25, walk_speed = 25, run_speed = 50,
|
||||
stand_start = 0, stand_end = 0,
|
||||
walk_start = 0, walk_end = 40,
|
||||
run_start = 0, run_end = 40,
|
||||
},
|
||||
follow = mobs_mc.follow.cow,
|
||||
on_rightclick = function(self, clicker)
|
||||
if mobs:feed_tame(self, clicker, 1, true, true) then return end
|
||||
if mobs:protect(self, clicker) then return end
|
||||
|
||||
if self.child then
|
||||
return
|
||||
end
|
||||
|
||||
local item = clicker:get_wielded_item()
|
||||
if item:get_name() == mobs_mc.items.bucket and clicker:get_inventory() then
|
||||
local inv = clicker:get_inventory()
|
||||
inv:remove_item("main", mobs_mc.items.bucket)
|
||||
-- if room add bucket of milk to inventory, otherwise drop as item
|
||||
if inv:room_for_item("main", {name=mobs_mc.items.milk}) then
|
||||
clicker:get_inventory():add_item("main", mobs_mc.items.milk)
|
||||
else
|
||||
local pos = self.object:getpos()
|
||||
pos.y = pos.y + 0.5
|
||||
minetest.add_item(pos, {name = mobs_mc.items.milk})
|
||||
end
|
||||
return
|
||||
end
|
||||
mobs:capture_mob(self, clicker, 0, 5, 60, false, nil)
|
||||
end,
|
||||
follow = mobs_mc.items.wheat,
|
||||
view_range = 10,
|
||||
fear_height = 4,
|
||||
}
|
||||
|
||||
mobs:register_mob("mobs_mc:cow", cow_def)
|
||||
|
||||
-- Mooshroom
|
||||
local mooshroom_def = table.copy(cow_def)
|
||||
|
||||
mooshroom_def.mesh = "mobs_mc_cow.b3d"
|
||||
mooshroom_def.textures = { {"mobs_mc_mooshroom.png^mobs_mc_mooshroom_mooshroom.png"}, }
|
||||
mooshroom_def.on_rightclick = function(self, clicker)
|
||||
if mobs:feed_tame(self, clicker, 1, true, true) then return end
|
||||
if mobs:protect(self, clicker) then return end
|
||||
|
||||
if self.child then
|
||||
return
|
||||
end
|
||||
local item = clicker:get_wielded_item()
|
||||
-- Use shears to get mushrooms and turn mooshroom into cow
|
||||
if item:get_name() == mobs_mc.items.shears then
|
||||
local pos = self.object:getpos()
|
||||
minetest.sound_play("shears", {pos = pos})
|
||||
minetest.add_item({x=pos.x, y=pos.y+1.4, z=pos.z}, mobs_mc.items.mushroom_red .. " 5")
|
||||
|
||||
local oldyaw = self.object:getyaw()
|
||||
self.object:remove()
|
||||
local cow = minetest.add_entity(pos, "mobs_mc:cow")
|
||||
cow:setyaw(oldyaw)
|
||||
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
item:add_wear(mobs_mc.misc.shears_wear)
|
||||
clicker:get_inventory():set_stack("main", clicker:get_wield_index(), item)
|
||||
end
|
||||
-- Use bucket to milk
|
||||
elseif item:get_name() == mobs_mc.items.bucket and clicker:get_inventory() then
|
||||
local inv = clicker:get_inventory()
|
||||
inv:remove_item("main", mobs_mc.items.bucket)
|
||||
-- If room, add milk to inventory, otherwise drop as item
|
||||
if inv:room_for_item("main", {name=mobs_mc.items.milk}) then
|
||||
clicker:get_inventory():add_item("main", mobs_mc.items.milk)
|
||||
else
|
||||
local pos = self.object:getpos()
|
||||
pos.y = pos.y + 0.5
|
||||
minetest.add_item(pos, {name = mobs_mc.items.milk})
|
||||
end
|
||||
-- Use bowl to get mushroom stew
|
||||
elseif item:get_name() == mobs_mc.items.bowl and clicker:get_inventory() then
|
||||
local inv = clicker:get_inventory()
|
||||
inv:remove_item("main", mobs_mc.items.bowl)
|
||||
-- If room, add mushroom stew to inventory, otherwise drop as item
|
||||
if inv:room_for_item("main", {name=mobs_mc.items.mushroom_stew}) then
|
||||
clicker:get_inventory():add_item("main", mobs_mc.items.mushroom_stew)
|
||||
else
|
||||
local pos = self.object:getpos()
|
||||
pos.y = pos.y + 0.5
|
||||
minetest.add_item(pos, {name = mobs_mc.items.mushroom_stew})
|
||||
end
|
||||
end
|
||||
mobs:capture_mob(self, clicker, 0, 5, 60, false, nil)
|
||||
end
|
||||
mobs:register_mob("mobs_mc:mooshroom", mooshroom_def)
|
||||
|
||||
|
||||
-- Spawning
|
||||
mobs:register_spawn("mobs_mc:cow", mobs_mc.spawn.grassland, minetest.LIGHT_MAX+1, 9, 17000, 20, 31000)
|
||||
mobs:register_spawn("mobs_mc:mooshroom", mobs_mc.spawn.mushroom_island, minetest.LIGHT_MAX+1, 9, 17000, 10, 31000)
|
||||
|
||||
|
||||
-- compatibility
|
||||
mobs:alias_mob("mobs_animal:cow", "mobs_mc:cow")
|
||||
|
||||
-- spawn egg
|
||||
mobs:register_egg("mobs_mc:cow", S("Cow"), "mobs_mc_spawn_icon_cow.png", 0)
|
||||
mobs:register_egg("mobs_mc:mooshroom", S("Mooshroom"), "mobs_mc_spawn_icon_mooshroom.png", 0)
|
||||
|
||||
if minetest.setting_get("log_mods") then
|
||||
minetest.log("action", "MC Cow loaded")
|
||||
end
|
@ -1,104 +0,0 @@
|
||||
--MCmobs v0.2
|
||||
--maikerumine
|
||||
--made for MC like Survival game
|
||||
--License for code WTFPL and otherwise stated in readmes
|
||||
|
||||
mobs:register_mob("mobs_mc:cow", {
|
||||
type = "animal",
|
||||
hp_min = 10,
|
||||
hp_max = 10,
|
||||
collisionbox = {-0.8, -0.01, -0.8, 0.8, 1.8, 0.8},
|
||||
|
||||
visual = "mesh",
|
||||
mesh = "mobs_mc_cow.x",
|
||||
textures = {
|
||||
{"mobs_mc_cow.png"}
|
||||
},
|
||||
makes_footstep_sound = true,
|
||||
walk_velocity = 1,
|
||||
armor = 100,
|
||||
drops = {
|
||||
{name = "mcl_mobitems:beef",
|
||||
chance = 1,
|
||||
min = 1,
|
||||
max = 3,},
|
||||
{name = "mcl_mobitems:leather",
|
||||
chance = 1,
|
||||
min = 0,
|
||||
max = 2,},
|
||||
},
|
||||
drawtype = "front",
|
||||
lava_damage = minetest.registered_nodes["mcl_core:lava_source"].damage_per_second,
|
||||
light_damage = 0,
|
||||
fear_height = 3,
|
||||
sounds = {
|
||||
random = "mobs_mc_cow",
|
||||
death = "Cowhurt1",
|
||||
damage = "Cowhurt1",
|
||||
},
|
||||
animation = {
|
||||
speed_normal = 24,
|
||||
stand_start = 0,
|
||||
stand_end = 23,
|
||||
walk_start = 24,
|
||||
walk_end = 49,
|
||||
hurt_start = 118,
|
||||
hurt_end = 154,
|
||||
death_start = 154,
|
||||
death_end = 179,
|
||||
eat_start = 49,
|
||||
eat_end = 78,
|
||||
look_start = 78,
|
||||
look_end = 108,
|
||||
},
|
||||
--from mobs_animals
|
||||
follow = "mcl_farming:wheat_item",
|
||||
view_range = 10,
|
||||
fear_height = 2,
|
||||
jump_height = 1.25,
|
||||
on_rightclick = function(self, clicker)
|
||||
|
||||
-- feed or tame
|
||||
if mobs:feed_tame(self, clicker, 1, true, true) then
|
||||
return
|
||||
end
|
||||
|
||||
local tool = clicker:get_wielded_item()
|
||||
|
||||
-- milk cow with empty bucket
|
||||
if tool:get_name() == "bucket:bucket_empty" then
|
||||
|
||||
if self.child == true then
|
||||
return
|
||||
end
|
||||
|
||||
local inv = clicker:get_inventory()
|
||||
|
||||
inv:remove_item("main", "bucket:bucket_empty")
|
||||
|
||||
if inv:room_for_item("main", {name = "mcl_mobitems:milk_bucket"}) then
|
||||
clicker:get_inventory():add_item("main", "mcl_mobitems:milk_bucket")
|
||||
else
|
||||
local pos = self.object:getpos()
|
||||
pos.y = pos.y + 0.5
|
||||
minetest.add_item(pos, {name = "mcl_mobitems:milk_bucket"})
|
||||
end
|
||||
|
||||
return
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
mobs:register_spawn("mobs_mc:cow", {"mcl_core:dirt_with_grass"}, 20, 9, 7000, 1, 31000)
|
||||
|
||||
|
||||
-- compatibility
|
||||
mobs:alias_mob("mobs:cow", "mobs_mc:cow")
|
||||
|
||||
-- spawn egg
|
||||
mobs:register_egg("mobs_mc:cow", "Spawn Cow", "spawn_egg_cow.png")
|
||||
|
||||
|
||||
if minetest.setting_get("log_mods") then
|
||||
minetest.log("action", "MC Cow loaded")
|
||||
end
|
@ -1,52 +1,98 @@
|
||||
--MCmobs v0.2
|
||||
--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")
|
||||
|
||||
|
||||
--###################
|
||||
--################### CREEPER
|
||||
--###################
|
||||
|
||||
|
||||
|
||||
|
||||
mobs:register_mob("mobs_mc:creeper", {
|
||||
type = "monster",
|
||||
hp_min = 20,
|
||||
hp_max = 20,
|
||||
collisionbox = {-0.4, -0.01, -0.4, 0.4, 1.6, 0.4},
|
||||
collisionbox = {-0.3, -0.01, -0.3, 0.3, 1.69, 0.3},
|
||||
pathfinding = 1,
|
||||
group_attack = true,
|
||||
visual = "mesh",
|
||||
visual_size = {x=.75, y=.75, z=.75},
|
||||
mesh = "mobs_creeper.x",
|
||||
mesh = "mobs_mc_creeper.b3d",
|
||||
textures = {
|
||||
{"mobs_creeper.png"}
|
||||
{"mobs_mc_creeper.png"},
|
||||
},
|
||||
makes_footstep_sound = false,
|
||||
visual_size = {x=3, y=3},
|
||||
sounds = {
|
||||
attack = "tnt_ignite",
|
||||
death = "Creeperdeath",
|
||||
damage = "Creeper4",
|
||||
death = "Creeperdeath", -- TODO: Replace
|
||||
damage = "Creeper4", -- TODO: Replce
|
||||
war_cry = "tnt_ignite",
|
||||
explode = "tnt_explode",
|
||||
distance = 16,
|
||||
},
|
||||
makes_footstep_sound = true,
|
||||
walk_velocity = 1.5,
|
||||
run_velocity = 3,
|
||||
damage = 1,
|
||||
attack_type = "explode",
|
||||
|
||||
explosion_radius = 3,
|
||||
armor = 100,
|
||||
maxdrops = 3,
|
||||
-- TODO: Disable Mobs Redo fire
|
||||
|
||||
-- Force-ignite creeper with flint and steel and explode after 1.5 seconds.
|
||||
-- TODO: Make creeper flash after doing this as well.
|
||||
-- TODO: Test and debug this code.
|
||||
on_rightclick = function(self, clicker)
|
||||
if self._forced_explosion_countdown_timer ~= nil then
|
||||
return
|
||||
end
|
||||
local item = clicker:get_wielded_item()
|
||||
if item:get_name() == mobs_mc.items.flint_and_steel then
|
||||
if not minetest.settings:get_bool("creative_mode") then
|
||||
-- Wear tool
|
||||
local wdef = item:get_definition()
|
||||
item:add_wear(1000)
|
||||
-- Tool break sound
|
||||
if itemstack:get_count() == 0 and wdef.sound and wdef.sound.breaks then
|
||||
minetest.sound_play(wdef.sound.breaks, {pos = pt.above, gain = 0.5})
|
||||
end
|
||||
clicker:set_wielded_item(item)
|
||||
end
|
||||
self._forced_explosion_countdown_timer = 1.5
|
||||
minetest.sound_play(self.sounds.attack, {pos = self.object:getpos(), gain = 1, max_hear_distance = 16})
|
||||
end
|
||||
end,
|
||||
do_custom = function(self, dtime)
|
||||
if self._forced_explosion_countdown_timer ~= nil then
|
||||
self._forced_explosion_countdown_timer = self._forced_explosion_countdown_timer - dtime
|
||||
if self._forced_explosion_countdown_timer <= 0 then
|
||||
mobs:explosion(self.object:getpos(), self.explosion_radius, 0, 1, self.sounds.explode)
|
||||
self.object:remove()
|
||||
end
|
||||
end
|
||||
end,
|
||||
on_die = function(self, pos)
|
||||
-- Drop a random music disc
|
||||
-- TODO: Only do this if killed by skeleton
|
||||
if math.random(1, 200) == 1 then
|
||||
local r = math.random(1, #mobs_mc.items.music_discs)
|
||||
minetest.add_item({x=pos.x, y=pos.y+1, z=pos.z}, mobs_mc.items.music_discs[r])
|
||||
end
|
||||
end,
|
||||
maxdrops = 2,
|
||||
drops = {
|
||||
{name = "mcl_mobitems:gunpowder",
|
||||
{name = mobs_mc.items.gunpowder,
|
||||
chance = 1,
|
||||
min = 0,
|
||||
max = 2,},
|
||||
-- TODO: In Minecraft, record discs only drop when a creeper got killed by a skeleton's arrow
|
||||
{name = "mcl_jukebox:record_6",
|
||||
chance = 100,
|
||||
min = 1,
|
||||
max = 1,},
|
||||
{name = "mcl_jukebox:record_7",
|
||||
chance = 125,
|
||||
|
||||
-- Head
|
||||
-- TODO: Only drop if killed by charged creeper
|
||||
{name = mobs_mc.items.head_creeper,
|
||||
chance = 200, -- 0.5%
|
||||
min = 1,
|
||||
max = 1,},
|
||||
},
|
||||
@ -66,23 +112,24 @@ mobs:register_mob("mobs_mc:creeper", {
|
||||
look_start = 50,
|
||||
look_end = 108,
|
||||
},
|
||||
drawtype = "front",
|
||||
lava_damage = minetest.registered_nodes["mcl_core:lava_source"].damage_per_second,
|
||||
floats = 1,
|
||||
fear_height = 4,
|
||||
water_damage = 1,
|
||||
lava_damage = 4,
|
||||
light_damage = 0,
|
||||
view_range = 16,
|
||||
attack_type = "explode",
|
||||
blood_amount = 0,
|
||||
})
|
||||
mobs:register_spawn("mobs_mc:creeper", {"group:solid"}, 7, -1, 5000, 4, 31000)
|
||||
|
||||
|
||||
mobs:spawn_specific("mobs_mc:creeper", mobs_mc.spawn.solid, {"air"},0, 7, 20, 16500, 1, -310, 31000)
|
||||
|
||||
-- compatibility
|
||||
mobs:alias_mob("mobs:creeper", "mobs_mc:creeper")
|
||||
|
||||
-- spawn eggs
|
||||
mobs:register_egg("mobs_mc:creeper", "Spawn Creeper", "spawn_egg_creeper.png")
|
||||
mobs:register_egg("mobs_mc:creeper", S("Creeper"), "mobs_mc_spawn_icon_creeper.png", 0)
|
||||
|
||||
|
||||
if minetest.setting_get("log_mods") then
|
||||
if minetest.settings:get_bool("log_mods") then
|
||||
minetest.log("action", "MC Creeper loaded")
|
||||
end
|
||||
|
@ -1,8 +1,11 @@
|
||||
mcl_core
|
||||
mcl_tools
|
||||
mcl_hunger
|
||||
mcl_fire
|
||||
default?
|
||||
mobs
|
||||
mcl_tnt
|
||||
mcl_mobitems
|
||||
3d_armor?
|
||||
tnt?
|
||||
mcl_throwing?
|
||||
throwing?
|
||||
fishing?
|
||||
bones?
|
||||
mesecons_materials?
|
||||
mobs_mc_gameconfig?
|
||||
intllib?
|
||||
doc_items?
|
||||
|
@ -1 +1 @@
|
||||
Adds Minecraft-like monsters and animals.
|
||||
Adds MC like monsters and animals.
|
182
mods/ENTITIES/mobs_mc/ender_dragon.lua
Normal file
182
mods/ENTITIES/mobs_mc/ender_dragon.lua
Normal file
@ -0,0 +1,182 @@
|
||||
--###################
|
||||
--################### ENDERDRAGON
|
||||
--###################
|
||||
|
||||
-- intllib
|
||||
local MP = minetest.get_modpath(minetest.get_current_modname())
|
||||
local S, NS = dofile(MP.."/intllib.lua")
|
||||
|
||||
--[[
|
||||
mobs:register_mob("mobs_mc:12enderdragon", {
|
||||
type = "animal",
|
||||
passive = true,
|
||||
runaway = true,
|
||||
stepheight = 1.2,
|
||||
hp_min = 30,
|
||||
hp_max = 60,
|
||||
armor = 150,
|
||||
collisionbox = {-0.35, -0.01, -0.35, 0.35, 2, 0.35},
|
||||
visual = "mesh",
|
||||
mesh = "enderdragon.b3d",
|
||||
textures = {
|
||||
{"enderdragon.png"},
|
||||
},
|
||||
visual_size = {x=1, y=1},
|
||||
walk_velocity = 0.6,
|
||||
run_velocity = 2,
|
||||
jump = true,
|
||||
animation = {
|
||||
speed_normal = 25, speed_run = 50,
|
||||
stand_start = 0, stand_end = 20,
|
||||
walk_start = 0, walk_end = 20,
|
||||
run_start = 0, run_end = 20,
|
||||
},
|
||||
})
|
||||
|
||||
mobs:register_egg("mobs_mc:12enderdragon", "Enderdragon", "enderdragon_inv.png", 0)
|
||||
]]
|
||||
mobs:register_mob("mobs_mc:enderdragon", {
|
||||
type = "monster",
|
||||
pathfinding = 1,
|
||||
attacks_animals = true,
|
||||
walk_chance = 100,
|
||||
hp_max = 200,
|
||||
hp_min = 200,
|
||||
collisionbox = {-2, 3, -2, 2, 5, 2},
|
||||
physical = false,
|
||||
visual = "mesh",
|
||||
mesh = "mobs_mc_dragon.b3d",
|
||||
textures = {
|
||||
{"mobs_mc_dragon.png"},
|
||||
},
|
||||
visual_size = {x=3, y=3},
|
||||
view_range = 35,
|
||||
walk_velocity = 6,
|
||||
run_velocity = 6,
|
||||
sounds = {
|
||||
shoot_attack = "mobs_mc_ender_dragon_shoot",
|
||||
attack = "mobs_mc_ender_dragon_attack",
|
||||
distance = 60,
|
||||
},
|
||||
physical = true,
|
||||
damage = 10,
|
||||
jump = true,
|
||||
jump_height = 14,
|
||||
stepheight = 1.2,
|
||||
jump_chance = 100,
|
||||
fear_height = 120,
|
||||
fly = true,
|
||||
fly_in = {"air"},
|
||||
dogshoot_switch = 1,
|
||||
dogshoot_count_max =5,
|
||||
dogshoot_count2_max = 5,
|
||||
passive = false,
|
||||
attack_animals = true,
|
||||
drops = {
|
||||
{name = mobs_mc.items.dragon_egg,
|
||||
chance = 1,
|
||||
min = 1,
|
||||
max = 1},
|
||||
},
|
||||
water_damage = 0,
|
||||
lava_damage = 0,
|
||||
light_damage = 0,
|
||||
on_rightclick = nil,
|
||||
attack_type = "dogshoot",
|
||||
arrow = "mobs_mc:fireball2",
|
||||
shoot_interval = 0.5,
|
||||
shoot_offset = -1,
|
||||
animation = {
|
||||
fly_speed = 8, stand_speed = 8,
|
||||
stand_start = 0, stand_end = 20,
|
||||
walk_start = 0, walk_end = 20,
|
||||
run_start = 0, run_end = 20,
|
||||
},
|
||||
blood_amount = 0,
|
||||
})
|
||||
|
||||
|
||||
|
||||
mobs:register_arrow("mobs_mc:roar_of_the_dragon2", {
|
||||
visual = "sprite",
|
||||
visual_size = {x = 1, y = 1},
|
||||
--textures = {"transparent.png"},
|
||||
textures = {"mese_egg.png"},
|
||||
velocity = 10,
|
||||
|
||||
on_step = function(self, dtime)
|
||||
|
||||
local pos = self.object:getpos()
|
||||
|
||||
local n = minetest.env:get_node(pos).name
|
||||
|
||||
if self.timer == 0 then
|
||||
self.timer = os.time()
|
||||
end
|
||||
|
||||
if os.time() - self.timer > 8 or minetest.is_protected(pos, "") then
|
||||
self.object:remove()
|
||||
end
|
||||
|
||||
local objects = minetest.env:get_objects_inside_radius(pos, 1)
|
||||
for _,obj in ipairs(objects) do
|
||||
local name = obj:get_entity_name()
|
||||
if name~="mobs_mc:roar_of_the_dragon2" and name ~= "mobs_mc:enderdragon" then
|
||||
obj:set_hp(obj:get_hp()-0.05)
|
||||
if (obj:get_hp() <= 0) then
|
||||
if (not obj:is_player()) and name ~= self.object:get_luaentity().name then
|
||||
obj:remove()
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
minetest.env:set_node(pos, {name="air"})
|
||||
if math.random(1,2)==1 then
|
||||
dx = math.random(-1,1)
|
||||
dy = math.random(-1,1)
|
||||
dz = math.random(-1,1)
|
||||
local p = {x=pos.x+dx, y=pos.y+dy, z=pos.z+dz}
|
||||
minetest.env:set_node(p, {name="air"})
|
||||
end
|
||||
end
|
||||
})
|
||||
--GOOD LUCK LOL!
|
||||
-- fireball (weapon)
|
||||
mobs:register_arrow(":mobs_mc:fireball2", {
|
||||
visual = "sprite",
|
||||
visual_size = {x = 1.5, y = 1.5},
|
||||
textures = {"fire_basic_flame.png"},
|
||||
--textures = {"mobs_skeleton2_front.png^[makealpha:255,255,255 "},
|
||||
velocity = 6,
|
||||
|
||||
-- direct hit, no fire... just plenty of pain
|
||||
hit_player = function(self, player)
|
||||
minetest.sound_play("tnt_explode", {pos = pos, gain = 1.5, max_hear_distance = 2*64})
|
||||
player:punch(self.object, 1.0, {
|
||||
full_punch_interval = 0.5,
|
||||
damage_groups = {fleshy = 6},
|
||||
}, nil)
|
||||
|
||||
end,
|
||||
|
||||
hit_mob = function(self, player)
|
||||
minetest.sound_play("tnt_explode", {pos = pos, gain = 1.5, max_hear_distance = 2*64})
|
||||
player:punch(self.object, 1.0, {
|
||||
full_punch_interval = 0.5,
|
||||
damage_groups = {fleshy = 12},
|
||||
}, nil)
|
||||
|
||||
end,
|
||||
|
||||
-- node hit, bursts into flame
|
||||
hit_node = function(self, pos, node)
|
||||
mobs:explosion(pos, 3, 1, 1)
|
||||
--from tnt
|
||||
minetest.sound_play("tnt_explode", {pos = pos, gain = 1.5, max_hear_distance = 2*64})
|
||||
|
||||
end
|
||||
})
|
||||
|
||||
mobs:register_egg("mobs_mc:enderdragon", S("Ender Dragon"), "mobs_mc_spawn_icon_dragon.png", 0)
|
||||
|
@ -1,73 +1,159 @@
|
||||
--MCmobs v0.2
|
||||
--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")
|
||||
|
||||
|
||||
--###################
|
||||
--################### ENDERMAN
|
||||
--###################
|
||||
|
||||
local pr = PseudoRandom(os.time()*(-334))
|
||||
local take_frequency = 10
|
||||
local place_frequency = 10
|
||||
|
||||
mobs:register_mob("mobs_mc:enderman", {
|
||||
type = "monster",
|
||||
runaway = true,
|
||||
pathfinding = 2,
|
||||
stepheight = 1.2,
|
||||
hp_min = 40,
|
||||
hp_max = 40,
|
||||
collisionbox = {-0.4, -1.5, -0.4, 0.4, 1.5, 0.4},
|
||||
pathfinding = 1,
|
||||
collisionbox = {-0.3, -0.01, -0.3, 0.3, 2.89, 0.3},
|
||||
visual = "mesh",
|
||||
mesh = "mobs_sand_monster.b3d",
|
||||
mesh = "mobs_mc_enderman.b3d",
|
||||
textures = {
|
||||
{"mobs_endermen.png"}
|
||||
{"mobs_mc_enderman.png^(mobs_mc_enderman_eyes.png^[makealpha:0,0,0)"},
|
||||
},
|
||||
visual_size = {x=1.5, y=1.6},
|
||||
visual_size = {x=3, y=3},
|
||||
makes_footstep_sound = true,
|
||||
sounds = {
|
||||
random = "mobs_sandmonster",
|
||||
war_cry = "mobs_sandmonster",
|
||||
death = "green_slime_death",
|
||||
damage = "Creeperdeath",
|
||||
distance = 16,
|
||||
},
|
||||
walk_velocity = 3.2,
|
||||
run_velocity = 5.4,
|
||||
damage = 1,
|
||||
armor = 100,
|
||||
walk_velocity = 0.2,
|
||||
run_velocity = 3.4,
|
||||
damage = 7,
|
||||
drops = {
|
||||
{name = "mcl_throwing:ender_pearl",
|
||||
{name = mobs_mc.items.ender_pearl,
|
||||
chance = 1,
|
||||
min = 0,
|
||||
max = 1,},
|
||||
},
|
||||
animation = {
|
||||
speed_normal = 45,
|
||||
speed_run = 15,
|
||||
stand_start = 0,
|
||||
stand_end = 39,
|
||||
walk_start = 41,
|
||||
walk_end = 72,
|
||||
run_start = 74,
|
||||
run_end = 105,
|
||||
punch_start = 74,
|
||||
punch_end = 105,
|
||||
speed_normal = 25, speed_run = 50,
|
||||
stand_start = 40, stand_end = 80,
|
||||
walk_start = 0, walk_end = 40,
|
||||
run_start = 0, run_end = 40,
|
||||
},
|
||||
drawtype = "front",
|
||||
water_damage = 1,
|
||||
lava_damage = minetest.registered_nodes["mcl_core:lava_source"].damage_per_second,
|
||||
_taken_node = "",
|
||||
do_custom = function(self, dtime)
|
||||
-- Take and put nodes
|
||||
if not self._take_place_timer then
|
||||
self._take_place_timer = 0
|
||||
return
|
||||
end
|
||||
self._take_place_timer = self._take_place_timer + dtime
|
||||
if (self._taken_node == nil or self._taken_node == "") and self._take_place_timer >= take_frequency then
|
||||
-- Take random node
|
||||
self._take_place_timer = 0
|
||||
local pos = self.object:getpos()
|
||||
local takable_nodes = minetest.find_nodes_in_area({x=pos.x-2, y=pos.y-1, z=pos.z-2}, {x=pos.x+2, y=pos.y+1, z=pos.z+2}, mobs_mc.enderman_takable)
|
||||
if #takable_nodes >= 1 then
|
||||
local r = pr:next(1, #takable_nodes)
|
||||
local take_pos = takable_nodes[r]
|
||||
local node = minetest.get_node(take_pos)
|
||||
local dug = minetest.dig_node(take_pos)
|
||||
if dug then
|
||||
self._taken_node = node.name
|
||||
-- TODO: Update enderman model (enderman holding block)
|
||||
local def = minetest.registered_nodes[self._taken_node]
|
||||
if def.sounds and def.sounds.dug then
|
||||
minetest.sound_play(def.sounds.dug, {pos = place_pos, max_hear_distance = 16})
|
||||
end
|
||||
end
|
||||
end
|
||||
elseif self._taken_node ~= nil and self._taken_node ~= "" and self._take_place_timer >= place_frequency then
|
||||
-- Place taken node
|
||||
self._take_place_timer = 0
|
||||
local pos = self.object:getpos()
|
||||
local yaw = self.object:get_yaw()
|
||||
-- Place node at looking direction
|
||||
local place_pos = vector.subtract(pos, minetest.facedir_to_dir(minetest.dir_to_facedir(minetest.yaw_to_dir(yaw))))
|
||||
if minetest.get_node(place_pos).name == "air" then
|
||||
-- ... but only if there's a free space
|
||||
minetest.place_node(place_pos, {name = self._taken_node})
|
||||
local def = minetest.registered_nodes[self._taken_node]
|
||||
if def.sounds and def.sounds.place then
|
||||
minetest.sound_play(def.sounds.place, {pos = place_pos, max_hear_distance = 16})
|
||||
end
|
||||
self._taken_node = ""
|
||||
end
|
||||
end
|
||||
end,
|
||||
-- TODO: Teleport enderman on damage, etc.
|
||||
_do_teleport = function(self)
|
||||
-- Attempt to randomly teleport enderman
|
||||
local pos = self.object:getpos()
|
||||
-- Find all solid nodes below air in a 65×65×65 cuboid centered on the enderman
|
||||
local nodes = minetest.find_nodes_in_area_under_air(vector.subtract(pos, 32), vector.add(pos, 32), {"group:solid", "group:cracky", "group:crumbly"})
|
||||
local telepos
|
||||
if #nodes > 0 then
|
||||
-- Up to 64 attempts to teleport
|
||||
for n=1, math.min(64, #nodes) do
|
||||
local r = pr:next(1, #nodes)
|
||||
local nodepos = nodes[r]
|
||||
local node_ok = true
|
||||
-- Selected node needs to have 3 nodes of free space above
|
||||
for u=1, 3 do
|
||||
local node = minetest.get_node({x=nodepos.x, y=nodepos.y+u, z=nodepos.z})
|
||||
if minetest.registered_nodes[node.name].walkable then
|
||||
node_ok = false
|
||||
break
|
||||
end
|
||||
end
|
||||
if node_ok then
|
||||
telepos = {x=nodepos.x, y=nodepos.y+1, z=nodepos.z}
|
||||
end
|
||||
end
|
||||
if telepos then
|
||||
self.object:setpos(telepos)
|
||||
end
|
||||
end
|
||||
end,
|
||||
on_die = function(self, pos)
|
||||
-- Drop carried node on death
|
||||
if self._taken_node ~= nil and self._taken_node ~= "" then
|
||||
minetest.add_item(pos, self._taken_node)
|
||||
end
|
||||
end,
|
||||
water_damage = 8,
|
||||
lava_damage = 4,
|
||||
light_damage = 0,
|
||||
view_range = 16,
|
||||
fear_height = 4,
|
||||
attack_type = "dogfight",
|
||||
replace_rate = 1,
|
||||
replace_what = {"mcl_flowers:allium", "mcl_flowers:azure_bluet", "mcl_flowers:blue_orchid", "mcl_flowers:dandelion", "mcl_flowers:tulip_orange", "mcl_flowers:tulip_red", "mcl_flowers:tulip_pink", "mcl_flowers:tulip_white", "mcl_flowers:oxeye_daisy", "mcl_flowers:poppy", "mcl_core:cactus", "mcl_core:clay", "mcl_core:coarse_dirt", "mcl_core:dirt", "mcl_core:dirt_with_grass", "mcl_core:gravel", "mcl_farming:melon", "mcl_farming:pumpkin_face", "mcl_core:mycelium", "mcl_core:podzol", "mcl_mushrooms:mushroom_red", "mcl_mushrooms:mushroom_brown", "mcl_core:redsand", "mcl_core:sand", "mcl_tnt:tnt", "mcl_nether:netherrack"},
|
||||
replace_with = "air",
|
||||
replace_offset = -1,
|
||||
|
||||
blood_amount = 0,
|
||||
})
|
||||
mobs:register_spawn("mobs_mc:enderman", { "group:solid"}, 7, -1, 6000, 4, 31000)
|
||||
|
||||
|
||||
|
||||
|
||||
--spawn on solid blocks
|
||||
mobs:register_spawn("mobs_mc:enderman", mobs_mc.spawn.desert, 7, 0, 9000, -31000, 31000)
|
||||
mobs:register_spawn("mobs_mc:enderman", mobs_mc.end_city, minetest.LIGHT_MAX+1, 0, 9000, -31000, -5000)
|
||||
-- spawn eggs
|
||||
mobs:register_egg("mobs_mc:enderman", "Spawn Enderman", "spawn_egg_enderman.png")
|
||||
mobs:register_egg("mobs_mc:enderman", S("Enderman"), "mobs_mc_spawn_icon_enderman.png", 0)
|
||||
|
||||
if minetest.settings:get_bool("log_mods") then
|
||||
|
||||
if minetest.setting_get("log_mods") then
|
||||
minetest.log("action", "MC Enderman loaded")
|
||||
end
|
||||
|
||||
|
39
mods/ENTITIES/mobs_mc/endermite.lua
Normal file
39
mods/ENTITIES/mobs_mc/endermite.lua
Normal file
@ -0,0 +1,39 @@
|
||||
--###################
|
||||
--################### ENDERMITE
|
||||
--###################
|
||||
|
||||
-- intllib
|
||||
local MP = minetest.get_modpath(minetest.get_current_modname())
|
||||
local S, NS = dofile(MP.."/intllib.lua")
|
||||
|
||||
mobs:register_mob("mobs_mc:endermite", {
|
||||
type = "monster",
|
||||
passive = false,
|
||||
hp_min = 8,
|
||||
hp_max = 8,
|
||||
armor = 100,
|
||||
group_attack = true,
|
||||
collisionbox = {-0.2, -0.01, -0.2, 0.2, 0.29, 0.2},
|
||||
visual = "mesh",
|
||||
mesh = "mobs_mc_endermite.b3d",
|
||||
textures = {
|
||||
{"mobs_mc_endermite.png"},
|
||||
},
|
||||
visual_size = {x=3, y=3},
|
||||
makes_footstep_sound = false,
|
||||
sounds = {
|
||||
random = "mobs_rat",
|
||||
},
|
||||
walk_velocity = 1,
|
||||
run_velocity = 2,
|
||||
jump = true,
|
||||
water_damage = 0,
|
||||
lava_damage = 4,
|
||||
light_damage = 0,
|
||||
fear_height = 4,
|
||||
view_range = 16,
|
||||
damage = 2,
|
||||
blood_amount = 0,
|
||||
})
|
||||
|
||||
mobs:register_egg("mobs_mc:endermite", S("Endermite"), "mobs_mc_spawn_icon_endermite.png", 0)
|
59
mods/ENTITIES/mobs_mc/gameconfig.md
Normal file
59
mods/ENTITIES/mobs_mc/gameconfig.md
Normal file
@ -0,0 +1,59 @@
|
||||
# Subgame integration help
|
||||
|
||||
This mod has been designed to make subgame integration rather easy. Ideally, it should be possible to include this mod verbatim in your subgame, with modifications only done by an external mod.
|
||||
|
||||
To integrate this mod in a subgame, you have to do 2 things: Adding the mod, and adding another mod which tells `mobs_mc` which items to use. The idea is that `mobs_mc` should work with any items. Specifically, these are the steps you need to follow:
|
||||
|
||||
* Add the `mobs_mc` mod and its dependencies
|
||||
* Add a mod with name “`mobs_mc_gameconfig`”
|
||||
* In this mod, do this:
|
||||
* Do *not* depend on `mobs_mc`
|
||||
* Create the table `mobs_mc`
|
||||
* Create the table `mobs_mc.override`
|
||||
* In `mobs_mc.override`, create subtables (`items`, `spawn`, etc.) like in `0_gameconfig.lua`, defining the na
|
||||
* Read `0_gameconfig.lua` to see which items you can override (and more explanations)
|
||||
* In `on_construct` of a pumpkin or jack'o lantern node, call:
|
||||
* `mobs_mc.tools.check_iron_golem_summon(pos)`
|
||||
* `mobs_mc.tools.check_snow_golem_summon(pos)`
|
||||
* For more information, see `snowman.lua` and `iron_golem.lua`
|
||||
|
||||
Some things to note:
|
||||
|
||||
* Every override is optional, but explicitly setting all the item overrides is strongly recommended
|
||||
* `mobs_mc` ships many (but not all) items on its own. If not item name override is set, the `mobs_mc` item is used
|
||||
* You decide whether your subgame defines its own items, outside of `mobs_mc` or if you let `mobs_mc` do the work.
|
||||
* Make sure to avoid duplicate items!
|
||||
* After finishing this, throughly test this
|
||||
* Without `mobs_mc_gameconfig`, the mod assumes Minetest Game items
|
||||
* `mobs_mc` optionally depends on `mobs_mc_gameconfig`
|
||||
|
||||
## Example `init.lua` in `mobs_mc_gameconfig`
|
||||
```
|
||||
mobs_mc = {}
|
||||
|
||||
mobs_mc.override = {}
|
||||
|
||||
-- Set the item names here
|
||||
mobs_mc.override.items = {
|
||||
blaze_rod = "mcl_mobitems:blaze_rod",
|
||||
blaze_powder = "mcl_mobitems:blaze_powder",
|
||||
chicken_raw = "mcl_mobitems:chicken",
|
||||
-- And so on ...
|
||||
}
|
||||
|
||||
-- Set the “follow” field of mobs (used for attracting mob, feeding and breeding)
|
||||
mobs_mc.override.follow = {
|
||||
chicken = { "mcl_farming:wheat_seeds", "mcl_farming:melon_seeds", "mcl_farming:pumpkin_seeds", "mcl_farming:beetroot_seeds", },
|
||||
horse = { "mcl_core:apple", mobs_mc.override.items.wheat }, -- TODO
|
||||
pig = { "mcl_farming:potato", mobs_mc.override.items.carrot, mobs_mc.override.items.carrot_on_a_stick},
|
||||
-- And so on ...
|
||||
}
|
||||
|
||||
-- Custom spawn nodes
|
||||
mobs_mc.override.spawn = {
|
||||
snow = { "example:snow", "example:snow2" },
|
||||
-- And so on ...
|
||||
}
|
||||
|
||||
-- Take a look at the other possible tables, see 0_gameconfig.lua
|
||||
```
|
@ -1,26 +1,32 @@
|
||||
--MCmobs v0.2
|
||||
--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")
|
||||
|
||||
--###################
|
||||
--################### GHAST
|
||||
--###################
|
||||
|
||||
|
||||
mobs:register_mob("mobs_mc:ghast", {
|
||||
type = "monster",
|
||||
pathfinding = 1,
|
||||
group_attack = true,
|
||||
hp_min = 10,
|
||||
hp_max = 10,
|
||||
collisionbox = {-1.45, -1.45, -1.45 ,1.45, 1.45, 1.45},
|
||||
visual_size = {x=3.0, y=3.0},
|
||||
collisionbox = {-2, 5, -2, 2, 9, 2},
|
||||
visual = "mesh",
|
||||
mesh = "mobs_mc_ghast.b3d",
|
||||
textures = {
|
||||
{"ghast_white.png", "ghast_white.png", "ghast_front.png", "ghast_white.png", "ghast_white.png", "ghast_white.png"}
|
||||
{"mobs_mc_ghast.png"},
|
||||
},
|
||||
visual = "cube",
|
||||
blood_texture ="mobs_blood.png",
|
||||
rotate = 270,
|
||||
makes_footstep_sound = true,
|
||||
visual_size = {x=12, y=12},
|
||||
sounds = {
|
||||
shoot = "mobs_fireball",
|
||||
death = "zombiedeath",
|
||||
@ -28,42 +34,31 @@ mobs:register_mob("mobs_mc:ghast", {
|
||||
attack = "mobs_fireball",
|
||||
random = "mobs_eerie",
|
||||
},
|
||||
walk_velocity = .8,
|
||||
run_velocity = 2.6,
|
||||
damage = 1,
|
||||
armor = 100,
|
||||
walk_velocity = 1.6,
|
||||
run_velocity = 3.2,
|
||||
drops = {
|
||||
{name = "mcl_mobitems:ghast_tear",
|
||||
chance = 1,
|
||||
min = 0,
|
||||
max = 1,},
|
||||
{name = "mcl_mobitems:gunpowder",
|
||||
{name = mobs_mc.items.gunpowder,
|
||||
chance = 1,
|
||||
min = 0,
|
||||
max = 2,},
|
||||
{name = mobs_mc.items.ghast_tear,
|
||||
chance = 1,
|
||||
min = 0,
|
||||
max = 1,},
|
||||
},
|
||||
animation = {
|
||||
speed_normal = 24,
|
||||
speed_run = 48,
|
||||
stand_start = 0,
|
||||
stand_end = 23,
|
||||
walk_start = 24,
|
||||
walk_end = 47,
|
||||
run_start = 48,
|
||||
run_end = 62,
|
||||
hurt_start = 64,
|
||||
hurt_end = 86,
|
||||
death_start = 88,
|
||||
death_end = 118,
|
||||
stand_speed = 50, walk_speed = 50, run_speed = 50,
|
||||
stand_start = 0, stand_end = 40,
|
||||
walk_start = 0, walk_end = 40,
|
||||
run_start = 0, run_end = 40,
|
||||
},
|
||||
drawtype = "front",
|
||||
lava_damage = 0,
|
||||
lava_damage = 4,
|
||||
light_damage = 0,
|
||||
fall_damage = 0,
|
||||
view_range = 100,
|
||||
--attack_type = "dogshoot",
|
||||
attack_type = "dogshoot",
|
||||
arrow = "mobs_mc:ghast_fireball",
|
||||
arrow = "mobs_monster:fireball",
|
||||
shoot_interval = 3.5,
|
||||
shoot_offset = 1,
|
||||
--'dogshoot_switch' allows switching between shoot and dogfight modes inside dogshoot using timer (1 = shoot, 2 = dogfight)
|
||||
@ -75,17 +70,19 @@ mobs:register_mob("mobs_mc:ghast", {
|
||||
jump_height = 4,
|
||||
floats=1,
|
||||
fly = true,
|
||||
fly_in = {"air"},
|
||||
jump_chance = 98,
|
||||
fear_height = 120,
|
||||
blood_amount = 0,
|
||||
})
|
||||
|
||||
|
||||
mobs:register_spawn("mobs_mc:ghast", {"mcl_core:lava_flowing", "mcl_nether:netherrack", "air"}, 17, -1, 5000, 1, -2000)
|
||||
|
||||
-- Ghast fireball
|
||||
mobs:register_arrow("mobs_mc:ghast_fireball", {
|
||||
--mobs:register_spawn("mobs_mc:ghast", {"default:flowing_lava", "nether:rack","air"}, 17, -1, 5000, 1, -2000)
|
||||
mobs:spawn_specific("mobs_mc:ghast", mobs_mc.spawn.nether, {"air"},0, minetest.LIGHT_MAX+1, 0, 18000, 2, -3610, -2100)
|
||||
-- fireball (weapon)
|
||||
mobs:register_arrow(":mobs_monster:fireball", {
|
||||
visual = "sprite",
|
||||
visual_size = {x = 0.8, y = 0.8},
|
||||
visual_size = {x = 0.5, y = 0.5},
|
||||
textures = {"mcl_fire_fire_charge.png"},
|
||||
velocity = 6,
|
||||
|
||||
@ -93,15 +90,14 @@ mobs:register_arrow("mobs_mc:ghast_fireball", {
|
||||
hit_player = function(self, player)
|
||||
player:punch(self.object, 1.0, {
|
||||
full_punch_interval = 1.0,
|
||||
damage_groups = {fleshy = 6},
|
||||
damage_groups = {fleshy = 8},
|
||||
}, nil)
|
||||
mcl_hunger.exhaust(player:get_player_name(), mcl_hunger.EXHAUST_DAMAGE)
|
||||
end,
|
||||
|
||||
hit_mob = function(self, player)
|
||||
player:punch(self.object, 1.0, {
|
||||
full_punch_interval = 1.0,
|
||||
damage_groups = {fleshy = 6},
|
||||
damage_groups = {fleshy = 8},
|
||||
}, nil)
|
||||
end,
|
||||
|
||||
@ -113,10 +109,10 @@ mobs:register_arrow("mobs_mc:ghast_fireball", {
|
||||
|
||||
|
||||
|
||||
|
||||
-- spawn eggs
|
||||
mobs:register_egg("mobs_mc:ghast", "Spawn Ghast", "spawn_egg_ghast.png")
|
||||
mobs:register_egg("mobs_mc:ghast", S("Ghast"), "mobs_mc_spawn_icon_ghast.png", 0)
|
||||
|
||||
|
||||
if minetest.setting_get("log_mods") then
|
||||
if minetest.settings:get_bool("log_mods") then
|
||||
minetest.log("action", "MC Ghast loaded")
|
||||
end
|
||||
|
86
mods/ENTITIES/mobs_mc/guardian.lua
Normal file
86
mods/ENTITIES/mobs_mc/guardian.lua
Normal file
@ -0,0 +1,86 @@
|
||||
-- v1.4
|
||||
|
||||
--###################
|
||||
--################### GUARDIAN
|
||||
--###################
|
||||
|
||||
-- intllib
|
||||
local MP = minetest.get_modpath(minetest.get_current_modname())
|
||||
local S, NS = dofile(MP.."/intllib.lua")
|
||||
|
||||
mobs:register_mob("mobs_mc:guardian", {
|
||||
type = "monster",
|
||||
hp_min = 30,
|
||||
hp_max = 30,
|
||||
passive = false,
|
||||
attack_type = "dogfight",
|
||||
pathfinding = 1,
|
||||
view_range = 16,
|
||||
walk_velocity = 2,
|
||||
run_velocity = 4,
|
||||
damage = 6,
|
||||
collisionbox = {-0.425, 0.25, -0.425, 0.425, 1.1, 0.425},
|
||||
visual = "mesh",
|
||||
mesh = "mobs_mc_guardian.b3d",
|
||||
textures = {
|
||||
{"mobs_mc_guardian.png"},
|
||||
},
|
||||
visual_size = {x=3, y=3},
|
||||
sounds = {
|
||||
damage = "mobs_mc_squid_hurt",
|
||||
distance = 16,
|
||||
},
|
||||
animation = {
|
||||
stand_speed = 25, walk_speed = 25, run_speed = 50,
|
||||
stand_start = 0, stand_end = 20,
|
||||
walk_start = 0, walk_end = 20,
|
||||
run_start = 0, run_end = 20,
|
||||
},
|
||||
drops = {
|
||||
{name = mobs_mc.items.prismarine_shard,
|
||||
chance = 1,
|
||||
min = 0,
|
||||
max = 2,},
|
||||
|
||||
-- The following drops are approximations
|
||||
-- Fish / prismarine crystal
|
||||
{name = mobs_mc.items.fish_raw,
|
||||
chance = 4,
|
||||
min = 1,
|
||||
max = 1,},
|
||||
{name = mobs_mc.items.prismarine_crystals,
|
||||
chance = 4,
|
||||
min = 1,
|
||||
max = 1,},
|
||||
|
||||
-- Rare drop: fish
|
||||
{name = mobs_mc.items.fish_raw,
|
||||
chance = 160, -- 2.5% / 4
|
||||
min = 1,
|
||||
max = 1,},
|
||||
{name = mobs_mc.items.salmon_raw,
|
||||
chance = 160,
|
||||
min = 1,
|
||||
max = 1,},
|
||||
{name = mobs_mc.items.clownfish_raw,
|
||||
chance = 160,
|
||||
min = 1,
|
||||
max = 1,},
|
||||
{name = mobs_mc.items.pufferfish_raw,
|
||||
chance = 160,
|
||||
min = 1,
|
||||
max = 1,},
|
||||
},
|
||||
fly = true,
|
||||
fly_in = mobs_mc.items.water_source,
|
||||
view_range = 16,
|
||||
water_damage = 0,
|
||||
lava_damage = 4,
|
||||
light_damage = 0,
|
||||
blood_amount = 0,
|
||||
})
|
||||
|
||||
mobs:register_spawn("mobs_mc:guardian", mobs_mc.spawn.water, minetest.LIGHT_MAX+1, 0, 5000, 2, -1000, true)
|
||||
|
||||
-- spawn eggs
|
||||
mobs:register_egg("mobs_mc:guardian", S("Guardian"), "mobs_mc_spawn_icon_guardian.png", 0)
|
92
mods/ENTITIES/mobs_mc/guardian_elder.lua
Normal file
92
mods/ENTITIES/mobs_mc/guardian_elder.lua
Normal file
@ -0,0 +1,92 @@
|
||||
-- v1.4
|
||||
|
||||
--###################
|
||||
--################### GUARDIAN
|
||||
--###################
|
||||
|
||||
-- intllib
|
||||
local MP = minetest.get_modpath(minetest.get_current_modname())
|
||||
local S, NS = dofile(MP.."/intllib.lua")
|
||||
|
||||
mobs:register_mob("mobs_mc:guardian_elder", {
|
||||
type = "monster",
|
||||
hp_min = 80,
|
||||
hp_max = 80,
|
||||
passive = false,
|
||||
attack_type = "dogfight",
|
||||
pathfinding = 1,
|
||||
view_range = 16,
|
||||
walk_velocity = 2,
|
||||
run_velocity = 4,
|
||||
damage = 8,
|
||||
collisionbox = {-0.99875, 0.5, -0.99875, 0.99875, 2.4975, 0.99875},
|
||||
visual = "mesh",
|
||||
mesh = "mobs_mc_guardian.b3d",
|
||||
textures = {
|
||||
{"mobs_mc_guardian_elder.png"},
|
||||
},
|
||||
visual_size = {x=7, y=7},
|
||||
sounds = {
|
||||
damage = "mobs_mc_squid_hurt",
|
||||
distance = 16,
|
||||
},
|
||||
animation = {
|
||||
stand_speed = 25, walk_speed = 25, run_speed = 50,
|
||||
stand_start = 0, stand_end = 20,
|
||||
walk_start = 0, walk_end = 20,
|
||||
run_start = 0, run_end = 20,
|
||||
},
|
||||
drops = {
|
||||
{name = mobs_mc.items.prismarine_shard,
|
||||
chance = 1,
|
||||
min = 0,
|
||||
max = 2,},
|
||||
-- TODO: Only drop if killed by player
|
||||
{name = mobs_mc.items.wet_sponge,
|
||||
chance = 1,
|
||||
min = 1,
|
||||
max = 1,},
|
||||
|
||||
-- The following drops are approximations
|
||||
-- Fish / prismarine crystal
|
||||
{name = mobs_mc.items.fish_raw,
|
||||
chance = 4,
|
||||
min = 1,
|
||||
max = 1,},
|
||||
{name = mobs_mc.items.prismarine_crystals,
|
||||
chance = 4,
|
||||
min = 1,
|
||||
max = 1,},
|
||||
|
||||
-- Rare drop: fish
|
||||
{name = mobs_mc.items.fish_raw,
|
||||
chance = 160, -- 2.5% / 4
|
||||
min = 1,
|
||||
max = 1,},
|
||||
{name = mobs_mc.items.salmon_raw,
|
||||
chance = 160,
|
||||
min = 1,
|
||||
max = 1,},
|
||||
{name = mobs_mc.items.clownfish_raw,
|
||||
chance = 160,
|
||||
min = 1,
|
||||
max = 1,},
|
||||
{name = mobs_mc.items.pufferfish_raw,
|
||||
chance = 160,
|
||||
min = 1,
|
||||
max = 1,},
|
||||
},
|
||||
fly = true,
|
||||
fly_in = mobs_mc.items.water_source,
|
||||
water_damage = 0,
|
||||
lava_damage = 4,
|
||||
light_damage = 0,
|
||||
view_range = 16,
|
||||
blood_amount = 0,
|
||||
})
|
||||
|
||||
mobs:register_spawn("mobs_mc:guardian_elder", mobs_mc.spawn.water, minetest.LIGHT_MAX+1, 0, 5000, 2, -1000, true)
|
||||
|
||||
-- spawn eggs
|
||||
mobs:register_egg("mobs_mc:guardian_elder", S("Elder Guardian"), "mobs_mc_spawn_icon_guardian_elder.png", 0)
|
||||
|
349
mods/ENTITIES/mobs_mc/horse.lua
Normal file
349
mods/ENTITIES/mobs_mc/horse.lua
Normal file
@ -0,0 +1,349 @@
|
||||
--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")
|
||||
|
||||
--###################
|
||||
--################### HORSE
|
||||
--###################
|
||||
|
||||
-- Return overlay texture for horse/donkey/mule, e.g. chest, saddle or horse armor
|
||||
local horse_extra_texture = function(horse)
|
||||
local base = horse._naked_texture
|
||||
local saddle = horse._saddle
|
||||
local chest = horse._chest
|
||||
local armor = horse._horse_armor
|
||||
if armor then
|
||||
if minetest.get_item_group(armor, "horse_armor") > 0 then
|
||||
base = base .. "^" .. minetest.registered_items[armor]._horse_overlay_image
|
||||
end
|
||||
end
|
||||
if saddle then
|
||||
base = base .. "^mobs_mc_horse_saddle.png"
|
||||
end
|
||||
if chest then
|
||||
base = base .. "^mobs_mc_horse_chest.png"
|
||||
end
|
||||
return base
|
||||
end
|
||||
|
||||
-- Helper functions to determine equipment rules
|
||||
local can_equip_horse_armor = function(entity_id)
|
||||
return entity_id == "mobs_mc:horse" or entity_id == "mobs_mc:skeleton_horse" or entity_id == "mobs_mc:zombie_horse"
|
||||
end
|
||||
local can_equip_chest = function(entity_id)
|
||||
return entity_id == "mobs_mc:mule" or entity_id == "mobs_mc:donkey"
|
||||
end
|
||||
local can_breed = function(entity_id)
|
||||
return entity_id == "mobs_mc:horse" or "mobs_mc:mule" or entity_id == "mobs_mc:donkey"
|
||||
end
|
||||
|
||||
--[[ Generate all possible horse textures.
|
||||
Horse textures are a combination of a base texture and an optional marking overlay. ]]
|
||||
-- The base horse textures
|
||||
local horse_base = {
|
||||
"mobs_mc_horse_brown.png",
|
||||
"mobs_mc_horse_darkbrown.png",
|
||||
"mobs_mc_horse_white.png",
|
||||
"mobs_mc_horse_gray.png",
|
||||
"mobs_mc_horse_black.png",
|
||||
"mobs_mc_horse_chestnut.png",
|
||||
}
|
||||
-- Horse marking texture overlay, to be appended to the base texture string
|
||||
local horse_markings = {
|
||||
"", -- no markings
|
||||
"^mobs_mc_horse_markings_whitedots.png", -- snowflake appaloosa
|
||||
"^mobs_mc_horse_markings_blackdots.png", -- sooty
|
||||
"^mobs_mc_horse_markings_whitefield.png", -- paint
|
||||
"^mobs_mc_horse_markings_white.png", -- stockings and blaze
|
||||
}
|
||||
|
||||
local horse_textures = {}
|
||||
for b=1, #horse_base do
|
||||
for m=1, #horse_markings do
|
||||
table.insert(horse_textures, { horse_base[b] .. horse_markings[m] })
|
||||
end
|
||||
end
|
||||
|
||||
-- Horse
|
||||
local horse = {
|
||||
type = "animal",
|
||||
visual = "mesh",
|
||||
mesh = "mobs_mc_horse.b3d",
|
||||
visual_size = {x=3.0, y=3.0},
|
||||
collisionbox = {-0.69825, -0.01, -0.69825, 0.69825, 1.59, 0.69825},
|
||||
animation = {
|
||||
stand_speed = 25, walk_speed = 25, run_speed = 50,
|
||||
stand_start = 0, stand_end = 0,
|
||||
walk_start = 0, walk_end = 40,
|
||||
run_start = 0, run_end = 40,
|
||||
},
|
||||
textures = horse_textures,
|
||||
fear_height = 4,
|
||||
fly = false,
|
||||
walk_chance = 60,
|
||||
view_range = 16,
|
||||
follow = mobs_mc.follow.horse,
|
||||
passive = true,
|
||||
hp_min = 15,
|
||||
hp_max = 30,
|
||||
floats = 1,
|
||||
lava_damage = 4,
|
||||
water_damage = 1,
|
||||
makes_footstep_sound = true,
|
||||
jump = true,
|
||||
jump_height = 5.75, -- can clear 2.5 blocks
|
||||
drops = {
|
||||
{name = mobs_mc.items.leather,
|
||||
chance = 1,
|
||||
min = 0,
|
||||
max = 2,},
|
||||
},
|
||||
|
||||
do_custom = function(self, dtime)
|
||||
|
||||
-- set needed values if not already present
|
||||
if not self._regentimer then
|
||||
self._regentimer = 0
|
||||
end
|
||||
if not self.v2 then
|
||||
self.v2 = 0
|
||||
self.max_speed_forward = 7
|
||||
self.max_speed_reverse = 2
|
||||
self.accel = 6
|
||||
self.terrain_type = 3
|
||||
self.driver_attach_at = {x = 0, y = 7.5, z = -1.75}
|
||||
self.driver_eye_offset = {x = 0, y = 3, z = 0}
|
||||
self.driver_scale = {x = 1/self.visual_size.x, y = 1/self.visual_size.y}
|
||||
end
|
||||
|
||||
-- Slowly regenerate health
|
||||
self._regentimer = self._regentimer + dtime
|
||||
if self._regentimer >= 4 then
|
||||
if self.health < self.hp_max then
|
||||
self.health = self.health + 1
|
||||
end
|
||||
self._regentimer = 0
|
||||
end
|
||||
|
||||
-- if driver present allow control of horse
|
||||
if self.driver then
|
||||
|
||||
mobs.drive(self, "walk", "stand", false, dtime)
|
||||
|
||||
return false -- skip rest of mob functions
|
||||
end
|
||||
|
||||
return true
|
||||
end,
|
||||
|
||||
on_die = function(self, pos)
|
||||
|
||||
-- drop saddle when horse is killed while riding
|
||||
if self._saddle then
|
||||
minetest.add_item(pos, mobs_mc.items.saddle)
|
||||
end
|
||||
-- also detach from horse properly
|
||||
if self.driver then
|
||||
mobs.detach(self.driver, {x = 1, y = 0, z = 1})
|
||||
end
|
||||
|
||||
end,
|
||||
|
||||
on_rightclick = function(self, clicker)
|
||||
|
||||
-- make sure player is clicking
|
||||
if not clicker or not clicker:is_player() then
|
||||
return
|
||||
end
|
||||
|
||||
local item = clicker:get_wielded_item()
|
||||
if can_breed(self.name) and (item:get_name() == mobs_mc.items.golden_apple or item:get_name() == mobs_mc.items.golden_carrot) then
|
||||
-- Breed horse with golden apple or golden carrot
|
||||
if mobs:feed_tame(self, clicker, 1, true, false) then return end
|
||||
end
|
||||
-- Feed/tame with anything else
|
||||
-- TODO: Different health bonus for feeding
|
||||
if mobs:feed_tame(self, clicker, 1, false, true) then return end
|
||||
if mobs:protect(self, clicker) then return end
|
||||
|
||||
-- Make sure tamed horse is mature and being clicked by owner only
|
||||
if self.tamed and not self.child and self.owner == clicker:get_player_name() then
|
||||
|
||||
local inv = clicker:get_inventory()
|
||||
|
||||
-- detatch player already riding horse
|
||||
if self.driver and clicker == self.driver then
|
||||
|
||||
mobs.detach(clicker, {x = 1, y = 0, z = 1})
|
||||
|
||||
-- Put on saddle if tamed
|
||||
elseif not self.driver and not self._saddle
|
||||
and clicker:get_wielded_item():get_name() == mobs_mc.items.saddle then
|
||||
|
||||
-- Put on saddle and take saddle from player's inventory
|
||||
local w = clicker:get_wielded_item()
|
||||
self._saddle = true
|
||||
if not minetest.settings:get_bool("creative_mode") then
|
||||
w:take_item()
|
||||
clicker:set_wielded_item(w)
|
||||
end
|
||||
|
||||
-- Update texture
|
||||
if not self._naked_texture then
|
||||
-- Base horse texture without chest or saddle
|
||||
self._naked_texture = self.base_texture[1]
|
||||
end
|
||||
local tex = horse_extra_texture(self)
|
||||
self.base_texture = { tex }
|
||||
self.object:set_properties({textures = self.base_texture})
|
||||
|
||||
-- Put on horse armor if tamed
|
||||
elseif can_equip_horse_armor(self.name) and not self.driver and not self._horse_armor
|
||||
and minetest.get_item_group(clicker:get_wielded_item():get_name(), "horse_armor") > 0 then
|
||||
|
||||
|
||||
-- Put on armor and take armor from player's inventory
|
||||
local w = clicker:get_wielded_item()
|
||||
local armor = minetest.get_item_group(w:get_name(), "horse_armor")
|
||||
self._horse_armor = w:get_name()
|
||||
if not minetest.settings:get_bool("creative_mode") then
|
||||
w:take_item()
|
||||
clicker:set_wielded_item(w)
|
||||
end
|
||||
|
||||
-- Set horse armor strength
|
||||
--[[ WARNING: This goes deep into the entity data structure and depends on
|
||||
how Mobs Redo works internally. This code assumes that Mobs Redo uses
|
||||
the fleshy group for armor. ]]
|
||||
-- TODO: Change this code as soon Mobs Redo officially allows to change armor afterwards
|
||||
self.armor = armor
|
||||
local agroups = self.object:get_armor_groups()
|
||||
agroups.fleshy = self.armor
|
||||
self.object:set_armor_groups(agroups)
|
||||
|
||||
-- Update texture
|
||||
if not self._naked_texture then
|
||||
-- Base horse texture without chest or saddle
|
||||
self._naked_texture = self.base_texture[1]
|
||||
end
|
||||
local tex = horse_extra_texture(self)
|
||||
self.base_texture = { tex }
|
||||
self.object:set_properties({textures = self.base_texture})
|
||||
|
||||
|
||||
-- Mount horse
|
||||
elseif not self.driver and self._saddle then
|
||||
|
||||
self.object:set_properties({stepheight = 1.1})
|
||||
mobs.attach(self, clicker)
|
||||
|
||||
-- Used to capture horse
|
||||
elseif not self.driver and clicker:get_wielded_item():get_name() ~= "" then
|
||||
mobs:capture_mob(self, clicker, 0, 5, 60, false, nil)
|
||||
end
|
||||
end
|
||||
end
|
||||
}
|
||||
|
||||
mobs:register_mob("mobs_mc:horse", horse)
|
||||
|
||||
-- Skeleton horse
|
||||
local skeleton_horse = table.copy(horse)
|
||||
skeleton_horse.textures = {{"mobs_mc_horse_skeleton.png"}}
|
||||
skeleton_horse.drops = {
|
||||
{name = mobs_mc.items.bone,
|
||||
chance = 1,
|
||||
min = 0,
|
||||
max = 2,},
|
||||
}
|
||||
skeleton_horse.sounds = {
|
||||
random = "skeleton1",
|
||||
death = "skeletondeath",
|
||||
damage = "skeletonhurt1",
|
||||
distance = 16,
|
||||
}
|
||||
skeleton_horse.blood_amount = 0
|
||||
mobs:register_mob("mobs_mc:skeleton_horse", skeleton_horse)
|
||||
|
||||
-- Zombie horse
|
||||
local zombie_horse = table.copy(horse)
|
||||
zombie_horse.textures = {{"mobs_mc_horse_zombie.png"}}
|
||||
zombie_horse.drops = {
|
||||
{name = mobs_mc.items.rotten_flesh,
|
||||
chance = 1,
|
||||
min = 0,
|
||||
max = 2,},
|
||||
}
|
||||
zombie_horse.sounds = {
|
||||
random = "zombie1",
|
||||
death = "zombiedeath",
|
||||
damage = "zombiehurt1",
|
||||
distance = 16,
|
||||
}
|
||||
mobs:register_mob("mobs_mc:zombie_horse", zombie_horse)
|
||||
|
||||
-- Donkey
|
||||
local d = 0.86 -- donkey scale
|
||||
local donkey = table.copy(horse)
|
||||
donkey.textures = {{"mobs_mc_donkey.png"}}
|
||||
donkey.animation = {
|
||||
speed_normal = 25,
|
||||
stand_start = 0, stand_end = 0,
|
||||
walk_start = 0, walk_end = 40,
|
||||
}
|
||||
donkey.visual_size = { x=horse.visual_size.x*d, y=horse.visual_size.y*d }
|
||||
donkey.collisionbox = {
|
||||
horse.collisionbox[1] * d,
|
||||
horse.collisionbox[2] * d,
|
||||
horse.collisionbox[3] * d,
|
||||
horse.collisionbox[4] * d,
|
||||
horse.collisionbox[5] * d,
|
||||
horse.collisionbox[6] * d,
|
||||
}
|
||||
donkey.jump = true
|
||||
donkey.jump_height = 3.75 -- can clear 1 block height
|
||||
|
||||
mobs:register_mob("mobs_mc:donkey", donkey)
|
||||
|
||||
-- Mule
|
||||
local m = 0.94
|
||||
local mule = table.copy(donkey)
|
||||
mule.textures = {{"mobs_mc_mule.png"}}
|
||||
mule.visual_size = { x=horse.visual_size.x*m, y=horse.visual_size.y*m }
|
||||
mule.collisionbox = {
|
||||
horse.collisionbox[1] * m,
|
||||
horse.collisionbox[2] * m,
|
||||
horse.collisionbox[3] * m,
|
||||
horse.collisionbox[4] * m,
|
||||
horse.collisionbox[5] * m,
|
||||
horse.collisionbox[6] * m,
|
||||
}
|
||||
mobs:register_mob("mobs_mc:mule", mule)
|
||||
|
||||
--===========================
|
||||
--Spawn Function
|
||||
mobs:register_spawn("mobs_mc:horse", mobs_mc.spawn.grassland_savanna, minetest.LIGHT_MAX+1, 0, 15000, 12, 31000)
|
||||
mobs:register_spawn("mobs_mc:donkey", mobs_mc.spawn.grassland_savanna, minetest.LIGHT_MAX+1, 0, 15000, 12, 31000)
|
||||
|
||||
|
||||
-- compatibility
|
||||
mobs:alias_mob("mobs:horse", "mobs_mc:horse")
|
||||
|
||||
-- spawn eggs
|
||||
mobs:register_egg("mobs_mc:horse", S("Horse"), "mobs_mc_spawn_icon_horse.png", 0)
|
||||
mobs:register_egg("mobs_mc:skeleton_horse", S("Skeleton Horse"), "mobs_mc_spawn_icon_horse_skeleton.png", 0)
|
||||
mobs:register_egg("mobs_mc:zombie_horse", S("Zombie Horse"), "mobs_mc_spawn_icon_horse_zombie.png", 0)
|
||||
mobs:register_egg("mobs_mc:donkey", S("Donkey"), "mobs_mc_spawn_icon_donkey.png", 0)
|
||||
mobs:register_egg("mobs_mc:mule", S("Mule"), "mobs_mc_spawn_icon_mule.png", 0)
|
||||
|
||||
|
||||
if minetest.settings:get_bool("log_mods") then
|
||||
minetest.log("action", "MC Horse loaded")
|
||||
end
|
@ -1,33 +1,117 @@
|
||||
--MCmobs v0.2
|
||||
--MCmobs v0.4
|
||||
--maikerumine
|
||||
--made for MC like Survival game
|
||||
--License for code WTFPL and otherwise stated in readmes
|
||||
|
||||
local path = minetest.get_modpath("mobs_mc")
|
||||
|
||||
if not minetest.get_modpath("mobs_mc_gameconfig") then
|
||||
mobs_mc = {}
|
||||
end
|
||||
|
||||
-- For utility functions
|
||||
mobs_mc.tools = {}
|
||||
|
||||
-- This function checks if the item ID has been overwritten and returns true if it is unchanged
|
||||
if minetest.get_modpath("mobs_mc_gameconfig") and mobs_mc.override and mobs_mc.override.items then
|
||||
mobs_mc.is_item_variable_overridden = function(id)
|
||||
return mobs_mc.override.items[id] == nil
|
||||
end
|
||||
else
|
||||
-- No items are overwritten, so always return true
|
||||
mobs_mc.is_item_variable_overridden = function(id)
|
||||
return true
|
||||
end
|
||||
end
|
||||
|
||||
--MOB ITEMS SELECTOR SWITCH
|
||||
dofile(path .. "/0_gameconfig.lua")
|
||||
--Items
|
||||
dofile(path .. "/1_items_default.lua")
|
||||
|
||||
--IN CASE THROWING IS NOT INSTALLED, THIS FIXES IT
|
||||
if not minetest.get_modpath("throwing") then
|
||||
dofile(minetest.get_modpath("mobs_mc").."/2_throwing.lua")
|
||||
minetest.register_alias("throwing:bow_wood", "mobs:bow_wood")
|
||||
minetest.register_alias("throwing:arrow", "mobs:arrow")
|
||||
mobs:alias_mob("throwing:arrow_entity", "mobs:arrow_entity")
|
||||
else
|
||||
minetest.register_alias("_:bow_wood", "throwing:bow_wood")
|
||||
minetest.register_alias("_:arrow", "throwing:arrow")
|
||||
mobs:alias_mob("_:arrow_entity", "throwing:arrow_entity")
|
||||
end
|
||||
|
||||
if not minetest.get_modpath("mcl_throwing") then
|
||||
dofile(minetest.get_modpath("mobs_mc").."/2_throwing.lua")
|
||||
minetest.register_alias("throwing:bow_wood", "mcl_throwing:bow")
|
||||
minetest.register_alias("throwing:arrow", "mcl_throwing:arrow")
|
||||
mobs:alias_mob("throwing:arrow_entity", "mcl_throwing:arrow_entity")
|
||||
else
|
||||
minetest.register_alias("_:bow", "throwing:bow_wood")
|
||||
minetest.register_alias("_:arrow", "throwing:arrow")
|
||||
mobs:alias_mob("_:arrow_entity", "throwing:arrow_entity")
|
||||
end
|
||||
-- Shared functions
|
||||
dofile(path .. "/3_shared.lua")
|
||||
|
||||
--Mob heads
|
||||
dofile(path .. "/4_heads.lua")
|
||||
|
||||
-- Animals
|
||||
dofile(path .. "/rabbit.lua") -- ExeterDad
|
||||
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
|
||||
dofile(path .. "/cow.lua") -- Mesh by Morn76 Animation by Pavel_S
|
||||
dofile(path .. "/sheep.lua") -- Mesh and animation by Pavel_S
|
||||
dofile(path .. "/cow+mooshroom.lua") -- Mesh by Morn76 Animation by Pavel_S
|
||||
dofile(path .. "/horse.lua") -- KrupnoPavel; Mesh and animation by toby109tt / https://github.com/22i
|
||||
dofile(path .. "/llama.lua") -- Mesh and animation by toby109tt / https://github.com/22i
|
||||
dofile(path .. "/ocelot.lua") -- Mesh and animation by toby109tt / https://github.com/22i
|
||||
dofile(path .. "/parrot.lua") -- Mesh and animation by toby109tt / https://github.com/22i
|
||||
dofile(path .. "/pig.lua") -- Mesh and animation by Pavel_S
|
||||
dofile(path .. "/polar_bear.lua") -- Mesh and animation by toby109tt / https://github.com/22i
|
||||
dofile(path .. "/sheep.lua") -- Mesh and animation by Pavel_S
|
||||
dofile(path .. "/wolf.lua") -- KrupnoPavel
|
||||
dofile(path .. "/squid.lua") -- Animation, sound and egg texture by daufinsyd
|
||||
|
||||
-- NPC
|
||||
dofile(path .. "/villager.lua") -- KrupnoPavel
|
||||
dofile(path .. "/villager.lua") -- KrupnoPavel Mesh and animation by toby109tt / https://github.com/22i
|
||||
--dofile(path .. "/villager_agent.lua") -- Mesh and animation by toby109tt / https://github.com/22i
|
||||
dofile(path .. "/villager_evoker.lua") -- Mesh and animation by toby109tt / https://github.com/22i
|
||||
dofile(path .. "/villager_vindicator.lua") -- Mesh and animation by toby109tt / https://github.com/22i
|
||||
dofile(path .. "/villager_zombie.lua") -- Mesh and animation by toby109tt / https://github.com/22i
|
||||
dofile(path .. "/witch.lua") -- Mesh and animation by toby109tt / https://github.com/22i
|
||||
|
||||
--Monsters
|
||||
dofile(path .. "/blaze.lua") -- Animation by daufinsyd
|
||||
dofile(path .. "/creeper.lua") -- Mesh by Morn76 Animation by Pavel_S
|
||||
dofile(path .. "/skeleton.lua") -- Mesh by Morn76 Animation by Pavel_S
|
||||
dofile(path .. "/ender_dragon.lua") -- Mesh and animation by toby109tt / https://github.com/22i
|
||||
dofile(path .. "/enderman.lua") -- Mesh and animation by toby109tt / https://github.com/22i
|
||||
dofile(path .. "/endermite.lua") -- Mesh and animation by toby109tt / https://github.com/22i
|
||||
dofile(path .. "/villager_illusioner.lua") -- Mesh and animation by toby109tt / https://github.com/22i
|
||||
dofile(path .. "/ghast.lua") -- maikerumine
|
||||
dofile(path .. "/guardian.lua") -- maikerumine Mesh and animation by toby109tt / https://github.com/22i
|
||||
dofile(path .. "/guardian_elder.lua") -- maikerumine Mesh and animation by toby109tt / https://github.com/22i
|
||||
dofile(path .. "/snowman.lua")
|
||||
dofile(path .. "/iron_golem.lua") -- maikerumine Mesh and animation by toby109tt / https://github.com/22i
|
||||
dofile(path .. "/shulker.lua") -- maikerumine Mesh and animation by toby109tt / https://github.com/22i
|
||||
dofile(path .. "/silverfish.lua") -- maikerumine Mesh and animation by toby109tt / https://github.com/22i
|
||||
dofile(path .. "/skeleton+stray.lua") -- Mesh by Morn76 Animation by Pavel_S
|
||||
dofile(path .. "/skeleton_wither.lua") -- Mesh by Morn76 Animation by Pavel_S
|
||||
dofile(path .. "/zombie.lua") -- Mesh by Morn76 Animation by Pavel_S
|
||||
dofile(path .. "/zombiepig.lua") -- Mesh by Morn76 Animation by Pavel_S
|
||||
dofile(path .. "/slimes.lua") -- Tomas J. Luis
|
||||
dofile(path .. "/slime+magma_cube.lua") -- Wuzzy
|
||||
--dofile(path .. "/snowman.lua") -- maikerumine Mesh and animation by toby109tt / https://github.com/22i
|
||||
dofile(path .. "/spider.lua") -- Spider by AspireMint (fishyWET (CC-BY-SA 3.0 license for texture)
|
||||
dofile(path .. "/enderman.lua") -- maikerumine
|
||||
dofile(path .. "/ghast.lua") -- maikerumine
|
||||
dofile(path .. "/vex.lua") -- KrupnoPavel
|
||||
dofile(path .. "/wither.lua") -- Mesh and animation by toby109tt / https://github.com/22i
|
||||
--NOTES:
|
||||
--
|
||||
--[[
|
||||
COLISIONBOX in minetest press f5 to see where you are looking at then put these wool collor nodes on the ground in direction of north/east/west... to make colisionbox editing easier
|
||||
#1west-pink/#2down/#3south-blue/#4east-red/#5up/#6north-yelow
|
||||
{-1, -0.5, -1, 1, 3, 1}, Right, Bottom, Back, Left, Top, Front
|
||||
--]]
|
||||
--
|
||||
--
|
||||
|
||||
dofile(path .. "/blaze.lua") -- Animation by daufinsyd
|
||||
|
||||
dofile(path .. "/old_mobs.lua") -- Compability with old removed mobs. To be removed later
|
||||
|
||||
print ("[MOD] Mobs Redo 'MC' loaded")
|
||||
|
45
mods/ENTITIES/mobs_mc/intllib.lua
Normal file
45
mods/ENTITIES/mobs_mc/intllib.lua
Normal file
@ -0,0 +1,45 @@
|
||||
|
||||
-- Fallback functions for when `intllib` is not installed.
|
||||
-- Code released under Unlicense <http://unlicense.org>.
|
||||
|
||||
-- Get the latest version of this file at:
|
||||
-- https://raw.githubusercontent.com/minetest-mods/intllib/master/lib/intllib.lua
|
||||
|
||||
local function format(str, ...)
|
||||
local args = { ... }
|
||||
local function repl(escape, open, num, close)
|
||||
if escape == "" then
|
||||
local replacement = tostring(args[tonumber(num)])
|
||||
if open == "" then
|
||||
replacement = replacement..close
|
||||
end
|
||||
return replacement
|
||||
else
|
||||
return "@"..open..num..close
|
||||
end
|
||||
end
|
||||
return (str:gsub("(@?)@(%(?)(%d+)(%)?)", repl))
|
||||
end
|
||||
|
||||
local gettext, ngettext
|
||||
if minetest.get_modpath("intllib") then
|
||||
if intllib.make_gettext_pair then
|
||||
-- New method using gettext.
|
||||
gettext, ngettext = intllib.make_gettext_pair()
|
||||
else
|
||||
-- Old method using text files.
|
||||
gettext = intllib.Getter()
|
||||
end
|
||||
end
|
||||
|
||||
-- Fill in missing functions.
|
||||
|
||||
gettext = gettext or function(msgid, ...)
|
||||
return format(msgid, ...)
|
||||
end
|
||||
|
||||
ngettext = ngettext or function(msgid, msgid_plural, n, ...)
|
||||
return format(n==1 and msgid or msgid_plural, ...)
|
||||
end
|
||||
|
||||
return gettext, ngettext
|
186
mods/ENTITIES/mobs_mc/iron_golem.lua
Normal file
186
mods/ENTITIES/mobs_mc/iron_golem.lua
Normal file
@ -0,0 +1,186 @@
|
||||
--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")
|
||||
--###################
|
||||
--################### IRON GOLEM
|
||||
--###################
|
||||
|
||||
|
||||
|
||||
mobs:register_mob("mobs_mc:iron_golem", {
|
||||
type = "npc",
|
||||
passive = true,
|
||||
hp_min = 100,
|
||||
hp_max = 100,
|
||||
collisionbox = {-0.7, -0.01, -0.7, 0.7, 2.69, 0.7},
|
||||
visual = "mesh",
|
||||
mesh = "mobs_mc_iron_golem.b3d",
|
||||
textures = {
|
||||
{"mobs_mc_iron_golem.png"},
|
||||
},
|
||||
visual_size = {x=3, y=3},
|
||||
makes_footstep_sound = true,
|
||||
sounds = {
|
||||
-- TODO
|
||||
distance = 16,
|
||||
},
|
||||
view_range = 16,
|
||||
stepheight = 1.1,
|
||||
owner = "",
|
||||
order = "follow",
|
||||
floats = 0,
|
||||
walk_velocity = 0.6,
|
||||
run_velocity = 1.2,
|
||||
-- Approximation
|
||||
damage = 14,
|
||||
group_attack = true,
|
||||
attacks_monsters = true,
|
||||
attack_type = "dogfight",
|
||||
drops = {
|
||||
{name = mobs_mc.items.iron_ingot,
|
||||
chance = 1,
|
||||
min = 3,
|
||||
max = 5,},
|
||||
{name = mobs_mc.items.poppy,
|
||||
chance = 1,
|
||||
min = 0,
|
||||
max = 2,},
|
||||
},
|
||||
water_damage = 0,
|
||||
lava_damage = 4,
|
||||
light_damage = 0,
|
||||
fall_damage = 0,
|
||||
animation = {
|
||||
stand_speed = 15, walk_speed = 15, run_speed = 25, punch_speed = 15,
|
||||
stand_start = 0, stand_end = 0,
|
||||
walk_start = 0, walk_end = 40,
|
||||
run_start = 0, run_end = 40,
|
||||
punch_start = 40, punch_end = 50,
|
||||
},
|
||||
jump = true,
|
||||
blood_amount = 0,
|
||||
})
|
||||
|
||||
|
||||
-- spawn eggs
|
||||
mobs:register_egg("mobs_mc:iron_golem", S("Iron Golem"), "mobs_mc_spawn_icon_iron_golem.png", 0)
|
||||
|
||||
|
||||
--[[ This is to be called when a pumpkin or jack'o lantern has been placed. Recommended: In the on_construct function of the node.
|
||||
This summons an iron golen if placing the pumpkin created an iron golem summon pattern:
|
||||
|
||||
.P.
|
||||
III
|
||||
.I.
|
||||
|
||||
P = Pumpkin or jack'o lantern
|
||||
I = Iron block
|
||||
. = Air
|
||||
]]
|
||||
|
||||
mobs_mc.tools.check_iron_golem_summon = function(pos)
|
||||
local checks = {
|
||||
-- These are the possible placement patterns, with offset from the pumpkin block.
|
||||
-- These tables include the positions of the iron blocks (1-4) and air blocks (5-8)
|
||||
-- 4th element is used to determine spawn position.
|
||||
-- If a 9th element is present, that one is used for the spawn position instead.
|
||||
-- Standing (x axis)
|
||||
{
|
||||
{x=-1, y=-1, z=0}, {x=1, y=-1, z=0}, {x=0, y=-1, z=0}, {x=0, y=-2, z=0}, -- iron blocks
|
||||
{x=-1, y=0, z=0}, {x=1, y=0, z=0}, {x=-1, y=-2, z=0}, {x=1, y=-2, z=0}, -- air
|
||||
},
|
||||
-- Upside down standing (x axis)
|
||||
{
|
||||
{x=-1, y=1, z=0}, {x=1, y=1, z=0}, {x=0, y=1, z=0}, {x=0, y=2, z=0},
|
||||
{x=-1, y=0, z=0}, {x=1, y=0, z=0}, {x=-1, y=2, z=0}, {x=1, y=2, z=0},
|
||||
{x=0, y=0, z=0}, -- Different offset for upside down pattern
|
||||
},
|
||||
|
||||
-- Standing (z axis)
|
||||
{
|
||||
{x=0, y=-1, z=-1}, {x=0, y=-1, z=1}, {x=0, y=-1, z=0}, {x=0, y=-2, z=0},
|
||||
{x=0, y=0, z=-1}, {x=0, y=0, z=1}, {x=0, y=-2, z=-1}, {x=0, y=-2, z=1},
|
||||
},
|
||||
-- Upside down standing (z axis)
|
||||
{
|
||||
{x=0, y=1, z=-1}, {x=0, y=1, z=1}, {x=0, y=1, z=0}, {x=0, y=2, z=0},
|
||||
{x=0, y=0, z=-1}, {x=0, y=0, z=1}, {x=0, y=2, z=-1}, {x=0, y=2, z=1},
|
||||
{x=0, y=0, z=0},
|
||||
},
|
||||
|
||||
-- Lying
|
||||
{
|
||||
{x=-1, y=0, z=-1}, {x=0, y=0, z=-1}, {x=1, y=0, z=-1}, {x=0, y=0, z=-2},
|
||||
{x=-1, y=0, z=0}, {x=1, y=0, z=0}, {x=-1, y=0, z=-2}, {x=1, y=0, z=-2},
|
||||
},
|
||||
{
|
||||
{x=-1, y=0, z=1}, {x=0, y=0, z=1}, {x=1, y=0, z=1}, {x=0, y=0, z=2},
|
||||
{x=-1, y=0, z=0}, {x=1, y=0, z=0}, {x=-1, y=0, z=2}, {x=1, y=0, z=2},
|
||||
},
|
||||
{
|
||||
{x=-1, y=0, z=-1}, {x=-1, y=0, z=0}, {x=-1, y=0, z=1}, {x=-2, y=0, z=0},
|
||||
{x=0, y=0, z=-1}, {x=0, y=0, z=1}, {x=-2, y=0, z=-1}, {x=-2, y=0, z=1},
|
||||
},
|
||||
{
|
||||
{x=1, y=0, z=-1}, {x=1, y=0, z=0}, {x=1, y=0, z=1}, {x=2, y=0, z=0},
|
||||
{x=0, y=0, z=-1}, {x=0, y=0, z=1}, {x=2, y=0, z=-1}, {x=2, y=0, z=1},
|
||||
},
|
||||
|
||||
|
||||
}
|
||||
|
||||
for c=1, #checks do
|
||||
-- Check all possible patterns
|
||||
local ok = true
|
||||
-- Check iron block nodes
|
||||
for i=1, 4 do
|
||||
local cpos = vector.add(pos, checks[c][i])
|
||||
local node = minetest.get_node(cpos)
|
||||
if node.name ~= mobs_mc.items.iron_block then
|
||||
ok = false
|
||||
break
|
||||
end
|
||||
end
|
||||
-- Check air nodes
|
||||
for a=5, 8 do
|
||||
local cpos = vector.add(pos, checks[c][a])
|
||||
local node = minetest.get_node(cpos)
|
||||
if node.name ~= "air" then
|
||||
ok = false
|
||||
break
|
||||
end
|
||||
end
|
||||
-- Pattern found!
|
||||
if ok then
|
||||
-- Remove the nodes
|
||||
minetest.remove_node(pos)
|
||||
core.check_for_falling(pos)
|
||||
for i=1, 4 do
|
||||
local cpos = vector.add(pos, checks[c][i])
|
||||
minetest.remove_node(cpos)
|
||||
core.check_for_falling(cpos)
|
||||
end
|
||||
-- Summon iron golem
|
||||
local place
|
||||
if checks[c][9] then
|
||||
place = vector.add(pos, checks[c][9])
|
||||
else
|
||||
place = vector.add(pos, checks[c][4])
|
||||
end
|
||||
place.y = place.y - 0.5
|
||||
minetest.add_entity(place, "mobs_mc:iron_golem")
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
if minetest.settings:get_bool("log_mods") then
|
||||
minetest.log("action", "MC Iron Golem loaded")
|
||||
end
|
146
mods/ENTITIES/mobs_mc/llama.lua
Normal file
146
mods/ENTITIES/mobs_mc/llama.lua
Normal file
@ -0,0 +1,146 @@
|
||||
--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")
|
||||
|
||||
|
||||
--###################
|
||||
--################### LLAMA
|
||||
--###################
|
||||
|
||||
|
||||
mobs:register_mob("mobs_mc:llama", {
|
||||
type = "animal",
|
||||
hp_min = 15,
|
||||
hp_max = 30,
|
||||
passive = false,
|
||||
collisionbox = {-0.45, -0.01, -0.45, 0.45, 1.86, 0.45},
|
||||
visual = "mesh",
|
||||
mesh = "mobs_mc_llama.b3d",
|
||||
textures = {{"mobs_mc_llama.png"},{"mobs_mc_llama_brown.png"},{"mobs_mc_llama_creamy.png"},{"mobs_mc_llama_white.png"},{"mobs_mc_llama_gray.png"}},
|
||||
visual_size = {x=3, y=3},
|
||||
makes_footstep_sound = true,
|
||||
runaway = true,
|
||||
walk_velocity = 1,
|
||||
run_velocity = 4.4,
|
||||
floats = 1,
|
||||
drops = {
|
||||
{name = mobs_mc.items.leather,
|
||||
chance = 1,
|
||||
min = 0,
|
||||
max = 2,},
|
||||
},
|
||||
water_damage = 0,
|
||||
lava_damage = 4,
|
||||
light_damage = 0,
|
||||
fear_height = 4,
|
||||
sounds = {
|
||||
random = "mobs_mc_llama",
|
||||
-- TODO: Death and damage sounds
|
||||
distance = 16,
|
||||
},
|
||||
animation = {
|
||||
speed_normal = 24,
|
||||
stand_start = 0,
|
||||
stand_end = 0,
|
||||
walk_start = 0,
|
||||
walk_end = 40,
|
||||
hurt_start = 118,
|
||||
hurt_end = 154,
|
||||
death_start = 154,
|
||||
death_end = 179,
|
||||
eat_start = 49,
|
||||
eat_end = 78,
|
||||
look_start = 78,
|
||||
look_end = 108,
|
||||
},
|
||||
follow = mobs_mc.items.horse,
|
||||
view_range = 16,
|
||||
do_custom = function(self, dtime)
|
||||
|
||||
-- set needed values if not already present
|
||||
if not self.v2 then
|
||||
self.v2 = 0
|
||||
self.max_speed_forward = 4
|
||||
self.max_speed_reverse = 2
|
||||
self.accel = 4
|
||||
self.terrain_type = 3
|
||||
self.driver_attach_at = {x = 0, y = 7.5, z = -1.5}
|
||||
self.driver_eye_offset = {x = 0, y = 3, z = 0}
|
||||
self.driver_scale = {x = 1/self.visual_size.x, y = 1/self.visual_size.y}
|
||||
end
|
||||
|
||||
-- if driver present allow control of llama
|
||||
if self.driver then
|
||||
|
||||
mobs.drive(self, "walk", "stand", false, dtime)
|
||||
|
||||
return false -- skip rest of mob functions
|
||||
end
|
||||
|
||||
return true
|
||||
end,
|
||||
|
||||
on_die = function(self, pos)
|
||||
|
||||
-- detach from llama properly
|
||||
if self.driver then
|
||||
mobs.detach(self.driver, {x = 1, y = 0, z = 1})
|
||||
end
|
||||
|
||||
end,
|
||||
|
||||
on_rightclick = function(self, clicker)
|
||||
|
||||
-- Make sure player is clicking
|
||||
if not clicker or not clicker:is_player() then
|
||||
return
|
||||
end
|
||||
|
||||
local item = clicker:get_wielded_item()
|
||||
if item:get_name() == mobs_mc.items.hay_bale then
|
||||
-- Breed with hay bale
|
||||
if mobs:feed_tame(self, clicker, 1, true, false) then return end
|
||||
else
|
||||
-- Feed with anything else
|
||||
if mobs:feed_tame(self, clicker, 1, false, true) then return end
|
||||
end
|
||||
if mobs:protect(self, clicker) then return end
|
||||
|
||||
-- Make sure tamed llama is mature and being clicked by owner only
|
||||
if self.tamed and not self.child and self.owner == clicker:get_player_name() then
|
||||
|
||||
local inv = clicker:get_inventory()
|
||||
|
||||
-- detatch player already riding llama
|
||||
if self.driver and clicker == self.driver then
|
||||
|
||||
mobs.detach(clicker, {x = 1, y = 0, z = 1})
|
||||
|
||||
-- attach player to llama
|
||||
elseif not self.driver then
|
||||
|
||||
self.object:set_properties({stepheight = 1.1})
|
||||
mobs.attach(self, clicker)
|
||||
end
|
||||
|
||||
-- Used to capture llama
|
||||
elseif not self.driver and clicker:get_wielded_item():get_name() ~= "" then
|
||||
mobs:capture_mob(self, clicker, 0, 5, 60, false, nil)
|
||||
end
|
||||
end
|
||||
|
||||
})
|
||||
|
||||
-- spawn eggs
|
||||
mobs:register_egg("mobs_mc:llama", S("Llama"), "mobs_mc_spawn_icon_llama.png", 0)
|
||||
|
||||
if minetest.settings:get_bool("log_mods") then
|
||||
minetest.log("action", "MC Llama loaded")
|
||||
end
|
450
mods/ENTITIES/mobs_mc/locale/de_DE.po
Normal file
450
mods/ENTITIES/mobs_mc/locale/de_DE.po
Normal file
@ -0,0 +1,450 @@
|
||||
# SOME DESCRIPTIVE TITLE.
|
||||
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
||||
# This file is distributed under the same license as the PACKAGE package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
||||
#
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: \n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2017-07-02 20:52+0200\n"
|
||||
"PO-Revision-Date: 2017-07-02 16:20+0200\n"
|
||||
"Last-Translator: Wuzzy <almikes@aol.com>\n"
|
||||
"Language-Team: \n"
|
||||
"Language: de_DE\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Generator: Poedit 2.0.2\n"
|
||||
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
|
||||
|
||||
#: 1_items_default.lua
|
||||
msgid "Blaze Rod"
|
||||
msgstr "Lohenrute"
|
||||
|
||||
#: 1_items_default.lua
|
||||
msgid "This is a crafting component dropped from dead blazes."
|
||||
msgstr "Dies ist eine Fertigungskomponente, welche von toten Lohen abfällt."
|
||||
|
||||
#: 1_items_default.lua
|
||||
msgid "Blaze Powder"
|
||||
msgstr "Lohenstaub"
|
||||
|
||||
#: 1_items_default.lua
|
||||
msgid "This item is mainly used for brewing potions and crafting."
|
||||
msgstr ""
|
||||
"Dieser Gegenstand wird hauptsächlich für die Trankzubereitung und die "
|
||||
"Fertigung benutzt."
|
||||
|
||||
#: 1_items_default.lua
|
||||
msgid "Raw Chicken"
|
||||
msgstr "Rohes Hühnchen"
|
||||
|
||||
#: 1_items_default.lua
|
||||
msgid "Cooked Chicken"
|
||||
msgstr "Gebratenes Hühnchen"
|
||||
|
||||
#: 1_items_default.lua
|
||||
msgid "Feather"
|
||||
msgstr "Feder"
|
||||
|
||||
#: 1_items_default.lua
|
||||
msgid "Raw Beef"
|
||||
msgstr "Rohes Rindfleisch"
|
||||
|
||||
#: 1_items_default.lua
|
||||
msgid "Steak"
|
||||
msgstr "Steak"
|
||||
|
||||
#: 1_items_default.lua
|
||||
msgid "Milk"
|
||||
msgstr "Milch"
|
||||
|
||||
#: 1_items_default.lua
|
||||
msgid "Bowl"
|
||||
msgstr "Schale"
|
||||
|
||||
#: 1_items_default.lua
|
||||
msgid "Mushroom Stew"
|
||||
msgstr "Pilzsuppe"
|
||||
|
||||
#: 1_items_default.lua
|
||||
msgid "Dragon Egg"
|
||||
msgstr "Drachenei"
|
||||
|
||||
#: 1_items_default.lua
|
||||
msgid "Eye of Ender"
|
||||
msgstr "Enderauge"
|
||||
|
||||
#: 1_items_default.lua
|
||||
msgid "Ghast Tear"
|
||||
msgstr "Ghastträne"
|
||||
|
||||
#: 1_items_default.lua
|
||||
msgid ""
|
||||
"A ghast tear is an item used in potion brewing. It is dropped from dead "
|
||||
"ghasts."
|
||||
msgstr ""
|
||||
"Eine Ghastträne kann für die Trankzubereitung benutzt werden. Sie wird von "
|
||||
"toten Ghasts abgeworfen."
|
||||
|
||||
#: 1_items_default.lua
|
||||
msgid "Saddle"
|
||||
msgstr "Sattel"
|
||||
|
||||
#: 1_items_default.lua
|
||||
msgid "Iron Horse Armor"
|
||||
msgstr "Eiserne Pferderüstung"
|
||||
|
||||
#: 1_items_default.lua
|
||||
msgid "Golden Horse Armor"
|
||||
msgstr "Goldene Pferderüstung"
|
||||
|
||||
#: 1_items_default.lua
|
||||
msgid "Diamond Horse Armor"
|
||||
msgstr "Diamantene Pferderüstung"
|
||||
|
||||
#: 1_items_default.lua
|
||||
msgid "Raw Porkchop"
|
||||
msgstr "Rohes Schweinefleisch"
|
||||
|
||||
#: 1_items_default.lua
|
||||
msgid "Cooked Porkchop"
|
||||
msgstr "Gebratenes Schweinefleisch"
|
||||
|
||||
#: 1_items_default.lua
|
||||
msgid "Carrot on a Stick"
|
||||
msgstr "Karottenrute"
|
||||
|
||||
#: 1_items_default.lua
|
||||
msgid "Raw Rabbit"
|
||||
msgstr "Rohes Kaninchen"
|
||||
|
||||
#: 1_items_default.lua
|
||||
msgid "Cooked Rabbit"
|
||||
msgstr "Gebratenes Kaninchen"
|
||||
|
||||
#: 1_items_default.lua
|
||||
msgid "Rabbit Hide"
|
||||
msgstr "Kaninchenfell"
|
||||
|
||||
#: 1_items_default.lua
|
||||
msgid "Rabbit's Foot"
|
||||
msgstr "Hasenpfote"
|
||||
|
||||
#: 1_items_default.lua
|
||||
msgid "Raw Mutton"
|
||||
msgstr "Rohes Hammelfleisch"
|
||||
|
||||
#: 1_items_default.lua
|
||||
msgid "Cooked Mutton"
|
||||
msgstr "Gebratenes Hammelfleisch"
|
||||
|
||||
#: 1_items_default.lua
|
||||
msgid "Shulker Shell"
|
||||
msgstr "Shulkerschale"
|
||||
|
||||
#: 1_items_default.lua
|
||||
msgid "Magma Cream"
|
||||
msgstr "Magmacreme"
|
||||
|
||||
#: 1_items_default.lua
|
||||
msgid "Magma cream is a crafting component."
|
||||
msgstr "Magmacreme wird zum Fertigen benutzt."
|
||||
|
||||
#: 1_items_default.lua
|
||||
msgid "Spider Eye"
|
||||
msgstr "Spinnenauge"
|
||||
|
||||
#: 1_items_default.lua
|
||||
msgid ""
|
||||
"Spider eyes are used mainly in crafting and brewing. Spider eyes can be "
|
||||
"eaten, but they poison you and reduce your health by 2 hit points."
|
||||
msgstr ""
|
||||
"Spinnenaugen werden hauptsächlich für die Fertigung und die Trankzubereitung "
|
||||
"benutzt. Spinnenaugen können gegessen werden, aber sie vergiften Sie und Sie "
|
||||
"verlieren 2 Trefferpunkte."
|
||||
|
||||
#: 1_items_default.lua
|
||||
msgid "Totem of Undying"
|
||||
msgstr "Totem der Unsterblichkeit"
|
||||
|
||||
#: 1_items_default.lua
|
||||
msgid "Rotten Flesh"
|
||||
msgstr "Verrottetes Fleisch"
|
||||
|
||||
#: 1_items_default.lua
|
||||
msgid "Nether Star"
|
||||
msgstr "Netherstern"
|
||||
|
||||
#: 2_throwing.lua
|
||||
msgid "Arrow"
|
||||
msgstr "Pfeil"
|
||||
|
||||
#: 2_throwing.lua
|
||||
msgid "Bow"
|
||||
msgstr "Bogen"
|
||||
|
||||
#: 2_throwing.lua
|
||||
msgid "Egg"
|
||||
msgstr "Ei"
|
||||
|
||||
#: 2_throwing.lua
|
||||
msgid "Snowball"
|
||||
msgstr "Schneeball"
|
||||
|
||||
#: 2_throwing.lua
|
||||
msgid ""
|
||||
"Snowballs can be thrown at your enemies. A snowball deals 3 damage to "
|
||||
"blazes, but is harmless to anything else."
|
||||
msgstr ""
|
||||
"Werfen Sie Schnebälle auf Ihre Feinde. Ein Schneeball richtet gegenüber "
|
||||
"Lohen 3 Schaden an, ist aber harmlos für alles andere."
|
||||
|
||||
#: bat.lua
|
||||
msgid "Bat"
|
||||
msgstr "Fledermaus"
|
||||
|
||||
#: blaze.lua
|
||||
msgid "Blaze"
|
||||
msgstr "Lohe"
|
||||
|
||||
#: chicken.lua
|
||||
msgid "Chicken"
|
||||
msgstr "Huhn"
|
||||
|
||||
#: cow+mooshroom.lua
|
||||
msgid "Cow"
|
||||
msgstr "Kuh"
|
||||
|
||||
#: cow+mooshroom.lua
|
||||
msgid "Mooshroom"
|
||||
msgstr "Mooshroom"
|
||||
|
||||
#: creeper.lua
|
||||
msgid "Creeper"
|
||||
msgstr "Creeper"
|
||||
|
||||
#: ender_dragon.lua
|
||||
msgid "Ender Dragon"
|
||||
msgstr "Enderdrache"
|
||||
|
||||
#: enderman.lua
|
||||
msgid "Enderman"
|
||||
msgstr "Enderman"
|
||||
|
||||
#: endermite.lua
|
||||
msgid "Endermite"
|
||||
msgstr "Endermite"
|
||||
|
||||
#: ghast.lua
|
||||
msgid "Ghast"
|
||||
msgstr "Ghast"
|
||||
|
||||
#: guardian_elder.lua
|
||||
msgid "Elder Guardian"
|
||||
msgstr "Großer Wächter"
|
||||
|
||||
#: guardian.lua
|
||||
msgid "Guardian"
|
||||
msgstr "Wächter"
|
||||
|
||||
#: heads.lua
|
||||
msgid "Creeper Head (WIP)"
|
||||
msgstr "Creeperkopf (unfertig)"
|
||||
|
||||
#: heads.lua
|
||||
msgid "Enderman Head (WIP)"
|
||||
msgstr "Endermankopf (unfertig)"
|
||||
|
||||
#: heads.lua
|
||||
msgid "Ghast Head (WIP)"
|
||||
msgstr "Ghastkopf (unfertig)"
|
||||
|
||||
#: heads.lua
|
||||
msgid "Skeleton Skull (WIP)"
|
||||
msgstr "Skelettschädel (unfertig)"
|
||||
|
||||
#: heads.lua
|
||||
msgid "Wither Skeleton Skull (WIP)"
|
||||
msgstr "Witherskelettschädel (unfertig)"
|
||||
|
||||
#: heads.lua
|
||||
msgid "Spider Head (WIP)"
|
||||
msgstr "Spinnenkopf (unfertig)"
|
||||
|
||||
#: heads.lua
|
||||
msgid "Zombie Head (WIP)"
|
||||
msgstr "Zombiekopf (unfertig)"
|
||||
|
||||
#: heads.lua
|
||||
msgid "Zombie Pigman Head (WIP)"
|
||||
msgstr "Schweinezombiekopf (unfertig)"
|
||||
|
||||
#: horse.lua
|
||||
msgid "Horse"
|
||||
msgstr "Pferd"
|
||||
|
||||
#: horse.lua
|
||||
msgid "Skeleton Horse"
|
||||
msgstr "Skelettpferd"
|
||||
|
||||
#: horse.lua
|
||||
msgid "Zombie Horse"
|
||||
msgstr "Zombiepferd"
|
||||
|
||||
#: horse.lua
|
||||
msgid "Donkey"
|
||||
msgstr "Esel"
|
||||
|
||||
#: horse.lua
|
||||
msgid "Mule"
|
||||
msgstr "Maultier"
|
||||
|
||||
#: iron_golem.lua
|
||||
msgid "Iron Golem"
|
||||
msgstr "Eisengolem"
|
||||
|
||||
#: llama.lua
|
||||
msgid "Llama"
|
||||
msgstr "Lama"
|
||||
|
||||
#: ocelot.lua
|
||||
msgid "Ocelot"
|
||||
msgstr "Ozelot"
|
||||
|
||||
#: parrot.lua
|
||||
msgid "Parrot"
|
||||
msgstr "Papagei"
|
||||
|
||||
#: pig.lua
|
||||
msgid "Pig"
|
||||
msgstr "Schwein"
|
||||
|
||||
#: polar_bear.lua
|
||||
msgid "Polar Bear"
|
||||
msgstr "Eisbär"
|
||||
|
||||
#: rabbit.lua
|
||||
msgid "Rabbit"
|
||||
msgstr "Kaninchen"
|
||||
|
||||
#: rabbit.lua
|
||||
msgid "Killer Bunny"
|
||||
msgstr "Killer-Kaninchen"
|
||||
|
||||
#: sheep.lua
|
||||
msgid "Sheep"
|
||||
msgstr "Schaf"
|
||||
|
||||
#: shulker.lua
|
||||
msgid "Shulker"
|
||||
msgstr "Shulker"
|
||||
|
||||
#: silverfish.lua
|
||||
msgid "Silverfish"
|
||||
msgstr "Silberfischchen"
|
||||
|
||||
#: silverfish.lua
|
||||
msgid "Stone Monster Egg"
|
||||
msgstr "Silberfischchen-Stein"
|
||||
|
||||
#: silverfish.lua
|
||||
msgid "Cobblestone Monster Egg"
|
||||
msgstr "Silberfischchen-Bruchstein"
|
||||
|
||||
#: silverfish.lua
|
||||
msgid "Mossy Cobblestone Monster Egg"
|
||||
msgstr "Bemooster Silberfischchen-Bruchstein"
|
||||
|
||||
#: silverfish.lua
|
||||
msgid "Stone Brick Monster Egg"
|
||||
msgstr "Silberfischchen-Steinziegel"
|
||||
|
||||
#: silverfish.lua
|
||||
msgid "Stone Block Monster Egg"
|
||||
msgstr "Silberfischchen-Steinblock"
|
||||
|
||||
#: skeleton.lua
|
||||
msgid "Skeleton"
|
||||
msgstr "Skelett"
|
||||
|
||||
#: skeleton_stray.lua
|
||||
msgid "Stray"
|
||||
msgstr "Eiswanderer"
|
||||
|
||||
#: skeleton_wither.lua
|
||||
msgid "Wither Skeleton"
|
||||
msgstr "Witherskelett"
|
||||
|
||||
#: slime+magma_cube.lua
|
||||
msgid "Magma Cube"
|
||||
msgstr "Magmawürfel"
|
||||
|
||||
#: slime+magma_cube.lua
|
||||
msgid "Slime"
|
||||
msgstr "Schleim"
|
||||
|
||||
#: snowman.lua
|
||||
msgid "Snow Golem"
|
||||
msgstr "Schneegolem"
|
||||
|
||||
#: spider.lua
|
||||
msgid "Spider"
|
||||
msgstr "Spinne"
|
||||
|
||||
#: spider.lua
|
||||
msgid "Cave Spider"
|
||||
msgstr "Höhlenspinne"
|
||||
|
||||
#: squid.lua
|
||||
msgid "Squid"
|
||||
msgstr "Tintenfisch"
|
||||
|
||||
#: vex.lua
|
||||
msgid "Vex"
|
||||
msgstr "Plagegeist"
|
||||
|
||||
#: villager_evoker.lua
|
||||
msgid "Evoker"
|
||||
msgstr "Magier"
|
||||
|
||||
#: villager_illusioner.lua
|
||||
msgid "Illusioner"
|
||||
msgstr "Illusionist"
|
||||
|
||||
#: villager.lua
|
||||
msgid "Villager"
|
||||
msgstr "Dorfbewohner"
|
||||
|
||||
#: villager_vindicator.lua
|
||||
msgid "Vindicator"
|
||||
msgstr "Diener"
|
||||
|
||||
#: villager_zombie.lua
|
||||
msgid "Zombie Villager"
|
||||
msgstr "Dorfbewohnerzombie"
|
||||
|
||||
#: witch.lua
|
||||
msgid "Witch"
|
||||
msgstr "Hexe"
|
||||
|
||||
#: wither.lua
|
||||
msgid "Wither"
|
||||
msgstr "Wither"
|
||||
|
||||
#: wolf.lua
|
||||
msgid "Wolf"
|
||||
msgstr "Wolf"
|
||||
|
||||
#: zombie.lua
|
||||
msgid "Husk"
|
||||
msgstr "Wüstenzombie"
|
||||
|
||||
#: zombie.lua
|
||||
msgid "Zombie"
|
||||
msgstr "Zombie"
|
||||
|
||||
#: zombiepig.lua
|
||||
msgid "Zombie Pigman"
|
||||
msgstr "Schweinezombie"
|
440
mods/ENTITIES/mobs_mc/locale/template.pot
Normal file
440
mods/ENTITIES/mobs_mc/locale/template.pot
Normal file
@ -0,0 +1,440 @@
|
||||
# SOME DESCRIPTIVE TITLE.
|
||||
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
|
||||
# This file is distributed under the same license as the PACKAGE package.
|
||||
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
|
||||
#
|
||||
#, fuzzy
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: PACKAGE VERSION\n"
|
||||
"Report-Msgid-Bugs-To: \n"
|
||||
"POT-Creation-Date: 2017-07-02 20:52+0200\n"
|
||||
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
|
||||
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
|
||||
"Language-Team: LANGUAGE <LL@li.org>\n"
|
||||
"Language: \n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=CHARSET\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
|
||||
#: 1_items_default.lua
|
||||
msgid "Blaze Rod"
|
||||
msgstr ""
|
||||
|
||||
#: 1_items_default.lua
|
||||
msgid "This is a crafting component dropped from dead blazes."
|
||||
msgstr ""
|
||||
|
||||
#: 1_items_default.lua
|
||||
msgid "Blaze Powder"
|
||||
msgstr ""
|
||||
|
||||
#: 1_items_default.lua
|
||||
msgid "This item is mainly used for brewing potions and crafting."
|
||||
msgstr ""
|
||||
|
||||
#: 1_items_default.lua
|
||||
msgid "Raw Chicken"
|
||||
msgstr ""
|
||||
|
||||
#: 1_items_default.lua
|
||||
msgid "Cooked Chicken"
|
||||
msgstr ""
|
||||
|
||||
#: 1_items_default.lua
|
||||
msgid "Feather"
|
||||
msgstr ""
|
||||
|
||||
#: 1_items_default.lua
|
||||
msgid "Raw Beef"
|
||||
msgstr ""
|
||||
|
||||
#: 1_items_default.lua
|
||||
msgid "Steak"
|
||||
msgstr ""
|
||||
|
||||
#: 1_items_default.lua
|
||||
msgid "Milk"
|
||||
msgstr ""
|
||||
|
||||
#: 1_items_default.lua
|
||||
msgid "Bowl"
|
||||
msgstr ""
|
||||
|
||||
#: 1_items_default.lua
|
||||
msgid "Mushroom Stew"
|
||||
msgstr ""
|
||||
|
||||
#: 1_items_default.lua
|
||||
msgid "Dragon Egg"
|
||||
msgstr ""
|
||||
|
||||
#: 1_items_default.lua
|
||||
msgid "Eye of Ender"
|
||||
msgstr ""
|
||||
|
||||
#: 1_items_default.lua
|
||||
msgid "Ghast Tear"
|
||||
msgstr ""
|
||||
|
||||
#: 1_items_default.lua
|
||||
msgid ""
|
||||
"A ghast tear is an item used in potion brewing. It is dropped from dead "
|
||||
"ghasts."
|
||||
msgstr ""
|
||||
|
||||
#: 1_items_default.lua
|
||||
msgid "Saddle"
|
||||
msgstr ""
|
||||
|
||||
#: 1_items_default.lua
|
||||
msgid "Iron Horse Armor"
|
||||
msgstr ""
|
||||
|
||||
#: 1_items_default.lua
|
||||
msgid "Golden Horse Armor"
|
||||
msgstr ""
|
||||
|
||||
#: 1_items_default.lua
|
||||
msgid "Diamond Horse Armor"
|
||||
msgstr ""
|
||||
|
||||
#: 1_items_default.lua
|
||||
msgid "Raw Porkchop"
|
||||
msgstr ""
|
||||
|
||||
#: 1_items_default.lua
|
||||
msgid "Cooked Porkchop"
|
||||
msgstr ""
|
||||
|
||||
#: 1_items_default.lua
|
||||
msgid "Carrot on a Stick"
|
||||
msgstr ""
|
||||
|
||||
#: 1_items_default.lua
|
||||
msgid "Raw Rabbit"
|
||||
msgstr ""
|
||||
|
||||
#: 1_items_default.lua
|
||||
msgid "Cooked Rabbit"
|
||||
msgstr ""
|
||||
|
||||
#: 1_items_default.lua
|
||||
msgid "Rabbit Hide"
|
||||
msgstr ""
|
||||
|
||||
#: 1_items_default.lua
|
||||
msgid "Rabbit's Foot"
|
||||
msgstr ""
|
||||
|
||||
#: 1_items_default.lua
|
||||
msgid "Raw Mutton"
|
||||
msgstr ""
|
||||
|
||||
#: 1_items_default.lua
|
||||
msgid "Cooked Mutton"
|
||||
msgstr ""
|
||||
|
||||
#: 1_items_default.lua
|
||||
msgid "Shulker Shell"
|
||||
msgstr ""
|
||||
|
||||
#: 1_items_default.lua
|
||||
msgid "Magma Cream"
|
||||
msgstr ""
|
||||
|
||||
#: 1_items_default.lua
|
||||
msgid "Magma cream is a crafting component."
|
||||
msgstr ""
|
||||
|
||||
#: 1_items_default.lua
|
||||
msgid "Spider Eye"
|
||||
msgstr ""
|
||||
|
||||
#: 1_items_default.lua
|
||||
msgid ""
|
||||
"Spider eyes are used mainly in crafting and brewing. Spider eyes can be "
|
||||
"eaten, but they poison you and reduce your health by 2 hit points."
|
||||
msgstr ""
|
||||
|
||||
#: 1_items_default.lua
|
||||
msgid "Totem of Undying"
|
||||
msgstr ""
|
||||
|
||||
#: 1_items_default.lua
|
||||
msgid "Rotten Flesh"
|
||||
msgstr ""
|
||||
|
||||
#: 1_items_default.lua
|
||||
msgid "Nether Star"
|
||||
msgstr ""
|
||||
|
||||
#: 2_throwing.lua
|
||||
msgid "Arrow"
|
||||
msgstr ""
|
||||
|
||||
#: 2_throwing.lua
|
||||
msgid "Bow"
|
||||
msgstr ""
|
||||
|
||||
#: 2_throwing.lua
|
||||
msgid "Egg"
|
||||
msgstr ""
|
||||
|
||||
#: 2_throwing.lua
|
||||
msgid "Snowball"
|
||||
msgstr ""
|
||||
|
||||
#: 2_throwing.lua
|
||||
msgid ""
|
||||
"Snowballs can be thrown at your enemies. A snowball deals 3 damage to "
|
||||
"blazes, but is harmless to anything else."
|
||||
msgstr ""
|
||||
|
||||
#: bat.lua
|
||||
msgid "Bat"
|
||||
msgstr ""
|
||||
|
||||
#: blaze.lua
|
||||
msgid "Blaze"
|
||||
msgstr ""
|
||||
|
||||
#: chicken.lua
|
||||
msgid "Chicken"
|
||||
msgstr ""
|
||||
|
||||
#: cow+mooshroom.lua
|
||||
msgid "Cow"
|
||||
msgstr ""
|
||||
|
||||
#: cow+mooshroom.lua
|
||||
msgid "Mooshroom"
|
||||
msgstr ""
|
||||
|
||||
#: creeper.lua
|
||||
msgid "Creeper"
|
||||
msgstr ""
|
||||
|
||||
#: ender_dragon.lua
|
||||
msgid "Ender Dragon"
|
||||
msgstr ""
|
||||
|
||||
#: enderman.lua
|
||||
msgid "Enderman"
|
||||
msgstr ""
|
||||
|
||||
#: endermite.lua
|
||||
msgid "Endermite"
|
||||
msgstr ""
|
||||
|
||||
#: ghast.lua
|
||||
msgid "Ghast"
|
||||
msgstr ""
|
||||
|
||||
#: guardian_elder.lua
|
||||
msgid "Elder Guardian"
|
||||
msgstr ""
|
||||
|
||||
#: guardian.lua
|
||||
msgid "Guardian"
|
||||
msgstr ""
|
||||
|
||||
#: heads.lua
|
||||
msgid "Creeper Head (WIP)"
|
||||
msgstr ""
|
||||
|
||||
#: heads.lua
|
||||
msgid "Enderman Head (WIP)"
|
||||
msgstr ""
|
||||
|
||||
#: heads.lua
|
||||
msgid "Ghast Head (WIP)"
|
||||
msgstr ""
|
||||
|
||||
#: heads.lua
|
||||
msgid "Skeleton Skull (WIP)"
|
||||
msgstr ""
|
||||
|
||||
#: heads.lua
|
||||
msgid "Wither Skeleton Skull (WIP)"
|
||||
msgstr ""
|
||||
|
||||
#: heads.lua
|
||||
msgid "Spider Head (WIP)"
|
||||
msgstr ""
|
||||
|
||||
#: heads.lua
|
||||
msgid "Zombie Head (WIP)"
|
||||
msgstr ""
|
||||
|
||||
#: heads.lua
|
||||
msgid "Zombie Pigman Head (WIP)"
|
||||
msgstr ""
|
||||
|
||||
#: horse.lua
|
||||
msgid "Horse"
|
||||
msgstr ""
|
||||
|
||||
#: horse.lua
|
||||
msgid "Skeleton Horse"
|
||||
msgstr ""
|
||||
|
||||
#: horse.lua
|
||||
msgid "Zombie Horse"
|
||||
msgstr ""
|
||||
|
||||
#: horse.lua
|
||||
msgid "Donkey"
|
||||
msgstr ""
|
||||
|
||||
#: horse.lua
|
||||
msgid "Mule"
|
||||
msgstr ""
|
||||
|
||||
#: iron_golem.lua
|
||||
msgid "Iron Golem"
|
||||
msgstr ""
|
||||
|
||||
#: llama.lua
|
||||
msgid "Llama"
|
||||
msgstr ""
|
||||
|
||||
#: ocelot.lua
|
||||
msgid "Ocelot"
|
||||
msgstr ""
|
||||
|
||||
#: parrot.lua
|
||||
msgid "Parrot"
|
||||
msgstr ""
|
||||
|
||||
#: pig.lua
|
||||
msgid "Pig"
|
||||
msgstr ""
|
||||
|
||||
#: polar_bear.lua
|
||||
msgid "Polar Bear"
|
||||
msgstr ""
|
||||
|
||||
#: rabbit.lua
|
||||
msgid "Rabbit"
|
||||
msgstr ""
|
||||
|
||||
#: rabbit.lua
|
||||
msgid "Killer Bunny"
|
||||
msgstr ""
|
||||
|
||||
#: sheep.lua
|
||||
msgid "Sheep"
|
||||
msgstr ""
|
||||
|
||||
#: shulker.lua
|
||||
msgid "Shulker"
|
||||
msgstr ""
|
||||
|
||||
#: silverfish.lua
|
||||
msgid "Silverfish"
|
||||
msgstr ""
|
||||
|
||||
#: silverfish.lua
|
||||
msgid "Stone Monster Egg"
|
||||
msgstr ""
|
||||
|
||||
#: silverfish.lua
|
||||
msgid "Cobblestone Monster Egg"
|
||||
msgstr ""
|
||||
|
||||
#: silverfish.lua
|
||||
msgid "Mossy Cobblestone Monster Egg"
|
||||
msgstr ""
|
||||
|
||||
#: silverfish.lua
|
||||
msgid "Stone Brick Monster Egg"
|
||||
msgstr ""
|
||||
|
||||
#: silverfish.lua
|
||||
msgid "Stone Block Monster Egg"
|
||||
msgstr ""
|
||||
|
||||
#: skeleton.lua
|
||||
msgid "Skeleton"
|
||||
msgstr ""
|
||||
|
||||
#: skeleton_stray.lua
|
||||
msgid "Stray"
|
||||
msgstr ""
|
||||
|
||||
#: skeleton_wither.lua
|
||||
msgid "Wither Skeleton"
|
||||
msgstr ""
|
||||
|
||||
#: slime+magma_cube.lua
|
||||
msgid "Magma Cube"
|
||||
msgstr ""
|
||||
|
||||
#: slime+magma_cube.lua
|
||||
msgid "Slime"
|
||||
msgstr ""
|
||||
|
||||
#: snowman.lua
|
||||
msgid "Snow Golem"
|
||||
msgstr ""
|
||||
|
||||
#: spider.lua
|
||||
msgid "Spider"
|
||||
msgstr ""
|
||||
|
||||
#: spider.lua
|
||||
msgid "Cave Spider"
|
||||
msgstr ""
|
||||
|
||||
#: squid.lua
|
||||
msgid "Squid"
|
||||
msgstr ""
|
||||
|
||||
#: vex.lua
|
||||
msgid "Vex"
|
||||
msgstr ""
|
||||
|
||||
#: villager_evoker.lua
|
||||
msgid "Evoker"
|
||||
msgstr ""
|
||||
|
||||
#: villager_illusioner.lua
|
||||
msgid "Illusioner"
|
||||
msgstr ""
|
||||
|
||||
#: villager.lua
|
||||
msgid "Villager"
|
||||
msgstr ""
|
||||
|
||||
#: villager_vindicator.lua
|
||||
msgid "Vindicator"
|
||||
msgstr ""
|
||||
|
||||
#: villager_zombie.lua
|
||||
msgid "Zombie Villager"
|
||||
msgstr ""
|
||||
|
||||
#: witch.lua
|
||||
msgid "Witch"
|
||||
msgstr ""
|
||||
|
||||
#: wither.lua
|
||||
msgid "Wither"
|
||||
msgstr ""
|
||||
|
||||
#: wolf.lua
|
||||
msgid "Wolf"
|
||||
msgstr ""
|
||||
|
||||
#: zombie.lua
|
||||
msgid "Husk"
|
||||
msgstr ""
|
||||
|
||||
#: zombie.lua
|
||||
msgid "Zombie"
|
||||
msgstr ""
|
||||
|
||||
#: zombiepig.lua
|
||||
msgid "Zombie Pigman"
|
||||
msgstr ""
|
Binary file not shown.
Binary file not shown.
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_agent.b3d
Normal file
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_agent.b3d
Normal file
Binary file not shown.
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_bat.b3d
Normal file
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_bat.b3d
Normal file
Binary file not shown.
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_blaze.b3d
Normal file
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_blaze.b3d
Normal file
Binary file not shown.
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_cat.b3d
Normal file
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_cat.b3d
Normal file
Binary file not shown.
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_chicken.b3d
Normal file
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_chicken.b3d
Normal file
Binary file not shown.
File diff suppressed because it is too large
Load Diff
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_cow.b3d
Normal file
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_cow.b3d
Normal file
Binary file not shown.
File diff suppressed because it is too large
Load Diff
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_creeper.b3d
Normal file
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_creeper.b3d
Normal file
Binary file not shown.
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_dragon.b3d
Normal file
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_dragon.b3d
Normal file
Binary file not shown.
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_enderman.b3d
Normal file
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_enderman.b3d
Normal file
Binary file not shown.
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_endermite.b3d
Normal file
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_endermite.b3d
Normal file
Binary file not shown.
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_evoker.b3d
Normal file
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_evoker.b3d
Normal file
Binary file not shown.
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_ghast.b3d
Normal file
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_ghast.b3d
Normal file
Binary file not shown.
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_guardian.b3d
Normal file
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_guardian.b3d
Normal file
Binary file not shown.
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_horse.b3d
Normal file
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_horse.b3d
Normal file
Binary file not shown.
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_illusioner.b3d
Normal file
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_illusioner.b3d
Normal file
Binary file not shown.
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_iron_golem.b3d
Normal file
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_iron_golem.b3d
Normal file
Binary file not shown.
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_llama.b3d
Normal file
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_llama.b3d
Normal file
Binary file not shown.
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_magmacube.b3d
Normal file
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_magmacube.b3d
Normal file
Binary file not shown.
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_mooshroom.b3d
Normal file
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_mooshroom.b3d
Normal file
Binary file not shown.
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_parrot.b3d
Normal file
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_parrot.b3d
Normal file
Binary file not shown.
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_pig.b3d
Normal file
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_pig.b3d
Normal file
Binary file not shown.
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_polarbear.b3d
Normal file
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_polarbear.b3d
Normal file
Binary file not shown.
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_rabbit.b3d
Normal file
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_rabbit.b3d
Normal file
Binary file not shown.
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_sheep.b3d
Normal file
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_sheep.b3d
Normal file
Binary file not shown.
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_sheepfur.b3d
Normal file
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_sheepfur.b3d
Normal file
Binary file not shown.
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_sheepnaked.b3d
Normal file
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_sheepnaked.b3d
Normal file
Binary file not shown.
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_shulker.b3d
Normal file
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_shulker.b3d
Normal file
Binary file not shown.
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_silverfish.b3d
Normal file
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_silverfish.b3d
Normal file
Binary file not shown.
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_skeleton.b3d
Normal file
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_skeleton.b3d
Normal file
Binary file not shown.
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_slime.b3d
Normal file
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_slime.b3d
Normal file
Binary file not shown.
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_snowman.b3d
Normal file
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_snowman.b3d
Normal file
Binary file not shown.
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_spider.b3d
Normal file
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_spider.b3d
Normal file
Binary file not shown.
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_squid.b3d
Normal file
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_squid.b3d
Normal file
Binary file not shown.
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_stray.b3d
Normal file
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_stray.b3d
Normal file
Binary file not shown.
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_vex.b3d
Normal file
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_vex.b3d
Normal file
Binary file not shown.
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_villager.b3d
Normal file
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_villager.b3d
Normal file
Binary file not shown.
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_vindicator.b3d
Normal file
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_vindicator.b3d
Normal file
Binary file not shown.
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_witch.b3d
Normal file
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_witch.b3d
Normal file
Binary file not shown.
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_wither.b3d
Normal file
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_wither.b3d
Normal file
Binary file not shown.
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_witherskeleton.b3d
Normal file
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_witherskeleton.b3d
Normal file
Binary file not shown.
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_wolf.b3d
Normal file
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_wolf.b3d
Normal file
Binary file not shown.
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_zombie.b3d
Normal file
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_zombie.b3d
Normal file
Binary file not shown.
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_zombie_pigman.b3d
Normal file
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_zombie_pigman.b3d
Normal file
Binary file not shown.
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_zvillager.b3d
Normal file
BIN
mods/ENTITIES/mobs_mc/models/mobs_mc_zvillager.b3d
Normal file
Binary file not shown.
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
Binary file not shown.
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
203
mods/ENTITIES/mobs_mc/ocelot.lua
Normal file
203
mods/ENTITIES/mobs_mc/ocelot.lua
Normal file
@ -0,0 +1,203 @@
|
||||
--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")
|
||||
|
||||
--###################
|
||||
--################### OCELOT AND CAT
|
||||
--###################
|
||||
|
||||
local pr = PseudoRandom(os.time()*12)
|
||||
|
||||
local default_walk_chance = 70
|
||||
|
||||
-- Returns true if the item is food (taming) for the cat/ocelot
|
||||
local is_food = function(itemstring)
|
||||
for f=1, #mobs_mc.follow.ocelot do
|
||||
if itemstring == mobs_mc.follow.ocelot[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
|
||||
|
||||
-- Ocelot
|
||||
local ocelot = {
|
||||
type = "animal",
|
||||
hp_min = 10,
|
||||
hp_max = 10,
|
||||
collisionbox = {-0.3, -0.01, -0.3, 0.3, 0.69, 0.3},
|
||||
visual = "mesh",
|
||||
mesh = "mobs_mc_cat.b3d",
|
||||
textures = {"mobs_mc_cat_ocelot.png"},
|
||||
visual_size = {x=2.0, y=2.0},
|
||||
makes_footstep_sound = true,
|
||||
walk_chance = default_walk_chance,
|
||||
walk_velocity = 1,
|
||||
run_velocity = 3,
|
||||
floats = 1,
|
||||
runaway = true,
|
||||
water_damage = 0,
|
||||
lava_damage = 4,
|
||||
light_damage = 0,
|
||||
fall_damage = 0,
|
||||
fear_height = 4,
|
||||
sounds = {
|
||||
random = "mobs_kitten",
|
||||
distance = 16,
|
||||
},
|
||||
animation = {
|
||||
speed_normal = 25, speed_run = 50,
|
||||
stand_start = 0, stand_end = 0,
|
||||
walk_start = 0, walk_end = 40,
|
||||
run_start = 0, run_end = 40,
|
||||
},
|
||||
follow = mobs_mc.follow.ocelot,
|
||||
view_range = 12,
|
||||
passive = false,
|
||||
attack_type = "dogfight",
|
||||
pathfinding = 1,
|
||||
damage = 2,
|
||||
attack_animals = true,
|
||||
specific_attack = { "mobs_mc:chicken" },
|
||||
on_rightclick = function(self, clicker)
|
||||
if self.child then return end
|
||||
-- Try to tame ocelot (mobs:feed_tame is intentionally NOT used)
|
||||
local item = clicker:get_wielded_item()
|
||||
if is_food(item:get_name()) then
|
||||
if not minetest.settings:get_bool("creative_mode") then
|
||||
item:take_item()
|
||||
clicker:set_wielded_item(item)
|
||||
end
|
||||
-- 1/3 chance of getting tamed
|
||||
if pr:next(1, 3) == 1 then
|
||||
local yaw = self.object:get_yaw()
|
||||
local cat = minetest.add_entity(self.object:getpos(), "mobs_mc:cat")
|
||||
cat:set_yaw(yaw)
|
||||
local ent = cat:get_luaentity()
|
||||
ent.owner = clicker:get_player_name()
|
||||
ent.tamed = true
|
||||
self.object:remove()
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
end,
|
||||
}
|
||||
|
||||
mobs:register_mob("mobs_mc:ocelot", ocelot)
|
||||
|
||||
-- Cat
|
||||
local cat = table.copy(ocelot)
|
||||
cat.textures = {{"mobs_mc_cat_black.png"}, {"mobs_mc_cat_red.png"}, {"mobs_mc_cat_siamese.png"}}
|
||||
cat.owner = ""
|
||||
cat.order = "roam" -- "sit" or "roam"
|
||||
cat.owner_loyal = true
|
||||
cat.tamed = true
|
||||
cat.runaway = false
|
||||
-- Automatically teleport cat to owner
|
||||
cat.do_custom = mobs_mc.make_owner_teleport_function(12)
|
||||
cat.on_rightclick = function(self, clicker)
|
||||
if mobs:feed_tame(self, clicker, 1, true, false) then return end
|
||||
if mobs:capture_mob(self, clicker, 0, 60, 5, false, nil) then return end
|
||||
if mobs:protect(self, clicker) then return end
|
||||
|
||||
if self.child then return end
|
||||
|
||||
-- Toggle sitting order
|
||||
|
||||
if not self.owner or self.owner == "" then
|
||||
-- Huh? This cat has no owner? Let's fix this! This should never happen.
|
||||
self.owner = clicker:get_player_name()
|
||||
end
|
||||
|
||||
if not self.order or self.order == "" or self.order == "sit" then
|
||||
self.order = "roam"
|
||||
self.walk_chance = default_walk_chance
|
||||
self.jump = true
|
||||
else
|
||||
-- “Sit!”
|
||||
-- TODO: Add sitting model
|
||||
self.order = "sit"
|
||||
self.walk_chance = 0
|
||||
self.jump = false
|
||||
end
|
||||
|
||||
end
|
||||
|
||||
mobs:register_mob("mobs_mc:cat", cat)
|
||||
|
||||
local base_spawn_chance = 5000
|
||||
|
||||
-- Spawn ocelot
|
||||
mobs:spawn({
|
||||
name = "mobs_mc:ocelot",
|
||||
nodes = mobs_mc.spawn.jungle,
|
||||
light_max = minetest.LIGHT_MAX+1,
|
||||
light_min = 0,
|
||||
chance = math.ceil(base_spawn_chance * 1.5), -- emulates 1/3 spawn failure rate
|
||||
active_object_count = 12,
|
||||
min_height = 1, -- Right above ocean level
|
||||
max_height = 31000,
|
||||
on_spawn = function(self, pos)
|
||||
--[[ Note: Minecraft has a 1/3 spawn failure rate.
|
||||
In this mod it is emulated by reducing the spawn rate accordingly (see above). ]]
|
||||
|
||||
-- 1/7 chance to spawn 2 ocelot kittens
|
||||
if pr:next(1,7) == 1 then
|
||||
-- Turn object into a child
|
||||
local make_child = function(object)
|
||||
local ent = object:get_luaentity()
|
||||
object:set_properties({
|
||||
visual_size = { x = ent.base_size.x/2, y = ent.base_size.y/2 },
|
||||
collisionbox = {
|
||||
ent.base_colbox[1]/2,
|
||||
ent.base_colbox[2]/2,
|
||||
ent.base_colbox[3]/2,
|
||||
ent.base_colbox[4]/2,
|
||||
ent.base_colbox[5]/2,
|
||||
ent.base_colbox[6]/2,
|
||||
}
|
||||
})
|
||||
ent.child = true
|
||||
end
|
||||
|
||||
-- Possible spawn offsets, two of these will get selected
|
||||
local k = 0.7
|
||||
local offsets = {
|
||||
{ x=k, y=0, z=0 },
|
||||
{ x=-k, y=0, z=0 },
|
||||
{ x=0, y=0, z=k },
|
||||
{ x=0, y=0, z=-k },
|
||||
{ x=k, y=0, z=k },
|
||||
{ x=k, y=0, z=-k },
|
||||
{ x=-k, y=0, z=k },
|
||||
{ x=-k, y=0, z=-k },
|
||||
}
|
||||
for i=1, 2 do
|
||||
local o = pr:next(1, #offsets)
|
||||
local offset = offsets[o]
|
||||
local child_pos = vector.add(pos, offsets[o])
|
||||
table.remove(offsets, o)
|
||||
make_child(minetest.add_entity(child_pos, "mobs_mc:ocelot"))
|
||||
end
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
-- compatibility
|
||||
mobs:alias_mob("mobs:kitten", "mobs_mc:ocelot")
|
||||
|
||||
-- spawn eggs
|
||||
-- FIXME: The spawn icon shows a cat texture, not an ocelot texture
|
||||
mobs:register_egg("mobs_mc:ocelot", S("Ocelot"), "mobs_mc_spawn_icon_cat.png", 0)
|
||||
|
||||
if minetest.settings:get_bool("log_mods") then
|
||||
minetest.log("action", "MC Ocelot loaded")
|
||||
end
|
@ -1,18 +0,0 @@
|
||||
|
||||
-- Compatibility with deleted mobs
|
||||
|
||||
-- Magically turn horses into rabbits and cows. :D
|
||||
mobs:alias_mob("mobs_mc:horse", "mobs_mc:rabbit")
|
||||
mobs:alias_mob("mobs_mc:horse2", "mobs_mc:cow")
|
||||
mobs:alias_mob("mobs_mc:horse3", "mobs_mc:cow")
|
||||
|
||||
minetest.register_alias("mobs_mc:horse", "mobs_mc:rabbit")
|
||||
minetest.register_alias("mobs_mc:horse2", "mobs_mc:cow")
|
||||
minetest.register_alias("mobs_mc:horse3", "mobs_mc:cow")
|
||||
|
||||
-- Magically turn wolves into sheep. (How ironic!)
|
||||
mobs:alias_mob("mobs_mc:wolf", "mobs_mc:sheep")
|
||||
mobs:alias_mob("mobs_mc:dog", "mobs_mc:sheep")
|
||||
|
||||
minetest.register_alias("mobs_mc:wolf", "mobs_mc:sheep")
|
||||
|
97
mods/ENTITIES/mobs_mc/parrot.lua
Normal file
97
mods/ENTITIES/mobs_mc/parrot.lua
Normal file
@ -0,0 +1,97 @@
|
||||
--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")
|
||||
|
||||
|
||||
--###################
|
||||
--################### PARROT
|
||||
--###################
|
||||
|
||||
|
||||
|
||||
mobs:register_mob("mobs_mc:parrot", {
|
||||
type = "npc",
|
||||
pathfinding = 1,
|
||||
hp_min = 6,
|
||||
hp_max = 6,
|
||||
collisionbox = {-0.25, -0.01, -0.25, 0.25, 0.89, 0.25},
|
||||
visual = "mesh",
|
||||
mesh = "mobs_mc_parrot.b3d",
|
||||
textures = {{"mobs_mc_parrot_blue.png"},{"mobs_mc_parrot_green.png"},{"mobs_mc_parrot_grey.png"},{"mobs_mc_parrot_red_blue.png"},{"mobs_mc_parrot_yellow_blue.png"}},
|
||||
visual_size = {x=3, y=3},
|
||||
makes_footstep_sound = true,
|
||||
walk_velocity = 3,
|
||||
run_velocity = 5,
|
||||
drops = {
|
||||
{name = mobs_mc.items.feather,
|
||||
chance = 1,
|
||||
min = 1,
|
||||
max = 2,},
|
||||
},
|
||||
animation = {
|
||||
stand_speed = 50,
|
||||
walk_speed = 50,
|
||||
stand_start = 0,
|
||||
stand_end = 0,
|
||||
walk_start = 0,
|
||||
walk_end = 130,
|
||||
--run_start = 0,
|
||||
--run_end = 20,
|
||||
--fly_start = 30,
|
||||
--fly_end = 45,
|
||||
},
|
||||
walk_chance = 100,
|
||||
water_damage = 0,
|
||||
lava_damage = 4,
|
||||
light_damage = 0,
|
||||
fall_damage = 0,
|
||||
fall_speed = -2.25,
|
||||
attack_type = "dogfight",
|
||||
jump = true,
|
||||
jump_height = 4,
|
||||
floats = 1,
|
||||
physical = true,
|
||||
fly = true,
|
||||
fly_in = {"air"},
|
||||
fear_height = 4,
|
||||
view_range = 16,
|
||||
follow = mobs_mc.follow.parrot,
|
||||
on_rightclick = function(self, clicker)
|
||||
if self._doomed then return end
|
||||
local item = clicker:get_wielded_item()
|
||||
-- Kill parrot if fed with cookie
|
||||
if item:get_name() == mobs_mc.items.cookie then
|
||||
self.health = 0
|
||||
-- Doomed to die
|
||||
self._doomed = true
|
||||
if not minetest.settings:get_bool("creative_mode") then
|
||||
item:take_item()
|
||||
clicker:set_wielded_item(item)
|
||||
end
|
||||
return
|
||||
end
|
||||
|
||||
-- Feed to tame, but not breed
|
||||
if mobs:feed_tame(self, clicker, 1, false, true) then return end
|
||||
if mobs:protect(self, clicker) then return end
|
||||
if mobs:capture_mob(self, clicker, 0, 50, 80, false, nil) then return end
|
||||
end,
|
||||
|
||||
})
|
||||
|
||||
|
||||
--spawn
|
||||
|
||||
-- spawn eggs
|
||||
mobs:register_egg("mobs_mc:parrot", S("Parrot"), "mobs_mc_spawn_icon_parrot.png", 0)
|
||||
|
||||
if minetest.settings:get_bool("log_mods") then
|
||||
minetest.log("action", "MC Parrot loaded")
|
||||
end
|
@ -1,48 +1,46 @@
|
||||
--MCmobs v0.2
|
||||
--maikerumine
|
||||
--made for MC like Survival game
|
||||
--License for code WTFPL and otherwise stated in readmes
|
||||
|
||||
|
||||
--dofile(minetest.get_modpath("mobs").."/api.lua")
|
||||
-- intllib
|
||||
local MP = minetest.get_modpath(minetest.get_current_modname())
|
||||
local S, NS = dofile(MP.."/intllib.lua")
|
||||
|
||||
mobs:register_mob("mobs_mc:pig", {
|
||||
type = "animal",
|
||||
runaway = true,
|
||||
hp_min = 10,
|
||||
hp_max = 10,
|
||||
collisionbox = {-0.5, -0.01, -0.5, 0.5, 0.874, 0.5},
|
||||
|
||||
collisionbox = {-0.45, -0.01, -0.45, 0.45, 0.865, 0.45},
|
||||
visual = "mesh",
|
||||
visual_size = {x=0.875, y=0.875},
|
||||
mesh = "mobs_pig.x",
|
||||
mesh = "mobs_mc_pig.b3d",
|
||||
textures = {
|
||||
{"mobs_pig.png"}
|
||||
{"mobs_mc_pig.png"},
|
||||
},
|
||||
visual_size = {x=2.5, y=2.5},
|
||||
makes_footstep_sound = true,
|
||||
walk_velocity = 1,
|
||||
armor = 100,
|
||||
run_velocity = 3,
|
||||
drops = {
|
||||
{name = "mcl_mobitems:porkchop",
|
||||
{name = mobs_mc.items.porkchop_raw,
|
||||
chance = 1,
|
||||
min = 1,
|
||||
max = 3,},
|
||||
},
|
||||
drawtype = "front",
|
||||
lava_damage = minetest.registered_nodes["mcl_core:lava_source"].damage_per_second,
|
||||
water_damage = 1,
|
||||
lava_damage = 4,
|
||||
light_damage = 0,
|
||||
fear_height = 4,
|
||||
jump_height = 4.5,
|
||||
sounds = {
|
||||
random = "mobs_pig",
|
||||
death = "mobs_pig_angry",
|
||||
damage = "mobs_pig",
|
||||
distance = 16,
|
||||
},
|
||||
animation = {
|
||||
speed_normal = 24,
|
||||
speed_normal = 40,
|
||||
stand_start = 0,
|
||||
stand_end = 23,
|
||||
walk_start = 24,
|
||||
walk_end = 49,
|
||||
stand_end = 0,
|
||||
walk_start = 0,
|
||||
walk_end = 40,
|
||||
hurt_start = 118,
|
||||
hurt_end = 154,
|
||||
death_start = 154,
|
||||
@ -52,8 +50,43 @@ mobs:register_mob("mobs_mc:pig", {
|
||||
look_start = 78,
|
||||
look_end = 108,
|
||||
},
|
||||
follow = {"mcl_farming:beetroot_item", "mcl_farming:carrot_item", "mcl_mobitems:carrot_on_a_stick", "mcl_farming:potato_item"},
|
||||
follow = mobs_mc.follow.pig,
|
||||
view_range = 5,
|
||||
do_custom = function(self, dtime)
|
||||
|
||||
-- set needed values if not already present
|
||||
if not self.v2 then
|
||||
self.v2 = 0
|
||||
self.max_speed_forward = 4
|
||||
self.max_speed_reverse = 2
|
||||
self.accel = 4
|
||||
self.terrain_type = 3
|
||||
self.driver_attach_at = {x = 0.0, y = 6.75, z = -1.5}
|
||||
self.driver_eye_offset = {x = 0, y = 3, z = 0}
|
||||
self.driver_scale = {x = 1/self.visual_size.x, y = 1/self.visual_size.y}
|
||||
end
|
||||
|
||||
-- if driver present allow control of horse
|
||||
if self.driver then
|
||||
|
||||
mobs.drive(self, "walk", "stand", false, dtime)
|
||||
|
||||
return false -- skip rest of mob functions
|
||||
end
|
||||
|
||||
return true
|
||||
end,
|
||||
|
||||
on_die = function(self, pos)
|
||||
|
||||
-- drop saddle when horse is killed while riding
|
||||
-- also detach from horse properly
|
||||
if self.driver then
|
||||
mobs.detach(self.driver, {x = 1, y = 0, z = 1})
|
||||
end
|
||||
|
||||
end,
|
||||
|
||||
on_rightclick = function(self, clicker)
|
||||
if not clicker or not clicker:is_player() then
|
||||
return
|
||||
@ -61,31 +94,35 @@ mobs:register_mob("mobs_mc:pig", {
|
||||
|
||||
local wielditem = clicker:get_wielded_item()
|
||||
-- Feed pig
|
||||
if wielditem:get_name() ~= "mcl_mobitems:carrot_on_a_stick" then
|
||||
if mobs:feed_tame(self, clicker, 1, true, true) then
|
||||
return
|
||||
if wielditem:get_name() ~= mobs_mc.items.carrot_on_a_stick then
|
||||
if mobs:feed_tame(self, clicker, 1, true, true) then return end
|
||||
end
|
||||
if mobs:protect(self, clicker) then return end
|
||||
|
||||
if self.child then
|
||||
return
|
||||
end
|
||||
|
||||
-- Put saddle on pig
|
||||
local item = clicker:get_wielded_item()
|
||||
if item:get_name() == "mcl_mobitems:saddle" and self.saddle ~= "yes" then
|
||||
if item:get_name() == mobs_mc.items.saddle and self.saddle ~= "yes" then
|
||||
self.base_texture = {"mobs_mc_pig.png^mobs_mc_pig_saddle.png"}
|
||||
self.object:set_properties({
|
||||
textures = {"mobs_pig_with_saddle.png"},
|
||||
textures = self.base_texture
|
||||
})
|
||||
self.saddle = "yes"
|
||||
self.tamed = true
|
||||
self.drops = {
|
||||
{name = "mcl_mobitems:porkchop",
|
||||
{name = mobs_mc.items.porkchop_raw,
|
||||
chance = 1,
|
||||
min = 1,
|
||||
max = 3,},
|
||||
{name = "mcl_mobitems:saddle",
|
||||
{name = mobs_mc.items.saddle,
|
||||
chance = 1,
|
||||
min = 1,
|
||||
max = 1,},
|
||||
}
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
if not minetest.settings:get_bool("creative_mode") then
|
||||
local inv = clicker:get_inventory()
|
||||
local stack = inv:get_stack("main", clicker:get_wield_index())
|
||||
stack:take_item()
|
||||
@ -94,89 +131,55 @@ mobs:register_mob("mobs_mc:pig", {
|
||||
return
|
||||
end
|
||||
|
||||
-- from boats mod
|
||||
-- Ride pig if it has a saddle and player uses a carrot on a stick
|
||||
-- Mount or detach player
|
||||
local name = clicker:get_player_name()
|
||||
if self.driver and clicker == self.driver then
|
||||
self.driver = nil
|
||||
clicker:set_detach()
|
||||
mcl_player.player_attached[name] = false
|
||||
mcl_player.player_set_animation(clicker, "stand" , 30)
|
||||
elseif not self.driver and self.saddle == "yes" then
|
||||
self.driver = clicker
|
||||
clicker:set_attach(self.object, "", {x = 0, y = 19, z = 0}, {x = 0, y = 0, z = 0})
|
||||
mcl_player.player_attached[name] = true
|
||||
minetest.after(0.2, function()
|
||||
mcl_player.player_set_animation(clicker, "sit" , 30)
|
||||
end)
|
||||
if self.name == "mobs_mc:pig" and self.saddle == "yes" and self.driver then
|
||||
if wielditem:get_name() == "mcl_mobitems:carrot_on_a_stick" then
|
||||
local yaw = self.driver:get_look_yaw() - math.pi / 2
|
||||
local velo = self.object:getvelocity()
|
||||
local v = 1.5
|
||||
if math.abs(velo.x) + math.abs(velo.z) < .6 then velo.y = 5 end
|
||||
self.state = "walk"
|
||||
self.object:setyaw(yaw)
|
||||
self.object:setvelocity({x = -math.sin(yaw) * v, y = velo.y, z = math.cos(yaw) * v})
|
||||
-- Detach if already attached
|
||||
mobs.detach(clicker, {x=1, y=0, z=0})
|
||||
return
|
||||
|
||||
elseif not self.driver and self.saddle == "yes" and wielditem:get_name() == mobs_mc.items.carrot_on_a_stick then
|
||||
-- Ride pig if it has a saddle and player uses a carrot on a stick
|
||||
|
||||
mobs.attach(self, clicker)
|
||||
|
||||
if not minetest.settings:get_bool("creative_mode") then
|
||||
|
||||
local inv = self.driver:get_inventory()
|
||||
-- 26 uses
|
||||
if wielditem:get_wear() > 63000 then
|
||||
wielditem = {name = "mcl_fishing:fishing_rod", count = 1}
|
||||
-- Break carrot on a stick
|
||||
local def = wielditem:get_definition()
|
||||
if def.sounds and def.sounds.breaks then
|
||||
minetest.sound_play(def.sounds.breaks, {pos = clicker:getpos(), max_hear_distance = 8, gain = 0.5})
|
||||
end
|
||||
wielditem = {name = mobs_mc.items.fishing_rod, count = 1}
|
||||
else
|
||||
wielditem:add_wear(2521)
|
||||
end
|
||||
inv:set_stack("main",self.driver:get_wield_index(), wielditem)
|
||||
end
|
||||
return
|
||||
end
|
||||
end
|
||||
|
||||
-- Capture pig
|
||||
elseif not self.driver and clicker:get_wielded_item():get_name() ~= "" then
|
||||
mobs:capture_mob(self, clicker, 0, 5, 60, false, nil)
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
mobs:register_spawn("mobs_mc:pig", {"mcl_core:dirt_with_grass"}, 20, 9, 5000, 1, 31000)
|
||||
|
||||
|
||||
--[[
|
||||
|
||||
on_step = function(self, dtime)
|
||||
-- ridable pigs
|
||||
if self.name == "mobs:pig" and self.saddle == "yes" and self.driver then
|
||||
local item = self.driver:get_wielded_item()
|
||||
if item:get_name() == "mobs:carrotstick" then
|
||||
local yaw = self.driver:get_look_yaw() - math.pi / 2
|
||||
local velo = self.object:getvelocity()
|
||||
local v = 1.5
|
||||
if math.abs(velo.x) + math.abs(velo.z) < .6 then velo.y = 5 end
|
||||
self.state = "walk"
|
||||
self.object:setyaw(yaw)
|
||||
self.object:setvelocity({x = -math.sin(yaw) * v, y = velo.y, z = math.cos(yaw) * v})
|
||||
|
||||
local inv = self.driver:get_inventory()
|
||||
local stack = inv:get_stack("main", self.driver:get_wield_index())
|
||||
stack:add_wear(100)
|
||||
if stack:get_wear() > 65400 then
|
||||
stack = {name = "fishing:pole", count = 1}
|
||||
end
|
||||
inv:set_stack("main", self.driver:get_wield_index(), stack)
|
||||
return
|
||||
end
|
||||
end
|
||||
end,
|
||||
]]
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
mobs:register_spawn("mobs_mc:pig", mobs_mc.spawn.grassland, minetest.LIGHT_MAX+1, 9, 15000, 30, 31000)
|
||||
|
||||
-- compatibility
|
||||
mobs:alias_mob("mobs:pig", "mobs_mc:pig")
|
||||
|
||||
-- spawn eggs
|
||||
mobs:register_egg("mobs_mc:pig", "Spawn Pig", "spawn_egg_pig.png")
|
||||
mobs:register_egg("mobs_mc:pig", S("Pig"), "mobs_mc_spawn_icon_pig.png", 0)
|
||||
|
||||
|
||||
if minetest.settings:get("log_mods") then
|
||||
|
||||
|
||||
|
||||
if minetest.setting_get("log_mods") then
|
||||
minetest.log("action", "MC Pig loaded")
|
||||
end
|
||||
|
83
mods/ENTITIES/mobs_mc/polar_bear.lua
Normal file
83
mods/ENTITIES/mobs_mc/polar_bear.lua
Normal file
@ -0,0 +1,83 @@
|
||||
--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")
|
||||
|
||||
--###################
|
||||
--################### POLARBEAR
|
||||
--###################
|
||||
|
||||
|
||||
mobs:register_mob("mobs_mc:polar_bear", {
|
||||
type = "animal",
|
||||
runaway = false,
|
||||
passive = false,
|
||||
stepheight = 1.2,
|
||||
hp_min = 30,
|
||||
hp_max = 30,
|
||||
collisionbox = {-0.7, -0.01, -0.7, 0.7, 1.39, 0.7},
|
||||
visual = "mesh",
|
||||
mesh = "mobs_mc_polarbear.b3d",
|
||||
textures = {
|
||||
{"mobs_mc_polarbear.png"},
|
||||
},
|
||||
visual_size = {x=3.0, y=3.0},
|
||||
makes_footstep_sound = true,
|
||||
damage = 6,
|
||||
walk_velocity = 1.2,
|
||||
run_velocity = 2.4,
|
||||
group_attack = true,
|
||||
attack_type = "dogfight",
|
||||
drops = {
|
||||
-- 3/4 chance to drop raw fish (poor approximation)
|
||||
{name = mobs_mc.items.fish_raw,
|
||||
chance = 2,
|
||||
min = 0,
|
||||
max = 2,},
|
||||
-- 1/4 to drop raw salmon
|
||||
{name = mobs_mc.items.salmon_raw,
|
||||
chance = 4,
|
||||
min = 0,
|
||||
max = 2,},
|
||||
|
||||
},
|
||||
water_damage = 0,
|
||||
floats = 1,
|
||||
lava_damage = 5,
|
||||
light_damage = 0,
|
||||
fear_height = 4,
|
||||
sounds = {
|
||||
random = "Cowhurt1", -- TODO: Replace
|
||||
distance = 16,
|
||||
},
|
||||
animation = {
|
||||
speed_normal = 25, speed_run = 50,
|
||||
stand_start = 0, stand_end = 0,
|
||||
walk_start = 0, walk_end = 40,
|
||||
run_start = 0, run_end = 40,
|
||||
},
|
||||
|
||||
view_range = 16,
|
||||
})
|
||||
|
||||
|
||||
-- compatibility
|
||||
mobs:alias_mob("mobs_mc:polarbear", "mobs_mc:polar_bear")
|
||||
|
||||
|
||||
mobs:register_spawn("mobs_mc:polar_bear", mobs_mc.spawn.snow, minetest.LIGHT_MAX+1, 0, 7000, 3, 31000)
|
||||
|
||||
|
||||
-- spawn egg
|
||||
|
||||
|
||||
|
||||
mobs:register_egg("mobs_mc:polar_bear", S("Polar Bear"), "mobs_mc_spawn_icon_polarbear.png", 0)
|
||||
|
||||
|
||||
if minetest.settings:get_bool("log_mods") then
|
||||
minetest.log("action", "MC Polar Bear loaded")
|
||||
end
|
@ -1,82 +1,174 @@
|
||||
--License for code WTFPL and otherwise stated in readmes
|
||||
|
||||
local S = mobs.intllib
|
||||
-- intllib
|
||||
local MP = minetest.get_modpath(minetest.get_current_modname())
|
||||
local S, NS = dofile(MP.."/intllib.lua")
|
||||
|
||||
|
||||
-- Rabbit by ExeterDad
|
||||
|
||||
mobs:register_mob("mobs_mc:rabbit", {
|
||||
local rabbit = {
|
||||
type = "animal",
|
||||
passive = true,
|
||||
reach = 1,
|
||||
reach = 2,
|
||||
|
||||
hp_min = 3,
|
||||
hp_max = 3,
|
||||
armor = 100,
|
||||
collisionbox = {-0.268, -0.5, -0.268, 0.268, 0.167, 0.268},
|
||||
collisionbox = {-0.2, -0.01, -0.2, 0.2, 0.49, 0.2},
|
||||
|
||||
visual = "mesh",
|
||||
mesh = "mobs_bunny.b3d",
|
||||
drawtype = "front",
|
||||
mesh = "mobs_mc_rabbit.b3d",
|
||||
textures = {
|
||||
{"mobs_bunny_black.png"},
|
||||
{"mobs_bunny_brown.png"},
|
||||
{"mobs_bunny_salt.png"},
|
||||
{"mobs_bunny_white.png"},
|
||||
{"mobs_bunny_gold.png"},
|
||||
{"mobs_mc_rabbit_brown.png"},
|
||||
{"mobs_mc_rabbit_gold.png"},
|
||||
{"mobs_mc_rabbit_white.png"},
|
||||
{"mobs_mc_rabbit_white_splotched.png"},
|
||||
{"mobs_mc_rabbit_salt.png"},
|
||||
{"mobs_mc_rabbit_black.png"},
|
||||
},
|
||||
visual_size = {x=1.5, y=1.5},
|
||||
sounds = {},
|
||||
makes_footstep_sound = false,
|
||||
walk_velocity = 1,
|
||||
run_velocity = 2,
|
||||
run_velocity = 3.7,
|
||||
floats = 1,
|
||||
runaway = true,
|
||||
jump = true,
|
||||
drops = {
|
||||
{name = "mcl_mobitems:rabbit", chance = 1, min = 0, max = 1},
|
||||
{name = "mcl_mobitems:rabbit_hide", chance = 1, min = 0, max = 1},
|
||||
{name = "mcl_mobitems:rabbit_foot", chance = 10, min = 1, max = 1},
|
||||
{name = mobs_mc.items.rabbit_raw, chance = 1, min = 0, max = 1},
|
||||
{name = mobs_mc.items.rabbit_hide, chance = 1, min = 0, max = 1},
|
||||
{name = mobs_mc.items.rabbit_foot, chance = 10, min = 1, max = 1},
|
||||
},
|
||||
lava_damage = minetest.registered_nodes["mcl_core:lava_source"].damage_per_second,
|
||||
water_damage = 1,
|
||||
lava_damage = 4,
|
||||
light_damage = 0,
|
||||
fear_height = 3,
|
||||
fear_height = 4,
|
||||
animation = {
|
||||
speed_normal = 15,
|
||||
stand_start = 1,
|
||||
stand_end = 15,
|
||||
walk_start = 16,
|
||||
walk_end = 24,
|
||||
punch_start = 16,
|
||||
punch_end = 24,
|
||||
speed_normal = 25, speed_run = 50,
|
||||
stand_start = 0, stand_end = 0,
|
||||
walk_start = 0, walk_end = 20,
|
||||
run_start = 0, run_end = 20,
|
||||
},
|
||||
follow = {"mcl_farming:carrot_item", "mcl_farming:carrot_item_gold", "mcl_flowers:dandelion"},
|
||||
-- Follow (yellow) dangelions, carrots and golden carrots
|
||||
follow = mobs_mc.follow.rabbit,
|
||||
view_range = 8,
|
||||
-- Eat carrots and reduce their growth stage by 1
|
||||
replace_rate = 10,
|
||||
replace_what = {"mcl_farming:carrot_3", "mcl_farming:carrot_2", "mcl_farming:carrot_1"},
|
||||
replace_with = "air",
|
||||
replace_what = mobs_mc.replace.rabbit,
|
||||
on_rightclick = function(self, clicker)
|
||||
|
||||
-- feed or tame
|
||||
if mobs:feed_tame(self, clicker, 1, true, true) then
|
||||
return
|
||||
end
|
||||
|
||||
-- Feed, tame protect or capture
|
||||
if mobs:feed_tame(self, clicker, 1, true, true) then return end
|
||||
if mobs:protect(self, clicker) then return end
|
||||
if mobs:capture_mob(self, clicker, 0, 50, 80, false, nil) then return end
|
||||
end,
|
||||
do_custom = function(self)
|
||||
-- Easter egg: Change texture if rabbit is named “Toast”
|
||||
if self.nametag == "Toast" and not self._has_toast_texture then
|
||||
self._original_rabbit_texture = self.base_texture
|
||||
self.base_texture = { "mobs_mc_rabbit_toast.png" }
|
||||
self.object:set_properties({ textures = self.base_texture })
|
||||
self._has_toast_texture = true
|
||||
elseif self.nametag ~= "Toast" and self._has_toast_texture then
|
||||
self.base_texture = self._original_rabbit_texture
|
||||
self.object:set_properties({ textures = self.base_texture })
|
||||
self._has_toast_texture = false
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
local spawn_on = {
|
||||
"mcl_core::dirt_with_grass", "mcl_core:sand", "mcl_core:snow", "mcl_core:snowblock", "mcl_core:podzol", "mcl_core:ice"
|
||||
}
|
||||
|
||||
mobs:spawn({
|
||||
mobs:register_mob("mobs_mc:rabbit", rabbit)
|
||||
|
||||
-- The killer bunny (Only with spawn egg)
|
||||
local killer_bunny = table.copy(rabbit)
|
||||
killer_bunny.type = "monster"
|
||||
killer_bunny.attack_type = "dogfight"
|
||||
killer_bunny.specific_attack = { "player", "mobs_mc:wolf", "mobs_mc:dog" }
|
||||
killer_bunny.damage = 8
|
||||
killer_bunny.passive = false
|
||||
-- 8 armor points
|
||||
killer_bunny.armor = 50
|
||||
killer_bunny.textures = { "mobs_mc_rabbit_caerbannog.png" }
|
||||
killer_bunny.view_range = 16
|
||||
killer_bunny.replace_rate = nil
|
||||
killer_bunny.replace_what = nil
|
||||
killer_bunny.on_rightclick = nil
|
||||
killer_bunny.run_velocity = 6
|
||||
killer_bunny.do_custom = function(self)
|
||||
if not self._killer_bunny_nametag_set then
|
||||
self.nametag = "The Killer Bunny"
|
||||
self._killer_bunny_nametag_set = true
|
||||
end
|
||||
end
|
||||
|
||||
mobs:register_mob("mobs_mc:killer_bunny", killer_bunny)
|
||||
|
||||
-- Mob spawning rules.
|
||||
-- Different skins depending on spawn location
|
||||
|
||||
local spawn = {
|
||||
name = "mobs_mc:rabbit",
|
||||
nodes = spawn_on,
|
||||
min_light = 10,
|
||||
chance = 15000,
|
||||
min_height = 0,
|
||||
day_toggle = true,
|
||||
})
|
||||
active_object_count = 99,
|
||||
min_light = 0,
|
||||
max_light = minetest.LIGHT_MAX+1,
|
||||
}
|
||||
|
||||
local spawn_desert = table.copy(spawn)
|
||||
spawn_desert.nodes = mobs_mc.spawn.desert
|
||||
on_spawn = function(self, pos)
|
||||
local ent = self:get_luaentity()
|
||||
texture = "mobs_mc_rabbit_gold.png"
|
||||
ent.base_texture = { "mobs_mc_rabbit_gold.png" }
|
||||
self:set_properties({textures = ent.base_texture})
|
||||
end
|
||||
mobs:spawn(spawn_desert)
|
||||
|
||||
local spawn_snow = table.copy(spawn)
|
||||
spawn_snow.nodes = mobs_mc.spawn.snow
|
||||
spawn_snow.on_spawn = function(self, pos)
|
||||
local ent = self:get_luaentity()
|
||||
local texture
|
||||
local r = math.random(1, 100)
|
||||
-- 80% white fur
|
||||
if r <= 80 then
|
||||
texture = "mobs_mc_rabbit_white.png"
|
||||
-- 20% black and white fur
|
||||
else
|
||||
texture = "mobs_mc_rabbit_white_splotched.png"
|
||||
end
|
||||
ent.base_texture = { texture }
|
||||
self:set_properties({textures = ent.base_texture})
|
||||
end
|
||||
mobs:spawn(spawn_snow)
|
||||
|
||||
local spawn_grass = table.copy(spawn)
|
||||
spawn_grass.nodes = mobs_mc.spawn.grassland
|
||||
spawn_grass.on_spawn = function(self, pos)
|
||||
local ent = self:get_luaentity()
|
||||
local texture
|
||||
local r = math.random(1, 100)
|
||||
-- 50% brown fur
|
||||
if r <= 50 then
|
||||
texture = "mobs_mc_rabbit_brown.png"
|
||||
-- 40% salt fur
|
||||
elseif r <= 90 then
|
||||
texture = "mobs_mc_rabbit_salt.png"
|
||||
-- 10% black fur
|
||||
else
|
||||
texture = "mobs_mc_rabbit_black.png"
|
||||
end
|
||||
ent.base_texture = { texture }
|
||||
self:set_properties({textures = ent.base_texture})
|
||||
end
|
||||
mobs:spawn(spawn_grass)
|
||||
|
||||
-- Spawn egg
|
||||
mobs:register_egg("mobs_mc:rabbit", S("Rabbit"), "mobs_mc_spawn_icon_rabbit.png", 0)
|
||||
|
||||
-- Note: This spawn egg does not exist in Minecraft
|
||||
mobs:register_egg("mobs_mc:killer_bunny", S("Killer Bunny"), "mobs_mc_spawn_icon_rabbit.png^[colorize:#FF0000:192", 0) -- TODO: Update inventory image
|
||||
|
||||
|
||||
mobs:register_egg("mobs_mc:rabbit", "Spawn Rabbit", "spawn_egg_rabbit.png", 0)
|
||||
|
||||
|
||||
mobs:alias_mob("mobs:bunny", "mobs_mc:bunny") -- compatibility
|
||||
-- compatibility
|
||||
mobs:alias_mob("mobs:bunny", "mobs_mc:rabbit")
|
||||
|
||||
if minetest.setting_get("log_mods") then
|
||||
minetest.log("action", "MC Bunny loaded")
|
||||
end
|
||||
|
@ -1,127 +1,138 @@
|
||||
--MCmobs v0.2
|
||||
--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")
|
||||
|
||||
--###################
|
||||
--################### SHEEP
|
||||
--###################
|
||||
|
||||
local colors = {
|
||||
-- dyecolor = { woolcolor, textures }
|
||||
white = { "white", { "mobs_sheep.png" } },
|
||||
brown = { "brown", { "mobs_sheep_brown.png" } },
|
||||
grey = { "silver", { "mobs_sheep_grey.png" } },
|
||||
dark_grey = { "grey", { "mobs_sheep_dark_grey.png" } },
|
||||
blue = { "blue", { "mobs_sheep_blue.png" } },
|
||||
lightblue = { "light_blue", { "mobs_sheep_lightblue.png" } },
|
||||
dark_green = { "green", { "mobs_sheep_dark_green.png" } },
|
||||
green = { "lime", { "mobs_sheep_green.png" } },
|
||||
violet = { "purple", { "mobs_sheep_violet.png" } },
|
||||
pink = { "pink", { "mobs_sheep_pink.png" } },
|
||||
yellow = { "yellow", { "mobs_sheep_yellow.png" } },
|
||||
orange = { "orange", { "mobs_sheep_orange.png" } },
|
||||
red = { "red", { "mobs_sheep_red.png" } },
|
||||
cyan = { "cyan", { "mobs_sheep_cyan.png" } },
|
||||
magenta = { "magenta", { "mobs_sheep_magenta.png" } },
|
||||
black = { "black", { "mobs_sheep_black.png" } },
|
||||
-- group = { wool, textures }
|
||||
unicolor_white = { mobs_mc.items.wool_white, "#FFFFFF00" },
|
||||
unicolor_dark_orange = { mobs_mc.items.wool_brown, "#502A00D0" },
|
||||
unicolor_grey = { mobs_mc.items.wool_light_grey, "#5B5B5BD0" },
|
||||
unicolor_darkgrey = { mobs_mc.items.wool_grey, "#303030D0" },
|
||||
unicolor_blue = { mobs_mc.items.wool_blue, "#0000CCD0" },
|
||||
unicolor_dark_green = { mobs_mc.items.wool_green, "#005000D0" },
|
||||
unicolor_green = { mobs_mc.items.wool_lime, "#50CC00D0" },
|
||||
unicolor_violet = { mobs_mc.items.wool_purple , "#5000CCD0" },
|
||||
unicolor_light_red = { mobs_mc.items.wool_pink, "#FF5050D0" },
|
||||
unicolor_yellow = { mobs_mc.items.wool_yellow, "#CCCC00D0" },
|
||||
unicolor_orange = { mobs_mc.items.wool_orange, "#CC5000D0" },
|
||||
unicolor_red = { mobs_mc.items.wool_red, "#CC0000D0" },
|
||||
unicolor_cyan = { mobs_mc.items.wool_cyan, "#00CCCCD0" },
|
||||
unicolor_red_violet = { mobs_mc.items.wool_magenta, "#CC0050D0" },
|
||||
unicolor_black = { mobs_mc.items.wool_black, "#000000D0" },
|
||||
}
|
||||
|
||||
-- Sheep
|
||||
if minetest.get_modpath("mcl_wool") ~= nil then
|
||||
colors["unicolor_light_blue"] = { mobs_mc.items.wool_light_blue, "#5050FFD0" }
|
||||
end
|
||||
|
||||
local sheep_texture = function(color_group)
|
||||
return {"mobs_mc_sheep.png^(mobs_mc_sheep_fur.png^[colorize:"..colors[color_group][2]..")"}
|
||||
end
|
||||
|
||||
--mcsheep
|
||||
mobs:register_mob("mobs_mc:sheep", {
|
||||
type = "animal",
|
||||
hp_min = 8,
|
||||
hp_max = 8,
|
||||
-- FIXME: Should be 1.3 blocks high
|
||||
collisionbox = {-0.45, -0.01, -0.45, 0.45, 1.09, 0.45},
|
||||
|
||||
collisionbox = {-0.45, -0.01, -0.45, 0.45, 1.29, 0.45},
|
||||
|
||||
visual = "mesh",
|
||||
visual_size = {x=0.6, y=0.6},
|
||||
mesh = "mobs_sheep.x",
|
||||
textures = {{"mobs_sheep.png"}},
|
||||
visual_size = {x=3, y=3},
|
||||
mesh = "mobs_mc_sheepfur.b3d",
|
||||
gotten_mesh = "mobs_mc_sheepnaked.b3d",
|
||||
textures = { sheep_texture("unicolor_white") },
|
||||
color = "unicolor_white",
|
||||
makes_footstep_sound = true,
|
||||
walk_velocity = 1,
|
||||
armor = 100,
|
||||
drops = {
|
||||
{name = "mcl_mobitems:mutton",
|
||||
{name = mobs_mc.items.mutton_raw,
|
||||
chance = 1,
|
||||
min = 1,
|
||||
max = 2,},
|
||||
{name = "mcl_wool:white",
|
||||
{name = colors["unicolor_white"][1],
|
||||
chance = 1,
|
||||
min = 1,
|
||||
max = 1,},
|
||||
},
|
||||
drawtype = "front",
|
||||
lava_damage = minetest.registered_nodes["mcl_core:lava_source"].damage_per_second,
|
||||
water_damage = 1,
|
||||
lava_damage = 4,
|
||||
light_damage = 0,
|
||||
fear_height = 4,
|
||||
jump_height = 4.5,
|
||||
sounds = {
|
||||
random = "mobs_sheep",
|
||||
death = "mobs_sheep",
|
||||
damage = "mobs_sheep",
|
||||
distance = 16,
|
||||
},
|
||||
animation = {
|
||||
speed_normal = 24,
|
||||
stand_start = 0,
|
||||
stand_end = 23,
|
||||
walk_start = 24,
|
||||
walk_end = 49,
|
||||
hurt_start = 118,
|
||||
hurt_end = 154,
|
||||
death_start = 154,
|
||||
death_end = 179,
|
||||
eat_start = 49,
|
||||
eat_end = 78,
|
||||
look_start = 78,
|
||||
look_end = 108,
|
||||
speed_normal = 25, speed_run = 50,
|
||||
stand_start = 40, stand_end = 80,
|
||||
walk_start = 0, walk_end = 40,
|
||||
run_start = 0, run_end = 40,
|
||||
},
|
||||
follow = {"mcl_farming:wheat_item"},
|
||||
view_range = 5,
|
||||
follow = mobs_mc.follow.sheep,
|
||||
view_range = 12,
|
||||
|
||||
replace_rate = 10,
|
||||
replace_what = {"mcl_core:dirt_with_grass", "mcl_flowers:tallgrass"},
|
||||
replace_with = "air",
|
||||
-- Eat grass
|
||||
replace_rate = 20,
|
||||
replace_what = mobs_mc.replace.sheep,
|
||||
-- Properly regrow wool after eating grass
|
||||
on_replace = function(self, pos, oldnode, newnode)
|
||||
self.gotten = false
|
||||
self.drops = {
|
||||
{name = mobs_mc.items.mutton_raw,
|
||||
chance = 1,
|
||||
min = 1,
|
||||
max = 2,},
|
||||
{name = colors[self.color][1],
|
||||
chance = 1,
|
||||
min = 1,
|
||||
max = 1,},
|
||||
}
|
||||
self.object:set_properties({
|
||||
mesh = "mobs_mc_sheepfur.b3d",
|
||||
})
|
||||
end,
|
||||
|
||||
-- Set random color on spawn
|
||||
do_custom = function(self)
|
||||
if not self.initial_color_set then
|
||||
local r = math.random(0,100000)
|
||||
local textures
|
||||
if r <= 81836 then
|
||||
-- 81.836%
|
||||
self.color = colors["white"][1]
|
||||
textures = colors["white"][2]
|
||||
self.base_texture = colors["white"][2]
|
||||
self.color = "unicolor_white"
|
||||
elseif r <= 81836 + 5000 then
|
||||
-- 5%
|
||||
self.color = colors["grey"][1]
|
||||
textures = colors["grey"][2]
|
||||
self.base_texture = colors["grey"][2]
|
||||
self.color = "unicolor_grey"
|
||||
elseif r <= 81836 + 5000 + 5000 then
|
||||
-- 5%
|
||||
self.color = colors["dark_grey"][1]
|
||||
textures = colors["dark_grey"][2]
|
||||
self.base_texture = colors["dark_grey"][2]
|
||||
self.color = "unicolor_darkgrey"
|
||||
elseif r <= 81836 + 5000 + 5000 + 5000 then
|
||||
-- 5%
|
||||
self.color = colors["black"][1]
|
||||
textures = colors["black"][2]
|
||||
self.base_texture = colors["black"][2]
|
||||
self.color = "unicolor_black"
|
||||
elseif r <= 81836 + 5000 + 5000 + 5000 + 3000 then
|
||||
-- 3%
|
||||
self.color = colors["brown"][1]
|
||||
textures = colors["brown"][2]
|
||||
self.base_texture = colors["brown"][2]
|
||||
self.color = "unicolor_dark_orange"
|
||||
else
|
||||
-- 0.164%
|
||||
self.color = colors["pink"][1]
|
||||
textures = colors["pink"][2]
|
||||
self.base_texture = colors["pink"][2]
|
||||
self.color = "unicolor_light_red"
|
||||
end
|
||||
self.textures = { textures },
|
||||
self.object:set_properties({ textures = textures })
|
||||
self.base_texture = sheep_texture(self.color)
|
||||
self.object:set_properties({ textures = self.base_texture })
|
||||
self.drops = {
|
||||
{name = "mcl_mobitems:mutton",
|
||||
{name = mobs_mc.items.mutton_raw,
|
||||
chance = 1,
|
||||
min = 1,
|
||||
max = 2,},
|
||||
{name = "mcl_wool:"..self.color,
|
||||
{name = colors[self.color][1],
|
||||
chance = 1,
|
||||
min = 1,
|
||||
max = 1,},
|
||||
@ -129,69 +140,72 @@ mobs:register_mob("mobs_mc:sheep", {
|
||||
self.initial_color_set = true
|
||||
end
|
||||
end,
|
||||
|
||||
on_rightclick = function(self, clicker)
|
||||
|
||||
if mobs:feed_tame(self, clicker, 1, true, true) then
|
||||
return
|
||||
end
|
||||
|
||||
local item = clicker:get_wielded_item()
|
||||
if item:get_name() == "mcl_tools:shears" and not self.gotten and not self.child then
|
||||
|
||||
if mobs:feed_tame(self, clicker, 1, true, true) then return end
|
||||
if mobs:protect(self, clicker) then return end
|
||||
|
||||
if item:get_name() == mobs_mc.items.shears and not self.gotten then
|
||||
self.gotten = true
|
||||
local pos = self.object:getpos()
|
||||
minetest.sound_play("shears", {pos = pos})
|
||||
pos.y = pos.y + 0.5
|
||||
if not self.color then
|
||||
minetest.add_item(pos, ItemStack("mcl_wool:white "..math.random(1,3)))
|
||||
else
|
||||
minetest.add_item(pos, ItemStack("mcl_wool:"..self.color.." "..math.random(1,3)))
|
||||
self.color = "unicolor_white"
|
||||
end
|
||||
minetest.add_item(pos, ItemStack(colors[self.color][1].." "..math.random(1,3)))
|
||||
self.object:set_properties({
|
||||
textures = {"mobs_sheep_sheared.png"},
|
||||
mesh = "mobs_mc_sheepnaked.b3d",
|
||||
})
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
item:add_wear(65535/238)
|
||||
if not minetest.settings:get_bool("creative_mode") then
|
||||
item:add_wear(mobs_mc.misc.shears_wear)
|
||||
clicker:get_inventory():set_stack("main", clicker:get_wield_index(), item)
|
||||
end
|
||||
end
|
||||
if minetest.get_item_group(item:get_name(), "dye") == 1 and not self.gotten then
|
||||
print(item:get_name(), minetest.get_item_group(item:get_name(), "dye"))
|
||||
local name = item:get_name()
|
||||
local pname = name:split(":")[2]
|
||||
|
||||
self.object:set_properties({
|
||||
textures = colors[pname][2],
|
||||
})
|
||||
self.base_texture = colors[pname][2]
|
||||
self.color = colors[pname][1]
|
||||
self.drops = {
|
||||
{name = "mcl_mobitems:mutton",
|
||||
{name = mobs_mc.items.mutton_raw,
|
||||
chance = 1,
|
||||
min = 1,
|
||||
max = 2,},
|
||||
{name = "mcl_wool:"..self.color,
|
||||
}
|
||||
return
|
||||
end
|
||||
-- Dye sheep
|
||||
if minetest.get_item_group(item:get_name(), "dye") == 1 and not self.gotten then
|
||||
minetest.log("verbose", "[mobs_mc] " ..item:get_name() .. " " .. minetest.get_item_group(item:get_name(), "dye"))
|
||||
for group, colordata in pairs(colors) do
|
||||
if minetest.get_item_group(item:get_name(), group) == 1 then
|
||||
self.base_texture = sheep_texture(group)
|
||||
self.object:set_properties({
|
||||
textures = self.base_texture,
|
||||
})
|
||||
self.color = group
|
||||
self.drops = {
|
||||
{name = mobs_mc.items.mutton_raw,
|
||||
chance = 1,
|
||||
min = 1,
|
||||
max = 2,},
|
||||
{name = colordata[1],
|
||||
chance = 1,
|
||||
min = 1,
|
||||
max = 1,},
|
||||
}
|
||||
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
item:take_item()
|
||||
clicker:get_inventory():set_stack("main", clicker:get_wield_index(), item)
|
||||
break
|
||||
end
|
||||
end
|
||||
return
|
||||
end
|
||||
if mobs:capture_mob(self, clicker, 0, 5, 70, false, nil) then return end
|
||||
end,
|
||||
})
|
||||
mobs:register_spawn("mobs_mc:sheep", {"mcl_core:dirt_with_grass"}, 20, 9, 5000, 2, 31000)
|
||||
|
||||
mobs:register_spawn("mobs_mc:sheep", mobs_mc.spawn.grassland, minetest.LIGHT_MAX+1, 0, 15000, 3, 31000)
|
||||
|
||||
-- compatibility
|
||||
mobs:alias_mob("mobs:sheep", "mobs_mc:sheep")
|
||||
|
||||
mobs:alias_mob("mobs_animal:sheep", "mobs_mc:sheep")
|
||||
-- spawn eggs
|
||||
mobs:register_egg("mobs_mc:sheep", "Spawn Sheep", "spawn_egg_sheep.png")
|
||||
mobs:register_egg("mobs_mc:sheep", S("Sheep"), "mobs_mc_spawn_icon_sheep.png", 0)
|
||||
|
||||
|
||||
if minetest.setting_get("log_mods") then
|
||||
if minetest.settings:get_bool("log_mods") then
|
||||
minetest.log("action", "MC Sheep loaded")
|
||||
end
|
||||
|
93
mods/ENTITIES/mobs_mc/shulker.lua
Normal file
93
mods/ENTITIES/mobs_mc/shulker.lua
Normal file
@ -0,0 +1,93 @@
|
||||
--MCmobs v0.2
|
||||
--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")
|
||||
|
||||
--###################
|
||||
--################### SHULKER
|
||||
--###################
|
||||
|
||||
-- animation 45-80 is transition between passive and attack stance
|
||||
|
||||
mobs:register_mob("mobs_mc:shulker", {
|
||||
type = "monster",
|
||||
attack_type = "shoot",
|
||||
shoot_interval = 0.5,
|
||||
arrow = "mobs_mc:shulkerbullet",
|
||||
shoot_offset = 0.5,
|
||||
passive = false,
|
||||
hp_min = 30,
|
||||
hp_max = 30,
|
||||
armor = 150,
|
||||
collisionbox = {-0.5, -0.01, -0.5, 0.5, 0.99, 0.5},
|
||||
visual = "mesh",
|
||||
mesh = "mobs_mc_shulker.b3d",
|
||||
textures = { "mobs_mc_endergolem.png", },
|
||||
-- TODO: Make shulker dye-able
|
||||
visual_size = {x=3, y=3},
|
||||
walk_chance = 0,
|
||||
jump = false,
|
||||
drops = {
|
||||
{name = mobs_mc.items.shulker_shell,
|
||||
chance = 1,
|
||||
min = 0,
|
||||
max = 1,},
|
||||
},
|
||||
animation = {
|
||||
stand_speed = 25, walk_speed = 25, run_speed = 50, punch_speed = 25,
|
||||
speed_normal = 25, speed_run = 50,
|
||||
stand_start = 0, stand_end = 45,
|
||||
walk_start = 0, walk_end = 45,
|
||||
run_start = 0, run_end = 45,
|
||||
punch_start = 80, punch_end = 100,
|
||||
},
|
||||
blood_amount = 0,
|
||||
view_range = 16,
|
||||
fear_height = 4,
|
||||
water_damage = 1,
|
||||
lava_damage = 4,
|
||||
light_damage = 0,
|
||||
})
|
||||
|
||||
-- bullet arrow (weapon)
|
||||
mobs:register_arrow("mobs_mc:shulkerbullet", {
|
||||
visual = "sprite",
|
||||
visual_size = {x = 0.25, y = 0.25},
|
||||
textures = {"mobs_mc_shulkerbullet.png"},
|
||||
velocity = 6,
|
||||
|
||||
hit_player = function(self, player)
|
||||
player:punch(self.object, 1.0, {
|
||||
full_punch_interval = 1.0,
|
||||
damage_groups = {fleshy = 4},
|
||||
}, nil)
|
||||
end,
|
||||
|
||||
hit_mob = function(self, player)
|
||||
player:punch(self.object, 1.0, {
|
||||
full_punch_interval = 1.0,
|
||||
damage_groups = {fleshy = 4},
|
||||
}, nil)
|
||||
end,
|
||||
|
||||
hit_node = function(self, pos, node)
|
||||
end
|
||||
})
|
||||
|
||||
|
||||
mobs:register_egg("mobs_mc:shulker", S("Shulker"), "mobs_mc_spawn_icon_shulker.png", 0)
|
||||
|
||||
mobs:spawn_specific("mobs_mc:shulker", mobs_mc.spawn.end_city, 0, minetest.LIGHT_MAX+1, 5, 3, 1, -31000, -5000)
|
||||
|
||||
|
||||
|
||||
|
||||
if minetest.settings:get_bool("log_mods") then
|
||||
minetest.log("action", "MC Shulkers loaded")
|
||||
end
|
128
mods/ENTITIES/mobs_mc/silverfish.lua
Normal file
128
mods/ENTITIES/mobs_mc/silverfish.lua
Normal file
@ -0,0 +1,128 @@
|
||||
--###################
|
||||
--################### SILVERFISH
|
||||
--###################
|
||||
|
||||
-- intllib
|
||||
local MP = minetest.get_modpath(minetest.get_current_modname())
|
||||
local S, NS = dofile(MP.."/intllib.lua")
|
||||
|
||||
mobs:register_mob("mobs_mc:silverfish", {
|
||||
type = "monster",
|
||||
passive = false,
|
||||
group_attack = true,
|
||||
reach = 1,
|
||||
hp_min = 8,
|
||||
hp_max = 8,
|
||||
collisionbox = {-0.4, -0.01, -0.4, 0.4, 0.44, 0.4},
|
||||
visual = "mesh",
|
||||
mesh = "mobs_mc_silverfish.b3d",
|
||||
textures = {
|
||||
{"mobs_mc_silverfish.png"},
|
||||
},
|
||||
pathfinding = 1,
|
||||
visual_size = {x=3, y=3},
|
||||
sounds = {},
|
||||
makes_footstep_sound = false,
|
||||
walk_velocity = 0.6,
|
||||
run_velocity = 2,
|
||||
jump = true,
|
||||
water_damage = 1,
|
||||
lava_damage = 4,
|
||||
light_damage = 0,
|
||||
fear_height = 4,
|
||||
replace_what = mobs_mc.replace.silverfish,
|
||||
replace_rate = 2,
|
||||
animation = {
|
||||
speed_normal = 25, speed_run = 50,
|
||||
stand_start = 0, stand_end = 20,
|
||||
walk_start = 0, walk_end = 20,
|
||||
run_start = 0, run_end = 20,
|
||||
},
|
||||
view_range = 16,
|
||||
attack_type = "dogfight",
|
||||
damage = 1,
|
||||
blood_amount = 0,
|
||||
})
|
||||
|
||||
mobs:register_egg("mobs_mc:silverfish", S("Silverfish"), "mobs_mc_spawn_icon_silverfish.png", 0)
|
||||
|
||||
-- Monster egg blocks (Minetest Game)
|
||||
if minetest.get_modpath("default") and mobs_mc.create_monster_egg_nodes then
|
||||
local spawn_silverfish = function(pos, oldnode, oldmetadata, digger)
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
minetest.add_entity(pos, "mobs_mc:silverfish")
|
||||
end
|
||||
end
|
||||
minetest.register_node("mobs_mc:monster_egg_stone", {
|
||||
description = S("Stone Monster Egg"),
|
||||
tiles = {"default_stone.png"},
|
||||
groups = {oddly_breakable_by_hand = 2, spawns_silverfish = 1},
|
||||
drop = '',
|
||||
is_ground_content = true,
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
after_dig_node = spawn_silverfish,
|
||||
})
|
||||
|
||||
minetest.register_node("mobs_mc:monster_egg_cobble", {
|
||||
description = S("Cobblestone Monster Egg"),
|
||||
tiles = {"default_cobble.png"},
|
||||
is_ground_content = false,
|
||||
groups = {oddly_breakable_by_hand = 2, spawns_silverfish = 1},
|
||||
drop = '',
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
after_dig_node = spawn_silverfish,
|
||||
})
|
||||
|
||||
minetest.register_node("mobs_mc:monster_egg_mossycobble", {
|
||||
description = S("Mossy Cobblestone Monster Egg"),
|
||||
tiles = {"default_mossycobble.png"},
|
||||
is_ground_content = false,
|
||||
groups = {oddly_breakable_by_hand = 2, spawns_silverfish = 1},
|
||||
drop = '',
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
after_dig_node = spawn_silverfish,
|
||||
})
|
||||
|
||||
minetest.register_node("mobs_mc:monster_egg_stonebrick", {
|
||||
description = S("Stone Brick Monster Egg"),
|
||||
paramtype2 = "facedir",
|
||||
place_param2 = 0,
|
||||
tiles = {"default_stone_brick.png"},
|
||||
is_ground_content = false,
|
||||
groups = {oddly_breakable_by_hand = 2, spawns_silverfish = 1},
|
||||
drop = '',
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
after_dig_node = spawn_silverfish,
|
||||
})
|
||||
|
||||
minetest.register_node("mobs_mc:monster_egg_stone_block", {
|
||||
description = S("Stone Block Monster Egg"),
|
||||
tiles = {"default_stone_block.png"},
|
||||
is_ground_content = false,
|
||||
groups = {oddly_breakable_by_hand = 2, spawns_silverfish = 1},
|
||||
drop = '',
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
after_dig_node = spawn_silverfish,
|
||||
})
|
||||
|
||||
-- Randomly spawn stone monster eggs in the world
|
||||
local mg_name = minetest.get_mapgen_setting("mg_name")
|
||||
local scarcity
|
||||
if mg_name == "v6" then
|
||||
scarcity = 28 * 28 * 28
|
||||
else
|
||||
scarcity = 22 * 22 * 22
|
||||
end
|
||||
minetest.register_ore({
|
||||
ore_type = "scatter",
|
||||
ore = "mobs_mc:monster_egg_stone",
|
||||
wherein = "default:stone",
|
||||
clust_scarcity = scarcity,
|
||||
clust_num_ores = 3,
|
||||
clust_size = 2,
|
||||
y_min = -31000,
|
||||
y_max = 31000,
|
||||
biomes = { "grassland" },
|
||||
})
|
||||
|
||||
end
|
133
mods/ENTITIES/mobs_mc/skeleton+stray.lua
Normal file
133
mods/ENTITIES/mobs_mc/skeleton+stray.lua
Normal file
@ -0,0 +1,133 @@
|
||||
--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")
|
||||
|
||||
|
||||
--###################
|
||||
--################### SKELETON
|
||||
--###################
|
||||
|
||||
|
||||
|
||||
local skeleton = {
|
||||
type = "monster",
|
||||
hp_min = 20,
|
||||
hp_max = 20,
|
||||
collisionbox = {-0.3, -0.01, -0.3, 0.3, 1.98, 0.3},
|
||||
pathfinding = 1,
|
||||
group_attack = true,
|
||||
visual = "mesh",
|
||||
mesh = "mobs_mc_skeleton.b3d",
|
||||
textures = {
|
||||
{"mobs_mc_skeleton.png^mobs_mc_skeleton_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,},
|
||||
|
||||
-- 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 = {
|
||||
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 = 1,
|
||||
lava_damage = 4,
|
||||
light_damage = 1,
|
||||
view_range = 16,
|
||||
fear_height = 4,
|
||||
attack_type = "dogshoot",
|
||||
arrow = "mobs_mc:arrow_entity",
|
||||
shoot_interval = 2.5,
|
||||
shoot_offset = 1,
|
||||
dogshoot_switch = 1,
|
||||
dogshoot_count_max =1.8,
|
||||
blood_amount = 0,
|
||||
}
|
||||
|
||||
mobs:register_mob("mobs_mc:skeleton", skeleton)
|
||||
|
||||
|
||||
--###################
|
||||
--################### STRAY
|
||||
--###################
|
||||
|
||||
local stray = table.copy(skeleton)
|
||||
stray.mesh = "mobs_mc_stray.b3d"
|
||||
stray.textures = {
|
||||
{"mobs_mc_stray.png"},
|
||||
}
|
||||
-- TODO: different sound (w/ echo)
|
||||
-- TODO: stray's arrow inflicts slowness status
|
||||
table.insert(stray.drops, {
|
||||
-- Chance to drop additional arrow.
|
||||
-- TODO: Should be tipped arrow of slowness
|
||||
name = mobs_mc.items.arrow,
|
||||
chance = 2,
|
||||
min = 1,
|
||||
max = 1,
|
||||
})
|
||||
|
||||
mobs:register_mob("mobs_mc:stray", stray)
|
||||
|
||||
-- compatibility
|
||||
mobs:alias_mob("mobs:skeleton", "mobs_mc:skeleton")
|
||||
|
||||
--spawn
|
||||
mobs:spawn_specific("mobs_mc:skeleton", mobs_mc.spawn.solid,{"air"}, 0, 7, 20, 17000, 2, -110, 31000)
|
||||
-- TODO: Spawn directly under the sky
|
||||
mobs:spawn_specific("mobs_mc:stray", mobs_mc.spawn.snow, {"air"}, 0, 7, 20, 19000, 2, -110, 31000)
|
||||
|
||||
-- spawn eggs
|
||||
mobs:register_egg("mobs_mc:skeleton", S("Skeleton"), "mobs_mc_spawn_icon_skeleton.png", 0)
|
||||
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 Skeleton loaded")
|
||||
end
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user