diff --git a/my_mobs/READ ME.txt b/my_mobs/READ ME.txt new file mode 100644 index 0000000..50a6338 --- /dev/null +++ b/my_mobs/READ ME.txt @@ -0,0 +1,61 @@ +FILE: hildigerr/my_mobs/Read Me.txt + +[wulfsdad -- December 2012 -- WTFPL -- Version 0.1] + +This MOD provides additional mobs to extend upon PilzAdam's Simple Mobs. +. +It is required for this MOD to work. + +You will need to rename one of the init-*.lua files to init.lua. +The "full" version is for people who use VanessaE's Home Decor Mod, +and "basic" is for those who don't. +Likewise with the default-*.txt files. + +It Includes: + Animals: + Cow (and milk), + Rabbit + Overcooking and using the result to make dye + Meat spoilage if it remains uncooked + +Raw meet can be preserved through "cheating" or using a refridgerator provided by VanessaE's Home Decor Mod +. + +KNOWN BUGS: + If you drink milk from a stack of vessels, you will not recieve the empty vessel. + + + +==ETHICAL DISCLOSURE== + +The cow texture was created by rinoux . +I retrieved it from the mobf mod by sapier. . +The cow's dry-up sound came from there too, which reports that the graphic is under WTFPL and +the sound is from +and created by Secretlondon + +The rabbit texture was acquired from cornernote's critters modpack. + +It's README.txt reports: + Artist: Martin Berube (Available for custom work) + Iconset Homepage: http://www.graphics-and-desktop-icons.com/animal-icons.html + License: Freeware + Commercial usage: Allowed + Readme file: textures/terms-of-use.txt -->[ I include it, but renamed to rabbit_terms-of-use.txt ] + +The rest of the sounds were found at various locations that I don't recall. +If you own one of them, I will remove it and delete all copies of it at you're request. + + +------------------------------------------------------------------------------------------------------------------------------------------------------------------- +Aditional TODO: +-- refactor redundant code +-- add sound effect variety +-- cheese craft +-- add more animals, +-- add monsters, +-- prevent "cheating" by hiding raw meat in the furnace or oven, +-- this should also make it seam as though you sometimes burn the meat you're cooking +-- Rot partial stacks possibility +-- cages for pet rodents +-- make chances and timer durations easily configurable diff --git a/my_mobs/depends-basic.txt b/my_mobs/depends-basic.txt new file mode 100644 index 0000000..6895273 --- /dev/null +++ b/my_mobs/depends-basic.txt @@ -0,0 +1,5 @@ +default +bucket +vessels +dye +mobs \ No newline at end of file diff --git a/my_mobs/depends-full.txt b/my_mobs/depends-full.txt new file mode 100644 index 0000000..0998d50 --- /dev/null +++ b/my_mobs/depends-full.txt @@ -0,0 +1,6 @@ +default +bucket +vessels +dye +mobs +homedecor \ No newline at end of file diff --git a/my_mobs/init-basic.lua b/my_mobs/init-basic.lua new file mode 100644 index 0000000..632429b --- /dev/null +++ b/my_mobs/init-basic.lua @@ -0,0 +1,413 @@ +-------------------------------------------------------------------------------- +-- hildigerr/my_mobs/init.lua +-- +-- Additional mobs to extend upon +-- PilzAdam's Simple Mobs +-- +-- Includes: +-- Animals -- Cow (and milk), Rabbit +-- Overcooking and using the result to make dye +-- Meat spoilage if it remains uncooked +-- +--NOTES: +-- Raw meet can be preserved through "cheating" or using a refridgerator +-- provided by VanessaE's Home Decor Mod +-- +-- +-- Known bugs: +-- drinking from a stack of vessels does not return an empty vessel +-- +-- Written by wulfsdad -- December 2012 -- WTFPL -- Version 0.1 +-------------------------------------------------------------------------------- +--Aditional TODO: +-- refactor redundant code +-- add sound effect variety +-- cheese [additional mod: proidge, seaweed stew] +-- add more animals, +-- add monsters, +-- prevent "cheating" by hiding raw meat in the furnace or oven, +-- this should also make it seam as though you sometimes burn the meat you're cooking +-- Rot partial stacks possibility +-- cages for pet rodents +-- make chances and timer durations easily configurable + +--------------------------------ANIMALS----------------------------------------- +----Cow: +mobs:register_mob("my_mobs:cow", { + type = "animal", + hp_max = 8, + collisionbox = {-0.5, -1, -1.2, 0.33, 0.5, 1.1}, + visual = "upright_sprite", + visual_size = {x=3.5, y=3.25}, + textures = { "animal_cow_cow_item.png", "animal_cow_cow_item.png"}, + makes_foostep_sound = true, + walk_velocity = 1, + armor = 3, + drops = { + {name = "mobs:meat_raw", + chance = 1, + min = 4, + max = 6,}, + }, + drawtype = "side", + water_damage = 1, + lava_damage = 8, + light_damage = 0, + sounds = { + random = "cow", + }, + + on_rightclick = function(self, clicker) + if self.milked then + return + end + tool = clicker:get_wielded_item():get_name() + if tool == "bucket:bucket_empty" then + clicker:get_inventory():remove_item("main", "bucket:bucket_empty") + clicker:get_inventory():add_item("main", "my_mobs:milk_bucket") + if math.random(1,2) > 1 then + self.milked = true + minetest.sound_play("Mudchute_cow_1", { + object = self.object, + gain = 1.0, -- default + max_hear_distance = 32, -- default + loop = false, -- only sounds connected to objects can be looped + }) + end + elseif tool == "vessels:glass_bottle" then + clicker:get_inventory():remove_item("main", "vessels:glass_bottle") + clicker:get_inventory():add_item("main", "my_mobs:milk_bottle_glass") + if math.random(1,3) > 2 then + self.milked = true + minetest.sound_play("Mudchute_cow_1", { + object = self.object, + gain = 1.0, -- default + max_hear_distance = 32, -- default + loop = false, -- only sounds connected to objects can be looped + }) + end + elseif tool == "vessels:drinking_glass" then + clicker:get_inventory():remove_item("main", "vessles:drinking_glass") + clicker:get_inventory():add_item("main", "my_mobs:milk_glass_cup") + if math.random(1,4) > 3 then + self.milked = true + minetest.sound_play("Mudchute_cow_1", { + object = self.object, + gain = 1.0, -- default + max_hear_distance = 32, -- default + loop = false, -- only sounds connected to objects can be looped + }) + end + elseif tool == "vessels:steel_bottle" then + clicker:get_inventory():remove_item("main", "vessels:steel_bottle") + clicker:get_inventory():add_item("main", "my_mobs:milk_bottle_steel") + if math.random(1,3) > 2 then + self.milked = true + minetest.sound_play("Mudchute_cow_1", { + object = self.object, + gain = 1.0, -- default + max_hear_distance = 32, -- default + loop = false, -- only sounds connected to objects can be looped + }) + end + end -- tool ifs + end, +}) +mobs:register_spawn("my_mobs:cow", {"default:dirt_with_grass"}, 20, 8, 6000, 2, 31000) + +minetest.register_craftitem("my_mobs:milk_bucket", { + description = "Bucket of Milk", + image = "bucket_milk.png", + on_use = minetest.item_eat(8,"bucket:bucket_empty"), + groups = { eatable=1 }, + stack_max = 1, +}) + +minetest.register_craftitem("my_mobs:milk_bottle_glass", { + description = "Bottle of Milk", + image = "glass_bottle_milk.png", + on_use = minetest.item_eat(4, "vessels:glass_bottle"), + groups = { eatable=1 }, +}) + +minetest.register_craftitem("my_mobs:milk_glass_cup", { + description = "Bottle of Milk", + image = "drinking_glass_milk.png", + on_use = minetest.item_eat(2, "vessels:drinking_glass"), + groups = { eatable=1 }, +}) + +minetest.register_craftitem("my_mobs:milk_bottle_steel", { + description = "Flask of Milk", + image = "steel_bottle_milk.png", + on_use = minetest.item_eat(4, "vessels:steel_bottle"), + groups = { eatable=1 }, +}) + + +----Rabbit: +mobs:register_mob("my_mobs:rabbit", { + type = "animal", + hp_max = 1, + collisionbox = {-0.25, -0.33, -0.25, 0.25, 0.33, 0.25}, + visual = "upright_sprite", + visual_size = {x=0.7, y=0.7}, + textures = {"critters_animals_rabbit.png", "critters_animals_rabbit.png"}, + makes_footstep_sound = false, + walk_velocity = 4, + armor = 3, + drops = { + {name = "default:apple", + chance = 4, + min = 1, + max = 1,}, + }, + drawtype = "front", + water_damage = 1, + lava_damage = 1, + light_damage = 0, + + on_rightclick = function(self, clicker) + if clicker:is_player() and clicker:get_inventory() then + clicker:get_inventory():add_item("main", "my_mobs:rabbit") + self.object:remove() + end + end, +}) +mobs:register_spawn("my_mobs:rabbit", {"default:dirt_with_grass"}, 20, 8, 8000, 1, 31000) + +minetest.register_craftitem("my_mobs:rabbit", { + description = "Rabbit", + inventory_image = "critters_animals_rabbit.png", + + on_place = function(itemstack, placer, pointed_thing) + if pointed_thing.above then + minetest.env:add_entity(pointed_thing.above, "my_mobs:rabbit") + itemstack:take_item() + end + return itemstack + end, +}) + +minetest.register_craftitem("my_mobs:rabbit_cooked", { + description = "Cooked Rabbit", + inventory_image = "my_mobs_cooked_rabbit.png", + + on_use = minetest.item_eat(5), +}) + +minetest.register_craft({ + type = "cooking", + output = "my_mobs:rabbit_cooked", + recipe = "my_mobs:rabbit", + cooktime = 5, +}) + + +----####: + + +---------------------------OVERCOOKING RECIPES---------------------------------- +minetest.register_craft({ + type = "cooking", + output = "scorched_stuff", + recipe = "my_mobs:rabbit_cooked", + cooktime = 5, +}) + +minetest.register_craft({ + type = "cooking", + output = "scorched_stuff", + recipe = "mobs:meat", + cooktime = 5, +}) + +minetest.register_craft({ + type = "cooking", + output = "scorched_stuff", + recipe = "mobs:rat_cooked", + cooktime = 5, +}) + +minetest.register_craft({ + type = "shapeless", + output = 'dye:grey 1', + recipe = { + "default:scorched_stuff", + } +}) + +minetest.register_craft({ + type = "shapeless", + output = 'dye:black 1', + recipe = { + "default:scorched_stuff", + "dye:grey", + } +}) + + +---------------------------------SPOILING MEAT---------------------------------- +minetest.register_craftitem("my_mobs:meat_rotten", { + description = "Rotten Meat", + image = "meat_rotten.png", + on_use = minetest.item_eat(-6), + groups = { meat=1, eatable=1 }, +}) + +minetest.register_craft({ + type = "cooking", + output = "scorched_stuff", + recipe = "my_mobs:meat_rotten", + cooktime = 5, +}) + +--Refactorization: (in progress) +-- function spoil_meat( inv, warn, owner ) +-- for i=1,inv.get_size("main") do +-- local item = inv:get_stack("main", i) +-- if item:get_name() == "mobs:meat_raw" then +-- item:replace({name = "my_mobs:meat_rotten", count = item:get_count(), wear=0, metadata=""}) +-- inv:set_stack("main", i, item) +-- if warn then +-- minetest.sound_play("ugh_rot_warn", { to_player = owner, gain = 1.0,}) +-- -- Change or have multiple strings to choose from randomly +-- minetest.chat_send_player( owner, "Something in your inventory is starting to smell bad!") +-- end -- if warn +-- end -- if found raw meat +-- end -- for each inv slot [i] +-- end -- spoil_meat func + + +--Rot Stored Meat +minetest.register_abm({ + nodenames = { "default:chest", "default:chest_locked", +-- "homedecor:kitchen_cabinet", "homedecor:kitchen_cabinet_half", +-- "homedecor:kitchen_cabinet_with_sink", "homedecor:nightstand_oak_one_drawer", +-- "homedecor:nightstand_oak_two_drawers", "homedecor:nightstand_mahogany_one_drawer", +-- "homedecor:nightstand_mahogany_two_drawers", + }, -- add homedecor to depends.txt if you want to use these + interval = 720, -- (operation interval) + chance = 3, -- (chance of trigger is 1.0/this) + action = function(pos, node) + local contents = minetest.env:get_meta(pos):get_inventory() +-- spoil_meat( contents, false, nil ) + for i=1,contents:get_size("main") do + local item = contents:get_stack("main", i) + if item:get_name() == "mobs:meat_raw" then + item:replace({name = "my_mobs:meat_rotten", count = item:get_count(), wear=0, metadata=""}) + contents:set_stack("main", i, item) + end -- if found raw meat + end -- for each item within chest [i] + end -- action func +}) +--TODO: Make so you cant hide meat in: +--"default:furnace","homedecor:oven" + + +--Rot Held Meat +local rotting_timer = 0 +minetest.register_globalstep( function(dtime) + rotting_timer = rotting_timer + dtime + if rotting_timer >= 720 then --TEST WiTH: 2 then -- + for _,player in ipairs(minetest.get_connected_players()) do + local who = player:get_player_name() + local stuff = player:get_inventory() + for i=1,stuff:get_size("main") do + local item = stuff:get_stack("main", i) + if item:get_name() == "mobs:meat_raw" then +-- for j=1,item:get_count() do --TODO: Rot partial stacks + if math.random(1,100) > 66 then -- about 1/3 chance + item:replace({name = "my_mobs:meat_rotten", count = item:get_count(), wear=0, metadata=""}) + stuff:set_stack("main", i, item) + --TODO: Change or have multiple strings to choose from randomly: + minetest.sound_play("ugh_rot_warn", { to_player = who, gain = 1.0,}) + minetest.chat_send_player(who, "Something in your inventory is starting to smell bad!") + end -- if by random chance +-- end -- for each item in stack [j] + end -- if is meat + end -- for each (32) inventory slot [i] + for i=1,stuff:get_size("craft") do + item = stuff:get_stack("craft", i) + if item:get_name() == "mobs:meat_raw" then + if math.random(1,100) > 66 then -- about 1/3 chance + item:replace({name = "my_mobs:meat_rotten", count = item:get_count(), wear=0, metadata=""}) + stuff:set_stack("craft", i, item) + --TODO: Change or have multiple strings to choose from randomly: + minetest.sound_play("ugh_rot_warn", { to_player = who, gain = 1.0,}) + minetest.chat_send_player(who, "Something in your inventory is starting to smell bad!") + end -- if by random chance + end -- if is meat + end -- for each (9) craft slot [i] + end -- for each player + rotting_timer = 0 --reset the timer + end -- timer +end) + + +--Rot Droped Meat +minetest.register_abm({ + nodenames = {"air"}, + neighbors = { "group:stone", "group:sand", + --"group:soil" : + "default:dirt_with_grass", "default:dirt_with_grass_footsteps", "default:dirt", + --etc: + "default:gravel", "default:sandstone", "default:clay", + "default:brick", "default:wood", + }, + interval = 360, -- (operation interval) + chance = 1, -- (chance of trigger is 1.0/this) + action = function(pos, node) + local objs = minetest.env:get_objects_inside_radius(pos, 1) + if objs then + for i,j in ipairs(objs) do + local k = j:get_luaentity() + if k then + local str = k.itemstring + if str ~= nil then + if str == "mobs:meat_raw" then + if math.random(1,100) > 66 then -- about 1/3 chance --TESTING + objs[i]:remove() + minetest.env:add_item(pos, "my_mobs:meat_rotten") + end -- if by chance + end -- if is meat + end -- itemstring exists + end -- luaidentity exists + end -- for objs + end -- objects exist + end -- func +}) + +minetest.register_abm({ + nodenames = {"default:water_source", "default:water_flowing"}, + neighbors = { "group:stone", "group:sand", + --"group:soil" : + "default:dirt_with_grass", "default:dirt_with_grass_footsteps", "default:dirt", + --etc: + "default:gravel", "default:sandstone", "default:clay", + "default:brick", "default:wood", + }, + interval = 240, -- (operation interval) + chance = 1, -- (chance of trigger is 1.0/this) + action = function(pos, node) + local objs = minetest.env:get_objects_inside_radius(pos, 1) + if objs then + for i,j in ipairs(objs) do + local k = j:get_luaentity() + if k then + local str = k.itemstring + if str ~= nil then + if str == "mobs:meat_raw" then + if math.random(1,100) > 50 then -- about 1/3 chance --TESTING + objs[i]:remove() + minetest.env:add_item(pos, "my_mobs:meat_rotten") + end -- if by chance + end -- if is meat + end -- itemstring exists + end -- luaidentity exists + end -- for objs + end -- objects exist + end -- func +}) + +-------------------------------------EOF---------------------------------------- \ No newline at end of file diff --git a/my_mobs/init-full.lua b/my_mobs/init-full.lua new file mode 100644 index 0000000..603a12e --- /dev/null +++ b/my_mobs/init-full.lua @@ -0,0 +1,413 @@ +-------------------------------------------------------------------------------- +-- hildigerr/my_mobs/init.lua +-- +-- Additional mobs to extend upon +-- PilzAdam's Simple Mobs +-- +-- Includes: +-- Animals -- Cow (and milk), Rabbit +-- Overcooking and using the result to make dye +-- Meat spoilage if it remains uncooked +-- +--NOTES: +-- Raw meet can be preserved through "cheating" or using a refridgerator +-- provided by VanessaE's Home Decor Mod +-- +-- +-- Known bugs: +-- drinking from a stack of vessels does not return an empty vessel +-- +-- Written by wulfsdad -- December 2012 -- WTFPL -- Version 0.1 +-------------------------------------------------------------------------------- +--Aditional TODO: +-- refactor redundant code +-- add sound effect variety +-- cheese [additional mod: proidge, seaweed stew] +-- add more animals, +-- add monsters, +-- prevent "cheating" by hiding raw meat in the furnace or oven, +-- this should also make it seam as though you sometimes burn the meat you're cooking +-- Rot partial stacks possibility +-- cages for pet rodents +-- make chances and timer durations easily configurable + +--------------------------------ANIMALS----------------------------------------- +----Cow: +mobs:register_mob("my_mobs:cow", { + type = "animal", + hp_max = 8, + collisionbox = {-0.5, -1, -1.2, 0.33, 0.5, 1.1}, + visual = "upright_sprite", + visual_size = {x=3.5, y=3.25}, + textures = { "animal_cow_cow_item.png", "animal_cow_cow_item.png"}, + makes_foostep_sound = true, + walk_velocity = 1, + armor = 3, + drops = { + {name = "mobs:meat_raw", + chance = 1, + min = 4, + max = 6,}, + }, + drawtype = "side", + water_damage = 1, + lava_damage = 8, + light_damage = 0, + sounds = { + random = "cow", + }, + + on_rightclick = function(self, clicker) + if self.milked then + return + end + tool = clicker:get_wielded_item():get_name() + if tool == "bucket:bucket_empty" then + clicker:get_inventory():remove_item("main", "bucket:bucket_empty") + clicker:get_inventory():add_item("main", "my_mobs:milk_bucket") + if math.random(1,2) > 1 then + self.milked = true + minetest.sound_play("Mudchute_cow_1", { + object = self.object, + gain = 1.0, -- default + max_hear_distance = 32, -- default + loop = false, -- only sounds connected to objects can be looped + }) + end + elseif tool == "vessels:glass_bottle" then + clicker:get_inventory():remove_item("main", "vessels:glass_bottle") + clicker:get_inventory():add_item("main", "my_mobs:milk_bottle_glass") + if math.random(1,3) > 2 then + self.milked = true + minetest.sound_play("Mudchute_cow_1", { + object = self.object, + gain = 1.0, -- default + max_hear_distance = 32, -- default + loop = false, -- only sounds connected to objects can be looped + }) + end + elseif tool == "vessels:drinking_glass" then + clicker:get_inventory():remove_item("main", "vessles:drinking_glass") + clicker:get_inventory():add_item("main", "my_mobs:milk_glass_cup") + if math.random(1,4) > 3 then + self.milked = true + minetest.sound_play("Mudchute_cow_1", { + object = self.object, + gain = 1.0, -- default + max_hear_distance = 32, -- default + loop = false, -- only sounds connected to objects can be looped + }) + end + elseif tool == "vessels:steel_bottle" then + clicker:get_inventory():remove_item("main", "vessels:steel_bottle") + clicker:get_inventory():add_item("main", "my_mobs:milk_bottle_steel") + if math.random(1,3) > 2 then + self.milked = true + minetest.sound_play("Mudchute_cow_1", { + object = self.object, + gain = 1.0, -- default + max_hear_distance = 32, -- default + loop = false, -- only sounds connected to objects can be looped + }) + end + end -- tool ifs + end, +}) +mobs:register_spawn("my_mobs:cow", {"default:dirt_with_grass"}, 20, 8, 6000, 2, 31000) + +minetest.register_craftitem("my_mobs:milk_bucket", { + description = "Bucket of Milk", + image = "bucket_milk.png", + on_use = minetest.item_eat(8,"bucket:bucket_empty"), + groups = { eatable=1 }, + stack_max = 1, +}) + +minetest.register_craftitem("my_mobs:milk_bottle_glass", { + description = "Bottle of Milk", + image = "glass_bottle_milk.png", + on_use = minetest.item_eat(4, "vessels:glass_bottle"), + groups = { eatable=1 }, +}) + +minetest.register_craftitem("my_mobs:milk_glass_cup", { + description = "Bottle of Milk", + image = "drinking_glass_milk.png", + on_use = minetest.item_eat(2, "vessels:drinking_glass"), + groups = { eatable=1 }, +}) + +minetest.register_craftitem("my_mobs:milk_bottle_steel", { + description = "Flask of Milk", + image = "steel_bottle_milk.png", + on_use = minetest.item_eat(4, "vessels:steel_bottle"), + groups = { eatable=1 }, +}) + + +----Rabbit: +mobs:register_mob("my_mobs:rabbit", { + type = "animal", + hp_max = 1, + collisionbox = {-0.25, -0.33, -0.25, 0.25, 0.33, 0.25}, + visual = "upright_sprite", + visual_size = {x=0.7, y=0.7}, + textures = {"critters_animals_rabbit.png", "critters_animals_rabbit.png"}, + makes_footstep_sound = false, + walk_velocity = 4, + armor = 3, + drops = { + {name = "default:apple", + chance = 4, + min = 1, + max = 1,}, + }, + drawtype = "front", + water_damage = 1, + lava_damage = 1, + light_damage = 0, + + on_rightclick = function(self, clicker) + if clicker:is_player() and clicker:get_inventory() then + clicker:get_inventory():add_item("main", "my_mobs:rabbit") + self.object:remove() + end + end, +}) +mobs:register_spawn("my_mobs:rabbit", {"default:dirt_with_grass"}, 20, 8, 8000, 1, 31000) + +minetest.register_craftitem("my_mobs:rabbit", { + description = "Rabbit", + inventory_image = "critters_animals_rabbit.png", + + on_place = function(itemstack, placer, pointed_thing) + if pointed_thing.above then + minetest.env:add_entity(pointed_thing.above, "my_mobs:rabbit") + itemstack:take_item() + end + return itemstack + end, +}) + +minetest.register_craftitem("my_mobs:rabbit_cooked", { + description = "Cooked Rabbit", + inventory_image = "my_mobs_cooked_rabbit.png", + + on_use = minetest.item_eat(5), +}) + +minetest.register_craft({ + type = "cooking", + output = "my_mobs:rabbit_cooked", + recipe = "my_mobs:rabbit", + cooktime = 5, +}) + + +----####: + + +---------------------------OVERCOOKING RECIPES---------------------------------- +minetest.register_craft({ + type = "cooking", + output = "scorched_stuff", + recipe = "my_mobs:rabbit_cooked", + cooktime = 5, +}) + +minetest.register_craft({ + type = "cooking", + output = "scorched_stuff", + recipe = "mobs:meat", + cooktime = 5, +}) + +minetest.register_craft({ + type = "cooking", + output = "scorched_stuff", + recipe = "mobs:rat_cooked", + cooktime = 5, +}) + +minetest.register_craft({ + type = "shapeless", + output = 'dye:grey 1', + recipe = { + "default:scorched_stuff", + } +}) + +minetest.register_craft({ + type = "shapeless", + output = 'dye:black 1', + recipe = { + "default:scorched_stuff", + "dye:grey", + } +}) + + +---------------------------------SPOILING MEAT---------------------------------- +minetest.register_craftitem("my_mobs:meat_rotten", { + description = "Rotten Meat", + image = "meat_rotten.png", + on_use = minetest.item_eat(-6), + groups = { meat=1, eatable=1 }, +}) + +minetest.register_craft({ + type = "cooking", + output = "scorched_stuff", + recipe = "my_mobs:meat_rotten", + cooktime = 5, +}) + +--Refactorization: (in progress) +-- function spoil_meat( inv, warn, owner ) +-- for i=1,inv.get_size("main") do +-- local item = inv:get_stack("main", i) +-- if item:get_name() == "mobs:meat_raw" then +-- item:replace({name = "my_mobs:meat_rotten", count = item:get_count(), wear=0, metadata=""}) +-- inv:set_stack("main", i, item) +-- if warn then +-- minetest.sound_play("ugh_rot_warn", { to_player = owner, gain = 1.0,}) +-- -- Change or have multiple strings to choose from randomly +-- minetest.chat_send_player( owner, "Something in your inventory is starting to smell bad!") +-- end -- if warn +-- end -- if found raw meat +-- end -- for each inv slot [i] +-- end -- spoil_meat func + + +--Rot Stored Meat +minetest.register_abm({ + nodenames = { "default:chest", "default:chest_locked", + "homedecor:kitchen_cabinet", "homedecor:kitchen_cabinet_half", + "homedecor:kitchen_cabinet_with_sink", "homedecor:nightstand_oak_one_drawer", + "homedecor:nightstand_oak_two_drawers", "homedecor:nightstand_mahogany_one_drawer", + "homedecor:nightstand_mahogany_two_drawers", + }, -- add homedecor to depends.txt if you want to use this + interval = 720, -- (operation interval) + chance = 3, -- (chance of trigger is 1.0/this) + action = function(pos, node) + local contents = minetest.env:get_meta(pos):get_inventory() +-- spoil_meat( contents, false, nil ) + for i=1,contents:get_size("main") do + local item = contents:get_stack("main", i) + if item:get_name() == "mobs:meat_raw" then + item:replace({name = "my_mobs:meat_rotten", count = item:get_count(), wear=0, metadata=""}) + contents:set_stack("main", i, item) + end -- if found raw meat + end -- for each item within chest [i] + end -- action func +}) +--TODO: Make so you cant hide meat in: +--"default:furnace","homedecor:oven" + + +--Rot Held Meat +local rotting_timer = 0 +minetest.register_globalstep( function(dtime) + rotting_timer = rotting_timer + dtime + if rotting_timer >= 720 then --TEST WiTH: 2 then -- + for _,player in ipairs(minetest.get_connected_players()) do + local who = player:get_player_name() + local stuff = player:get_inventory() + for i=1,stuff:get_size("main") do + local item = stuff:get_stack("main", i) + if item:get_name() == "mobs:meat_raw" then +-- for j=1,item:get_count() do --TODO: Rot partial stacks + if math.random(1,100) > 66 then -- about 1/3 chance + item:replace({name = "my_mobs:meat_rotten", count = item:get_count(), wear=0, metadata=""}) + stuff:set_stack("main", i, item) + --TODO: Change or have multiple strings to choose from randomly: + minetest.sound_play("ugh_rot_warn", { to_player = who, gain = 1.0,}) + minetest.chat_send_player(who, "Something in your inventory is starting to smell bad!") + end -- if by random chance +-- end -- for each item in stack [j] + end -- if is meat + end -- for each (32) inventory slot [i] + for i=1,stuff:get_size("craft") do + item = stuff:get_stack("craft", i) + if item:get_name() == "mobs:meat_raw" then + if math.random(1,100) > 66 then -- about 1/3 chance + item:replace({name = "my_mobs:meat_rotten", count = item:get_count(), wear=0, metadata=""}) + stuff:set_stack("craft", i, item) + --TODO: Change or have multiple strings to choose from randomly: + minetest.sound_play("ugh_rot_warn", { to_player = who, gain = 1.0,}) + minetest.chat_send_player(who, "Something in your inventory is starting to smell bad!") + end -- if by random chance + end -- if is meat + end -- for each (9) craft slot [i] + end -- for each player + rotting_timer = 0 --reset the timer + end -- timer +end) + + +--Rot Droped Meat +minetest.register_abm({ + nodenames = {"air"}, + neighbors = { "group:stone", "group:sand", + --"group:soil" : + "default:dirt_with_grass", "default:dirt_with_grass_footsteps", "default:dirt", + --etc: + "default:gravel", "default:sandstone", "default:clay", + "default:brick", "default:wood", + }, + interval = 360, -- (operation interval) + chance = 1, -- (chance of trigger is 1.0/this) + action = function(pos, node) + local objs = minetest.env:get_objects_inside_radius(pos, 1) + if objs then + for i,j in ipairs(objs) do + local k = j:get_luaentity() + if k then + local str = k.itemstring + if str ~= nil then + if str == "mobs:meat_raw" then + if math.random(1,100) > 66 then -- about 1/3 chance --TESTING + objs[i]:remove() + minetest.env:add_item(pos, "my_mobs:meat_rotten") + end -- if by chance + end -- if is meat + end -- itemstring exists + end -- luaidentity exists + end -- for objs + end -- objects exist + end -- func +}) + +minetest.register_abm({ + nodenames = {"default:water_source", "default:water_flowing"}, + neighbors = { "group:stone", "group:sand", + --"group:soil" : + "default:dirt_with_grass", "default:dirt_with_grass_footsteps", "default:dirt", + --etc: + "default:gravel", "default:sandstone", "default:clay", + "default:brick", "default:wood", + }, + interval = 240, -- (operation interval) + chance = 1, -- (chance of trigger is 1.0/this) + action = function(pos, node) + local objs = minetest.env:get_objects_inside_radius(pos, 1) + if objs then + for i,j in ipairs(objs) do + local k = j:get_luaentity() + if k then + local str = k.itemstring + if str ~= nil then + if str == "mobs:meat_raw" then + if math.random(1,100) > 50 then -- about 1/3 chance --TESTING + objs[i]:remove() + minetest.env:add_item(pos, "my_mobs:meat_rotten") + end -- if by chance + end -- if is meat + end -- itemstring exists + end -- luaidentity exists + end -- for objs + end -- objects exist + end -- func +}) + +-------------------------------------EOF---------------------------------------- \ No newline at end of file diff --git a/my_mobs/sounds/Mudchute_cow_1.ogg b/my_mobs/sounds/Mudchute_cow_1.ogg new file mode 100644 index 0000000..7c93ded Binary files /dev/null and b/my_mobs/sounds/Mudchute_cow_1.ogg differ diff --git a/my_mobs/sounds/cow.0.ogg b/my_mobs/sounds/cow.0.ogg new file mode 100644 index 0000000..52b3b39 Binary files /dev/null and b/my_mobs/sounds/cow.0.ogg differ diff --git a/my_mobs/sounds/cow.1.ogg b/my_mobs/sounds/cow.1.ogg new file mode 100644 index 0000000..e919c6b Binary files /dev/null and b/my_mobs/sounds/cow.1.ogg differ diff --git a/my_mobs/sounds/ugh_rot_warn.ogg b/my_mobs/sounds/ugh_rot_warn.ogg new file mode 100644 index 0000000..940068a Binary files /dev/null and b/my_mobs/sounds/ugh_rot_warn.ogg differ diff --git a/my_mobs/textures/animal_cow_cow_item.png b/my_mobs/textures/animal_cow_cow_item.png new file mode 100644 index 0000000..eee2008 Binary files /dev/null and b/my_mobs/textures/animal_cow_cow_item.png differ diff --git a/my_mobs/textures/bucket_milk.png b/my_mobs/textures/bucket_milk.png new file mode 100644 index 0000000..faa39e9 Binary files /dev/null and b/my_mobs/textures/bucket_milk.png differ diff --git a/my_mobs/textures/critters_animals_rabbit.png b/my_mobs/textures/critters_animals_rabbit.png new file mode 100644 index 0000000..cb219b3 Binary files /dev/null and b/my_mobs/textures/critters_animals_rabbit.png differ diff --git a/my_mobs/textures/drinking_glass_milk.png b/my_mobs/textures/drinking_glass_milk.png new file mode 100644 index 0000000..e57aa90 Binary files /dev/null and b/my_mobs/textures/drinking_glass_milk.png differ diff --git a/my_mobs/textures/glass_bottle_milk.png b/my_mobs/textures/glass_bottle_milk.png new file mode 100644 index 0000000..582a601 Binary files /dev/null and b/my_mobs/textures/glass_bottle_milk.png differ diff --git a/my_mobs/textures/meat_rotten.png b/my_mobs/textures/meat_rotten.png new file mode 100644 index 0000000..b6d6911 Binary files /dev/null and b/my_mobs/textures/meat_rotten.png differ diff --git a/my_mobs/textures/my_mobs_cooked_rabbit.png b/my_mobs/textures/my_mobs_cooked_rabbit.png new file mode 100644 index 0000000..339ab20 Binary files /dev/null and b/my_mobs/textures/my_mobs_cooked_rabbit.png differ diff --git a/my_mobs/textures/rabbit_terms-of-use.txt b/my_mobs/textures/rabbit_terms-of-use.txt new file mode 100644 index 0000000..ff6d2a8 --- /dev/null +++ b/my_mobs/textures/rabbit_terms-of-use.txt @@ -0,0 +1,49 @@ +Terms of use + + + + + +1. Terms +By accessing this folder, you are agreeing to be bound by these folder Terms and Conditions of Use, all applicable laws and regulations, and agree that you are responsible for compliance with any applicable local laws. If you do not agree with any of these terms, you are prohibited from using or accessing this folder. The materials contained in this folder are protected by applicable copyright and trade mark law. + +2. Use License + +General use of the icons: + +Permission is granted to temporarily download one copy of the materials (icons) on Graphics-and-desktop-icons.com for personal or commercial use. This is the grant of a license, not a transfer of title, and under this license you may not: +- claim to be the author of the images; +- sell the images (clipart resale); +- transfer the materials to another person or "mirror" the materials on any other server unless a static link is provide to Graphics-and-desktop-icons.com's homepage. +This license shall automatically terminate if you violate any of these restrictions and may be terminated by Graphics-and-desktop-icons.com at any time. Upon terminating your viewing of these materials or upon the termination of this license, you must destroy any downloaded materials in your possession whether in electronic or printed format. + + +Services: + +The materials provided through services by Graphics-and-desktop-icons.com or its owner are provided "as is". Graphics-and-desktop-icons.com and its owner makes no warranties, expressed or implied, and hereby disclaims and negates all other warranties, including without limitation, implied warranties or conditions of merchantability, fitness for a particular purpose, or non-infringement of intellectual property or other violation of rights. Further, Graphics-and-desktop-icons.com and its owner does not warrant or make any representations concerning the accuracy, likely results, or reliability of the use of the materials provided by Graphics-and-desktop-icons.com and its owner or otherwise relating to such materials. + +In no event shall Graphics-and-desktop-icons.com, its owner or its suppliers be liable for any damages (including, without limitation, damages for loss of data or profit, or due to business interruption,) arising out of the use or inability to use the materials provided by Graphics-and-desktop-icons.com or its owner, even if Graphics-and-desktop-icons.com or its owner has been notified orally or in writing of the possibility of such damage. Because some jurisdictions do not allow limitations on implied warranties, or limitations of liability for consequential or incidental damages, these limitations may not apply to you. + +Any claim relating to Graphics-and-desktop-icons.com or its owner shall be governed by the laws of the State of Graphics-and-desktop-icons.com or its owner without regard to its conflict of law provisions. + +3. Disclaimer +The materials on Graphics-and-desktop-icons.com are provided "as is". Graphics-and-desktop-icons.com makes no warranties, expressed or implied, and hereby disclaims and negates all other warranties, including without limitation, implied warranties or conditions of merchantability, fitness for a particular purpose, or non-infringement of intellectual property or other violation of rights. Further, Graphics-and-desktop-icons.com does not warrant or make any representations concerning the accuracy, likely results, or reliability of the use of the materials on its Internet web site or otherwise relating to such materials or on any sites linked to this site. + +4. Limitations +In no event shall Graphics-and-desktop-icons.com or its suppliers be liable for any damages (including, without limitation, damages for loss of data or profit, or due to business interruption,) arising out of the use or inability to use the materials on Graphics-and-desktop-icons.com Internet site, even if Graphics-and-desktop-icons.com or a Graphics-and-desktop-icons.com authorized representative has been notified orally or in writing of the possibility of such damage. Because some jurisdictions do not allow limitations on implied warranties, or limitations of liability for consequential or incidental damages, these limitations may not apply to you. + +5. Revisions and Errata +The materials appearing on Graphics-and-desktop-icons.com could include technical, typographical, or photographic errors. Graphics-and-desktop-icons.com does not warrant that any of the materials on its web site are accurate, complete, or current. Graphics-and-desktop-icons.com may make changes to the materials contained on its web site at any time without notice. + +6. Links +Graphics-and-desktop-icons.com has not reviewed all of the sites linked to its Internet web site and is not responsible for the contents of any such linked site. The inclusion of any link does not imply endorsement by Graphics-and-desktop-icons.com of the site. Use of any such linked web site is at the user's own risk. + +7. Site Terms of Use Modifications +Graphics-and-desktop-icons.com may revise these terms of use for its web site at any time without notice. By using this web site you are agreeing to be bound by the then current version of these Terms and Conditions of Use. + +8. Governing Law +Any claim relating to Graphics-and-desktop-icons.com shall be governed by the laws of the State of Graphics-and-desktop-icons.com without regard to its conflict of law provisions. + + + + diff --git a/my_mobs/textures/steel_bottle_milk.png b/my_mobs/textures/steel_bottle_milk.png new file mode 100644 index 0000000..629c857 Binary files /dev/null and b/my_mobs/textures/steel_bottle_milk.png differ