Add first item variables for chicken

This commit is contained in:
Wuzzy 2017-06-23 14:50:25 +02:00
parent 33cf39cd38
commit e87ec3021f
3 changed files with 90 additions and 51 deletions

43
3_gameconfig.lua Normal file
View File

@ -0,0 +1,43 @@
--[[ 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.
For instance, subgames could add a mod which overrides
mobs_mc.items_dirt_with_grass and set the used node to the subgame's equivalent
of dirt with grass. ]]
-- Standard items
mobs_mc.items = {}
-- mobs_mc
mobs_mc.items.blaze_rod = "mobs_mc:blaze_rod"
mobs_mc.items.blaze_powder = "mobs_mc:blaze_powder"
mobs_mc.items.chicken_raw = "mobs_mc:chicken_raw"
mobs_mc.items.chicken_cooked = "mobs_mc:chicken_cooked"
mobs_mc.items.feather = "mobs_mc:feather"
mobs_mc.items.beef_raw = "mobs_mc:beef_raw"
mobs_mc.items.beef_cooked = "mobs_mc:beef_cooked"
mobs_mc.items.bowl = "mobs_mc:bowl"
mobs_mc.items.mushroom_stew = "mobs_mc:mushroom_stew"
mobs_mc.items.milk_bucket = "mobs_mc:milk_bucket"
mobs_mc.items.dragon_egg = "mobs_mc:dragon_egg"
mobs_mc.items.egg = "mobs_mc:egg"
-- Mobs Redo
mobs_mc.items.leather = "mobs:leather"
mobs_mc.items.shears = "mobs:shears"
-- Minetest Game
mobs_mc.items.mushroom_red = "flowers:mushroom_red"
mobs_mc.items.bucket = "bucket:bucket_empty"
mobs_mc.items.dirt_with_grass = "default:dirt_with_grass"
-- Tables for attracting, feeding and breeding mobs
mobs_mc.follow = {}
mobs_mc.follow.chicken = { "farming:seed_wheat", "farming:seed_cotton" }

View File

@ -30,11 +30,11 @@ mobs:register_mob("mobs_mc:chicken", {
makes_footstep_sound = true,
walk_velocity = 1,
drops = {
{name = "mobs_mc:chicken_raw",
{name = mobs_mc.items.chicken_raw,
chance = 1,
min = 1,
max = 1,},
{name = "mobs_mc:feather",
{name = mobs_mc.items.feather,
chance = 1,
min = 0,
max = 2,},
@ -55,7 +55,7 @@ mobs:register_mob("mobs_mc:chicken", {
run_start = 0, run_end = 40,
},
follow = {"farming:seed_wheat", "farming:seed_cotton"},
follow = mobs_mc.follow.chicken,
view_range = 16,
on_rightclick = function(self, clicker)
@ -80,7 +80,7 @@ mobs:register_mob("mobs_mc:chicken", {
local pos = self.object:getpos()
minetest.add_item(pos, "mobs_mc:egg")
minetest.add_item(pos, mobs_mc.items.egg)
minetest.sound_play("mobs_mc_chicken_lay_egg", {
pos = pos,
@ -92,7 +92,7 @@ mobs:register_mob("mobs_mc:chicken", {
})
--spawn
mobs:register_spawn("mobs_mc:chicken", {"default:dirt_with_grass"}, 20, 8, 17000, 3, 31000)
mobs:register_spawn("mobs_mc:chicken", {mobs_mc.items.dirt_with_grass}, 20, 8, 17000, 3, 31000)
-- compatibility

View File

@ -5,6 +5,48 @@
local path = minetest.get_modpath("mobs_mc")
mobs_mc = {}
--Mob heads
dofile(path .. "/heads.lua") -- maikerumine
--MOB ITEMS SELECTOR SWITCH
--Items
if not minetest.get_modpath("mobs_mc_gameconfig") then
dofile(path .. "/1_items_default.lua")
end
--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
dofile(path .. "/3_gameconfig.lua")
-- Animals
dofile(path .. "/bat.lua") -- Mesh and animation by toby109tt / https://github.com/22i
dofile(path .. "/rabbit.lua") -- Mesh and animation byExeterDad
@ -55,52 +97,6 @@ dofile(path .. "/spider.lua") -- Spider by AspireMint (fishyWET (CC-BY-SA 3.0 li
dofile(path .. "/spider_cave.lua") -- Spider by AspireMint (fishyWET (CC-BY-SA 3.0 license for texture)
dofile(path .. "/vex.lua") -- KrupnoPavel
dofile(path .. "/wither.lua") -- Mesh and animation by toby109tt / https://github.com/22i
--Heads
dofile(path .. "/heads.lua") -- maikerumine
--MOB ITEMS SELECTOR SWITCH
--Items
--dofile(path .. "/1_items_default.lua") -- Selected if using default in subgame
--dofile(path .. "/2_items_mc2.lua") -- Selected if using mineclone2 subgame
if not mcl_core then
dofile(path .. "/1_items_default.lua")
end
--IN CASE THROWING IS NOT INSTALLED, THIS FIX
if not 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 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
--NOTES:
--
--[[