Noch ein paar mehr Mods
|
@ -436,6 +436,18 @@ minetest.register_craft({
|
|||
replacements = {{"farming:juicer", "farming:juicer"}}
|
||||
})
|
||||
|
||||
if (minetest.get_modpath("naturalbiomes")) then
|
||||
|
||||
minetest.register_craft({
|
||||
output = "ethereal:olive 3",
|
||||
recipe = {
|
||||
{"naturalbiomes:olives"}
|
||||
}
|
||||
})
|
||||
|
||||
end
|
||||
|
||||
|
||||
-- Kappa Maki (sushi with cucumber)
|
||||
|
||||
minetest.register_craftitem("ethereal:sushi_kappamaki", {
|
||||
|
|
7
mods/item_physics/LICENSE
Normal file
|
@ -0,0 +1,7 @@
|
|||
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE INCLUDING ALL
|
||||
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
||||
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER
|
||||
IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
||||
PERFORMANCE OF THIS SOFTWARE.
|
4
mods/item_physics/README.md
Normal file
|
@ -0,0 +1,4 @@
|
|||
|
||||
# item_physics
|
||||
Makes items not spin when they are on the floor.
|
||||
|
139
mods/item_physics/init.lua
Normal file
|
@ -0,0 +1,139 @@
|
|||
|
||||
minetest.register_on_mods_loaded(function()
|
||||
|
||||
local builtin_item = minetest.registered_entities["__builtin:item"]
|
||||
|
||||
item_physics = {}
|
||||
item_physics.settings = {
|
||||
item_scale = tonumber(minetest.settings:get("item_physics_item_scale")) or nil,
|
||||
rotation = minetest.settings:get_bool("item_physics_rotation", true),
|
||||
initial_rotation = minetest.settings:get_bool("item_physics_initial_rotation", true),
|
||||
}
|
||||
|
||||
if (item_physics.settings.item_scale ~= nil) and item_physics.settings.item_scale <= 0.05 then
|
||||
item_physics.settings.item_scale = nil
|
||||
end
|
||||
|
||||
local flat_node_types = {
|
||||
signlike = true,
|
||||
raillike = true,
|
||||
torchlike = true,
|
||||
plantlike = true,
|
||||
}
|
||||
-- rot = vector.new(0,0,1):rotate(rot)
|
||||
local new_item_ent = {
|
||||
_get_is_node = function(self, itemname)
|
||||
local idef = minetest.registered_items[itemname]
|
||||
if not idef then return false end
|
||||
if idef.type ~= "node" then return false end
|
||||
if flat_node_types[idef.drawtype] ~= nil then return false end
|
||||
if idef.wield_image ~= "" then return false end
|
||||
return true
|
||||
end,
|
||||
_item_stick = function(self)
|
||||
self._is_stuck = true
|
||||
if (not self._is_node) then
|
||||
local rot = self.object:get_rotation()
|
||||
rot = vector.new(math.pi*0.5, rot.y, 0)
|
||||
self.object:set_rotation(rot)
|
||||
end
|
||||
end,
|
||||
_item_unstick = function(self)
|
||||
self._is_stuck = false
|
||||
local rot = self.object:get_rotation()
|
||||
rot = vector.new(0, rot.y, 0)
|
||||
self.object:set_rotation(rot)
|
||||
end,
|
||||
enable_physics = function(self)
|
||||
local ret = builtin_item.enable_physics(self)
|
||||
self:_item_unstick()
|
||||
return ret
|
||||
end,
|
||||
disable_physics = function(self)
|
||||
local ret = builtin_item.disable_physics(self)
|
||||
self:_item_stick()
|
||||
return ret
|
||||
end,
|
||||
set_item = function(self, item, ...)
|
||||
local ret = builtin_item.set_item(self, item, ...)
|
||||
local stack = ItemStack(item or self.itemstring)
|
||||
local itemname = stack:get_name()
|
||||
|
||||
self._is_node = self:_get_is_node(itemname)
|
||||
|
||||
local props = self.object:get_properties()
|
||||
if not props.collisionbox then
|
||||
props.collisionbox = {-0.3, -0.3, -0.3, 0.3, 0.3, 0.3}
|
||||
end
|
||||
-- allow custom size
|
||||
if item_physics.settings.item_scale then
|
||||
local s = item_physics.settings.item_scale
|
||||
local c = s - 0.1
|
||||
props.collisionbox = {-c,-c,-c, c, c, c}
|
||||
props.visual_size = vector.new(s,s,s)
|
||||
else
|
||||
-- use the other sizes as a reference to make it compat with more things
|
||||
props.collisionbox[2] = props.collisionbox[1] * 0.6
|
||||
end
|
||||
-- items lie flat
|
||||
if (not self._is_node) then
|
||||
props.collisionbox[2] = -0.03
|
||||
end
|
||||
-- remove `automatic_rotate` because it's broken
|
||||
self.object:set_properties({
|
||||
automatic_rotate = 0,
|
||||
collisionbox = props.collisionbox,
|
||||
visual_size = props.visual_size,
|
||||
})
|
||||
if item_physics.settings.initial_rotation then
|
||||
self.object:set_rotation(vector.new(0,math.random()*math.pi*2, 0))
|
||||
end
|
||||
if self._is_stuck then
|
||||
self:_item_stick()
|
||||
else
|
||||
self:_item_unstick()
|
||||
end
|
||||
return ret
|
||||
end,
|
||||
try_merge_with = function(self, own_stack, object, entity, ...)
|
||||
return builtin_item.try_merge_with(self, own_stack, object, entity, ...)
|
||||
end,
|
||||
_do_idle_rotation = function(self, amount)
|
||||
local rot = self.object:get_rotation()
|
||||
if not rot then return end
|
||||
rot = vector.new(0, rot.y - amount * self._spin_dir, 0)
|
||||
self.object:set_rotation(rot)
|
||||
end,
|
||||
on_step = function(self, dtime, moveresult, ...)
|
||||
-- if not self.itemstring then return end
|
||||
local pos = self.object:get_pos()
|
||||
-- prevent unloaded nil errors just in case
|
||||
if not pos then return end
|
||||
local vel = self.object:get_velocity()
|
||||
|
||||
-- if it's not moving, stick
|
||||
-- items lay flat while sliding, nodes don't
|
||||
if not self._is_node then vel.x = 0; vel.z = 0; end
|
||||
local should_stick = (math.abs(vel.x) + math.abs(vel.y) + math.abs(vel.z) < 0.1)
|
||||
if should_stick and not self._is_stuck then
|
||||
self:_item_stick()
|
||||
elseif self._is_stuck and not should_stick then
|
||||
self:_item_unstick()
|
||||
end
|
||||
|
||||
if not self._spin_dir then
|
||||
self._spin_dir = math.random(0,1)*2-1
|
||||
end
|
||||
if (not self._is_stuck) and item_physics.settings.rotation then
|
||||
local spin_speed = math.min(0.3, dtime * vel:length())
|
||||
self._do_idle_rotation(self, spin_speed)
|
||||
end
|
||||
|
||||
builtin_item.on_step(self, dtime, moveresult, ...)
|
||||
end,
|
||||
}
|
||||
|
||||
setmetatable(new_item_ent, { __index = builtin_item })
|
||||
minetest.register_entity(":__builtin:item", new_item_ent)
|
||||
|
||||
end)
|
7
mods/item_physics/mod.conf
Normal file
|
@ -0,0 +1,7 @@
|
|||
name = item_physics
|
||||
author = Sumianvoice
|
||||
optional_depends = mcl_core, default, age_of_mending
|
||||
|
||||
release = 26261
|
||||
description = Makes items lay flat on the ground and not spin.
|
||||
title = Item Physics
|
10
mods/item_physics/settingtypes.txt
Normal file
|
@ -0,0 +1,10 @@
|
|||
|
||||
# Whether items will rotate as they move.
|
||||
item_physics_rotation (Enable Rotation) bool true
|
||||
|
||||
# Whether items will have a random starting rotation when they first spawn in.
|
||||
item_physics_initial_rotation (Enable Rotation) bool true
|
||||
|
||||
# No change if set to a negative value.
|
||||
# Changes the size of item entities.
|
||||
item_physics_item_scale (Item Scale) float -1
|
48
mods/jelys_pizzaria/LICENCE
Normal file
|
@ -0,0 +1,48 @@
|
|||
Minetest mod: Pizzaria [jelys_pizzaria]
|
||||
---------------------------------------
|
||||
|
||||
Code MIT (Extex101) 2021-2023
|
||||
|
||||
|
||||
Licenses of media
|
||||
---------------------------------------
|
||||
|
||||
Audio
|
||||
---------------------------------------
|
||||
|
||||
Jan Koehl jelys_pizzaria_pizza_walk.ogg (CC BY-SA 3.0)
|
||||
https://freesound.org/people/JanKoehl/sounds/85604/
|
||||
|
||||
Textures
|
||||
---------------------------------------
|
||||
Attribution-ShareAlike 3.0 Unported (CC BY-SA 3.0)
|
||||
|
||||
Extex101 2021-2023
|
||||
|
||||
You are free to:
|
||||
Share — copy and redistribute the material in any medium or format.
|
||||
Adapt — remix, transform, and build upon the material for any purpose, even commercially.
|
||||
The licensor cannot revoke these freedoms as long as you follow the license terms.
|
||||
|
||||
Under the following terms:
|
||||
|
||||
Attribution — You must give appropriate credit, provide a link to the license, and
|
||||
indicate if changes were made. You may do so in any reasonable manner, but not in any way
|
||||
that suggests the licensor endorses you or your use.
|
||||
|
||||
ShareAlike — If you remix, transform, or build upon the material, you must distribute
|
||||
your contributions under the same license as the original.
|
||||
|
||||
No additional restrictions — You may not apply legal terms or technological measures that
|
||||
legally restrict others from doing anything the license permits.
|
||||
|
||||
Notices:
|
||||
|
||||
You do not have to comply with the license for elements of the material in the public
|
||||
domain or where your use is permitted by an applicable exception or limitation.
|
||||
No warranties are given. The license may not give you all of the permissions necessary
|
||||
for your intended use. For example, other rights such as publicity, privacy, or moral
|
||||
rights may limit how you use the material.
|
||||
|
||||
For more details:
|
||||
http://creativecommons.org/licenses/by-sa/3.0/
|
29
mods/jelys_pizzaria/README.md
Normal file
|
@ -0,0 +1,29 @@
|
|||
# Pizzaria
|
||||
Minetest Pizzaria mod that adds advanced pizza baking as a late-game food source
|
||||
|
||||
Due to MTG's lack of animals and certain plants I've added the rather silly "Mese Mutation Crystal" to turn other items into the ones needed.
|
||||
|
||||
### - Mutations:
|
||||
|
||||
- Mutating an apple gives a tomato
|
||||
- Mutating an apple with two pine leaves gives pineapple
|
||||
- Mutating a player's bones gives 9 Meat
|
||||
- Mutating blueberries gives olives
|
||||
And probably the wackiest of all:
|
||||
- Mutating Gold fives cheese
|
||||
|
||||
### - Curing:
|
||||
|
||||
Pepperoni has to be cured, craft your pepperoni then hang it from your ceiling until it's fully cured.
|
||||
|
||||
### - Pizza prep
|
||||
|
||||
1. Craft a bucket of water with flour to make 2x Pizza dough
|
||||
2. Place the pizza dough then punch it with a rolling pin until it breaks and is rolled out into a pizza base
|
||||
3. Place on your cheese, and tomato sauce
|
||||
4. Add whatever 1-2 toppings your heart desires
|
||||
5. Place your pizza into your pizza oven and stoke the fire with tree logs
|
||||
6. Ignite your fire with a torch by punching it
|
||||
7. Wait until your pizza is done, be careful not to burn it!
|
||||
8. Finally remove your pizza and place it down in a pizza box or on your table
|
||||
9. Cut it up and enjoy!
|
10
mods/jelys_pizzaria/depends.txt
Normal file
|
@ -0,0 +1,10 @@
|
|||
default
|
||||
vessels
|
||||
flowers
|
||||
hunger_ng?
|
||||
nbhunger?
|
||||
pineapple?
|
||||
mobs?
|
||||
creatures?
|
||||
stairs?
|
||||
fire?
|
198
mods/jelys_pizzaria/functions.lua
Normal file
|
@ -0,0 +1,198 @@
|
|||
function jpizza.register_topping(def)
|
||||
local newdef = def
|
||||
table.insert(jpizza.toppings, {name=def.name, texture=def.texture, item=def.item, cooked_texture=def.cooked_texture, topping_inv=def.topping_inv, eat=def.eat})
|
||||
end
|
||||
|
||||
local function find(value, key, list)
|
||||
for _, i in pairs(list) do
|
||||
if i[key] == value then
|
||||
return _
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
function jpizza.register_pizza(name, def)
|
||||
local newDef = def
|
||||
newDef.tiles = {
|
||||
def.texture[1],
|
||||
def.texture[2]
|
||||
}
|
||||
newDef.groups = {oddly_breakable_by_hand=3, crumbly=3, attached_node = 1}
|
||||
if def.toppings == 1 then
|
||||
newDef.groups.pizza = 1
|
||||
end
|
||||
newDef.use_texture_alpha = "clip"
|
||||
newDef.drawtype = "nodebox"
|
||||
newDef.paramtype = "light"
|
||||
newDef.sunlight_propagates = true
|
||||
newDef.selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.5, -0.5, 0.5, -0.4, 0.5},
|
||||
}
|
||||
}
|
||||
newDef.stack_max = 1
|
||||
newDef.node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.5, -0.1875, 0.5, -0.4375, 0.1875},
|
||||
{-0.1875, -0.5, -0.5, 0.1875, -0.4375, 0.5},
|
||||
{-0.3125, -0.5, -0.4375, 0.3125, -0.4375, 0.4375},
|
||||
{-0.4375, -0.5, -0.3125, 0.4375, -0.4375, 0.3125},
|
||||
{-0.375, -0.5, -0.375, 0.375, -0.4375, 0.375},
|
||||
}
|
||||
}
|
||||
if newDef.sounds == nil then
|
||||
newDef.sounds = {
|
||||
footstep = {name = "jelys_pizzaria_pizza_walk", gain = 0.3},
|
||||
dug = {name = "jelys_pizzaria_pizza_walk", gain = 0.3},
|
||||
dig = {name = "jelys_pizzaria_pizza_walk", gain = 0.3},
|
||||
}
|
||||
end
|
||||
minetest.register_node(name, newDef)
|
||||
end
|
||||
|
||||
local raw_texture = "jelys_pizzaria_pizza_dough.png^"..
|
||||
"jelys_pizzaria_pizza_sauce.png^"..
|
||||
"jelys_pizzaria_pizza_cheese.png^"
|
||||
|
||||
local cooked_texture = "jelys_pizzaria_cooked_dough.png^"..
|
||||
"jelys_pizzaria_pizza_cooked_sauce.png^"..
|
||||
"jelys_pizzaria_pizza_cooked_cheese.png^"
|
||||
function jpizza.spawn_slices(pos, item)
|
||||
for i = 0, 5, 1 do
|
||||
local x = pos.x+math.sin(i*60)/3
|
||||
local z = pos.z+math.cos(i*60)/3
|
||||
minetest.add_item({x=x, y=pos.y, z=z}, item)
|
||||
end
|
||||
end
|
||||
function jpizza.make_pizzas()
|
||||
for i, base in pairs(jpizza.toppings) do
|
||||
jpizza.register_pizza("jelys_pizzaria:raw_pizza_"..base.name, {
|
||||
description = "Raw Pizza with "..base.name,
|
||||
texture = {
|
||||
raw_texture..base.texture,
|
||||
"jelys_pizzaria_pizza_dough.png"
|
||||
},
|
||||
cooked = "jelys_pizzaria:pizza_"..base.name,
|
||||
cook_time = {min=100, max=200},
|
||||
raw = 1,
|
||||
toppings = 1,
|
||||
on_rightclick = function(pos, node, player, itemstack, pointed_thing)
|
||||
local name = itemstack:get_name()
|
||||
|
||||
local fetch = find(name, "item", jpizza.toppings)
|
||||
if fetch then
|
||||
local stuff = jpizza.toppings[fetch]
|
||||
if minetest.registered_nodes["jelys_pizzaria:raw_pizza_"..base.name.."_"..stuff.name] then
|
||||
if not minetest.is_creative_enabled(player:get_player_name()) then
|
||||
itemstack:take_item()
|
||||
end
|
||||
minetest.set_node(pos, {name = "jelys_pizzaria:raw_pizza_"..base.name.."_"..stuff.name})
|
||||
return itemstack
|
||||
end
|
||||
end
|
||||
end,
|
||||
})
|
||||
jpizza.register_pizza("jelys_pizzaria:pizza_"..base.name, {
|
||||
description = "Pizza with "..base.name,
|
||||
texture = {
|
||||
cooked_texture..base.cooked_texture,
|
||||
"jelys_pizzaria_cooked_dough.png"
|
||||
},
|
||||
|
||||
on_punch = function(pos, oldnode, digger)
|
||||
local down = minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z})
|
||||
local itemstack = digger:get_wielded_item()
|
||||
local downdef = minetest.registered_nodes[down.name]
|
||||
if itemstack:get_name() == "jelys_pizzaria:pizza_cutter" and downdef.groups.pizza_oven == nil then
|
||||
jpizza.spawn_slices(pos, "jelys_pizzaria:pizza_"..base.name.."_slice")
|
||||
local wear = itemstack:get_wear()
|
||||
itemstack:set_wear(wear+(65535/40))
|
||||
digger:set_wielded_item(itemstack)
|
||||
minetest.remove_node(pos)
|
||||
end
|
||||
end,
|
||||
done = true
|
||||
})
|
||||
minetest.register_craftitem("jelys_pizzaria:pizza_"..base.name.."_slice", {
|
||||
description = "Slice of "..base.name.." Pizza",
|
||||
inventory_image = "jelys_pizzaria_pizza_slice.png^"..base.topping_inv[2],
|
||||
stack_max = 6,
|
||||
groups = {food = 1},
|
||||
on_use = minetest.item_eat(1+base.eat)
|
||||
})
|
||||
if jpizza.has_depends.hunger_ng then
|
||||
hunger_ng.add_hunger_data("jelys_pizzaria:pizza_"..base.name.."_slice", {satiates = 1+base.eat})
|
||||
end
|
||||
if jpizza.has_depends.hbhunger and minetest.global_exists("hbhunger") then
|
||||
hbhunger.register_food("jelys_pizzaria:pizza_"..base.name.."_slice", 1+base.eat)
|
||||
end
|
||||
for j = i, #jpizza.toppings, 1 do
|
||||
local side = jpizza.toppings[j]
|
||||
if side.name ~= base.name then
|
||||
local pizza_name = "jelys_pizzaria:raw_pizza_"..base.name.."_"..side.name
|
||||
local pizza_name2 = "jelys_pizzaria:raw_pizza_"..side.name.."_"..base.name
|
||||
minetest.register_alias(pizza_name2, pizza_name)
|
||||
jpizza.register_pizza(pizza_name, {
|
||||
description = "Raw Pizza with "..base.name.." and "..side.name,
|
||||
cook_time = {min=200, max=250},
|
||||
texture = {
|
||||
raw_texture..base.texture.."^("..side.texture.."^[transformR90)",
|
||||
"jelys_pizzaria_pizza_dough.png"
|
||||
},
|
||||
raw = 1,
|
||||
cooked = "jelys_pizzaria:pizza_"..base.name.."_"..side.name,
|
||||
})
|
||||
end
|
||||
end
|
||||
|
||||
for j = i, #jpizza.toppings, 1 do
|
||||
local side = jpizza.toppings[j]
|
||||
if side.name ~= base.name then
|
||||
local pizza_name = "jelys_pizzaria:pizza_"..base.name.."_"..side.name
|
||||
|
||||
jpizza.register_pizza(pizza_name, {
|
||||
description = "Pizza with "..base.name.." and "..side.name,
|
||||
texture = {
|
||||
cooked_texture..base.cooked_texture.."^("..side.cooked_texture.."^[transformR90)",
|
||||
"jelys_pizzaria_cooked_dough.png"
|
||||
},
|
||||
on_punch = function(pos, oldnode, digger)
|
||||
local down = minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z})
|
||||
local itemstack = digger:get_wielded_item()
|
||||
local downdef = minetest.registered_nodes[down.name]
|
||||
if itemstack:get_name() == "jelys_pizzaria:pizza_cutter" and downdef.groups.pizza_oven == nil then
|
||||
jpizza.spawn_slices(pos, pizza_name.."_slice")
|
||||
local wear = itemstack:get_wear()
|
||||
itemstack:set_wear(wear+(65535/40))
|
||||
digger:set_wielded_item(itemstack)
|
||||
minetest.remove_node(pos)
|
||||
end
|
||||
end,
|
||||
done=true
|
||||
})
|
||||
local num1 = math.floor(math.random(1,2)+0.5)
|
||||
local num2 = 1
|
||||
if num1 == 1 then
|
||||
num2 = 2
|
||||
end
|
||||
minetest.register_craftitem(pizza_name.."_slice", {
|
||||
description = "Slice of "..base.name.." and "..side.name.." Pizza",
|
||||
inventory_image = "jelys_pizzaria_pizza_slice.png^"..base.topping_inv[num1].."^"..side.topping_inv[num2],
|
||||
stack_max = 6,
|
||||
groups = {food = 1},
|
||||
on_use = minetest.item_eat(1+base.eat+side.eat)
|
||||
})
|
||||
minetest.register_alias(pizza_name.."_slice", "jelys_pizzaria:pizza_"..side.name.."_"..base.name)
|
||||
if jpizza.has_depends.hunger_ng == true then
|
||||
hunger_ng.add_hunger_data(pizza_name.."_slice", {satiates = 1+base.eat+side.eat})
|
||||
end
|
||||
if jpizza.has_depends.hbhunger and minetest.global_exists("hbhunger") then
|
||||
hbhunger.register_food(pizza_name.."_slice", 1+base.eat+side.eat)
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
75
mods/jelys_pizzaria/init.lua
Normal file
|
@ -0,0 +1,75 @@
|
|||
jpizza = {}
|
||||
jpizza.toppings = {}
|
||||
|
||||
jpizza.op_depends = {"hunger_ng", "hbhunger", "pineapple", "mobs", "creatures", "fire", "stairs", "dungeon_loot", "farming"}
|
||||
jpizza.has_depends = {}
|
||||
for _, i in pairs(jpizza.op_depends) do
|
||||
if minetest.get_modpath(i) then
|
||||
jpizza.has_depends[i] = true
|
||||
else
|
||||
jpizza.has_depends[i] = false
|
||||
end
|
||||
end
|
||||
|
||||
jpizza.path = minetest.get_modpath("jelys_pizzaria")
|
||||
dofile(jpizza.path.."/functions.lua")
|
||||
|
||||
dofile(jpizza.path.."/nodes.lua")--nodes
|
||||
|
||||
dofile(jpizza.path.."/oven.lua")
|
||||
|
||||
dofile(jpizza.path.."/items.lua")
|
||||
|
||||
|
||||
|
||||
jpizza.register_topping({
|
||||
item = "jelys_pizzaria:olives",
|
||||
name = "olives",
|
||||
topping_inv = {
|
||||
"jelys_pizzaria_topping_olives_inv_1.png",
|
||||
"jelys_pizzaria_topping_olives_inv_2.png"
|
||||
},
|
||||
texture = "jelys_pizzaria_topping_olives.png",
|
||||
cooked_texture = "jelys_pizzaria_topping_olives_cooked.png",
|
||||
eat = 2,
|
||||
})
|
||||
|
||||
jpizza.register_topping({
|
||||
item = "jelys_pizzaria:pepperoni_cured",
|
||||
name = "pepperoni",
|
||||
topping_inv = {
|
||||
"jelys_pizzaria_topping_pepperoni_inv_1.png",
|
||||
"jelys_pizzaria_topping_pepperoni_inv_2.png"
|
||||
},
|
||||
texture = "jelys_pizzaria_topping_pepperoni.png",
|
||||
cooked_texture = "jelys_pizzaria_topping_pepperoni_cooked.png",
|
||||
eat = 4,
|
||||
})
|
||||
|
||||
jpizza.register_topping({
|
||||
item = "jelys_pizzaria:sausage",
|
||||
name = "sausage",
|
||||
topping_inv = {
|
||||
"jelys_pizzaria_topping_sausage_inv_1.png",
|
||||
"jelys_pizzaria_topping_sausage_inv_2.png"
|
||||
},
|
||||
texture = "jelys_pizzaria_topping_sausage.png",
|
||||
cooked_texture = "jelys_pizzaria_topping_sausage_cooked.png",
|
||||
eat = 4,
|
||||
})
|
||||
|
||||
jpizza.register_topping({
|
||||
item = "flowers:mushroom_brown",
|
||||
name = "mushrooms",
|
||||
topping_inv = {
|
||||
"jelys_pizzaria_topping_mushroom_inv_1.png",
|
||||
"jelys_pizzaria_topping_mushroom_inv_2.png",
|
||||
},
|
||||
texture = "jelys_pizzaria_topping_mushrooms.png",
|
||||
cooked_texture = "jelys_pizzaria_topping_mushrooms_cooked.png",
|
||||
eat = 1,
|
||||
})
|
||||
|
||||
dofile(jpizza.path.."/mutation_backup.lua")
|
||||
|
||||
jpizza.make_pizzas()
|
217
mods/jelys_pizzaria/items.lua
Normal file
|
@ -0,0 +1,217 @@
|
|||
|
||||
-- Burnt Pizza
|
||||
jpizza.register_pizza("jelys_pizzaria:burnt_pizza", {
|
||||
description = "Burnt Pizza",
|
||||
texture = {"jelys_pizzaria_burnt_pizza.png", "jelys_pizzaria_burnt_pizza.png"},
|
||||
on_punch = function(pos, oldnode, digger)
|
||||
local down = minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z})
|
||||
local itemstack = digger:get_wielded_item()
|
||||
local downdef = minetest.registered_nodes[down.name]
|
||||
if itemstack:get_name() == "jelys_pizzaria:pizza_cutter" and downdef.groups.pizza_oven == nil then
|
||||
jpizza.spawn_slices(pos, "jelys_pizzaria:burnt_pizza_slice")
|
||||
minetest.remove_node(pos)
|
||||
end
|
||||
end,
|
||||
on_destruct = function(pos)
|
||||
local down = {x=pos.x, y=pos.y-1,z=pos.z}
|
||||
if minetest.get_node(down).name == "jelys_pizzaria:pizza_oven" then
|
||||
minetest.get_meta(down):set_string("infotext", "Empty Pizza Oven")
|
||||
end
|
||||
end,
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_craftitem("jelys_pizzaria:burnt_pizza_slice", {
|
||||
description = "Burned Pizza Slice",
|
||||
inventory_image = "jelys_pizzaria_burnt_pizza_slice.png",
|
||||
stack_max = 12,
|
||||
on_use = function(itemstack, player, pointed_thing)
|
||||
minetest.chat_send_player(player:get_player_name(), "Blecht")
|
||||
return minetest.do_item_eat(-2, "", itemstack, player, pointed_thing)
|
||||
end
|
||||
})
|
||||
|
||||
--Tools
|
||||
|
||||
minetest.register_node("jelys_pizzaria:rolling_pin", {
|
||||
description = "Rolling Pin",
|
||||
inventory_image = "jelys_pizzaria_rolling_pin_inv.png",
|
||||
tiles={"default_wood.png"},
|
||||
drawtype = "nodebox",
|
||||
groups={oddly_breakable_by_hand=3},--just in case somebody places it
|
||||
visual_size = 2,
|
||||
tool_capabilities = {
|
||||
full_punch_interval = 2.0,
|
||||
max_drop_level=0,
|
||||
groupcaps={
|
||||
rolling_pin = {times={[2]=3.00, [3]=5.60}, uses=1, maxlevel=1},
|
||||
},
|
||||
damage_groups = {}
|
||||
},
|
||||
stack_max=1,
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.125, -0.125, -0.5, 0.125, 0.125, 0.5},
|
||||
{-0.0625, -0.0625, -0.6875, 0.0625, 0.0625, 0.6875},
|
||||
}
|
||||
},
|
||||
sound = {breaks = "default_tool_breaks"},
|
||||
on_place = function() return end,
|
||||
node_placement_prediction = "",
|
||||
})
|
||||
|
||||
minetest.register_tool("jelys_pizzaria:pizza_cutter", {
|
||||
description = "Pizza Cutter",
|
||||
inventory_image = "jelys_pizzaria_pizza_cutter.png",
|
||||
wield_image = "jelys_pizzaria_pizza_cutter.png^[transformFX",
|
||||
sound = {breaks = "default_tool_breaks"}
|
||||
})
|
||||
|
||||
--Hunger support
|
||||
|
||||
if jpizza.has_depends.hunger_ng then
|
||||
hunger_ng.add_hunger_data("jelys_pizzaria:burnt_pizza_slice", {satiates = -3, heals = -2})
|
||||
hunger_ng.add_hunger_data("jelys_pizzaria:cheese_pizza_slice", {satiates = 1})
|
||||
end
|
||||
if jpizza.has_depends.hbhunger and minetest.global_exists("hbhunger") then
|
||||
hbhunger.register_food("jelys_pizzaria:burnt_pizza_slice", 0, "", 2)
|
||||
hbhunger.register_food("jelys_pizzaria:cheese_pizza_slice", 1)
|
||||
end
|
||||
|
||||
|
||||
--Craft recipes
|
||||
minetest.register_craft({
|
||||
output = "jelys_pizzaria:rolling_pin",
|
||||
recipe = {
|
||||
{"", "", "group:stick"},
|
||||
{"", "group:wood",""},
|
||||
{"group:stick", "",""},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "jelys_pizzaria:pizza_cutter",
|
||||
recipe = {
|
||||
{"","default:steel_ingot", "default:steel_ingot"},
|
||||
{"","group:stick", "default:steel_ingot"},
|
||||
{"group:stick", "", ""}
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "jelys_pizzaria:pizza_box_closed",
|
||||
recipe = {
|
||||
{"dye:green", "dye:white","dye:red"},
|
||||
{"default:paper", "default:paper","default:paper"},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "jelys_pizzaria:dough 2",
|
||||
recipe = {"farming:flour", "bucket:bucket_water"},
|
||||
replacements = {
|
||||
{"bucket:bucket_water", "bucket:bucket_empty"}
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "jelys_pizzaria:dough 2",
|
||||
recipe = {"farming:flour", "bucket:bucket_river_water"},
|
||||
replacements = {
|
||||
{"bucket:bucket_river_water", "bucket:bucket_empty"}
|
||||
}
|
||||
})
|
||||
|
||||
--Easter Eggs
|
||||
minetest.register_craftitem("jelys_pizzaria:hainac_slice", {
|
||||
description = "Slice of \"Heart attack in a circle\" pizza",
|
||||
inventory_image = "jelys_pizzaria_hainac_slice.png",
|
||||
groups = {food = 1},
|
||||
on_use = function(itemstack, player, pointed_thing)
|
||||
minetest.after(1, function(itemstack, player, pointed_thing)
|
||||
if player:get_hp() > 0 then
|
||||
minetest.do_item_eat(20, "", itemstack, player, pointed_thing)
|
||||
end
|
||||
end, itemstack, player, pointed_thing)
|
||||
return minetest.do_item_eat(-10, "", itemstack, player, pointed_thing)
|
||||
end
|
||||
})
|
||||
|
||||
|
||||
jpizza.register_pizza("jelys_pizzaria:hainac_pizza", {
|
||||
description = "Whole \"Heart attack in a circle\" Pizza",
|
||||
texture = {"jelys_pizzaria_pizza_hainac.png", "jelys_pizzaria_cooked_dough.png"},
|
||||
done = 1,
|
||||
on_punch = function(pos, oldnode, digger)
|
||||
local down = minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z})
|
||||
local itemstack = digger:get_wielded_item()
|
||||
local downdef = minetest.registered_nodes[down.name]
|
||||
if itemstack:get_name() == "jelys_pizzaria:pizza_cutter" and downdef.groups.pizza_oven == nil then
|
||||
jpizza.spawn_slices(pos, "jelys_pizzaria:hainac_slice")
|
||||
minetest.remove_node(pos)
|
||||
end
|
||||
end,
|
||||
})
|
||||
local h = "jelys_pizzaria:hainac_slice"
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "jelys_pizzaria:hainac_pizza",
|
||||
recipe = {h,h,h,h,h,h},
|
||||
})
|
||||
|
||||
if jpizza.has_depends.dungeon_loot and minetest.settings:get_bool("jelys_pizzaria.enable_dungeon_loot") then
|
||||
|
||||
--Cheese
|
||||
dungeon_loot.register({
|
||||
name = "jelys_pizzaria:cheese",
|
||||
chance = 0.1,
|
||||
count = {1, 2},
|
||||
y = {-32768, 0},
|
||||
})
|
||||
dungeon_loot.register({
|
||||
name = "jelys_pizzaria:cheese",
|
||||
chance = 0.2,
|
||||
count = {3, 7},
|
||||
y = {-32768, -500},
|
||||
})
|
||||
dungeon_loot.register({
|
||||
name = "jelys_pizzaria:cheese",
|
||||
chance = 0.2,
|
||||
count = {3, 7},
|
||||
y = {-431, -431},
|
||||
})
|
||||
|
||||
|
||||
--Heart attack in a circle
|
||||
|
||||
dungeon_loot.register({
|
||||
name = "jelys_pizzaria:hainac_slice",
|
||||
chance = 0.01,
|
||||
count = {1,2},
|
||||
y = {-608, -400},
|
||||
})
|
||||
dungeon_loot.register({
|
||||
name = "jelys_pizzaria:hainac_slice",
|
||||
chance = 0.06,
|
||||
count = {1,2},
|
||||
y = {-850, -800},
|
||||
})
|
||||
dungeon_loot.register({
|
||||
name = "jelys_pizzaria:hainac_slice",
|
||||
chance = 0.85,
|
||||
count = {8, 10},
|
||||
y = {-431, -431},
|
||||
})
|
||||
|
||||
|
||||
--Pizza Oven
|
||||
|
||||
dungeon_loot.register({
|
||||
name = "jelys_pizzaria:pizza_oven",
|
||||
chance = 0.006,
|
||||
y = {-32768, -500},
|
||||
})
|
||||
end
|
BIN
mods/jelys_pizzaria/media/jelys_pizzaria_pizza_walk.1.ogg
Normal file
BIN
mods/jelys_pizzaria/media/jelys_pizzaria_pizza_walk.2.ogg
Normal file
BIN
mods/jelys_pizzaria/media/jelys_pizzaria_pizza_walk.3.ogg
Normal file
BIN
mods/jelys_pizzaria/media/jelys_pizzaria_pizza_walk.4.ogg
Normal file
7
mods/jelys_pizzaria/mod.conf
Normal file
|
@ -0,0 +1,7 @@
|
|||
name = jelys_pizzaria
|
||||
description = Adds Pizza as an Endgame food
|
||||
depends = default, vessels, flowers, farming
|
||||
optional_depends = hunger_ng, hbhunger, pineapple, mobs, creatures, stairs, fire
|
||||
author = Extex
|
||||
title = Pizzaria
|
||||
release = 27608
|
|
@ -0,0 +1,48 @@
|
|||
# Blender v2.79 (sub 7) OBJ File: ''
|
||||
# www.blender.org
|
||||
o model
|
||||
v 0.501000 -0.375000 0.501000
|
||||
v 0.501000 -0.375000 -0.501000
|
||||
v -0.501000 -0.375000 -0.501000
|
||||
v -0.501000 -0.375000 0.501000
|
||||
v 0.501000 -0.500000 -0.501000
|
||||
v 0.501000 -0.500000 0.501000
|
||||
v -0.501000 -0.500000 0.501000
|
||||
v -0.501000 -0.500000 -0.501000
|
||||
vt -0.000000 1.000000
|
||||
vt -0.000000 0.500000
|
||||
vt 0.500000 0.500000
|
||||
vt 0.500000 1.000000
|
||||
vt 1.000000 0.093750
|
||||
vt 1.000000 0.156250
|
||||
vt 0.500000 0.156250
|
||||
vt 0.500000 0.093750
|
||||
vt 1.000000 0.093750
|
||||
vt 1.000000 0.156250
|
||||
vt 0.500000 0.156250
|
||||
vt 0.500000 0.093750
|
||||
vt 1.000000 0.093750
|
||||
vt 1.000000 0.156250
|
||||
vt 0.500000 0.156250
|
||||
vt 0.500000 0.093750
|
||||
vt 1.000000 0.093750
|
||||
vt 1.000000 0.156250
|
||||
vt 0.500000 0.156250
|
||||
vt 0.500000 0.093750
|
||||
vt 1.000000 1.000000
|
||||
vt 0.500000 1.000000
|
||||
vt 0.500000 0.500000
|
||||
vt 1.000000 0.500000
|
||||
vn 0.0000 1.0000 0.0000
|
||||
vn 1.0000 0.0000 0.0000
|
||||
vn -1.0000 0.0000 0.0000
|
||||
vn 0.0000 0.0000 -1.0000
|
||||
vn 0.0000 0.0000 1.0000
|
||||
vn 0.0000 -1.0000 -0.0000
|
||||
s 1
|
||||
f 1/1/1 2/2/1 3/3/1 4/4/1
|
||||
f 5/5/2 2/6/2 1/7/2 6/8/2
|
||||
f 7/9/3 4/10/3 3/11/3 8/12/3
|
||||
f 8/13/4 3/14/4 2/15/4 5/16/4
|
||||
f 6/17/5 1/18/5 4/19/5 7/20/5
|
||||
f 8/21/6 5/22/6 6/23/6 7/24/6
|
159
mods/jelys_pizzaria/models/jelys_pizzaria_pizza_box_open.obj
Normal file
|
@ -0,0 +1,159 @@
|
|||
# Blender v2.79 (sub 7) OBJ File: ''
|
||||
# www.blender.org
|
||||
o model
|
||||
v 0.501000 -0.500000 -0.501000
|
||||
v 0.501000 -0.500000 0.501000
|
||||
v -0.501000 -0.500000 0.501000
|
||||
v -0.501000 -0.500000 -0.501000
|
||||
v -0.501000 -0.437500 0.501000
|
||||
v 0.501000 -0.437500 0.501000
|
||||
v -0.501000 -0.437500 -0.501000
|
||||
v 0.501000 -0.437500 -0.501000
|
||||
v 0.501000 -0.423437 0.561897
|
||||
v 0.501000 0.552869 0.336444
|
||||
v -0.501000 0.552869 0.336444
|
||||
v -0.501000 -0.423437 0.561897
|
||||
v -0.501000 -0.437500 0.501000
|
||||
v 0.501000 -0.437500 0.501000
|
||||
v -0.501000 0.538807 0.275547
|
||||
v 0.501000 0.538807 0.275547
|
||||
v 0.501000 -0.424306 0.561029
|
||||
v 0.501000 0.552001 0.335576
|
||||
v -0.501000 0.552001 0.335576
|
||||
v -0.501000 -0.424306 0.561029
|
||||
v 0.498999 -0.421516 0.561326
|
||||
v 0.498999 0.550892 0.336773
|
||||
v -0.498999 0.550892 0.336773
|
||||
v -0.498999 -0.421516 0.561326
|
||||
v -0.500891 -0.437474 0.500981
|
||||
v 0.500891 -0.437474 0.500981
|
||||
v -0.500891 0.538771 0.275560
|
||||
v 0.500891 0.538771 0.275560
|
||||
v 0.498410 -0.499838 -0.498410
|
||||
v 0.498410 -0.499839 0.498410
|
||||
v -0.500120 -0.499839 0.498410
|
||||
v -0.498410 -0.499838 -0.498410
|
||||
v -0.500120 -0.437478 0.500982
|
||||
v 0.500975 -0.437478 0.500982
|
||||
v -0.500120 -0.437661 -0.498410
|
||||
v 0.500975 -0.437661 -0.498410
|
||||
v 0.501000 -0.495373 -0.501000
|
||||
v 0.501000 -0.495373 0.501000
|
||||
v -0.501000 -0.495373 0.501000
|
||||
v -0.501000 -0.495373 -0.501000
|
||||
vt 1.000000 1.000000
|
||||
vt 0.500000 1.000000
|
||||
vt 0.500000 0.500000
|
||||
vt 1.000000 0.500000
|
||||
vt 1.000000 0.093750
|
||||
vt 1.000000 0.125000
|
||||
vt 0.500000 0.125000
|
||||
vt 0.500000 0.093750
|
||||
vt 1.000000 0.093750
|
||||
vt 1.000000 0.125000
|
||||
vt 0.500000 0.125000
|
||||
vt 0.500000 0.093750
|
||||
vt 1.000000 0.093750
|
||||
vt 1.000000 0.125000
|
||||
vt 0.500000 0.125000
|
||||
vt 0.500000 0.093750
|
||||
vt 1.000000 0.093750
|
||||
vt 1.000000 0.125000
|
||||
vt 0.500000 0.125000
|
||||
vt 0.500000 0.093750
|
||||
vt -0.000000 1.000000
|
||||
vt -0.000000 0.500000
|
||||
vt 0.500000 0.500000
|
||||
vt 0.500000 1.000000
|
||||
vt 1.000000 0.125000
|
||||
vt 1.000000 0.156250
|
||||
vt 0.500000 0.156250
|
||||
vt 0.500000 0.125000
|
||||
vt 1.000000 0.125000
|
||||
vt 1.000000 0.156250
|
||||
vt 0.500000 0.156250
|
||||
vt 0.500000 0.125000
|
||||
vt 1.000000 0.125000
|
||||
vt 1.000000 0.156250
|
||||
vt 0.500000 0.156250
|
||||
vt 0.500000 0.125000
|
||||
vt 1.000000 0.125000
|
||||
vt 1.000000 0.156250
|
||||
vt 0.500000 0.156250
|
||||
vt 0.500000 0.125000
|
||||
vt 0.500000 0.000000
|
||||
vt 0.500000 0.500000
|
||||
vt 0.000000 0.500000
|
||||
vt 0.000000 0.000000
|
||||
vt 1.000000 0.031250
|
||||
vt 1.000000 0.062500
|
||||
vt 0.500000 0.062500
|
||||
vt 0.500000 0.031250
|
||||
vt 1.000000 0.031250
|
||||
vt 1.000000 0.062500
|
||||
vt 0.500000 0.062500
|
||||
vt 0.500000 0.031250
|
||||
vt 1.000000 0.031250
|
||||
vt 1.000000 0.062500
|
||||
vt 0.500000 0.062500
|
||||
vt 0.500000 0.031250
|
||||
vt 1.000000 0.031250
|
||||
vt 1.000000 0.062500
|
||||
vt 0.500000 0.062500
|
||||
vt 0.500000 0.031250
|
||||
vt 1.000000 0.000000
|
||||
vt 1.000000 0.031250
|
||||
vt 0.500000 0.031250
|
||||
vt 0.500000 0.000000
|
||||
vt 1.000000 0.000000
|
||||
vt 1.000000 0.031250
|
||||
vt 0.500000 0.031250
|
||||
vt 0.500000 0.000000
|
||||
vt 1.000000 0.000000
|
||||
vt 1.000000 0.031250
|
||||
vt 0.500000 0.031250
|
||||
vt 0.500000 0.000000
|
||||
vt 1.000000 0.000000
|
||||
vt 1.000000 0.031250
|
||||
vt 0.500000 0.031250
|
||||
vt 0.500000 0.000000
|
||||
vt 0.000000 0.000000
|
||||
vt 0.500000 0.000000
|
||||
vt 0.500000 0.500000
|
||||
vt 0.000000 0.500000
|
||||
vn 0.0000 -1.0000 -0.0000
|
||||
vn 0.0000 0.0000 1.0000
|
||||
vn 0.0000 0.0000 -1.0000
|
||||
vn -1.0000 0.0000 0.0000
|
||||
vn 1.0000 0.0000 0.0000
|
||||
vn 0.0000 0.2250 0.9744
|
||||
vn 0.0000 0.9744 -0.2250
|
||||
vn 0.0000 -0.9744 0.2250
|
||||
vn 0.9995 0.0068 0.0295
|
||||
vn -0.9995 0.0068 0.0295
|
||||
vn 0.0000 0.9810 -0.1942
|
||||
vn 0.0000 -0.9668 0.2557
|
||||
vn 0.0000 -0.0412 0.9992
|
||||
vn -0.9999 -0.0137 -0.0009
|
||||
vn 0.9992 -0.0412 0.0000
|
||||
s 1
|
||||
f 4/1/1 1/2/1 2/3/1 3/4/1
|
||||
f 2/5/2 6/6/2 5/7/2 3/8/2
|
||||
f 4/9/3 7/10/3 8/11/3 1/12/3
|
||||
f 3/13/4 5/14/4 7/15/4 4/16/4
|
||||
f 1/17/5 8/18/5 6/19/5 2/20/5
|
||||
f 9/21/6 10/22/6 11/23/6 12/24/6
|
||||
f 16/25/5 10/26/5 9/27/5 14/28/5
|
||||
f 13/29/4 12/30/4 11/31/4 15/32/4
|
||||
f 15/33/7 11/34/7 10/35/7 16/36/7
|
||||
f 14/37/8 9/38/8 12/39/8 13/40/8
|
||||
f 17/41/6 18/42/6 19/43/6 20/44/6
|
||||
f 28/45/9 22/46/9 21/47/9 26/48/9
|
||||
f 25/49/10 24/50/10 23/51/10 27/52/10
|
||||
f 27/53/11 23/54/11 22/55/11 28/56/11
|
||||
f 26/57/12 21/58/12 24/59/12 25/60/12
|
||||
f 30/61/13 34/62/13 33/63/13 31/64/13
|
||||
f 32/65/3 35/66/3 36/67/3 29/68/3
|
||||
f 31/69/14 33/70/14 35/71/14 32/72/14
|
||||
f 29/73/15 36/74/15 34/75/15 30/76/15
|
||||
f 40/77/1 37/78/1 38/79/1 39/80/1
|
315
mods/jelys_pizzaria/models/jelys_pizzaria_pizza_oven.obj
Normal file
|
@ -0,0 +1,315 @@
|
|||
# Blender v2.79 (sub 7) OBJ File: 'oven.blend'
|
||||
# www.blender.org
|
||||
mtllib jelys_pizzaria_pizza_oven.mtl
|
||||
o model
|
||||
v 0.502452 -0.499878 0.439521
|
||||
v 0.502452 0.505025 0.439521
|
||||
v 0.314032 0.505025 0.439521
|
||||
v 0.314032 -0.499878 0.439521
|
||||
v 0.314032 -0.499878 -0.502576
|
||||
v 0.314032 0.505025 -0.502576
|
||||
v 0.502452 0.505025 -0.502576
|
||||
v 0.502452 -0.499878 -0.502576
|
||||
v -0.314032 -0.499878 0.439521
|
||||
v -0.314032 0.505025 0.439521
|
||||
v -0.502452 0.505025 0.439521
|
||||
v -0.502452 -0.499878 0.439521
|
||||
v -0.502452 -0.499878 -0.502576
|
||||
v -0.502452 0.505025 -0.502576
|
||||
v -0.314032 0.505025 -0.502576
|
||||
v -0.314032 -0.499878 -0.502576
|
||||
v -0.502452 -0.248652 0.439521
|
||||
v 0.502452 -0.248652 0.439521
|
||||
v 0.502452 -0.248652 -0.502576
|
||||
v -0.502452 -0.248652 -0.502576
|
||||
v -0.502452 -0.499878 -0.125737
|
||||
v -0.502452 0.505025 -0.125737
|
||||
v 0.502452 0.505025 -0.125737
|
||||
v 0.502452 -0.499878 -0.125737
|
||||
v 0.502452 0.128186 0.439521
|
||||
v -0.502452 0.128186 0.439521
|
||||
v -0.502452 0.128186 -0.502576
|
||||
v 0.502452 0.128186 -0.502576
|
||||
v -0.502452 -0.185846 -0.439769
|
||||
v 0.502452 -0.185846 -0.439769
|
||||
v 0.502452 -0.185846 -0.502576
|
||||
v -0.502452 -0.185846 -0.502576
|
||||
v 0.502452 -0.499878 -0.439769
|
||||
v -0.502452 -0.499878 -0.439769
|
||||
v 0.439645 0.505025 0.439521
|
||||
v -0.439645 0.505025 0.439521
|
||||
v -0.439645 0.505025 -0.000124
|
||||
v 0.439645 0.505025 -0.000124
|
||||
v 0.439645 1.133090 0.439521
|
||||
v -0.439645 1.133090 0.439521
|
||||
v -0.439645 1.133090 -0.000124
|
||||
v 0.439645 1.133090 -0.000124
|
||||
v 0.502452 1.133090 0.439521
|
||||
v 0.314032 1.133090 0.439521
|
||||
v 0.314032 0.505025 -0.439769
|
||||
v 0.314032 1.133090 -0.439769
|
||||
v 0.502452 1.133090 -0.439769
|
||||
v 0.502452 0.505025 -0.439769
|
||||
v -0.314032 1.133090 0.439521
|
||||
v -0.502452 1.133090 0.439521
|
||||
v -0.502452 0.505025 -0.439769
|
||||
v -0.502452 1.133090 -0.439769
|
||||
v -0.314032 1.133090 -0.439769
|
||||
v -0.314032 0.505025 -0.439769
|
||||
v 0.502452 0.630638 0.439521
|
||||
v -0.502452 0.630638 0.439521
|
||||
v -0.502452 0.630638 -0.439769
|
||||
v 0.502452 0.630638 -0.439769
|
||||
v -0.251226 1.384315 0.502328
|
||||
v 0.251226 1.384315 0.502328
|
||||
v 0.251226 1.384315 -0.000124
|
||||
v -0.251226 1.384315 -0.000124
|
||||
v 0.251226 -0.499878 0.502328
|
||||
v -0.251226 -0.499878 0.502328
|
||||
v -0.251226 -0.499878 -0.000124
|
||||
v 0.251226 -0.499878 -0.000124
|
||||
v 0.333841 -0.307556 -0.260998
|
||||
v -0.268463 -0.239891 -0.425669
|
||||
v 0.353949 0.001258 -0.207653
|
||||
v -0.248355 0.068923 -0.372323
|
||||
v 0.267235 -0.044627 0.090662
|
||||
v -0.335069 0.023038 -0.074009
|
||||
v -0.355178 -0.285777 -0.127354
|
||||
v 0.042002 0.142762 -0.425081
|
||||
v -0.198226 0.139221 0.155214
|
||||
v 0.306285 0.012476 -0.316469
|
||||
v 0.066056 0.008935 0.263826
|
||||
v 0.186521 -0.273249 -0.367792
|
||||
v -0.053708 -0.276790 0.212503
|
||||
v -0.077762 -0.142963 -0.476404
|
||||
v -0.317991 -0.146504 0.103891
|
||||
vt 0.000215 0.734052
|
||||
vt 0.000215 0.656142
|
||||
vt 0.078125 0.656142
|
||||
vt 0.078125 0.734052
|
||||
vt 0.000215 0.656142
|
||||
vt 0.078125 0.656142
|
||||
vt 0.078125 0.500323
|
||||
vt 0.000215 0.500323
|
||||
vt 0.156035 0.656142
|
||||
vt 0.156035 0.500323
|
||||
vt 0.078125 0.734052
|
||||
vt 0.000215 0.734052
|
||||
vt 0.000215 0.656142
|
||||
vt 0.078125 0.656142
|
||||
vt 0.000215 0.656142
|
||||
vt 0.078125 0.656142
|
||||
vt 0.078125 0.500323
|
||||
vt 0.000215 0.500323
|
||||
vt 0.000215 0.500323
|
||||
vt 0.078125 0.500323
|
||||
vt 0.078125 0.656142
|
||||
vt 0.000215 0.656142
|
||||
vt 0.078125 0.500323
|
||||
vt 0.156035 0.500323
|
||||
vt 0.156035 0.656142
|
||||
vt 0.078125 0.656142
|
||||
vt 0.500000 -0.000000
|
||||
vt 0.500000 0.250000
|
||||
vt 0.453125 0.250000
|
||||
vt 0.453125 -0.000000
|
||||
vt 0.046875 -0.000000
|
||||
vt 0.046875 0.250000
|
||||
vt -0.000000 0.250000
|
||||
vt -0.000000 -0.000000
|
||||
vt 0.500000 -0.000000
|
||||
vt 0.500000 0.250000
|
||||
vt 0.265625 0.250000
|
||||
vt 0.265625 -0.000000
|
||||
vt 0.234375 0.250000
|
||||
vt 0.234375 0.500000
|
||||
vt -0.000000 0.500000
|
||||
vt -0.000000 0.250000
|
||||
vt 0.296875 -0.000000
|
||||
vt 0.296875 0.250000
|
||||
vt 0.250000 0.250000
|
||||
vt 0.250000 -0.000000
|
||||
vt 0.250000 -0.000000
|
||||
vt 0.250000 0.250000
|
||||
vt 0.203125 0.250000
|
||||
vt 0.203125 -0.000000
|
||||
vt 0.500000 0.250000
|
||||
vt 0.500000 0.500000
|
||||
vt 0.265625 0.500000
|
||||
vt 0.265625 0.250000
|
||||
vt 0.484375 -0.000000
|
||||
vt 0.484375 0.250000
|
||||
vt 0.375000 0.468750
|
||||
vt 0.125000 0.468750
|
||||
vt 0.125000 0.234375
|
||||
vt 0.375000 0.234375
|
||||
vt 0.500000 0.015625
|
||||
vt 0.750000 0.015625
|
||||
vt 0.750000 0.250000
|
||||
vt 0.500000 0.250000
|
||||
vt 0.375000 0.250000
|
||||
vt 0.375000 0.500000
|
||||
vt 0.125000 0.500000
|
||||
vt 0.125000 0.250000
|
||||
vt 0.500000 0.250000
|
||||
vt 0.750000 0.250000
|
||||
vt 0.750000 0.484375
|
||||
vt 0.500000 0.484375
|
||||
vt 0.375000 0.734375
|
||||
vt 0.125000 0.734375
|
||||
vt 0.125000 0.500000
|
||||
vt 0.375000 0.500000
|
||||
vt 0.250000 0.156250
|
||||
vt -0.000000 0.156250
|
||||
vt 0.250000 0.078125
|
||||
vt -0.000000 0.078125
|
||||
vt -0.000000 0.062500
|
||||
vt 0.250000 0.062500
|
||||
vt 0.250000 -0.000000
|
||||
vt 0.250000 0.078125
|
||||
vt 0.000000 0.078125
|
||||
vt 0.000000 -0.000000
|
||||
vt 0.250000 0.078125
|
||||
vt -0.000000 0.078125
|
||||
vt 0.015625 0.390625
|
||||
vt 0.500000 0.390625
|
||||
vt 0.500000 0.500000
|
||||
vt 0.015625 0.500000
|
||||
vt 0.984375 0.593750
|
||||
vt 0.984375 0.750000
|
||||
vt 0.765625 0.750000
|
||||
vt 0.765625 0.593750
|
||||
vt 0.359375 0.562500
|
||||
vt 0.359375 0.718750
|
||||
vt 0.140625 0.718750
|
||||
vt 0.140625 0.562500
|
||||
vt 1.000000 0.593750
|
||||
vt 1.000000 0.750000
|
||||
vt 0.953125 0.750000
|
||||
vt 0.953125 0.593750
|
||||
vt 0.546875 0.500000
|
||||
vt 0.546875 0.656250
|
||||
vt 0.500000 0.656250
|
||||
vt 0.500000 0.500000
|
||||
vt 0.968750 0.593750
|
||||
vt 0.968750 0.750000
|
||||
vt 0.750000 0.750000
|
||||
vt 0.750000 0.593750
|
||||
vt 0.218750 0.343750
|
||||
vt 0.218750 0.500000
|
||||
vt -0.000000 0.500000
|
||||
vt -0.000000 0.343750
|
||||
vt 0.796875 0.593750
|
||||
vt 0.796875 0.750000
|
||||
vt 0.750000 0.750000
|
||||
vt 0.750000 0.593750
|
||||
vt 0.750000 0.500000
|
||||
vt 0.750000 0.656250
|
||||
vt 0.703125 0.656250
|
||||
vt 0.703125 0.500000
|
||||
vt 0.500000 0.343750
|
||||
vt 0.500000 0.500000
|
||||
vt 0.281250 0.500000
|
||||
vt 0.281250 0.343750
|
||||
vt 1.000000 0.593750
|
||||
vt 1.000000 0.750000
|
||||
vt 0.781250 0.750000
|
||||
vt 0.781250 0.593750
|
||||
vt 0.500000 0.015625
|
||||
vt 0.750000 0.015625
|
||||
vt 0.750000 0.234375
|
||||
vt 0.500000 0.234375
|
||||
vt 0.125000 0.296875
|
||||
vt 0.375000 0.296875
|
||||
vt 0.375000 0.515625
|
||||
vt 0.125000 0.515625
|
||||
vt 0.750000 0.531250
|
||||
vt 0.500000 0.531250
|
||||
vt 0.750000 0.593750
|
||||
vt 0.750000 0.468750
|
||||
vt 0.875000 0.468750
|
||||
vt 0.875000 0.593750
|
||||
vt 0.562500 0.000000
|
||||
vt 0.687500 0.000000
|
||||
vt 0.687500 0.125000
|
||||
vt 0.562500 0.125000
|
||||
vt 1.000000 -0.000000
|
||||
vt 1.000000 0.468750
|
||||
vt 0.875000 0.468750
|
||||
vt 0.875000 -0.000000
|
||||
vt 0.312500 0.312500
|
||||
vt 0.312500 0.781250
|
||||
vt 0.171875 0.781250
|
||||
vt 0.171875 0.312500
|
||||
vt 1.000000 0.000000
|
||||
vt 1.000000 0.468750
|
||||
vt 0.875000 0.468750
|
||||
vt 0.875000 0.000000
|
||||
vt 1.000000 0.000000
|
||||
vt 1.000000 0.468750
|
||||
vt 0.875000 0.468750
|
||||
vt 0.875000 0.000000
|
||||
vn -0.9590 0.1077 -0.2622
|
||||
vn -0.2761 -0.1461 0.9499
|
||||
vn -0.0640 -0.9834 -0.1699
|
||||
vn -0.3825 -0.0056 0.9239
|
||||
vn -0.3814 -0.9099 -0.1634
|
||||
vn 0.8416 -0.4149 0.3459
|
||||
vn 0.3814 0.9099 0.1634
|
||||
vn 0.0000 -0.0000 1.0000
|
||||
vn 0.0000 0.0000 -1.0000
|
||||
vn 1.0000 0.0000 0.0000
|
||||
vn -1.0000 0.0000 0.0000
|
||||
vn 0.0000 1.0000 0.0000
|
||||
vn 0.0000 -0.7071 0.7071
|
||||
vn 0.0000 -1.0000 -0.0000
|
||||
vn 0.0000 0.7071 0.7071
|
||||
usemtl default_obsidian.png
|
||||
s off
|
||||
f 70/1/1 68/2/1 73/3/1 72/4/1
|
||||
f 67/5/2 69/6/2 70/7/2 68/8/2
|
||||
f 69/6/3 71/9/3 72/10/3 70/7/3
|
||||
f 76/11/4 74/12/4 80/13/4 78/14/4
|
||||
f 74/15/5 76/16/5 77/17/5 75/18/5
|
||||
f 80/19/6 74/20/6 75/21/6 81/22/6
|
||||
f 78/23/7 80/24/7 81/25/7 79/26/7
|
||||
usemtl default_obsidian.png_NONE
|
||||
s 1
|
||||
f 1/27/8 2/28/8 3/29/8 4/30/8
|
||||
f 5/31/9 6/32/9 7/33/9 8/34/9
|
||||
f 8/35/10 7/36/10 2/37/10 1/38/10
|
||||
f 4/39/11 3/40/11 6/41/11 5/42/11
|
||||
f 9/43/8 10/44/8 11/45/8 12/46/8
|
||||
f 13/47/9 14/48/9 15/49/9 16/50/9
|
||||
f 16/51/10 15/52/10 10/53/10 9/54/10
|
||||
f 12/55/11 11/56/11 14/48/11 13/47/11
|
||||
f 17/57/12 18/58/12 19/59/12 20/60/12
|
||||
f 1/61/13 12/62/13 13/63/14 8/64/14
|
||||
f 1/27/13 2/28/15 11/45/15 12/46/13
|
||||
f 21/65/9 22/66/9 23/67/9 24/68/9
|
||||
f 11/69/15 2/70/15 7/71/12 14/72/12
|
||||
f 25/73/14 26/74/14 27/75/14 28/76/14
|
||||
f 27/77/9 14/48/9 7/33/9 28/78/9
|
||||
f 29/79/12 30/80/12 31/81/12 32/82/12
|
||||
f 33/83/8 30/84/8 29/85/8 34/86/8
|
||||
f 13/47/9 32/87/9 31/88/9 8/34/9
|
||||
f 35/89/14 36/90/14 37/91/14 38/92/14
|
||||
f 35/93/8 39/94/8 40/95/8 36/96/8
|
||||
f 37/97/9 41/98/9 42/99/9 38/100/9
|
||||
f 2/101/8 43/102/8 44/103/8 3/104/8
|
||||
f 45/105/9 46/106/9 47/107/9 48/108/9
|
||||
f 48/109/10 47/110/10 43/111/10 2/112/10
|
||||
f 3/113/11 44/114/11 46/115/11 45/116/11
|
||||
f 10/117/8 49/118/8 50/119/8 11/120/8
|
||||
f 51/121/9 52/122/9 53/123/9 54/124/9
|
||||
f 54/125/10 53/126/10 49/127/10 10/128/10
|
||||
f 11/129/11 50/130/11 52/131/11 51/132/11
|
||||
f 50/133/12 43/134/12 47/135/12 52/136/12
|
||||
f 55/137/14 56/138/14 57/139/14 58/140/14
|
||||
f 57/141/9 52/122/9 47/107/9 58/142/9
|
||||
f 59/143/12 60/144/12 61/145/12 62/146/12
|
||||
f 63/147/14 64/148/14 65/149/14 66/150/14
|
||||
f 63/151/8 60/152/8 59/153/8 64/154/8
|
||||
f 65/155/9 62/156/9 61/157/9 66/158/9
|
||||
f 66/159/10 61/160/10 60/161/10 63/162/10
|
||||
f 64/163/11 59/164/11 62/165/11 65/166/11
|
160
mods/jelys_pizzaria/mutation_backup.lua
Normal file
|
@ -0,0 +1,160 @@
|
|||
local mutagen = "jelys_pizzaria:mese_mutator"
|
||||
minetest.register_craftitem("jelys_pizzaria:mese_mutator", {
|
||||
description = "Mese Mutation Crystals",
|
||||
inventory_image = "jelys_pizzaria_mese_mutation_crystal.png",
|
||||
})
|
||||
|
||||
local f = "default:mese_crystal_fragment"
|
||||
local m = "default:mese_crystal"
|
||||
minetest.register_craft({
|
||||
output = "jelys_pizzaria:mese_mutator 4",
|
||||
recipe = {
|
||||
{"", f, ""},
|
||||
{f, m, f},
|
||||
}
|
||||
})
|
||||
|
||||
local tomato = "jelys_pizzaria:tomato"
|
||||
if farming and farming.mod == "redo" then
|
||||
tomato = "farming:tomato"
|
||||
else
|
||||
minetest.register_craftitem("jelys_pizzaria:tomato", {
|
||||
description = "Tomato",
|
||||
inventory_image = "jelys_pizzaria_tomato.png",
|
||||
})
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "jelys_pizzaria:tomato",
|
||||
recipe = {"default:apple", mutagen},
|
||||
})
|
||||
end
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "jelys_pizzaria:sauce",
|
||||
recipe = {tomato, "vessels:glass_bottle"},
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "jelys_pizzaria:olives",
|
||||
recipe = {"default:blueberries", mutagen},
|
||||
})
|
||||
|
||||
minetest.register_craftitem("jelys_pizzaria:cheese", {
|
||||
description = "Cheese",
|
||||
inventory_image = "jelys_pizzaria_cheese.png",
|
||||
})
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "jelys_pizzaria:cheese 2",
|
||||
recipe = {"default:gold_ingot", mutagen},
|
||||
})
|
||||
|
||||
minetest.register_craftitem("jelys_pizzaria:olives", {
|
||||
description = "Olives",
|
||||
inventory_image = "jelys_pizzaria_olives.png",
|
||||
})
|
||||
|
||||
minetest.register_craftitem("jelys_pizzaria:olives", {
|
||||
description = "Olives",
|
||||
inventory_image = "jelys_pizzaria_olives.png",
|
||||
})
|
||||
|
||||
minetest.register_craftitem("jelys_pizzaria:sausage_raw", {
|
||||
description = "Raw Sausage",
|
||||
inventory_image = "jelys_pizzaria_sausage_raw.png",
|
||||
})
|
||||
minetest.register_craft({
|
||||
type = "cooking",
|
||||
output = "jelys_pizzaria:sausage",
|
||||
recipe = "jelys_pizzaria:sausage_raw",
|
||||
cooktime = 20,
|
||||
})
|
||||
minetest.register_craftitem("jelys_pizzaria:sausage", {
|
||||
description = "Sausage",
|
||||
inventory_image = "jelys_pizzaria_sausage.png",
|
||||
})
|
||||
|
||||
minetest.register_craftitem("jelys_pizzaria:sauce", {
|
||||
description = "Tomato Sauce",
|
||||
inventory_image = "jelys_pizzaria_sauce.png",
|
||||
})
|
||||
|
||||
local meat = "jelys_pizzaria:meat"
|
||||
if jpizza.has_depends.mobs then
|
||||
meat = "mobs:meat_raw"
|
||||
elseif jpizza.has_depends.creatures then
|
||||
meat = "creatures:flesh"
|
||||
else
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "jelys_pizzaria:meat 9",
|
||||
recipe = {mutagen, mutagen, mutagen, mutagen, "bones:bones", mutagen, mutagen, mutagen, mutagen},
|
||||
})
|
||||
minetest.register_craftitem("jelys_pizzaria:meat", {
|
||||
description = "Meat",
|
||||
inventory_image = "jelys_pizzaria_meat.png",
|
||||
})
|
||||
|
||||
end
|
||||
|
||||
minetest.register_craft({
|
||||
output = "jelys_pizzaria:pepperoni_uncured",
|
||||
recipe = {
|
||||
{meat},
|
||||
{meat},
|
||||
{meat}
|
||||
},
|
||||
})
|
||||
minetest.register_craft({
|
||||
output = "jelys_pizzaria:sausage_raw",
|
||||
recipe = {
|
||||
{meat,meat,meat},
|
||||
},
|
||||
})
|
||||
|
||||
local pineapple = "jelys_pizzaria:pineapple"
|
||||
if jpizza.has_depends.pineapple then
|
||||
minetest.register_alias("pineapple:pineapple", "jelys_pizzaria:pineapple")
|
||||
pineapple = "pineapple:pineapple"
|
||||
end
|
||||
if farming and farming.mod == "redo" then
|
||||
minetest.register_alias("farming:pineapple_ring", "jelys_pizzaria:pineapple")
|
||||
pineapple = "farming:pineapple_ring"
|
||||
end
|
||||
if not jpizza.has_depends.pineapple and (not farming or farming and not farming.mod) then
|
||||
minetest.register_node("jelys_pizzaria:pineapple", {
|
||||
description = "Pineapple",
|
||||
drawtype = "plantlike",
|
||||
tiles = {"jelys_pizzaria_pineapple.png"},
|
||||
inventory_image = "jelys_pizzaria_pineapple_inv.png",
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
walkable = false,
|
||||
is_ground_content = false,
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {-3 / 16, -7 / 16, -3 / 16, 3 / 16, 4 / 16, 3 / 16}
|
||||
},
|
||||
groups = {fleshy = 3, dig_immediate = 3, flammable = 2},
|
||||
on_use = minetest.item_eat(2),
|
||||
sounds = default.node_sound_leaves_defaults(),
|
||||
})
|
||||
minetest.register_craft({
|
||||
type = "shapeless",
|
||||
output = "jelys_pizzaria:pineapple",
|
||||
recipe = {"default:pine_needles","default:pine_needles","default:apple", mutagen, mutagen},
|
||||
})
|
||||
end
|
||||
jpizza.register_topping({
|
||||
item = pineapple,
|
||||
name = "pineapple",
|
||||
topping_inv = {
|
||||
"jelys_pizzaria_topping_pineapple_inv_1.png",
|
||||
"jelys_pizzaria_topping_pineapple_inv_2.png",
|
||||
},
|
||||
texture = "jelys_pizzaria_topping_pineapple.png",
|
||||
cooked_texture = "jelys_pizzaria_topping_pineapple_cooked.png",
|
||||
eat = 3,
|
||||
})
|
431
mods/jelys_pizzaria/nodes.lua
Normal file
|
@ -0,0 +1,431 @@
|
|||
local function find(value, key, list)
|
||||
for _, i in pairs(list) do
|
||||
if i[key] == value then
|
||||
return _
|
||||
end
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
minetest.register_node("jelys_pizzaria:dough", {
|
||||
description = "Pizza dough",
|
||||
tiles = {
|
||||
"jelys_pizzaria_pizza_dough.png",
|
||||
},
|
||||
groups = {rolling_pin=2, oddly_breakable_by_hand=3, attached_node = 1},
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
-5 / 16, -0.5, -5 / 16,
|
||||
5 / 16, 1 /16, 5 / 16
|
||||
}
|
||||
},
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.1875, -0.5, -0.1875, 0.1875, -0.25, 0.125},
|
||||
{-0.25, -0.5, -0.125, 0.25, -0.25, 0.0625},
|
||||
{-0.125, -0.5, -0.25, 0.125, -0.25, 0.1875},
|
||||
{-0.125, -0.5, -0.1875, 0.125, -0.1875, 0.125},
|
||||
}
|
||||
},
|
||||
on_dig = function(pos, node, player)
|
||||
local protected = minetest.is_protected(pos, player:get_player_name())
|
||||
local wielded = player:get_wielded_item()
|
||||
if wielded:get_name() == "jelys_pizzaria:rolling_pin" then
|
||||
minetest.set_node(pos, {name = "jelys_pizzaria:dough_rolled"})
|
||||
else
|
||||
if not protected then
|
||||
minetest.node_dig(pos, node, player)
|
||||
end
|
||||
end
|
||||
end,
|
||||
sounds = {
|
||||
footstep = {name = "jelys_pizzaria_pizza_walk", gain = 0.3},--https://freesound.org/people/JanKoehl/sounds/85604/
|
||||
dug = {name = "jelys_pizzaria_pizza_walk", gain = 0.3},
|
||||
dig = {name = "jelys_pizzaria_pizza_walk", gain = 0.3},
|
||||
},
|
||||
})
|
||||
|
||||
jpizza.register_pizza("jelys_pizzaria:dough_rolled", {
|
||||
description = "Rolled Pizza dough",
|
||||
texture = {
|
||||
"jelys_pizzaria_pizza_dough.png",
|
||||
"jelys_pizzaria_pizza_dough.png"
|
||||
},
|
||||
drop = "jelys_pizzaria:dough",
|
||||
on_rightclick = function(pos, node, player, itemstack, pointed_thing)
|
||||
if itemstack:get_name() == "jelys_pizzaria:sauce" then
|
||||
if not minetest.is_creative_enabled(player:get_player_name()) then
|
||||
itemstack:take_item()
|
||||
local inv = player:get_inventory()
|
||||
if inv:room_for_item("main", "vessels:glass_bottle") then
|
||||
inv:add_item("main", "vessels:glass_bottle")
|
||||
else
|
||||
minetest.add_item({x=pos.x, y=pos.y+1, z=pos.z}, "vessels:glass_bottle")
|
||||
end
|
||||
end
|
||||
minetest.set_node(pos, {name="jelys_pizzaria:dough_with_sauce"})
|
||||
return itemstack
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
jpizza.register_pizza("jelys_pizzaria:dough_with_sauce", {
|
||||
description = "Pizza dough with Sauce",
|
||||
texture = {
|
||||
"jelys_pizzaria_pizza_dough.png^jelys_pizzaria_pizza_sauce.png",
|
||||
"jelys_pizzaria_pizza_dough.png"
|
||||
},
|
||||
on_rightclick = function(pos, node, player, itemstack, pointed_thing)
|
||||
if itemstack:get_name() == "jelys_pizzaria:cheese" then
|
||||
minetest.set_node(pos, {name="jelys_pizzaria:raw_cheese_pizza"})
|
||||
if not minetest.is_creative_enabled(player:get_player_name()) then
|
||||
itemstack:take_item()
|
||||
end
|
||||
end
|
||||
return itemstack
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
jpizza.register_pizza("jelys_pizzaria:raw_cheese_pizza", {
|
||||
description = "Raw Cheese Pizza",
|
||||
texture = {
|
||||
"jelys_pizzaria_pizza_dough.png^jelys_pizzaria_pizza_sauce.png^jelys_pizzaria_pizza_cheese.png",
|
||||
"jelys_pizzaria_pizza_dough.png"
|
||||
},
|
||||
cooked = "jelys_pizzaria:cheese_pizza",
|
||||
cook_time = {min=50, max = 100},
|
||||
on_rightclick = function(pos, node, player, itemstack, pointed_thing)
|
||||
local name = itemstack:get_name()
|
||||
local fetch = find(name, "item", jpizza.toppings)
|
||||
if fetch then
|
||||
local stuff = jpizza.toppings[fetch]
|
||||
if not minetest.is_creative_enabled(player:get_player_name()) then
|
||||
itemstack:take_item()
|
||||
end
|
||||
minetest.set_node(pos, {name = "jelys_pizzaria:raw_pizza_"..stuff.name})
|
||||
return itemstack
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
|
||||
jpizza.register_pizza("jelys_pizzaria:cheese_pizza", {
|
||||
description = "Cheese Pizza",
|
||||
texture = {
|
||||
"jelys_pizzaria_cooked_dough.png^jelys_pizzaria_pizza_cooked_sauce.png^jelys_pizzaria_pizza_cooked_cheese.png",
|
||||
"jelys_pizzaria_cooked_dough.png"
|
||||
},
|
||||
done = true,
|
||||
on_punch = function(pos, oldnode, digger)
|
||||
local down = minetest.get_node({x=pos.x, y=pos.y-1, z=pos.z})
|
||||
local itemstack = digger:get_wielded_item()
|
||||
local downdef = minetest.registered_nodes[down.name]
|
||||
if itemstack:get_name() == "jelys_pizzaria:pizza_cutter" and downdef.groups.pizza_oven == nil then
|
||||
jpizza.spawn_slices(pos, "jelys_pizzaria:cheese_pizza_slice")
|
||||
minetest.remove_node(pos)
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_craftitem("jelys_pizzaria:cheese_pizza_slice", {
|
||||
description = "Slice of Cheese Pizza",
|
||||
stack_max = 6,
|
||||
inventory_image = "jelys_pizzaria_pizza_slice.png",
|
||||
groups = {food = 1},
|
||||
on_use = minetest.item_eat(1),
|
||||
})
|
||||
|
||||
local function punch_pepperoni(pos, oldnode, digger)
|
||||
local num = 0
|
||||
local below = {x=pos.x, y=pos.y, z=pos.z}
|
||||
local inv = digger:get_inventory()
|
||||
if minetest.is_protected(pos, digger:get_player_name()) then return end
|
||||
local name = minetest.get_node(below).name
|
||||
while minetest.registered_nodes[name].groups ~= nil and minetest.registered_nodes[name].groups.pepperoni == 1 do
|
||||
minetest.remove_node(below)
|
||||
minetest.add_item(below, name)
|
||||
below.y = below.y - 1
|
||||
num = num + 1
|
||||
name = minetest.get_node(below).name
|
||||
end
|
||||
if num == 0 then return end
|
||||
return true
|
||||
end
|
||||
|
||||
|
||||
|
||||
minetest.register_node("jelys_pizzaria:pepperoni_uncured", {
|
||||
description = "Uncured Pepperoni",
|
||||
inventory_image = "jelys_pizzaria_meat_pepperoni_uncured_inv.png",
|
||||
wield_image = "jelys_pizzaria_meat_pepperoni_uncured_inv.png",
|
||||
tiles = {
|
||||
"jelys_pizzaria_meat_pepperoni_uncured.png",
|
||||
"jelys_pizzaria_meat_pepperoni_uncured.png^[transformFX",
|
||||
"jelys_pizzaria_meat_pepperoni_uncured.png",
|
||||
"jelys_pizzaria_meat_pepperoni_uncured.png",
|
||||
"jelys_pizzaria_meat_pepperoni_uncured.png^[transformFX",
|
||||
"jelys_pizzaria_meat_pepperoni_uncured.png^[transformFX"
|
||||
},
|
||||
use_texture_alpha = true,
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
groups = {pepperoni = 1},
|
||||
on_construct = function(pos)
|
||||
minetest.get_node_timer(pos):start(math.random(100, 200))
|
||||
end,
|
||||
on_timer = function(pos)
|
||||
minetest.swap_node(pos, {name="jelys_pizzaria:pepperoni_cured"})
|
||||
end,
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if pointed_thing.type == "node" then
|
||||
local pos = pointed_thing.above
|
||||
local uppos = {x=pos.x, y=pos.y+1, z=pos.z}
|
||||
local upnode = minetest.get_node(uppos)
|
||||
if minetest.is_protected(uppos, placer:get_player_name()) then
|
||||
return minetest.item_place(itemstack, placer, pointed_thing)
|
||||
end
|
||||
if minetest.registered_nodes[upnode.name].walkable == false then
|
||||
if placer:is_player() then minetest.chat_send_player(placer:get_player_name(), "Pepperoni has to be hung up to dry!") end
|
||||
return itemstack
|
||||
else
|
||||
local name = minetest.get_node(pos).name
|
||||
if minetest.registered_nodes[name].buildable_to == true or name == "air" then
|
||||
minetest.set_node(pos, {name="jelys_pizzaria:pepperoni_uncured"})
|
||||
if not minetest.is_creative_enabled(placer:get_player_name()) then
|
||||
itemstack:take_item()
|
||||
end
|
||||
end
|
||||
return minetest.item_place(itemstack, placer, pointed_thing)
|
||||
end
|
||||
end
|
||||
return minetest.item_place(itemstack, placer, pointed_thing)
|
||||
end,
|
||||
on_punch = punch_pepperoni,
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.125, -0.437, 0.125, 0.125, 0.125, -0.125},
|
||||
{-0.125, 0.5, 0, 0.125, -0.5, 0},
|
||||
{0, 0.5, -0.125, 0, -0.5, 0.125},
|
||||
}
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.125, -0.437, 0.125, 0.125, 0.125, -0.125},
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
minetest.register_node("jelys_pizzaria:pepperoni_cured", {
|
||||
description = "Cured Pepperoni",
|
||||
inventory_image = "jelys_pizzaria_meat_pepperoni_cured_inv.png",
|
||||
wield_image = "jelys_pizzaria_meat_pepperoni_cured_inv.png",
|
||||
tiles = {
|
||||
"jelys_pizzaria_meat_pepperoni_cured.png",
|
||||
"jelys_pizzaria_meat_pepperoni_cured.png^[transformFX",
|
||||
"jelys_pizzaria_meat_pepperoni_cured.png",
|
||||
"jelys_pizzaria_meat_pepperoni_cured.png",
|
||||
"jelys_pizzaria_meat_pepperoni_cured.png^[transformFX",
|
||||
"jelys_pizzaria_meat_pepperoni_cured.png^[transformFX"
|
||||
},
|
||||
use_texture_alpha = true,
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
groups = {pepperoni = 1},
|
||||
on_place = function(itemstack, placer, pointed_thing)
|
||||
if pointed_thing.type == "node" then
|
||||
local pos = pointed_thing.above
|
||||
local uppos = {x=pos.x, y=pos.y+1, z=pos.z}
|
||||
local upnode = minetest.get_node(uppos)
|
||||
if minetest.is_protected(uppos, placer:get_player_name()) then
|
||||
return minetest.item_place(itemstack, placer, pointed_thing)
|
||||
end
|
||||
if minetest.registered_nodes[upnode.name].walkable == false then
|
||||
return minetest.item_place(itemstack, placer, pointed_thing)
|
||||
else
|
||||
local name = minetest.get_node(pos).name
|
||||
if minetest.registered_nodes[name].buildable_to == true or name == "air" then
|
||||
minetest.set_node(pos, {name="jelys_pizzaria:pepperoni_cured"})
|
||||
if not minetest.is_creative_enabled(placer:get_player_name()) then
|
||||
itemstack:take_item()
|
||||
end
|
||||
end
|
||||
return minetest.item_place(itemstack, placer, pointed_thing)
|
||||
end
|
||||
end
|
||||
return minetest.item_place(itemstack, placer, pointed_thing)
|
||||
end,
|
||||
on_punch = punch_pepperoni,
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.125, -0.437, 0.125, 0.125, 0.125, -0.125},
|
||||
{-0.125, 0.5, 0, 0.125, -0.5, 0},
|
||||
{0, 0.5, -0.125, 0, -0.5, 0.125},
|
||||
}
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.125, -0.437, 0.125, 0.125, 0.125, -0.125},
|
||||
}
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
|
||||
minetest.register_node("jelys_pizzaria:pizza_box_closed", {
|
||||
description = "Pizza Box Closed",
|
||||
drawtype = "mesh",
|
||||
paramtype2 = "facedir",
|
||||
tiles = {
|
||||
"jelys_pizzaria_pizza_box.png",
|
||||
},
|
||||
groups = {oddly_breakable_by_hand=3},
|
||||
mesh = "jelys_pizzaria_pizza_box_closed.obj",
|
||||
collision_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.501, -0.5, -0.501, 0.501, -0.375, 0.501}
|
||||
},
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.501, -0.5, -0.501, 0.501, -0.375, 0.501}
|
||||
},
|
||||
},
|
||||
on_rightclick = function(pos, node, player, itemstack, pointed_thing)
|
||||
local inv = player:get_inventory()
|
||||
local contents = minetest.get_meta(pos):get_string("pizza")
|
||||
if contents and minetest.registered_nodes[contents] then
|
||||
minetest.get_meta(pos):set_string("pizza", "")
|
||||
minetest.swap_node(pos, {name="jelys_pizzaria:pizza_box_open", param2 = node.param2})
|
||||
local leftover = itemstack:add_item(contents)
|
||||
if leftover:is_empty() then
|
||||
return itemstack
|
||||
end
|
||||
inv:add_item("main", leftover)
|
||||
end
|
||||
minetest.swap_node(pos, {name="jelys_pizzaria:pizza_box_open", param2=node.param2})
|
||||
return itemstack
|
||||
end,
|
||||
on_dig = function(pos, node, player)
|
||||
local meta = minetest.get_meta(pos)
|
||||
local contents = meta:get_string("pizza")
|
||||
local inv = player:get_inventory()
|
||||
local item = ItemStack("jelys_pizzaria:pizza_box_closed")
|
||||
local imeta = item:get_meta()
|
||||
if type(contents) == "string" and string.len(contents) > 0 then
|
||||
local def = minetest.registered_nodes[contents]
|
||||
imeta:set_string("pizza", contents)
|
||||
imeta:set_string("description", def.description)
|
||||
end
|
||||
|
||||
if inv:room_for_item("main", item) then
|
||||
inv:add_item("main", item)
|
||||
minetest.remove_node(pos)
|
||||
return true
|
||||
end
|
||||
end,
|
||||
after_place_node = function(pos, placer, itemstack, pointed_thing)
|
||||
local meta = minetest.get_meta(pos)
|
||||
local imeta = itemstack:get_meta()
|
||||
|
||||
local pizza = imeta:get_string("pizza")
|
||||
if pizza then
|
||||
meta:set_string("pizza", pizza)
|
||||
end
|
||||
|
||||
end,
|
||||
})
|
||||
minetest.register_node("jelys_pizzaria:pizza_box_open", {
|
||||
drawtype = "mesh",
|
||||
paramtype2 = "facedir",
|
||||
tiles = {
|
||||
"jelys_pizzaria_pizza_box.png",
|
||||
},
|
||||
groups = {oddly_breakable_by_hand=3},
|
||||
mesh = "jelys_pizzaria_pizza_box_open.obj",
|
||||
drop = "jelys_pizzaria:pizza_box_closed",
|
||||
collision_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.501, -0.5, -0.501, 0.501, -0.375, 0.501}
|
||||
},
|
||||
},
|
||||
selection_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.501, -0.5, -0.501, 0.501, -0.4375, 0.501}
|
||||
},
|
||||
},
|
||||
on_rightclick = function(pos, node, player, itemstack, pointed_thing)
|
||||
local def = minetest.registered_nodes[itemstack:get_name()]
|
||||
if def and def.done then
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_string("pizza", itemstack:get_name())
|
||||
itemstack:take_item()
|
||||
end
|
||||
minetest.swap_node(pos, {name="jelys_pizzaria:pizza_box_closed", param2 = node.param2})
|
||||
return itemstack
|
||||
end,
|
||||
})
|
||||
|
||||
minetest.register_node("jelys_pizzaria:reinforced_brick", {
|
||||
description = "Reinforced Brick",
|
||||
paramtype2 = "facedir",
|
||||
place_param2 = 0,
|
||||
tiles = {
|
||||
"jelys_pizzaria_reinforced_brick_top.png^[transformFX",
|
||||
"jelys_pizzaria_reinforced_brick_top.png",
|
||||
"jelys_pizzaria_reinforced_brick3.png",
|
||||
"jelys_pizzaria_reinforced_brick2.png^[transformFX",
|
||||
"jelys_pizzaria_reinforced_brick.png^[transformFX",
|
||||
"jelys_pizzaria_reinforced_brick.png",
|
||||
},
|
||||
groups = {cracky = 3, level = 1},
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
|
||||
if jpizza.has_depends.stairs then
|
||||
local function my_register_stair_and_slab(subname, recipeitem, groups, images,
|
||||
desc_stair, desc_slab, sounds, worldaligntex)
|
||||
stairs.register_stair(subname, recipeitem, groups, images, desc_stair,
|
||||
sounds, worldaligntex)
|
||||
stairs.register_stair_inner(subname, recipeitem, groups, images, "",
|
||||
sounds, worldaligntex, "Inner " .. desc_stair)
|
||||
stairs.register_stair_outer(subname, recipeitem, groups, images, "",
|
||||
sounds, worldaligntex, "Outer " .. desc_stair)
|
||||
stairs.register_slab(subname, recipeitem, groups, images, desc_slab,
|
||||
sounds, worldaligntex)
|
||||
end
|
||||
|
||||
|
||||
my_register_stair_and_slab(
|
||||
"reinforced_brick",
|
||||
"jelys_pizzaria:reinforced_brick",
|
||||
{cracky=3},
|
||||
{
|
||||
"jelys_pizzaria_reinforced_brick_top.png^[transformFX",
|
||||
"jelys_pizzaria_reinforced_brick_top.png",
|
||||
"jelys_pizzaria_reinforced_brick3.png",
|
||||
"jelys_pizzaria_reinforced_brick2.png^[transformFX",
|
||||
"jelys_pizzaria_reinforced_brick.png^[transformFX",
|
||||
"jelys_pizzaria_reinforced_brick.png"
|
||||
},
|
||||
"Reinforced Brick Stair",
|
||||
"Reinforced Brick Slab",
|
||||
default.node_sound_stone_defaults(),
|
||||
false
|
||||
)
|
||||
end
|
329
mods/jelys_pizzaria/oven.lua
Normal file
|
@ -0,0 +1,329 @@
|
|||
local fuel = 260
|
||||
|
||||
local oven_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.5, -0.5, -0.5, -0.3125, 0.5, 0.4375}, -- bottom_left
|
||||
{0.3125, -0.5, -0.5, 0.5, 0.5, 0.4375}, -- bottom_right
|
||||
{-0.5, -0.5, -0.5, 0.5, -0.25, 0.4375}, -- bottom_bottom
|
||||
{-0.5, -0.5, -0.125, 0.5, 0.5, 0.4375}, -- bottom_inside
|
||||
{-0.5, 0.125, -0.5, 0.5, 0.5, 0.4375}, -- bottom_top
|
||||
{-0.5, -0.5, -0.5, 0.5, -0.1875, -0.4375}, -- bottom_front
|
||||
{-0.4375, 0.5, 0.25, 0.4375, 1.125, 0.4375}, -- top_back
|
||||
{-0.5, 0.5, -0.4375, -0.3125, 1.125, 0.4375}, -- top_left
|
||||
{0.3125, 0.5, -0.4375, 0.5, 1.125, 0.4375}, -- top_right
|
||||
{-0.5, 0.625, -0.4375, 0.5, 1.125, 0.4375}, -- top_front
|
||||
{-0.25, -0.5, 0, 0.25, 1.375, 0.5}, -- stack_thing
|
||||
}
|
||||
}
|
||||
|
||||
minetest.register_node("jelys_pizzaria:pizza_oven_slot", {
|
||||
drawtype = "airlike",
|
||||
paramtype = "light",
|
||||
sunlight_propagates = true,
|
||||
walkable = false,
|
||||
pointable = false,
|
||||
diggable = false,
|
||||
buildable_to = true,
|
||||
floodable = true,
|
||||
air_equivalent = true,
|
||||
drop = "",
|
||||
groups = {not_in_creative_inventory=1},
|
||||
on_construct = function(pos)
|
||||
local down = {x=pos.x, y=pos.y-1, z=pos.z}
|
||||
if minetest.get_node(down).name ~= "jelys_pizzaria:pizza_oven" then
|
||||
minetest.remove_node(pos)
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
local function pizza_above(pos)
|
||||
local up = {x=pos.x, y=pos.y+1, z=pos.z}
|
||||
local node = minetest.get_node(up)
|
||||
local def = minetest.registered_nodes[node.name]
|
||||
if def then
|
||||
if def.cooked then
|
||||
return "raw", def.cooked
|
||||
end
|
||||
if def.done then
|
||||
return "cooked", "jelys_pizzaria:burnt_pizza"
|
||||
end
|
||||
if node.name == "jelys_pizzaria:burnt_pizza" then
|
||||
return "burnt", nil
|
||||
end
|
||||
end
|
||||
return false, nil
|
||||
end
|
||||
|
||||
local function get_oven_state(pos)
|
||||
local node = minetest.get_node(pos)
|
||||
if node.name == "jelys_pizzaria:pizza_oven" then
|
||||
return "empty"
|
||||
elseif node.name == "jelys_pizzaria:pizza_oven_fueled" then
|
||||
return "fueled"
|
||||
elseif node.name == "jelys_pizzaria:pizza_oven_active" then
|
||||
return "active"
|
||||
end
|
||||
return false
|
||||
end
|
||||
|
||||
local function swap_node(pos, name)
|
||||
local node = minetest.get_node(pos)
|
||||
if name == node.name or not name then
|
||||
return
|
||||
end
|
||||
node.name = name
|
||||
local timer = minetest.get_node_timer(pos)
|
||||
local timeout = timer:get_timeout()
|
||||
local elapsed = timer:get_elapsed()
|
||||
minetest.swap_node(pos, node)
|
||||
timer = minetest.get_node_timer(pos)
|
||||
timer:set(timeout, elapsed)
|
||||
end
|
||||
|
||||
local function start_timer(pos, elapsed)
|
||||
--Pizza pos
|
||||
local pizza_pos = {x=pos.x, y=pos.y+1, z=pos.z}
|
||||
|
||||
--Meta values
|
||||
local meta = minetest.get_meta(pos)
|
||||
local cook_time_elapsed = meta:get_float("cook_time_elapsed")
|
||||
local cook_time = meta:get_float("cook_time")
|
||||
local fuel_time = meta:get_float("fuel_time")
|
||||
local timer = minetest.get_node_timer(pos)
|
||||
|
||||
--Node States
|
||||
local pizza, cooked = pizza_above(pos)
|
||||
local oven = get_oven_state(pos)
|
||||
|
||||
--Mode specification
|
||||
local mode = ""
|
||||
|
||||
if not pizza and oven == "empty" then
|
||||
mode = "empty"
|
||||
elseif pizza == "raw" and oven == "active" then
|
||||
mode = "cooking"
|
||||
elseif cooked == "jelys_pizzaria:burnt_pizza" then
|
||||
mode = "burning"
|
||||
elseif oven == "empty" and pizza then
|
||||
mode = "fuel_empty"
|
||||
elseif not pizza and oven ~= "empty" then
|
||||
mode = "nopizza"
|
||||
end
|
||||
|
||||
--Run timers based on mode
|
||||
if pizza and oven == "active" and cook_time > 0 then
|
||||
meta:set_float("cook_time_elapsed", cook_time_elapsed+elapsed)
|
||||
end
|
||||
if oven == "active" and fuel_time > 0 then
|
||||
meta:set_float("fuel_time", fuel_time-elapsed)
|
||||
end
|
||||
|
||||
--Update values
|
||||
cook_time_elapsed = meta:get_float("cook_time_elapsed")
|
||||
fuel_time = meta:get_float("fuel_time")
|
||||
if not pizza then
|
||||
meta:set_float("cook_time_elapsed", 0)
|
||||
meta:set_float("cook_time", 0)
|
||||
minetest.set_node(pizza_pos, {name = "jelys_pizzaria:pizza_oven_slot"})
|
||||
end
|
||||
|
||||
--Make a change
|
||||
if cook_time_elapsed > cook_time and cooked then
|
||||
minetest.set_node(pizza_pos, {name=cooked})
|
||||
meta:set_float("cook_time_elapsed", 0)
|
||||
meta:set_float("cook_time", 50)
|
||||
end
|
||||
if fuel_time <= 1 then
|
||||
swap_node(pos, "jelys_pizzaria:pizza_oven")
|
||||
if mode == "burning" then
|
||||
meta:set_float("cook_time_elapsed", 0)
|
||||
meta:set_float("cook_time", 0)
|
||||
end
|
||||
end
|
||||
|
||||
--Infotext
|
||||
local infotext = "Pizza: 100%\nFuel: none;"
|
||||
|
||||
local fuel_percentage = math.max(math.ceil(0.5+fuel_time/fuel*98), 0)
|
||||
local cook_percentage = math.floor(0.5+cook_time_elapsed/cook_time*99)
|
||||
|
||||
if mode == "nopizza" then
|
||||
infotext = "Pizza: none;\n"..
|
||||
"Fuel: ".. fuel_percentage.. "%"
|
||||
elseif mode == "cooking" then
|
||||
infotext = "Pizza: "..cook_percentage.."%\n"..
|
||||
"Fuel: ".. fuel_percentage.. "%"
|
||||
elseif mode == "fuel_empty" then
|
||||
infotext = "Pizza: "..cook_percentage.."%\n"..
|
||||
"Fuel: none;"
|
||||
elseif mode == "empty" then
|
||||
infotext = "Pizza: none;\nFuel: none;"
|
||||
elseif oven == "fueled" and pizza ~= "cooked" then
|
||||
infotext = "Pizza: "..cook_percentage.."%\n"..
|
||||
"Fuel: ".. fuel_percentage.. "%"
|
||||
elseif mode == "burning" then
|
||||
infotext = "Pizza will burn in: ".. math.floor(cook_time-cook_time_elapsed).."s\n"..
|
||||
"Fuel: ".. fuel_percentage.. "%"
|
||||
elseif pizza == "cooked" and oven == "empty" then
|
||||
infotext = "Pizza: 100%\n"..
|
||||
"Fuel: none;"
|
||||
elseif pizza == "burnt" then
|
||||
infotext = "Pizza: Burnt"
|
||||
end
|
||||
local oven_state = ""
|
||||
if oven == "active" then
|
||||
oven_state = "Active"
|
||||
else
|
||||
oven_state = "Extinguished"
|
||||
end
|
||||
meta:set_string("infotext", infotext.."\n"..oven_state)
|
||||
|
||||
--Start next timer
|
||||
local tick = cook_time/fuel
|
||||
timer:start(tick)
|
||||
end
|
||||
|
||||
|
||||
local function rightclick(pos, node, player, itemstack, pointed_thing)
|
||||
local name = itemstack:get_name()
|
||||
local def = minetest.registered_nodes[name]
|
||||
local pizzaspace = pizza_above(pos)
|
||||
if def and def.cook_time and def.cooked and not pizzaspace then
|
||||
local meta = minetest.get_meta(pos)
|
||||
local up = {x = pos.x, y = pos.y+1, z = pos.z}
|
||||
local itemdef = minetest.registered_nodes[name]
|
||||
local cook_time = itemdef.cook_time
|
||||
minetest.set_node(up, {name = name})
|
||||
meta:set_float("cook_time", math.random(cook_time.min, cook_time.max))
|
||||
if node.name == "jelys_pizzaria:pizza_oven_active" then
|
||||
start_timer(pos, 0)
|
||||
meta:set_float("cook_time_elapsed", 0)
|
||||
end
|
||||
if not minetest.is_creative_enabled(player:get_player_name()) then
|
||||
itemstack:take_item()
|
||||
end
|
||||
end
|
||||
return itemstack
|
||||
end
|
||||
|
||||
local function after_destruct(pos, oldnode)
|
||||
local up = {x = pos.x, y = pos.y+1, z = pos.z}
|
||||
local pizza = pizza_above(pos)
|
||||
local oven = oldnode.name
|
||||
minetest.dig_node(up)
|
||||
if jpizza.has_depends.fire and oven == "jelys_pizzaria:pizza_oven_active" then
|
||||
if minetest.get_node(pos).name == "air" then
|
||||
minetest.set_node(pos, {name = "fire:basic_flame"})
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
minetest.register_node("jelys_pizzaria:pizza_oven_active", {
|
||||
drawtype = "mesh",
|
||||
paramtype2 = "facedir",
|
||||
paramtype = "light",
|
||||
light_source = 8,
|
||||
drop = "jelys_pizzaria:pizza_oven",
|
||||
groups = {cracky = 3, level = 1, pizza_oven = 1, not_in_creative_inventory=1},
|
||||
tiles = {
|
||||
{
|
||||
name = "jelys_pizzaria_pizza_oven_active_animated.png",
|
||||
backface_culling = false,
|
||||
animation = {
|
||||
type = "vertical_frames",
|
||||
aspect_w = 64,
|
||||
aspect_h = 64,
|
||||
length = 3.0,
|
||||
},
|
||||
},
|
||||
},
|
||||
mesh = "jelys_pizzaria_pizza_oven.obj",
|
||||
selection_box = oven_box,
|
||||
collision_box = oven_box,
|
||||
on_rightclick = rightclick,
|
||||
after_destruct = after_destruct,
|
||||
on_timer = start_timer,
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_node("jelys_pizzaria:pizza_oven_fueled", {
|
||||
drawtype = "mesh",
|
||||
paramtype2 = "facedir",
|
||||
groups = {cracky = 3, level = 1, pizza_oven = 1, not_in_creative_inventory=1},
|
||||
tiles = {
|
||||
"jelys_pizzaria_pizza_oven_fueled.png",
|
||||
},
|
||||
mesh = "jelys_pizzaria_pizza_oven.obj",
|
||||
drop = "jelys_pizzaria:pizza_oven",
|
||||
selection_box = oven_box,
|
||||
collision_box = oven_box,
|
||||
after_destruct = after_destruct,
|
||||
on_punch = function(pos, node, player)
|
||||
local itemstack = player:get_wielded_item()
|
||||
if itemstack:get_name() == "default:torch" or itemstack:get_name() == "fire:flint_and_steel" then
|
||||
swap_node(pos, "jelys_pizzaria:pizza_oven_active")
|
||||
start_timer(pos, 0)
|
||||
end
|
||||
end,
|
||||
on_ignite = function(pos, igniter)
|
||||
swap_node(pos, "jelys_pizzaria:pizza_oven_active")
|
||||
start_timer(pos, 0)
|
||||
end,
|
||||
on_rightclick = rightclick,
|
||||
on_timer = start_timer,
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
minetest.register_node("jelys_pizzaria:pizza_oven", {
|
||||
description = "Pizza Oven",
|
||||
drawtype = "mesh",
|
||||
paramtype2 = "facedir",
|
||||
groups = {cracky = 3, level = 1, pizza_oven = 1},
|
||||
tiles = {
|
||||
"jelys_pizzaria_pizza_oven.png",
|
||||
},
|
||||
on_construct = function(pos)
|
||||
local meta = minetest.get_meta(pos)
|
||||
meta:set_float("cook_time_elapsed", 0)
|
||||
meta:set_float("cook_time", 0)
|
||||
meta:set_float("fuel_time", 0)
|
||||
|
||||
start_timer(pos, 0)
|
||||
end,
|
||||
mesh = "jelys_pizzaria_pizza_oven.obj",
|
||||
selection_box = oven_box,
|
||||
collision_box = oven_box,
|
||||
after_destruct = after_destruct,
|
||||
on_rightclick = function(pos, node, player, itemstack, pointed_thing)
|
||||
local itemstack = player:get_wielded_item()
|
||||
|
||||
if minetest.get_item_group(itemstack:get_name(), "tree") > 0 then
|
||||
if not minetest.is_creative_enabled(player:get_player_name()) then
|
||||
itemstack:take_item()
|
||||
end
|
||||
swap_node(pos, "jelys_pizzaria:pizza_oven_fueled")
|
||||
minetest.get_meta(pos):set_float("fuel_time", fuel)
|
||||
end
|
||||
return rightclick(pos, node, player, itemstack, pointed_thing)
|
||||
end,
|
||||
on_timer = start_timer,
|
||||
sounds = default.node_sound_stone_defaults(),
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "jelys_pizzaria:reinforced_brick",
|
||||
recipe = {
|
||||
{"default:clay_brick", "default:clay_brick", "default:clay_brick"},
|
||||
{"default:clay_brick", "default:clay_brick", "default:clay_brick"},
|
||||
{"default:clay_brick", "default:clay_brick", "default:clay_brick"},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "jelys_pizzaria:pizza_oven",
|
||||
recipe = {
|
||||
{"jelys_pizzaria:reinforced_brick", "jelys_pizzaria:reinforced_brick", "jelys_pizzaria:reinforced_brick"},
|
||||
{"jelys_pizzaria:reinforced_brick", "", "jelys_pizzaria:reinforced_brick"},
|
||||
{"jelys_pizzaria:reinforced_brick", "jelys_pizzaria:reinforced_brick", "jelys_pizzaria:reinforced_brick"},
|
||||
}
|
||||
})
|
BIN
mods/jelys_pizzaria/screenshot.png
Normal file
After Width: | Height: | Size: 170 KiB |
2
mods/jelys_pizzaria/settingtypes.txt
Normal file
|
@ -0,0 +1,2 @@
|
|||
# Whether pizza items should appear in dungeon chests, disabling will make the rare "haiac pizza" unobtainable, (Requires dungeon_loot)
|
||||
jelys_pizzaria.enable_dungeon_loot (Add Pizza items to dungeon_loot table) bool true
|
BIN
mods/jelys_pizzaria/textures/jelys_pizzaria_burnt_pizza.png
Normal file
After Width: | Height: | Size: 440 B |
After Width: | Height: | Size: 348 B |
BIN
mods/jelys_pizzaria/textures/jelys_pizzaria_burnt_pizzaa.png
Normal file
After Width: | Height: | Size: 439 B |
BIN
mods/jelys_pizzaria/textures/jelys_pizzaria_cheese.png
Normal file
After Width: | Height: | Size: 333 B |
BIN
mods/jelys_pizzaria/textures/jelys_pizzaria_cooked_dough.png
Normal file
After Width: | Height: | Size: 426 B |
BIN
mods/jelys_pizzaria/textures/jelys_pizzaria_hainac_slice.png
Normal file
After Width: | Height: | Size: 475 B |
BIN
mods/jelys_pizzaria/textures/jelys_pizzaria_meat.png
Normal file
After Width: | Height: | Size: 516 B |
After Width: | Height: | Size: 232 B |
After Width: | Height: | Size: 444 B |
After Width: | Height: | Size: 233 B |
After Width: | Height: | Size: 463 B |
After Width: | Height: | Size: 345 B |
BIN
mods/jelys_pizzaria/textures/jelys_pizzaria_olives.png
Normal file
After Width: | Height: | Size: 318 B |
BIN
mods/jelys_pizzaria/textures/jelys_pizzaria_pineapple.png
Normal file
After Width: | Height: | Size: 596 B |
BIN
mods/jelys_pizzaria/textures/jelys_pizzaria_pineapple_inv.png
Normal file
After Width: | Height: | Size: 311 B |
BIN
mods/jelys_pizzaria/textures/jelys_pizzaria_pizza_box.png
Normal file
After Width: | Height: | Size: 843 B |
BIN
mods/jelys_pizzaria/textures/jelys_pizzaria_pizza_cheese.png
Normal file
After Width: | Height: | Size: 428 B |
After Width: | Height: | Size: 435 B |
After Width: | Height: | Size: 490 B |
BIN
mods/jelys_pizzaria/textures/jelys_pizzaria_pizza_cutter.png
Normal file
After Width: | Height: | Size: 279 B |
BIN
mods/jelys_pizzaria/textures/jelys_pizzaria_pizza_dough.png
Normal file
After Width: | Height: | Size: 418 B |
BIN
mods/jelys_pizzaria/textures/jelys_pizzaria_pizza_hainac.png
Normal file
After Width: | Height: | Size: 564 B |
After Width: | Height: | Size: 436 B |
BIN
mods/jelys_pizzaria/textures/jelys_pizzaria_pizza_oven.png
Normal file
After Width: | Height: | Size: 4.3 KiB |
After Width: | Height: | Size: 11 KiB |
After Width: | Height: | Size: 4.7 KiB |
BIN
mods/jelys_pizzaria/textures/jelys_pizzaria_pizza_sauce.png
Normal file
After Width: | Height: | Size: 525 B |
BIN
mods/jelys_pizzaria/textures/jelys_pizzaria_pizza_slice.png
Normal file
After Width: | Height: | Size: 476 B |
BIN
mods/jelys_pizzaria/textures/jelys_pizzaria_reinforced_brick.png
Normal file
After Width: | Height: | Size: 579 B |
After Width: | Height: | Size: 586 B |
After Width: | Height: | Size: 592 B |
After Width: | Height: | Size: 633 B |
BIN
mods/jelys_pizzaria/textures/jelys_pizzaria_rolling_pin.png
Normal file
After Width: | Height: | Size: 310 B |
BIN
mods/jelys_pizzaria/textures/jelys_pizzaria_rolling_pin_inv.png
Normal file
After Width: | Height: | Size: 300 B |
BIN
mods/jelys_pizzaria/textures/jelys_pizzaria_sauce.png
Normal file
After Width: | Height: | Size: 376 B |
BIN
mods/jelys_pizzaria/textures/jelys_pizzaria_sausage.png
Normal file
After Width: | Height: | Size: 242 B |
BIN
mods/jelys_pizzaria/textures/jelys_pizzaria_sausage_raw.png
Normal file
After Width: | Height: | Size: 244 B |
BIN
mods/jelys_pizzaria/textures/jelys_pizzaria_tomato.png
Normal file
After Width: | Height: | Size: 358 B |
After Width: | Height: | Size: 161 B |
After Width: | Height: | Size: 173 B |
After Width: | Height: | Size: 258 B |
After Width: | Height: | Size: 169 B |
After Width: | Height: | Size: 157 B |
BIN
mods/jelys_pizzaria/textures/jelys_pizzaria_topping_olives.png
Normal file
After Width: | Height: | Size: 223 B |
After Width: | Height: | Size: 169 B |
After Width: | Height: | Size: 157 B |
After Width: | Height: | Size: 169 B |
After Width: | Height: | Size: 157 B |
After Width: | Height: | Size: 156 B |
After Width: | Height: | Size: 130 B |
After Width: | Height: | Size: 146 B |
After Width: | Height: | Size: 251 B |
After Width: | Height: | Size: 256 B |
After Width: | Height: | Size: 157 B |
After Width: | Height: | Size: 148 B |
After Width: | Height: | Size: 162 B |
BIN
mods/jelys_pizzaria/textures/jelys_pizzaria_topping_sausage.png
Normal file
After Width: | Height: | Size: 164 B |
After Width: | Height: | Size: 164 B |
After Width: | Height: | Size: 144 B |
After Width: | Height: | Size: 157 B |
2
mods/livingslimes/.gitattributes
vendored
|
@ -1,2 +0,0 @@
|
|||
*.xcf export-ignore
|
||||
*.blend export-ignore
|
|
@ -1,185 +0,0 @@
|
|||
GNU GENERAL PUBLIC LICENSE
|
||||
Version 3, 29 June 2007
|
||||
|
||||
Copyright © 2007 Free Software Foundation, Inc. <https://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
|
|
@ -1,29 +0,0 @@
|
|||
License for code
|
||||
----------------
|
||||
|
||||
Copyright (C) 2024 "EmptyStar"
|
||||
|
||||
Original mod copyright (C) 2019 "Piezo_" <https://github.com/mt-historical/tmw_slimes>
|
||||
|
||||
This mod 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 mod 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 mod. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
License for media
|
||||
(Sounds, textures, models)
|
||||
--------------------------
|
||||
|
||||
Sounds (.ogg files under sounds/) copyright (C) 2024 "EmptyStar"
|
||||
|
||||
Models and textures (files under models/ and textures/) copyright (C) 2019 "Piezo_"
|
||||
|
||||
Creative Commons Attribution-ShareAlike 4.0 <https://creativecommons.org/licenses/by-sa/4.0/legalcode>
|
|
@ -1,57 +0,0 @@
|
|||
# Living Slimes
|
||||
|
||||
Bring the classic fodder of fantasy adventure to your world with Living Slimes! From simple grass slimes to fire-belching lava slimes and everything in between, these living slimes can be found high and low throughout the world. Some are content to roam and forage while others are hostile hunters.
|
||||
|
||||
This mod is substantially based on [The Mana World slimes mod](https://github.com/mt-historical/tmw_slimes) by Piezo_ which was inspired by [The Mana World](https://themanaworld.org/).
|
||||
|
||||
## Slimes
|
||||
|
||||
The following slimes can be found in various environments throughout the world:
|
||||
|
||||
- **Grass Slime** - Found in grasslands and forests; loves to eat plants and leaves
|
||||
- **Savanna Slime** - Found in savannas and dry plains; eats dry grass
|
||||
- **Poisonous Slime** - Found in swamps and jungles; oozes poison and is harmful to the touch
|
||||
- **Algae Slime** - Found in swamps and wetlands; docile attitude and loves to eat mushrooms
|
||||
- **Ice Slime** - Found in icy and snowy biomes; subsists on ice and snow
|
||||
- **Ocean Slime** - Found in bodies of water; small, gentle, and quick
|
||||
- **Lava Slime** - Found in lava pools; very aggressive and spreads fire when provoked, also burns when touched
|
||||
- **Mineral Slime** - Found underground; a sturdy slime that eats stones and rare minerals
|
||||
- **Dark Slime** - Found in shadows underground; sneaky and malevolent
|
||||
|
||||
## Behaviors
|
||||
|
||||
### Eating
|
||||
|
||||
Slimes are eager to eat any items that are left on the ground near them. Many slimes favor weapons and tools, so beware that if you drop valuable items near them, they are likely to be eaten.
|
||||
|
||||
When no dropped items are available to eat, slimes will often dig up resources from their surrounding environment for sustenance. Most slimes have a preferred diet, and they will seek out foods that are most favorable to them.
|
||||
|
||||
### Digesting
|
||||
|
||||
Slimes will begin to digest the contents of their stomach after eating, a process which takes a few minutes per item eaten. When an item is digested, it is permanently destroyed without a trace. So if you suspect that a slime has eaten your items, be sure to get them back quickly!
|
||||
|
||||
Any items that a slime has not digested will be dropped when the slime is killed.
|
||||
|
||||
### Attacking
|
||||
|
||||
Most slimes are territorial and will pursue nearby players. Slime speeds, strength, and aggression vary by type, and they can only attack when they're close enough to a player to strike at close range although certain slimes have extra tricks up their sleeve (e.g., poisonous slimes and lava slimes).
|
||||
|
||||
### Stealing
|
||||
|
||||
When a slime successfully attacks a player, it's possible that the slime will rob the player of an item on their hotbar. When this happens, it's as though the slime has eaten the item meaning that it will be digested if left unrecovered.
|
||||
|
||||
Note that the stolen item can be the item in the player's hand, so be mindful of what you're holding!
|
||||
|
||||
## Drops and Resources
|
||||
|
||||
All slimes will drop at least one slime goo of its type when killed. This goo is edible with varying nutritional benefits or detriments.
|
||||
|
||||
Placing slime goo of the same kind in each square of a 3x3 crafting grid will create a slime block of that type. Slime blocks are slippery and bouncy, and they will prevent all fall damage from any height when landing on it from above.
|
||||
|
||||
## Settings
|
||||
|
||||
Many of the slime behaviors documented above can be enabled/disabled or adjusted via mod settings. Check the mod settings under `All Settings > Content: Mods > Living Slimes` for available settings. Also see [settingtypes.txt](https://github.com/EmptyStar/livingslimes/tree/main/settingtypes.txt) for a textual description of mod settings.
|
||||
|
||||
## Errors, Issues, and Bugs
|
||||
|
||||
Please [open an issue at GitHub](https://github.com/EmptyStar/livingslimes/issues/new) to report any problems encountered with this mod.
|
|
@ -1,629 +0,0 @@
|
|||
--
|
||||
-- Slime behaviors
|
||||
--
|
||||
|
||||
local function reset_attack_vals(self)
|
||||
self.target = nil
|
||||
end
|
||||
|
||||
-- Dig limits
|
||||
|
||||
livingslimes.dig_limit = {
|
||||
limit = livingslimes.settings.dig_limit,
|
||||
get = function(self,pos)
|
||||
local mapblock = minetest.hash_node_position(vector.divide(pos,16):floor())
|
||||
local value = self[mapblock] or (function()
|
||||
local stored_value = livingslimes.storage:get_int(mapblock)
|
||||
self[mapblock] = stored_value
|
||||
return stored_value
|
||||
end)()
|
||||
return mapblock, value
|
||||
end,
|
||||
limited = livingslimes.settings.dig_limit > 0 and function(self,pos)
|
||||
local mapblock, value = self:get(pos)
|
||||
return value >= self.limit
|
||||
end or function() return false end,
|
||||
increment = livingslimes.settings.dig_limit and function(self,pos)
|
||||
local mapblock, value = self:get(pos)
|
||||
value = value + 1
|
||||
livingslimes.storage:set_int(mapblock,value)
|
||||
self[mapblock] = value
|
||||
end or function() end,
|
||||
}
|
||||
|
||||
-- Actions
|
||||
|
||||
function livingslimes.action_pursue(self, target, method, speed_factor, anim)
|
||||
local goal
|
||||
local function func(_self)
|
||||
local target_alive, line_of_sight, tgt_pos = _self:get_target(target)
|
||||
if not target_alive then
|
||||
return true
|
||||
end
|
||||
goal = goal or tgt_pos
|
||||
self:animate("move")
|
||||
if line_of_sight
|
||||
and vector.distance(goal, tgt_pos) > 3 then
|
||||
goal = tgt_pos
|
||||
end
|
||||
if _self:move_to(goal, method or "creatura:obstacle_avoidance", speed_factor or 0.5) then
|
||||
return true
|
||||
end
|
||||
end
|
||||
self:set_action(func)
|
||||
end
|
||||
|
||||
function livingslimes.action_pursue_poison(self, target, method, speed_factor, anim)
|
||||
local poison_timer = 0.5
|
||||
local goal
|
||||
local function func(_self)
|
||||
local target_alive, line_of_sight, tgt_pos = _self:get_target(target)
|
||||
if not target_alive then
|
||||
return true
|
||||
end
|
||||
goal = goal or tgt_pos
|
||||
poison_timer = poison_timer - _self.dtime
|
||||
self:animate("move")
|
||||
if line_of_sight
|
||||
and vector.distance(goal, tgt_pos) > 3 then
|
||||
goal = tgt_pos
|
||||
end
|
||||
if poison_timer <= 0 then
|
||||
poison_timer = 0.5
|
||||
local pos = _self.object:get_pos()
|
||||
local nodename = minetest.get_node(pos).name
|
||||
local below = minetest.get_node(pos:add(vector.new(0,-1,0))).name
|
||||
if below ~= "air" and (nodename == "air" or nodename == _self.poison) then
|
||||
minetest.set_node(pos,{ name = _self.poison, param2 = 0 })
|
||||
minetest.get_node_timer(pos):start(10)
|
||||
end
|
||||
end
|
||||
if _self:move_to(goal, method or "creatura:obstacle_avoidance", speed_factor or 0.5) then
|
||||
return true
|
||||
end
|
||||
end
|
||||
self:set_action(func)
|
||||
end
|
||||
|
||||
function livingslimes.action_forage(self, target, method, speed_factor, anim)
|
||||
local goal
|
||||
local item = target.item
|
||||
local function func(_self)
|
||||
local tgt_pos = item and item.object and item.object:get_pos()
|
||||
target.timeout = target.timeout - _self.dtime
|
||||
if not tgt_pos or target.timeout <= 0 then
|
||||
_self.nearby_food = nil
|
||||
return
|
||||
end
|
||||
goal = goal or tgt_pos
|
||||
self:animate(anim or "move")
|
||||
if vector.distance(goal, tgt_pos) > 3 then
|
||||
goal = tgt_pos
|
||||
end
|
||||
if _self:move_to(goal, method or "creatura:obstacle_avoidance", speed_factor or 0.5) then
|
||||
return true
|
||||
end
|
||||
end
|
||||
self:set_action(func)
|
||||
end
|
||||
|
||||
function livingslimes.action_dig(self, node, method, speed_factor, anim)
|
||||
local goal
|
||||
local function func(_self)
|
||||
local tgt_pos = node and node.pos
|
||||
node.timeout = node.timeout - _self.dtime
|
||||
if not tgt_pos or minetest.get_node(node.pos).name ~= node.name or node.timeout <= 0 then
|
||||
_self.nearby_node = nil
|
||||
return
|
||||
end
|
||||
goal = goal or tgt_pos
|
||||
self:animate(anim or "move")
|
||||
if vector.distance(goal, tgt_pos) > 3 then
|
||||
goal = tgt_pos
|
||||
end
|
||||
if _self:move_to(goal, method or "creatura:obstacle_avoidance", speed_factor or 0.5) then
|
||||
return true
|
||||
end
|
||||
end
|
||||
self:set_action(func)
|
||||
end
|
||||
|
||||
function livingslimes.action_punch(self, target)
|
||||
local jump_init = false
|
||||
local timeout = 2
|
||||
local function func(_self)
|
||||
local tgt_alive, _, tgt_pos = _self:get_target(target)
|
||||
if not tgt_alive then return true end
|
||||
local pos = _self.object:get_pos()
|
||||
if not pos then return end
|
||||
local dir = vector.direction(pos, tgt_pos)
|
||||
if not jump_init
|
||||
and _self.touching_ground then
|
||||
_self.object:add_velocity({x = dir.x * 3, y = 2, z = dir.z * 3})
|
||||
jump_init = true
|
||||
end
|
||||
timeout = timeout - _self.dtime
|
||||
if timeout <= 0 then return true end
|
||||
local dist = vector.distance(pos, tgt_pos)
|
||||
if dist < _self.width + 1 then
|
||||
_self:punch_target(target)
|
||||
local knockback = minetest.calculate_knockback(
|
||||
target, self.object, 1.0,
|
||||
{damage_groups = {fleshy = self.damage}},
|
||||
dir, 2.0, self.damage
|
||||
)
|
||||
target:add_velocity({x = dir.x * knockback, y = dir.y * knockback, z = dir.z * knockback})
|
||||
return true
|
||||
end
|
||||
end
|
||||
self:set_action(func)
|
||||
end
|
||||
|
||||
-- Utilities
|
||||
|
||||
-- wander: slime wanders the area aimlessly
|
||||
creatura.register_utility("livingslimes:wander", function(self)
|
||||
local move_chance = self.move_chance or 3
|
||||
local center = self.object:get_pos()
|
||||
if not center then return end
|
||||
local move = self.wander_action or creatura.action_move
|
||||
local function func(_self)
|
||||
if not _self:get_action() then
|
||||
local pos2 = _self:get_wander_pos(2, 3)
|
||||
if math.random(move_chance) == 1
|
||||
and vector.distance(pos2, center) < _self.tracking_range * 0.5 then
|
||||
move(_self, pos2, 2, "creatura:obstacle_avoidance", 0.35, "move")
|
||||
else
|
||||
creatura.action_idle(_self, math.random(2,5), "idle")
|
||||
end
|
||||
end
|
||||
end
|
||||
self:set_utility(func)
|
||||
end)
|
||||
|
||||
-- attack: slime attacks a target
|
||||
creatura.register_utility("livingslimes:attack", function(self, target)
|
||||
self.nearby_food = nil -- forget about food, this is a much better target >:)
|
||||
self.nearby_node = nil
|
||||
local width = self.width
|
||||
local punch_init = false
|
||||
local function func(_self)
|
||||
local pos = _self.object:get_pos()
|
||||
if not pos then return end
|
||||
local tgt_alive, _, tgt_pos = _self:get_target(target)
|
||||
if not tgt_alive then reset_attack_vals(self) return true end
|
||||
local dist = vector.distance(pos, tgt_pos)
|
||||
if dist > self.tracking_range then reset_attack_vals(self) return true end
|
||||
local punch_cooldown = self.punch_cooldown or 0
|
||||
if punch_cooldown > 0 then
|
||||
punch_cooldown = punch_cooldown - self.dtime
|
||||
end
|
||||
self.punch_cooldown = punch_cooldown
|
||||
if punch_cooldown <= 0
|
||||
and dist < width + 1
|
||||
and not punch_init then
|
||||
punch_init = true
|
||||
_self:play_sound("attack")
|
||||
livingslimes.action_punch(_self, target)
|
||||
self.punch_cooldown = 1
|
||||
if livingslimes.settings.allow_steal and math.random(100) <= livingslimes.settings.steal_chance then
|
||||
_self.steal_item(target)
|
||||
_self:play_sound("slurp")
|
||||
end
|
||||
end
|
||||
if not _self:get_action() then
|
||||
if punch_init then reset_attack_vals(self) return true end
|
||||
livingslimes.action_pursue(_self, target, "creatura:obstacle_avoidance", 0.75)
|
||||
end
|
||||
end
|
||||
self:set_utility(func)
|
||||
end)
|
||||
|
||||
-- neutral: slime is idle unless a hostile target attacks it
|
||||
creatura.register_utility("livingslimes:neutral", function(self, target)
|
||||
self.nearby_food = nil -- forget about food, this is a much better target >:)
|
||||
self.nearby_node = nil
|
||||
local width = self.width
|
||||
local punch_init = false
|
||||
local function func(_self)
|
||||
local pos = _self.object:get_pos()
|
||||
if not pos then return end
|
||||
local tgt_alive, _, tgt_pos = _self:get_target(target)
|
||||
if not tgt_alive then reset_attack_vals(self) return true end
|
||||
local dist = vector.distance(pos, tgt_pos)
|
||||
if dist > self.tracking_range then reset_attack_vals(self) return true end
|
||||
local punch_cooldown = self.punch_cooldown or 0
|
||||
if punch_cooldown > 0 then
|
||||
punch_cooldown = punch_cooldown - self.dtime
|
||||
end
|
||||
self.punch_cooldown = punch_cooldown
|
||||
if punch_cooldown <= 0
|
||||
and dist < width + 1
|
||||
and not punch_init then
|
||||
punch_init = true
|
||||
_self:play_sound("attack")
|
||||
livingslimes.action_punch(_self, target)
|
||||
self.punch_cooldown = 1
|
||||
if livingslimes.settings.allow_steal and math.random(100) <= livingslimes.settings.steal_chance then
|
||||
_self.steal_item(target)
|
||||
_self:play_sound("slurp")
|
||||
end
|
||||
end
|
||||
if not _self:get_action() then
|
||||
if punch_init then reset_attack_vals(self) return true end
|
||||
livingslimes.action_pursue(_self, target, "creatura:obstacle_avoidance", 0.75)
|
||||
end
|
||||
end
|
||||
self:set_utility(func)
|
||||
end)
|
||||
|
||||
-- poison: slime leaves poisonous creep on the ground while attacking
|
||||
creatura.register_utility("livingslimes:poison", function(self, target)
|
||||
self.nearby_food = nil -- forget about food, this is a much better target >:)
|
||||
self.nearby_node = nil
|
||||
local width = self.width
|
||||
local punch_init = false
|
||||
local function func(_self)
|
||||
local pos = _self.object:get_pos()
|
||||
if not pos then return end
|
||||
local tgt_alive, _, tgt_pos = _self:get_target(target)
|
||||
if not tgt_alive then reset_attack_vals(self) return true end
|
||||
local dist = vector.distance(pos, tgt_pos)
|
||||
if dist > self.tracking_range then reset_attack_vals(self) return true end
|
||||
local punch_cooldown = self.punch_cooldown or 0
|
||||
if punch_cooldown > 0 then
|
||||
punch_cooldown = punch_cooldown - self.dtime
|
||||
end
|
||||
self.punch_cooldown = punch_cooldown
|
||||
if punch_cooldown <= 0
|
||||
and dist < width + 1
|
||||
and not punch_init then
|
||||
punch_init = true
|
||||
_self:play_sound("attack")
|
||||
livingslimes.action_punch(_self, target)
|
||||
self.punch_cooldown = 1
|
||||
end
|
||||
if not _self:get_action() then
|
||||
if punch_init then reset_attack_vals(self) return true end
|
||||
livingslimes.action_pursue_poison(_self, target, "creatura:obstacle_avoidance", 0.75)
|
||||
end
|
||||
end
|
||||
self:set_utility(func)
|
||||
end)
|
||||
|
||||
-- die: slime's HP reaches zero and it must die
|
||||
creatura.register_utility("livingslimes:die", function(self)
|
||||
local timer = 1.5
|
||||
local init = false
|
||||
local function func(_self)
|
||||
if not init then
|
||||
_self:animate("idle")
|
||||
_self.object:set_properties({
|
||||
visual_size = {x = 8, y = 0.5},
|
||||
selectionbox = {0,0,0,0,0,0},
|
||||
pointable = false,
|
||||
})
|
||||
_self:play_sound("die")
|
||||
init = true
|
||||
end
|
||||
timer = timer - _self.dtime
|
||||
if timer <= 0 then
|
||||
local pos = _self.object:get_pos()
|
||||
if not pos then return end
|
||||
minetest.add_particlespawner({
|
||||
amount = 8,
|
||||
time = 0.25,
|
||||
minpos = {x = pos.x - 0.1, y = pos.y, z = pos.z - 0.1},
|
||||
maxpos = {x = pos.x + 0.1, y = pos.y + 0.1, z = pos.z + 0.1},
|
||||
minacc = {x = 0, y = 2, z = 0},
|
||||
maxacc = {x = 0, y = 3, z = 0},
|
||||
minvel = {x = math.random(-1, 1), y = -0.25, z = math.random(-1, 1)},
|
||||
maxvel = {x = math.random(-2, 2), y = -0.25, z = math.random(-2, 2)},
|
||||
minexptime = 0.75,
|
||||
maxexptime = 1,
|
||||
minsize = 4,
|
||||
maxsize = 4,
|
||||
texture = "creatura_smoke_particle.png",
|
||||
animation = {
|
||||
type = 'vertical_frames',
|
||||
aspect_w = 4,
|
||||
aspect_h = 4,
|
||||
length = 1,
|
||||
},
|
||||
glow = 1
|
||||
})
|
||||
creatura.drop_items(_self)
|
||||
_self.stomach:drop(pos)
|
||||
_self.object:remove()
|
||||
end
|
||||
end
|
||||
self:set_utility(func)
|
||||
end)
|
||||
|
||||
-- eat: slime eats an item
|
||||
creatura.register_utility("livingslimes:eat", function(self, target)
|
||||
local item = target.item
|
||||
local width = self.width
|
||||
local function func(_self)
|
||||
local pos = _self.object:get_pos()
|
||||
local itempos = item and item.object and item.object:get_pos()
|
||||
if not pos or not itempos then
|
||||
_self.nearby_food = nil
|
||||
return
|
||||
end
|
||||
if vector.distance(pos,itempos) < width + 0.5 then
|
||||
_self:play_sound("slurp")
|
||||
_self.stomach:add(item.itemstring)
|
||||
item.object:remove()
|
||||
_self.nearby_food = nil
|
||||
else
|
||||
livingslimes.action_forage(_self, target, "creatura:obstacle_avoidance", 0.5)
|
||||
end
|
||||
end
|
||||
self:set_utility(func)
|
||||
end)
|
||||
|
||||
-- dig: slime digs a node
|
||||
creatura.register_utility("livingslimes:dig", function(self, node)
|
||||
local width = self.width
|
||||
local function func(_self)
|
||||
local pos = _self.object:get_pos()
|
||||
local nodepos = node.pos
|
||||
if not pos or not nodepos or minetest.get_node(nodepos).name ~= node.name then
|
||||
_self.nearby_node = nil
|
||||
return
|
||||
end
|
||||
if vector.distance(pos,nodepos) < width + 0.5 then
|
||||
local nodedef = minetest.registered_nodes[node.name]
|
||||
if nodedef and nodedef.sounds and nodedef.sounds.dug then
|
||||
minetest.sound_play(nodedef.sounds.dug,{
|
||||
gain = 0.5,
|
||||
pos = node.pos,
|
||||
max_hear_distance = 40,
|
||||
},true)
|
||||
end
|
||||
minetest.remove_node(node.pos)
|
||||
livingslimes.dig_limit:increment(node.pos)
|
||||
local drop = minetest.get_node_drops(node.name)
|
||||
if drop and drop[1] then
|
||||
_self:play_sound("slurp")
|
||||
_self.stomach:add(drop[1])
|
||||
end
|
||||
_self.nearby_node = nil
|
||||
else
|
||||
livingslimes.action_dig(_self, node, "creatura:obstacle_avoidance", 0.5)
|
||||
end
|
||||
end
|
||||
self:set_utility(func)
|
||||
end)
|
||||
|
||||
-- digest: slime digests an item in its stomach
|
||||
creatura.register_utility("livingslimes:digest", function(self, item)
|
||||
local timer = 5
|
||||
local init = false
|
||||
local function func(_self)
|
||||
if not init then
|
||||
init = true
|
||||
_self.charging = "digest"
|
||||
creatura.action_idle(_self, timer, "none")
|
||||
end
|
||||
timer = timer - _self.dtime
|
||||
if timer <= 0 then
|
||||
_self:play_sound("digest")
|
||||
_self.stomach:digest()
|
||||
_self.charging = nil
|
||||
return true
|
||||
end
|
||||
end
|
||||
self:set_utility(func)
|
||||
end)
|
||||
|
||||
creatura.register_utility("livingslimes:fire", function(self)
|
||||
local timer = 2
|
||||
local init = false
|
||||
local function func(_self)
|
||||
local pos = _self.object:get_pos()
|
||||
if not init then
|
||||
init = true
|
||||
_self.charging = "fire"
|
||||
minetest.add_particlespawner({
|
||||
amount = 40,
|
||||
time = 2,
|
||||
minpos = {x = pos.x - 0.9, y = pos.y + 0.1, z = pos.z - 0.9},
|
||||
maxpos = {x = pos.x + 0.9, y = pos.y + 0.2, z = pos.z + 0.9},
|
||||
minacc = {x = 0, y = 2, z = 0},
|
||||
maxacc = {x = 0, y = 3, z = 0},
|
||||
minvel = {x = 0, y = 0, z = 0},
|
||||
maxvel = {x = 0, y = 0.5, z = 0},
|
||||
minexptime = 0.75,
|
||||
maxexptime = 1,
|
||||
minsize = 2.5,
|
||||
maxsize = 3.25,
|
||||
texture = {
|
||||
name = livingslimes.fire.texture,
|
||||
scale_tween = {
|
||||
{ x = 0.875, y = 1 },
|
||||
{ x = 0, y = 1.4 },
|
||||
},
|
||||
animation = {
|
||||
type = 'vertical_frames',
|
||||
aspect_w = 16,
|
||||
aspect_h = 16,
|
||||
length = 7,
|
||||
},
|
||||
},
|
||||
glow = 14,
|
||||
})
|
||||
creatura.action_idle(_self, timer, "idle")
|
||||
end
|
||||
timer = timer - _self.dtime
|
||||
if timer <= 0 then
|
||||
_self.charging = nil
|
||||
local nearby_ground = minetest.find_nodes_in_area_under_air(pos:add(vector.new(-4,-1,-4)), pos:add(vector.new(4,1,4)),{
|
||||
"group:soil",
|
||||
"group:stone",
|
||||
"group:crumbly",
|
||||
"group:cracky",
|
||||
})
|
||||
local nearby_ground_limit = #nearby_ground
|
||||
for node = 1, math.min(20,nearby_ground_limit) do
|
||||
node = nearby_ground[math.random(1,nearby_ground_limit)]:add(vector.new(0,1,0))
|
||||
minetest.set_node(node,{ name = livingslimes.fire.node, param2 = 0 })
|
||||
end
|
||||
_self:play_sound("fire")
|
||||
return true
|
||||
end
|
||||
end
|
||||
self:set_utility(func)
|
||||
end)
|
||||
|
||||
-- Utility stack behaviors
|
||||
livingslimes.behaviors = {
|
||||
wander = {
|
||||
utility = "livingslimes:wander",
|
||||
step_delay = 0.25,
|
||||
get_score = function(self)
|
||||
return 0.1, {self}
|
||||
end,
|
||||
enabled = true,
|
||||
},
|
||||
eat = {
|
||||
utility = "livingslimes:eat",
|
||||
get_score = function(self)
|
||||
-- Already seeking food
|
||||
local existing_food = self.nearby_food
|
||||
if existing_food then
|
||||
return 0.3, {self,existing_food}
|
||||
end
|
||||
|
||||
-- More likely to eat if stomach is empty
|
||||
if math.random(0,self.stomach:size() * 20 + 39) == 0 then
|
||||
local items = minetest.get_objects_inside_radius(self.object:get_pos(),self.tracking_range)
|
||||
local favorite = {
|
||||
item = nil,
|
||||
score = 0,
|
||||
timeout = 6,
|
||||
}
|
||||
for item = 1, #items do
|
||||
item = items[item]:get_luaentity()
|
||||
local is_food = item and item.name == "__builtin:item" and item.itemstring and true or false
|
||||
local food_score = is_food and (self.diet[ItemStack(item.itemstring):get_name()] or (self.diet.any or -1)) or -1
|
||||
if food_score > favorite.score
|
||||
then
|
||||
favorite.item = item
|
||||
favorite.score = food_score
|
||||
end
|
||||
end
|
||||
if favorite.item then
|
||||
self.nearby_food = favorite
|
||||
return 0.3, {self,favorite}
|
||||
else
|
||||
return 0
|
||||
end
|
||||
else
|
||||
return 0
|
||||
end
|
||||
end,
|
||||
enabled = livingslimes.settings.allow_eat,
|
||||
},
|
||||
digest = {
|
||||
utility = "livingslimes:digest",
|
||||
get_score = function(self)
|
||||
return (self.charging == "digest" or (self.stomach:can_digest() and self:get_utility() == "livingslimes:wander")) and 0.6 or 0, {self}
|
||||
end,
|
||||
enabled = livingslimes.settings.allow_digest,
|
||||
},
|
||||
attack = {
|
||||
utility = "livingslimes:attack",
|
||||
step_delay = 0.25,
|
||||
get_score = function(self)
|
||||
local target = creatura.get_nearby_player(self,self.tracking_range)
|
||||
return target and 0.4 or 0, {self,target}
|
||||
end,
|
||||
enabled = livingslimes.settings.allow_attack,
|
||||
},
|
||||
neutral = {
|
||||
utility = "livingslimes:neutral",
|
||||
step_delay = 0.25,
|
||||
get_score = function(self)
|
||||
local target = creatura.get_nearby_player(self,self.tracking_range)
|
||||
return target and target:is_player() and self.enemies[target:get_player_name() or ""] and 0.4 or 0, {self,target}
|
||||
end,
|
||||
enabled = livingslimes.settings.allow_attack,
|
||||
},
|
||||
poison = {
|
||||
utility = "livingslimes:poison",
|
||||
step_delay = 0.25,
|
||||
get_score = function(self)
|
||||
local target = creatura.get_nearby_player(self,self.tracking_range)
|
||||
return target and 0.4 or 0, {self,target}
|
||||
end,
|
||||
enabled = livingslimes.settings.allow_attack and livingslimes.settings.allow_poison,
|
||||
alternative = "attack",
|
||||
},
|
||||
fire = {
|
||||
utility = "livingslimes:fire",
|
||||
get_score = function(self)
|
||||
return (self.charging == "fire" or (math.random(1,10) == 1 and self:get_utility() == "livingslimes:attack")) and 0.5 or 0, {self}
|
||||
end,
|
||||
enabled = livingslimes.settings.allow_attack and livingslimes.fire and livingslimes.settings.allow_fire,
|
||||
},
|
||||
dig = {
|
||||
utility = "livingslimes:dig",
|
||||
get_score = function(self)
|
||||
-- Already seeking node
|
||||
local existing_node = self.nearby_node
|
||||
if existing_node then
|
||||
return 0.275, {self,existing_node}
|
||||
end
|
||||
|
||||
-- More likely to dig for food if stomach is empty
|
||||
if math.random(0,self.stomach:size() * 20 + 99) == 0 then
|
||||
local pos = self.object:get_pos()
|
||||
local nodes = minetest.find_nodes_in_area_under_air(
|
||||
pos:add(vector.new(-self.tracking_range,-1,-self.tracking_range)),
|
||||
pos:add(vector.new(self.tracking_range,1,self.tracking_range)),
|
||||
self.diet_set
|
||||
)
|
||||
local favorite = {
|
||||
node = nil,
|
||||
positions = nil,
|
||||
score = 0,
|
||||
}
|
||||
for _,node in ipairs(nodes) do
|
||||
node = {
|
||||
name = minetest.get_node(node).name,
|
||||
pos = node,
|
||||
}
|
||||
local food_score = self.diet[node.name] or -1
|
||||
if food_score > favorite.score then
|
||||
favorite.node = node.name
|
||||
favorite.positions = { node.pos }
|
||||
favorite.score = food_score
|
||||
elseif food_score == favorite.score then
|
||||
favorite.positions[#favorite.positions + 1] = node.pos
|
||||
end
|
||||
end
|
||||
if favorite.node then
|
||||
local pos = favorite.positions[math.random(#favorite.positions)]
|
||||
if livingslimes.dig_limit:limited(pos) then
|
||||
return 0
|
||||
else
|
||||
favorite = {
|
||||
name = favorite.node,
|
||||
pos = pos,
|
||||
timeout = 6,
|
||||
}
|
||||
self.nearby_node = favorite
|
||||
return 0.275, {self,favorite}
|
||||
end
|
||||
else
|
||||
return 0
|
||||
end
|
||||
else
|
||||
return 0
|
||||
end
|
||||
end,
|
||||
enabled = livingslimes.settings.allow_dig,
|
||||
}
|
||||
}
|
|
@ -1,496 +0,0 @@
|
|||
-- Get list of liquid nodes that slimes should float on
|
||||
local is_liquid = {}
|
||||
minetest.register_on_mods_loaded(function()
|
||||
for node,ndef in pairs(minetest.registered_nodes) do
|
||||
if ndef.liquidtype and ndef.liquidtype ~= "none" then
|
||||
is_liquid[node] = true
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
-- Lookup table for poison particles
|
||||
local poisonmap = {}
|
||||
|
||||
-- Register slimes
|
||||
function livingslimes.register_slime(name,def)
|
||||
-- Skip unsupported slimes
|
||||
if not def then
|
||||
goto continue
|
||||
end
|
||||
|
||||
-- Get slime technical name component
|
||||
local tname = string.lower(name) .. "_slime"
|
||||
|
||||
-- Register goo item
|
||||
local goo = "livingslimes:" .. tname .. "_goo"
|
||||
minetest.register_craftitem(goo, {
|
||||
inventory_image = "livingslimes_slime_goo.png^[colorize:" .. def.color,
|
||||
description = name .. " Slime Goo",
|
||||
groups = {slime = 1},
|
||||
on_use = def.edible ~= 0 and minetest.item_eat(def.edible) or nil,
|
||||
light_source = def.glow,
|
||||
})
|
||||
|
||||
-- Register goo block
|
||||
local slime_block = "livingslimes:" .. tname .. "_block"
|
||||
minetest.register_node(slime_block, {
|
||||
tiles = {"livingslimes_slime_block.png^[colorize:" .. def.color .. "^[colorize:#000:25"},
|
||||
description = name .. " Slime Block",
|
||||
drawtype = "allfaces_optional",
|
||||
use_texture_alpha = true,
|
||||
groups = {
|
||||
slippery = 1,
|
||||
crumbly = 3,
|
||||
oddly_breakable_by_hand = 2,
|
||||
fall_damage_add_percent = -100,
|
||||
bouncy = 40,
|
||||
},
|
||||
sounds = {
|
||||
footstep = "livingslimes_hit",
|
||||
dig = "livingslimes_hit",
|
||||
dug = "livingslimes_hit",
|
||||
place = "livingslimes_hit",
|
||||
},
|
||||
damage_per_second = def.harmful,
|
||||
light_source = def.glow,
|
||||
})
|
||||
|
||||
-- Register goo block recipe
|
||||
minetest.register_craft({
|
||||
output = slime_block,
|
||||
recipe = {
|
||||
{goo,goo,goo},
|
||||
{goo,goo,goo},
|
||||
{goo,goo,goo},
|
||||
}
|
||||
})
|
||||
|
||||
-- Identify items and nodes that belong to dietary groups
|
||||
minetest.register_on_mods_loaded(function()
|
||||
for food,score in pairs(def.diet) do
|
||||
local mod, name = (function(match)
|
||||
return match(), match()
|
||||
end)(food:gmatch("[^:]+"))
|
||||
if mod == "group" then
|
||||
for item,idef in pairs(minetest.registered_items) do
|
||||
if idef.groups and idef.groups[name] and idef.groups[name] > 0 then
|
||||
def.diet[item] = score
|
||||
end
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
-- Create boolean map of slime behaviors
|
||||
for i = 1, #def.behaviors do
|
||||
def.behaviors[def.behaviors[i]] = true
|
||||
end
|
||||
|
||||
-- Register slime punchback if the slime is harmful
|
||||
-- Deals damage to players that attack the slime bare-handed
|
||||
local punchback = function() end
|
||||
if def.harmful then
|
||||
local pbdmg = def.harmful
|
||||
punchback = function(self,puncher)
|
||||
if puncher:is_player() and puncher:get_wielded_item():is_empty() then
|
||||
puncher:punch(self.object, nil, {damage_groups={fleshy=pbdmg}}, nil)
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
-- Register slime poison node if slime is poisonous
|
||||
local poison_node = nil
|
||||
if def.behaviors.poison then
|
||||
local pdmg = def.harmful or 1
|
||||
poison_node = "livingslimes:" .. tname .. "_poison"
|
||||
minetest.register_node(poison_node,{
|
||||
description = name .. " Slime Poison",
|
||||
damage_per_second = pdmg,
|
||||
walkable = false,
|
||||
pointable = false,
|
||||
diggable = false,
|
||||
climbable = false,
|
||||
move_resistance = 1,
|
||||
buildable_to = true,
|
||||
floodable = true,
|
||||
sunlight_propagates = true,
|
||||
groups = { not_in_creative_inventory = 1 },
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
tiles = { "livingslimes_slime_block.png^[colorize:" .. def.color .. "^[opacity:150" },
|
||||
use_texture_alpha = "blend",
|
||||
color = def.color,
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = { -0.5, -0.5, -0.5, 0.5, -0.49, 0.5 },
|
||||
},
|
||||
post_effect_color = "#cc00cc0f",
|
||||
on_construct = function(pos)
|
||||
local hash = minetest.hash_node_position(pos)
|
||||
poisonmap[hash] = minetest.add_particlespawner({
|
||||
pos = {
|
||||
min = pos:add(vector.new(-0.45,-0.05,-0.45)),
|
||||
max = pos:add(vector.new(0.45,-0.4,0.45)),
|
||||
},
|
||||
amount = 15,
|
||||
time = 0,
|
||||
collisiondetection = false,
|
||||
collision_removal = false,
|
||||
object_collision = false,
|
||||
vertical = true,
|
||||
texture = {
|
||||
name = "livingslimes_slime_inventory.png^[colorize:" .. def.color .. "^[opacity:150",
|
||||
scale_tween = {
|
||||
{ x = 1, y = 1 },
|
||||
{ x = 0, y = 0 },
|
||||
}
|
||||
},
|
||||
minsize = 0.75,
|
||||
maxsize = 1.25,
|
||||
minvel = { x = 0, y = 0.25, z = 0 },
|
||||
maxvel = { x = 0, y = 1, z = 0 },
|
||||
minexptime = 1,
|
||||
maxexptime = 2,
|
||||
glow = 1,
|
||||
})
|
||||
if poisonmap[hash] == -1 then -- adding particles did not succeed
|
||||
poisonmap[hash] = nil
|
||||
end
|
||||
end,
|
||||
on_destruct = function(pos)
|
||||
minetest.get_node_timer(pos):stop()
|
||||
local hash = minetest.hash_node_position(pos)
|
||||
if poisonmap[hash] then
|
||||
minetest.delete_particlespawner(poisonmap[hash])
|
||||
poisonmap[hash] = nil
|
||||
end
|
||||
end,
|
||||
on_timer = function(pos)
|
||||
minetest.remove_node(pos)
|
||||
end,
|
||||
drop = nil,
|
||||
})
|
||||
end
|
||||
|
||||
-- Register slime mob with Creatura
|
||||
local mob = "livingslimes:" .. tname
|
||||
creatura.register_mob(mob,{
|
||||
-- Engine properties
|
||||
infotext = name .. " Slime",
|
||||
visual_size = { x = def.size, y = def.size },
|
||||
visual = "mesh",
|
||||
mesh = def.aquatic and "slime_liquid.b3d" or "slime_land.b3d",
|
||||
textures = {
|
||||
{"livingslimes_slime_block.png^[colorize:" .. def.color,"livingslimes_slime_block.png^[colorize:" .. def.color},
|
||||
},
|
||||
use_texture_alpha = true,
|
||||
stepheight = 1.1,
|
||||
glow = def.glow,
|
||||
|
||||
-- Creatura properties
|
||||
max_health = def.max_health,
|
||||
armor_groups = (function()
|
||||
local groups = {fleshy = 100, fire = 100}
|
||||
local additional_groups = def.armor_groups or {}
|
||||
for group,value in pairs(additional_groups) do
|
||||
groups[group] = value
|
||||
end
|
||||
return groups
|
||||
end)(),
|
||||
fire_resistance = def.fire_resistance or 0,
|
||||
fall_resistance = 1,
|
||||
damage = def.damage,
|
||||
speed = def.speed,
|
||||
tracking_range = def.tracking_range,
|
||||
despawn_after = 1500,
|
||||
max_fall = 0,
|
||||
turn_rate = 6,
|
||||
-- water physics
|
||||
liquid_drag = 0,
|
||||
liquid_submergence = 0.0025,
|
||||
makes_footstep_sound = false,
|
||||
sounds = {
|
||||
move = {
|
||||
name = "livingslimes_move",
|
||||
gain = 2.75,
|
||||
distance = 40,
|
||||
},
|
||||
slurp = {
|
||||
name = "livingslimes_slurp",
|
||||
gain = 2.75,
|
||||
distance = 40,
|
||||
},
|
||||
attack = {
|
||||
name = "livingslimes_attack",
|
||||
gain = 10,
|
||||
distance = 40,
|
||||
},
|
||||
hit = {
|
||||
name = "livingslimes_hit",
|
||||
gain = 10,
|
||||
distance = 40,
|
||||
},
|
||||
hurt = {
|
||||
name = "livingslimes_hit",
|
||||
gain = 10,
|
||||
distance = 40,
|
||||
},
|
||||
die = {
|
||||
name = "livingslimes_die",
|
||||
gain = 10,
|
||||
distance = 40,
|
||||
},
|
||||
fire = {
|
||||
name = livingslimes.fire.sound,
|
||||
gain = 1,
|
||||
distance = 40,
|
||||
},
|
||||
digest = {
|
||||
name = "livingslimes_digest",
|
||||
gain = 2.75,
|
||||
distance = 40,
|
||||
},
|
||||
},
|
||||
hitbox = {
|
||||
width = def.size / 10,
|
||||
height = def.size / 5,
|
||||
},
|
||||
animations = {
|
||||
none = {
|
||||
range = { x = 0, y = 0 },
|
||||
speed = 10,
|
||||
loop = true,
|
||||
},
|
||||
idle = {
|
||||
range = { x = 0, y = 19 },
|
||||
speed = 10,
|
||||
frame_blend = 0.3,
|
||||
loop = true,
|
||||
},
|
||||
move = {
|
||||
range = { x = 21, y = 40 },
|
||||
speed = 30,
|
||||
frame_blend = 0.3,
|
||||
loop = true,
|
||||
},
|
||||
fall = {
|
||||
range = { x = 42, y = 62 },
|
||||
speed = 20,
|
||||
frame_blend = 0.3,
|
||||
loop = true,
|
||||
},
|
||||
jump = {
|
||||
range = { x = 63, y = 83 },
|
||||
speed = 20,
|
||||
frame_blend = 0.3,
|
||||
loop = true,
|
||||
},
|
||||
},
|
||||
drops = (function()
|
||||
local d = {
|
||||
{
|
||||
name = goo,
|
||||
min = 1,
|
||||
max = 2,
|
||||
chance = 1,
|
||||
},
|
||||
}
|
||||
if def.drops then
|
||||
for _,drop in ipairs(def.drops) do
|
||||
d[#d + 1] = drop
|
||||
end
|
||||
end
|
||||
return d
|
||||
end)(),
|
||||
utility_stack = (function()
|
||||
local stack = {}
|
||||
for i = 1, #def.behaviors do
|
||||
local behavior = livingslimes.behaviors[def.behaviors[i]]
|
||||
while behavior and not behavior.enabled do
|
||||
behavior = livingslimes.behaviors[behavior.alternative or ""]
|
||||
end
|
||||
if behavior then
|
||||
stack[#stack + 1] = behavior
|
||||
end
|
||||
end
|
||||
return stack
|
||||
end)(),
|
||||
|
||||
-- Functions
|
||||
on_punch = def.behaviors.neutral and function(self, puncher, ...)
|
||||
punchback(self,puncher)
|
||||
creatura.basic_punch_func(self, puncher, ...)
|
||||
local name = puncher:is_player() and puncher:get_player_name()
|
||||
if name then
|
||||
if not self.enemies[name] then
|
||||
self.enemies[name] = true
|
||||
self.enemies[0] = self.enemies[0] + 1
|
||||
if self.enemies[0] > 15 then
|
||||
for ename,_ in pairs(self.enemies) do
|
||||
if ename ~= 0 then
|
||||
self.enemies[ename] = nil
|
||||
self.enemies[0] = 15
|
||||
break
|
||||
end
|
||||
end
|
||||
end
|
||||
self.enemies = self:memorize("enemies", self.enemies)
|
||||
end
|
||||
end
|
||||
end or function(self, puncher, ...)
|
||||
punchback(self,puncher)
|
||||
creatura.basic_punch_func(self, puncher, ...)
|
||||
end,
|
||||
|
||||
activate_func = function(self)
|
||||
-- General initialization
|
||||
self:animate("idle")
|
||||
self.is_floating_mob = true
|
||||
self.step_sound_timer = 0
|
||||
self.poison = poison_node
|
||||
self.diet = def.diet
|
||||
self.diet_set = (function()
|
||||
local items = {}
|
||||
for item,_ in pairs(def.diet) do
|
||||
table.insert(items,item)
|
||||
end
|
||||
return items
|
||||
end)()
|
||||
|
||||
-- Stateful initialization
|
||||
self.enemies = def.behaviors.neutral and (self:recall("enemies") or self:memorize("enemies",{ [0] = 0 })) or nil
|
||||
self.stomach = {
|
||||
contents = self:recall("stomach") or self:memorize("stomach",{
|
||||
a = 1,
|
||||
z = 0,
|
||||
digestion_timer = livingslimes.settings.digest_timer,
|
||||
}),
|
||||
add = function(self,item)
|
||||
self.contents.z = self.contents.z + 1
|
||||
self.contents[self.contents.z] = item
|
||||
self.contents.digestion_timer = self:size() == 1 and livingslimes.settings.digest_timer or self.contents.digestion_timer
|
||||
end,
|
||||
digest = function(self)
|
||||
self.contents[self.contents.a] = nil
|
||||
self.contents.a = self.contents.a + 1
|
||||
self.contents.digestion_timer = livingslimes.settings.digest_timer
|
||||
end,
|
||||
size = function(self)
|
||||
return self.contents.z - self.contents.a + 1
|
||||
end,
|
||||
tick = function(self,dtime)
|
||||
self.contents.digestion_timer = self.contents.digestion_timer - dtime
|
||||
end,
|
||||
can_digest = function(self)
|
||||
return (self:size() > 0 and self.contents.digestion_timer <= 0) and true or false
|
||||
end,
|
||||
drop = function(self,pos)
|
||||
for i = self.contents.a, self.contents.z do
|
||||
minetest.add_item({x=pos.x + math.random()/2,y=pos.y+0.5,z=pos.z+math.random()/2}, self.contents[i])
|
||||
end
|
||||
end,
|
||||
}
|
||||
|
||||
-- Item stealing function
|
||||
self.steal_item = function(player)
|
||||
local inventory = player and player:get_inventory()
|
||||
local size = inventory and inventory:get_size("main")
|
||||
if size and size > 0 then
|
||||
local hotbar = {}
|
||||
for i = 1, player:hud_get_hotbar_itemcount() do
|
||||
local item = inventory:get_stack("main",i)
|
||||
if item and not item:is_empty() then
|
||||
hotbar[#hotbar + 1] = {
|
||||
index = i,
|
||||
item = item,
|
||||
}
|
||||
end
|
||||
end
|
||||
if #hotbar > 0 then
|
||||
local stolen = hotbar[math.random(#hotbar)]
|
||||
self.stomach:add(stolen.item:to_string())
|
||||
inventory:set_stack("main",stolen.index,ItemStack(nil))
|
||||
end
|
||||
end
|
||||
end
|
||||
end,
|
||||
|
||||
step_func = function(self,dtime,moveresult)
|
||||
self.step_sound_timer = self.step_sound_timer - dtime
|
||||
self.stomach:tick(self.dtime)
|
||||
local velocity = self.object:get_velocity()
|
||||
local pos = self.object:get_pos()
|
||||
if (math.abs(velocity.x) > 0.025 or math.abs(velocity.z) > 0.025) and self.step_sound_timer <= 0 then
|
||||
self:play_sound("move")
|
||||
self.step_sound_timer = 1.5
|
||||
end
|
||||
end,
|
||||
|
||||
death_func = function(self)
|
||||
if self:get_utility() ~= "livingslimes:die" then
|
||||
self:initiate_utility("livingslimes:die", self)
|
||||
end
|
||||
end,
|
||||
})
|
||||
|
||||
-- Register spawn egg for slime mob
|
||||
creatura.register_spawn_egg(mob,def.color:sub(2,-5),"555")
|
||||
|
||||
-- Create spawning rules for slime mob
|
||||
creatura.register_abm_spawn(mob,{
|
||||
chance = def.spawn_chance,
|
||||
interval = 30,
|
||||
min_height = def.min_height,
|
||||
max_height = def.max_height,
|
||||
min_light = def.min_light,
|
||||
max_light = def.max_light,
|
||||
min_group = def.min_group,
|
||||
max_group = def.max_group,
|
||||
block_protected = true,
|
||||
biomes = def.spawn_biomes,
|
||||
nodes = def.spawn_nodes,
|
||||
spawn_in_nodes = false,
|
||||
spawn_cap = def.spawn_cap,
|
||||
})
|
||||
|
||||
::continue::
|
||||
end
|
||||
|
||||
-- Override Creatura's default water physics; slimes must rise quickly in
|
||||
-- liquids and must float on top of liquids
|
||||
-- Define gravity constants
|
||||
local fall_gravity = -9.8
|
||||
local float_gravity = 0.0001
|
||||
local rise_gravity = 2
|
||||
|
||||
local odwp = creatura.default_water_physics
|
||||
creatura.default_water_physics = function(self)
|
||||
if not self.is_floating_mob then
|
||||
odwp(self)
|
||||
else
|
||||
local pos = self.object:get_pos()
|
||||
local below = pos:add(vector.new(0,-1,0))
|
||||
local posnode = minetest.get_node(pos).name
|
||||
local belownode = minetest.get_node(below).name
|
||||
local velocity = self.object:get_velocity()
|
||||
local gravity = fall_gravity
|
||||
if is_liquid[posnode] then
|
||||
self:set_gravity(rise_gravity)
|
||||
gravity = rise_gravity
|
||||
else
|
||||
if is_liquid[belownode] then
|
||||
self:set_gravity(float_gravity)
|
||||
gravity = float_gravity
|
||||
if math.abs(velocity.x) > 0.25 or math.abs(velocity.z) > 0.25 then
|
||||
self.object:set_velocity({x = 0, y = -0.75, z = 0})
|
||||
else
|
||||
self.object:set_velocity({x = 0, y = -0.425, z = 0})
|
||||
end
|
||||
else
|
||||
self:set_gravity(fall_gravity)
|
||||
gravity = fall_gravity
|
||||
end
|
||||
end
|
||||
self.object:set_acceleration({x = 0, y = gravity, z = 0})
|
||||
end
|
||||
end
|
|
@ -1,77 +0,0 @@
|
|||
-- Globals
|
||||
livingslimes = {
|
||||
storage = minetest.get_mod_storage(),
|
||||
settings = {
|
||||
allow_attack = minetest.settings:get_bool("livingslimes.allow_attack",true) and minetest.settings:get_bool("enable_damage",true),
|
||||
allow_eat = minetest.settings:get_bool("livingslimes.allow_eat",true),
|
||||
allow_dig = minetest.settings:get_bool("livingslimes.allow_dig",true),
|
||||
dig_limit = tonumber(minetest.settings:get("livingslimes.dig_limit",8) or 8),
|
||||
allow_steal = minetest.settings:get_bool("livingslimes.allow_steal",true),
|
||||
steal_chance = tonumber(minetest.settings:get("livingslimes.steal_chance",36) or 36),
|
||||
allow_digest = minetest.settings:get_bool("livingslimes.allow_digest",true),
|
||||
digest_timer = tonumber(minetest.settings:get("livingslimes.digest_timer",240) or 240),
|
||||
allow_poison = minetest.settings:get_bool("livingslimes.allow_poison",true),
|
||||
allow_fire = minetest.settings:get_bool("livingslimes.allow_fire",true),
|
||||
spawn_chance_docile = tonumber(minetest.settings:get("livingslimes.spawn_chance_docile",8500) or 8500),
|
||||
spawn_chance_hostile = tonumber(minetest.settings:get("livingslimes.spawn_chance_hostile",12750) or 12750),
|
||||
},
|
||||
dependencies = (function()
|
||||
local deps = {}
|
||||
for _,dependency in ipairs({
|
||||
"default",
|
||||
"fire",
|
||||
"ethereal",
|
||||
"everness",
|
||||
"naturalbiomes",
|
||||
"variety",
|
||||
"asuna_core",
|
||||
"mcl_biomes",
|
||||
"mcl_core",
|
||||
"mcl_fire",
|
||||
"mcl_flowers",
|
||||
"mcl_mushrooms",
|
||||
}) do
|
||||
deps[dependency] = minetest.get_modpath(dependency) and true or false
|
||||
end
|
||||
return deps
|
||||
end)(),
|
||||
fire = (function()
|
||||
if minetest.get_modpath("fire") then
|
||||
return {
|
||||
node = "fire:basic_flame",
|
||||
texture = "fire_basic_flame_animated.png",
|
||||
sound = "fire_extinguish_flame",
|
||||
}
|
||||
elseif minetest.get_modpath("mcl_fire") then
|
||||
return {
|
||||
node = "mcl_fire:fire",
|
||||
texture = "fire_basic_flame_animated.png",
|
||||
sound = "fire_extinguish_flame",
|
||||
}
|
||||
else
|
||||
return nil
|
||||
end
|
||||
end)(),
|
||||
}
|
||||
|
||||
-- Do not spawn slimes in Asuna if slimes are disabled
|
||||
if not asuna.content.menagerie.slimes then
|
||||
livingslimes.settings.spawn_chance_docile = -1
|
||||
livingslimes.settings.spawn_chance_hostile = -1
|
||||
end
|
||||
|
||||
-- Get mod path
|
||||
local mpath = minetest.get_modpath("livingslimes")
|
||||
|
||||
-- Load slime behaviors
|
||||
dofile(mpath .. "/behaviors.lua")
|
||||
|
||||
-- Load functions
|
||||
dofile(mpath .. "/functions.lua")
|
||||
|
||||
-- Load slimes
|
||||
local slimes_path = mpath .. "/slimes/"
|
||||
local slime_files = minetest.get_dir_list(slimes_path,false)
|
||||
for i = 1, #slime_files do
|
||||
dofile(slimes_path .. slime_files[i])
|
||||
end
|
|
@ -1,6 +0,0 @@
|
|||
name = livingslimes
|
||||
title = Living Slimes
|
||||
description = Adds living slime mobs to Minetest
|
||||
author = EmptyStar
|
||||
depends = creatura
|
||||
optional_depends = default, fire, ethereal, everness, naturalbiomes, variety, asuna_core, mcl_biomes, mcl_core, mcl_fire, mcl_flowers, mcl_mushrooms
|
|
@ -1,39 +0,0 @@
|
|||
[Behaviors]
|
||||
|
||||
# Allow slimes to attack? If disabled, all slimes will be passive and will not attack even if attacked. Attacking is automatically disabled on worlds where damage is disabled.
|
||||
livingslimes.allow_attack (Allow slimes to attack?) bool true
|
||||
|
||||
# Allow slimes to eat items? If enabled, slimes will eat items left on the ground and, if given enough time, will permanently digest the items.
|
||||
livingslimes.allow_eat (Allow slimes to eat items?) bool true
|
||||
|
||||
# Allow slimes to dig nodes? If enabled, slimes will forage in their local environment for food, a process which is destructive to landscapes and structures.
|
||||
livingslimes.allow_dig (Allow slimes to dig nodes?) bool true
|
||||
|
||||
# The total number of nodes that can be dug by slimes per mapblock. 4096 represents an entire 16x16x16 mapblock. Set to 0 for no limit.
|
||||
livingslimes.dig_limit (Allowed nodes per mapblock slimes can dig) int 8 0 4096
|
||||
|
||||
# Allow slimes to steal items from player hotbar? If enabled, a successful slime attack has a chance that the attacking slime will steal/eat an item from the target player's hotbar.
|
||||
livingslimes.allow_steal (Allow slimes to steal items on attack?) bool true
|
||||
|
||||
# The percentage chance that a slime will steal an item from a player on a successful attack.
|
||||
livingslimes.steal_chance (Chance that slimes will steal an item on attack) int 36 1 100
|
||||
|
||||
# Allow slimes to digest the contents of their stomach? If enabled, items that slimes eat can be permanently destroyed.
|
||||
livingslimes.allow_digest (Allow slimes to digest?) bool true
|
||||
|
||||
# How many seconds must pass before a slime will digest an item in its stomach.
|
||||
livingslimes.digest_timer (How many seconds between slime digestions) int 240 30 3600
|
||||
|
||||
# Allow slimes to spread poison? If enabled, poisonous slimes will leave behind harmful but temporary poison on the ground.
|
||||
livingslimes.allow_poison (Allow slimes to spread poison?) bool true
|
||||
|
||||
# Allow slimes to spread fire? If enabled, slimes that are able to spread fire may create fires in their local environment when provoked. Fire may cause serious damage to flora and flammable structures.
|
||||
livingslimes.allow_fire (Allow slimes to spread fire?) bool true
|
||||
|
||||
[Spawning]
|
||||
|
||||
# The chance that a docile slime can spawn. Affects algae slimes, ocean slimes, and mineral slimes. Set to -1 to disable spawning for docile slimes.
|
||||
livingslimes.spawn_chance_docile (Spawn chance of docile slimes) int 8500 -1 50000
|
||||
|
||||
# The chance that an aggressive slime can spawn. Affects grass slimes, poison slimes, savanna slimes, ice slimes, dark slimes, and lava slimes. Set to -1 to disable spawning for aggressive slimes.
|
||||
livingslimes.spawn_chance_hostile (Spawn chance of hostile slimes) int 12750 -1 50000
|
|
@ -1,72 +0,0 @@
|
|||
livingslimes.register_slime("Algae",{
|
||||
-- Mob Properties
|
||||
color = "#0C9:170",
|
||||
size = 4,
|
||||
glow = 1,
|
||||
aquatic = true,
|
||||
max_health = 10,
|
||||
damage = 1,
|
||||
speed = 3.5,
|
||||
tracking_range = 13,
|
||||
behaviors = {
|
||||
"wander",
|
||||
"neutral",
|
||||
"dig",
|
||||
"eat",
|
||||
"digest",
|
||||
},
|
||||
diet = {
|
||||
["group:mushroom"] = 5,
|
||||
["group:grass"] = 1,
|
||||
["group:flora"] = 1,
|
||||
},
|
||||
|
||||
-- Spawning properties
|
||||
spawn_chance = livingslimes.settings.spawn_chance_docile,
|
||||
spawn_cap = 2,
|
||||
spawn_biomes = {
|
||||
"swamp",
|
||||
"alderswamp",
|
||||
"naturalbiomes:alderswamp",
|
||||
"marsh",
|
||||
"Swampland",
|
||||
"MangroveSwamp",
|
||||
},
|
||||
spawn_nodes = {
|
||||
"group:soil",
|
||||
"group:water",
|
||||
},
|
||||
min_height = 0,
|
||||
max_height = 31000,
|
||||
min_light = 0,
|
||||
max_light = 16,
|
||||
min_group = 1,
|
||||
max_group = 2,
|
||||
|
||||
-- Drops properties
|
||||
edible = 1,
|
||||
harmful = 0,
|
||||
drops = (function()
|
||||
local d = {}
|
||||
|
||||
if livingslimes.dependencies.default then
|
||||
d[#d + 1] = {
|
||||
name = "flowers:mushroom_red",
|
||||
min = 1,
|
||||
max = 1,
|
||||
chance = 10,
|
||||
}
|
||||
end
|
||||
|
||||
if livingslimes.dependencies.mcl_mushrooms then
|
||||
d[#d + 1] = {
|
||||
name = "mcl_mushrooms:mushroom_red",
|
||||
min = 1,
|
||||
max = 1,
|
||||
chance = 10,
|
||||
}
|
||||
end
|
||||
|
||||
return d
|
||||
end)(),
|
||||
})
|
|
@ -1,44 +0,0 @@
|
|||
livingslimes.register_slime("Dark",{
|
||||
-- Mob Properties
|
||||
color = "#100015:120",
|
||||
size = 5,
|
||||
aquatic = false,
|
||||
max_health = 18,
|
||||
damage = 4,
|
||||
speed = 2.5,
|
||||
tracking_range = 14,
|
||||
behaviors = {
|
||||
"wander",
|
||||
"attack",
|
||||
"eat",
|
||||
"digest",
|
||||
},
|
||||
diet = {
|
||||
["group:sword"] = 10,
|
||||
["group:pickaxe"] = 9,
|
||||
["group:axe"] = 8,
|
||||
["group:shovel"] = 7,
|
||||
["group:hoe"] = 7,
|
||||
["group:food"] = 2,
|
||||
any = 1,
|
||||
},
|
||||
|
||||
-- Spawning properties
|
||||
spawn_chance = livingslimes.settings.spawn_chance_hostile,
|
||||
spawn_cap = 1,
|
||||
spawn_biomes = nil,
|
||||
spawn_nodes = {
|
||||
"group:soil",
|
||||
"group:stone",
|
||||
},
|
||||
min_height = -31000,
|
||||
max_height = -32,
|
||||
min_light = 0,
|
||||
max_light = 7,
|
||||
min_group = 1,
|
||||
max_group = 1,
|
||||
|
||||
-- Drops properties
|
||||
edible = 2,
|
||||
harmful = 0,
|
||||
})
|
|
@ -1,97 +0,0 @@
|
|||
livingslimes.register_slime("Grass",{
|
||||
-- Mob Properties
|
||||
color = "#0A1:180",
|
||||
size = 5,
|
||||
aquatic = false,
|
||||
max_health = 14,
|
||||
damage = 2,
|
||||
speed = 3.25,
|
||||
tracking_range = 13,
|
||||
behaviors = {
|
||||
"wander",
|
||||
"attack",
|
||||
"dig",
|
||||
"eat",
|
||||
"digest",
|
||||
},
|
||||
diet = {
|
||||
["group:sword"] = 10,
|
||||
["group:pickaxe"] = 9,
|
||||
["group:axe"] = 8,
|
||||
["group:shovel"] = 7,
|
||||
["group:hoe"] = 7,
|
||||
["group:grass"] = 3,
|
||||
["group:flora"] = 3,
|
||||
["group:leaves"] = 3,
|
||||
["group:food"] = 2,
|
||||
any = 1,
|
||||
},
|
||||
|
||||
-- Spawning properties
|
||||
spawn_chance = livingslimes.settings.spawn_chance_hostile,
|
||||
spawn_cap = 1,
|
||||
spawn_biomes = {
|
||||
"grassland",
|
||||
"grassytwo",
|
||||
"junglee",
|
||||
"grassytwo",
|
||||
"dorwinion",
|
||||
"prairie",
|
||||
"grove",
|
||||
"alpine",
|
||||
"deciduous_forest",
|
||||
"japanese_forest",
|
||||
"japaneseforest",
|
||||
"meadow",
|
||||
"cherry",
|
||||
"sakura",
|
||||
"bamboo",
|
||||
"bambooforest",
|
||||
"bamboo_forest",
|
||||
"Plains",
|
||||
"SunflowerPlains",
|
||||
"Forest",
|
||||
"FlowerForest",
|
||||
"BirchForest",
|
||||
"BirchForestM",
|
||||
"mediterranean",
|
||||
"naturalbiomes:bushland",
|
||||
"naturalbiomes:heath",
|
||||
},
|
||||
spawn_nodes = {
|
||||
"group:soil",
|
||||
},
|
||||
min_height = 0,
|
||||
max_height = 31000,
|
||||
min_light = 0,
|
||||
max_light = 16,
|
||||
min_group = 1,
|
||||
max_group = 1,
|
||||
|
||||
-- Drops properties
|
||||
edible = 2,
|
||||
harmful = 0,
|
||||
drops = (function()
|
||||
local d = {}
|
||||
|
||||
if livingslimes.dependencies.default then
|
||||
d[#d + 1] = {
|
||||
name = "default:grass_1",
|
||||
min = 1,
|
||||
max = 1,
|
||||
chance = 10,
|
||||
}
|
||||
end
|
||||
|
||||
if livingslimes.dependencies.mcl_flowers then
|
||||
d[#d + 1] = {
|
||||
name = "mcl_flowers:tallgrass",
|
||||
min = 1,
|
||||
max = 1,
|
||||
chance = 10,
|
||||
}
|
||||
end
|
||||
|
||||
return d
|
||||
end)(),
|
||||
})
|
|
@ -1,85 +0,0 @@
|
|||
livingslimes.register_slime("Ice",{
|
||||
-- Mob Properties
|
||||
color = "#8BF:180",
|
||||
size = 5,
|
||||
aquatic = false,
|
||||
max_health = 14,
|
||||
damage = 2,
|
||||
speed = 3.25,
|
||||
tracking_range = 13,
|
||||
behaviors = {
|
||||
"wander",
|
||||
"attack",
|
||||
"eat",
|
||||
"digest",
|
||||
},
|
||||
diet = {
|
||||
["group:sword"] = 10,
|
||||
["group:pickaxe"] = 9,
|
||||
["group:axe"] = 8,
|
||||
["group:shovel"] = 7,
|
||||
["group:hoe"] = 7,
|
||||
["group:snowy"] = 5,
|
||||
["group:food"] = 2,
|
||||
any = 1,
|
||||
},
|
||||
|
||||
-- Spawning properties
|
||||
spawn_chance = livingslimes.settings.spawn_chance_hostile,
|
||||
spawn_cap = 1,
|
||||
spawn_biomes = {
|
||||
"tundra",
|
||||
"tundra_highland",
|
||||
"taiga",
|
||||
"coniferous_forest",
|
||||
"frost_land",
|
||||
"glacier",
|
||||
"everness_frosted_icesheet",
|
||||
"everness:frosted_icesheet",
|
||||
"icesheet",
|
||||
"snowy_grassland",
|
||||
"frost",
|
||||
"frost_floatland",
|
||||
"IcePlains",
|
||||
"IcePlainsSpikes",
|
||||
"ColdTaiga",
|
||||
},
|
||||
spawn_nodes = {
|
||||
"group:soil",
|
||||
"group:snowy",
|
||||
"group:ice",
|
||||
},
|
||||
min_height = 0,
|
||||
max_height = 31000,
|
||||
min_light = 0,
|
||||
max_light = 16,
|
||||
min_group = 1,
|
||||
max_group = 1,
|
||||
|
||||
-- Drops properties
|
||||
edible = 2,
|
||||
harmful = 0,
|
||||
drops = (function()
|
||||
local d = {}
|
||||
|
||||
if livingslimes.dependencies.default then
|
||||
d[#d + 1] = {
|
||||
name = "default:ice",
|
||||
min = 1,
|
||||
max = 1,
|
||||
chance = 10,
|
||||
}
|
||||
end
|
||||
|
||||
if livingslimes.dependencies.mcl_core then
|
||||
d[#d + 1] = {
|
||||
name = "mcl_core:ice",
|
||||
min = 1,
|
||||
max = 1,
|
||||
chance = 10,
|
||||
}
|
||||
end
|
||||
|
||||
return d
|
||||
end)(),
|
||||
})
|