silkworm!

master
runs 2019-08-15 23:10:00 +02:00
parent fda43dc1ef
commit 82e69de302
13 changed files with 205 additions and 196 deletions

View File

@ -2,27 +2,6 @@ local modpath, modname, S = ...
local creative_mode = minetest.settings:get_bool("creative_mode")
petz = {}
--
--The Petz
--
petz.petz_list = {"kitty", "puppy", "ducky", "lamb", "lion", "calf", "panda", --A table with all the petz names
"grizzly", "pony", "parrot", "chicken", "piggy", "wolf", "elephant",
"elephant_female", "pigeon", "moth", "camel", "clownfish", "bat"}
petz.petz_list_by_owner = {} --a list of tamed petz with owner
--
--Settings
--
petz.settings = {}
petz.settings.mesh = nil
petz.settings.visual_size = {}
petz.settings.rotate = 0
petz.settings.tamagochi_safe_nodes = {} --Table with safe nodes for tamagochi mode
assert(loadfile(modpath .. "/api_helper_functions.lua"))(modpath, S)
assert(loadfile(modpath .. "/api_orders.lua"))(modpath, S)
assert(loadfile(modpath .. "/api_init_prop.lua"))(modpath, S) --Load the init the properties for the entities

View File

@ -10,12 +10,31 @@ local mg_name = minetest.get_mapgen_setting("mg_name")
-- internationalization boilerplate
local S = minetest.get_translator(minetest.get_current_modname())
--
--The Petz
--
petz = {}
--
--Settings
--
petz.settings = {}
petz.settings.mesh = nil
petz.settings.visual_size = {}
petz.settings.rotate = 0
petz.settings.tamagochi_safe_nodes = {} --Table with safe nodes for tamagochi mode
assert(loadfile(modpath .. "/settings.lua"))(modpath, S) --Load the settings
petz.petz_list = string.split(petz.settings.petz_list, ',') --A list with all the petz names
petz.petz_list_by_owner = {} --a list of tamed petz with owner
assert(loadfile(modpath .. "/api.lua"))(modpath, modname, S)
assert(loadfile(modpath .. "/mount.lua"))(modpath, S) --Load the mount engine
assert(loadfile(modpath .. "/mobkit.lua"))(modpath, S)
assert(loadfile(modpath .. "/mobkit_plus.lua"))(modpath, S)
assert(loadfile(modpath .. "/behaviours.lua"))(modpath, S)
assert(loadfile(modpath .. "/settings.lua"))(modpath, S) --Load the settings
assert(loadfile(modpath .. "/nodes.lua"))(modpath, S) --Load the nodes
assert(loadfile(modpath .. "/items.lua"))(modpath, S) --Load the items
assert(loadfile(modpath .. "/food.lua"))(modpath, S) --Load the food items

View File

@ -1,5 +1,6 @@
# textdomain: petz
Alight= Posarse
A silk bobbin has been created!=¡Se ha creado una bobina de seda!
Bat=Murciélago
Beaver Fur=Piel de castor
Beaver Oil=Aceite de castor
@ -27,6 +28,7 @@ Ducky Feather=Pluma de pato
Ducky Nest with Egg=Nido de pato con huevo
Ducky=Patito
Female=Hembra
First, extract the silk bobbin from the spinning wheel.=Primero extrae la bobina de seda ya creada.
Fish Tank= Pecera
Fly=Volar
Follow me=Sígueme
@ -34,6 +36,8 @@ Fried Egg=Huevo frito
Fried and Egg=Huevo frito con beicon
Frog Leg=Anca de rana
Frog= Rana
Glass Syringe=Jeringuilla de cristal
Glass Syringe with sperm=Jeringuilla con esperma
Guard=Guardar
had already been brushed.=ya había sido cepillado.
had already been spreaded with beaver oil.=ya había sido untado con aceite de castor.
@ -50,9 +54,11 @@ Lion=León
Male=Macho
Mini Lamb Chop=Chuletilla de cordero
Milk Bucket=Balde de leche
more to create the bobbin.=más para crear la bobina.
Moth=Polilla
Name=Nombre
Nest=Nido
No room in your inventory for the silk bobbin.=No hay sitio en tu inventario para la bobina de seda.
No room in your inventory for the egg.=No hay sitio en tu inventario para el huevo.
Orders=Ordenes
Parrot=Loro
@ -81,13 +87,17 @@ Satiated=Saciado
Set=Cambiar
Shears=Cizallas
Show tag=Mostrar etiqueta
Silk Bobbin=Bobina de seda
Silk Count=Contaje de seda
Silkworm=Gusano de seda
Silkworm Cocoon=Capullo de gusano de seda
Silkworm Eggs=Huevos de gusano de seda
Square Ball (use to throw)=Bola cuadrada (usar para lanzar)
Stand here=Espera aquí
Status=Estado
Tamed=Domesticado
Glass Syringe=Jeringuilla de cristal
Glass Syringe with sperm=Jeringuilla con esperma
The wolf turn into puppy.=El lobo se ha convertido en cachorrito.
There are still=Todavía faltan
There's already a parrot on top.=Ya hay un loro encima.
This animal is already pregnant.=Este animal ya está preñado.
This animal is already rut.=Este animal ya está en celo.
@ -102,4 +112,5 @@ Pet Whistle=Silbato para mascota
Wolf=Lobo
Your=Tu
You are not the owner of the=Tú no eres el propietario del
You got the bobbin!=¡Has obtenido la bobina!
You have no pets with a name to call.=No tienes mascotas con nombre para llamar.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@ -1,160 +1,128 @@
mtllib petz_spinning_wheel.mtl
o converted_out
v 0.5 -0.3125 -0.1875
v 0.5 -0.3125 0.25
v 0.5 -0.25 0.25
v 0.5 -0.25 -0.1875
v -0.5 -0.3125 -0.1875
v -0.5 -0.3125 0.25
v -0.5 -0.25 0.25
v -0.5 -0.25 -0.1875
v 0.4375 -0.5 -0.125
v 0.4375 -0.5 -0.0625
v 0.4375 -0.3125 -0.0625
v 0.4375 -0.3125 -0.125
v 0.375 -0.5 -0.125
v 0.375 -0.5 -0.0625
v 0.375 -0.3125 -0.0625
v 0.375 -0.3125 -0.125
v 0.5 0 0
v 0.5 0 0.0625
v 0.5 0.4375 0.0625
v 0.5 0.4375 0
v 0.4375 0 0
v 0.4375 0 0.0625
v 0.4375 0.4375 0.0625
v 0.4375 0.4375 0
v 0.5 0.4375 0
v 0.5 0.4375 0.0625
v 0.5 0.5 0.0625
v 0.5 0.5 0
v -0.0625002 0.4375 0
v -0.0625002 0.4375 0.0625
v -0.0625002 0.5 0.0625
v -0.0625002 0.5 0
v -0 0 0
v -0 0 0.0625
v -0 0.4375 0.0625
v -0 0.4375 0
v -0.0625 0 0
v -0.0625 0 0.0625
v -0.0625 0.4375 0.0625
v -0.0625 0.4375 0
v 0.5 -0.0625 0
v 0.5 -0.0625 0.0625
v 0.5 1.49012e-08 0.0625
v 0.5 1.49012e-08 0
v -0.0625 -0.0625 0
v -0.0625 -0.0625 0.0625
v -0.0625 1.49012e-08 0.0625
v -0.0625 1.49012e-08 0
v 0.4375 0.1875 0
v 0.4375 0.1875 0.0625
v 0.5 0.25 0
v 0.5 0.25 0.0625
v 0.5 0.3125 0.0625
v 0.5 0.3125 0
v -0.0625 0.25 0
v -0.0625 0.25 0.0625
v -0.0625 0.3125 0.0625
v -0.0625 0.3125 0
v 0.5 -0.1875 0
v 0.5 -0.1875 0.0625
v 0.5 0.25 0.0625
v 0.5 0.25 0
v 0.4375 -0.1875 0
v 0.4375 -0.1875 0.0625
v 0.4375 0.25 0.0625
v 0.4375 0.25 0
v -0 0.1875 0
v -0 0.1875 0.0625
v 0.5 -0.25 0
v 0.5 -0.25 0.0625
v 0.5 -0.1875 0.0625
v 0.5 -0.1875 0
v -0.0625 -0.25 0
v -0.0625 -0.25 0.0625
v -0.0625 -0.1875 0.0625
v -0.0625 -0.1875 0
v -0 -0.1875 0
v -0 -0.1875 0.0625
v -0 0.25 0.0625
v -0 0.25 0
v 0.25 -0.25 -0.125
v 0.25 -0.25 -0.0625
v 0.25 0.3125 -0.0625
v 0.25 0.3125 -0.125
v 0.1875 -0.25 -0.125
v 0.1875 -0.25 -0.0625
v 0.1875 0.3125 -0.0625
v 0.1875 0.3125 -0.125
v 0.25 -0.25 0.125
v 0.25 -0.25 0.1875
v 0.25 0.3125 0.1875
v 0.25 0.3125 0.125
v 0.1875 -0.25 0.125
v 0.1875 -0.25 0.1875
v 0.1875 0.3125 0.1875
v 0.1875 0.3125 0.125
v 0.25 0.1875 -0.0625
v 0.25 0.1875 5.58794e-09
v 0.25 0.25 5.58794e-09
v 0.25 0.25 -0.0625
v 0.1875 0.1875 -0.0625
v 0.1875 0.1875 5.58794e-09
v 0.1875 0.25 5.58794e-09
v 0.1875 0.25 -0.0625
v 0.25 0.1875 0.0625
v 0.25 0.1875 0.125
v 0.25 0.25 0.125
v -0.0625 -0.1875 0
v -0.0625 -0.1875 0.0625
v -0.0625 0.25 0.0625
v -0.0625 0.25 0
v 0.4375 0 0
v 0.4375 0 0.0625
v 0.4375 0.0625 0.0625
v 0.4375 0.0625 0
v -8.9407e-08 0 0
v -8.9407e-08 0 0.0625
v -8.9407e-08 0.0625 0.0625
v -8.9407e-08 0.0625 0
v 0.25 -0.1875 0
v 0.25 -0.1875 0.0625
v 0.25 -5.58794e-08 0.0625
v 0.25 -5.58794e-08 0
v 0.1875 -0.1875 0
v 0.1875 -0.1875 0.0625
v 0.1875 -5.58794e-08 0.0625
v 0.1875 -5.58794e-08 0
v 0.25 0.0625 0
v 0.25 0.0625 0.0625
v 0.25 0.25 0.0625
v 0.1875 0.1875 0.0625
v 0.1875 0.1875 0.125
v 0.1875 0.25 0.125
v 0.1875 0.25 0.0625
v -0.3125 -0.25 0
v -0.3125 -0.25 0.0625
v -0.3125 -0.125 0.0625
v -0.3125 -0.125 0
v -0.375 -0.25 0
v -0.375 -0.25 0.0625
v -0.375 -0.125 0.0625
v -0.375 -0.125 0
v -0.25 -0.125 -0.0625
v -0.25 -0.125 0.125
v -0.25 0.125 0.125
v -0.25 0.125 -0.0625
v -0.4375 -0.125 -0.0625
v -0.4375 -0.125 0.125
v -0.4375 0.125 0.125
v -0.4375 0.125 -0.0625
v -0.3125 0.125 0
v -0.3125 0.125 0.0625
v -0.3125 0.1875 0.0625
v -0.3125 0.1875 0
v -0.375 0.125 0
v -0.375 0.125 0.0625
v -0.375 0.1875 0.0625
v -0.375 0.1875 0
v 0.25 0.25 0
v 0.25 0.25 0.0624999
v 0.25 0.4375 0.0624999
v 0.25 0.4375 0
v 0.1875 0.0625 0
v 0.1875 0.0625 0.0625
v 0.1875 0.25 0.0625
v 0.1875 0.25 0
v 0.1875 0.25 0.0624999
v 0.1875 0.4375 0.0624999
v 0.1875 0.4375 0
v 0.25 0 0
v 0.25 -0.4375 0.125
v 0.25 -0.4375 0.1875
v 0.25 0.0625 0.1875
v 0.25 0.0625 0.125
v 0.1875 -0.4375 0.125
v 0.1875 -0.4375 0.1875
v 0.1875 0.0625 0.1875
v 0.1875 0.0625 0.125
v 0.25 0 0.0625
v 0.25 0.1875 0.0625
v 0.25 0.1875 0
v 0.1875 0 0
v 0.25 0 0.125
v 0.25 0.0625 0.125
v 0.25 0.0625 0.0625
v 0.1875 0 0.0625
v 0.1875 0.1875 0.0625
v 0.1875 0.1875 0
v 0.4375 -0.5 0.125
v 0.4375 -0.5 0.1875
v 0.4375 -0.3125 0.1875
v 0.4375 -0.3125 0.125
v 0.375 -0.5 0.125
v 0.375 -0.5 0.1875
v 0.375 -0.3125 0.1875
v 0.375 -0.3125 0.125
v -0.375 -0.5 0.125
v -0.375 -0.5 0.1875
v -0.375 -0.3125 0.1875
v -0.375 -0.3125 0.125
v -0.4375 -0.5 0.125
v -0.4375 -0.5 0.1875
v -0.4375 -0.3125 0.1875
v -0.4375 -0.3125 0.125
v -0.375 -0.5 -0.125
v -0.375 -0.5 -0.0625001
v -0.375 -0.3125 -0.0625001
v -0.375 -0.3125 -0.125
v -0.4375 -0.5 -0.125
v -0.4375 -0.5 -0.0625001
v -0.4375 -0.3125 -0.0625001
v -0.4375 -0.3125 -0.125
v 0.1875 0 0.125
v 0.1875 0.0625 0.125
v 0.1875 0.0625 0.0625
v 0.25 0 -0.0625
v 0.25 0 2.42144e-08
v 0.25 0.0624999 2.42144e-08
v 0.25 0.0624999 -0.0625
v 0.1875 0 -0.0625
v 0.1875 0 2.42144e-08
v 0.1875 0.0624999 2.42144e-08
v 0.1875 0.0624999 -0.0625
v 0.25 -0.4375 -0.125
v 0.25 -0.4375 -0.0625
v 0.25 0.0625 -0.0625
v 0.25 0.0625 -0.125
v 0.1875 -0.4375 -0.125
v 0.1875 -0.4375 -0.0625
v 0.1875 0.0625 -0.0625
v 0.1875 0.0625 -0.125
v 0.5 -0.5 -0.1875
v 0.5 -0.5 0.25
v 0.5 -0.4375 0.25
v 0.5 -0.4375 -0.1875
v -0.5 -0.5 -0.1875
v -0.5 -0.5 0.25
v -0.5 -0.4375 0.25
v -0.5 -0.4375 -0.1875
v -0.375 -0.4375 0
v -0.375 -0.4375 0.0625
v -0.375 -0.3125 0.0625
v -0.375 -0.3125 0
v -0.4375 -0.4375 0
v -0.4375 -0.4375 0.0625
v -0.4375 -0.3125 0.0625
v -0.4375 -0.3125 0
v -0.3125 -0.3125 -0.0625
v -0.3125 -0.3125 0.125
v -0.3125 -0.0625 0.125
v -0.3125 -0.0625 -0.0625
v -0.5 -0.3125 -0.0625
v -0.5 -0.3125 0.125
v -0.5 -0.0625 0.125
v -0.5 -0.0625 -0.0625
v -0.375 -0.0625 0
v -0.375 -0.0625 0.0625
v -0.375 -7.45058e-09 0.0625
v -0.375 -7.45058e-09 0
v -0.4375 -0.0625 0
v -0.4375 -0.0625 0.0625
v -0.4375 -7.45058e-09 0.0625
v -0.4375 -7.45058e-09 0
usemtl none
s off
g nodebox1
g nodebox20
f 1 2 3 4
f 5 6 7 8
f 1 4 8 5
@ -259,31 +227,3 @@ f 113 116 120 117
f 114 115 119 118
f 113 114 118 117
f 116 115 119 120
g nodebox16
f 121 122 123 124
f 125 126 127 128
f 121 124 128 125
f 122 123 127 126
f 121 122 126 125
f 124 123 127 128
g nodebox17
f 129 130 131 132
f 133 134 135 136
f 129 132 136 133
f 130 131 135 134
f 129 130 134 133
f 132 131 135 136
g nodebox18
f 137 138 139 140
f 141 142 143 144
f 137 140 144 141
f 138 139 143 142
f 137 138 142 141
f 140 139 143 144
g nodebox19
f 145 146 147 148
f 149 150 151 152
f 145 148 152 149
f 146 147 151 150
f 145 146 150 149
f 148 147 151 152

View File

@ -391,3 +391,60 @@ minetest.register_abm({
end
end
})
--Spinning Wheel
minetest.register_node("petz:spinning_wheel", {
description = S("Spinning Wheel"),
groups = {snappy=1, bendy=2, cracky=1},
sounds = default.node_sound_wood_defaults(),
paramtype = "light",
drawtype = "mesh",
mesh = 'petz_spinning_wheel.b3d',
tiles = {"petz_spinning_wheel_loaded.png"},
collision_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.25, 0.5, 0.3125, 0.1875},
},
selection_box = {
type = "fixed",
fixed = {-0.5, -0.5, -0.25, 0.5, 0.3125, 0.1875},
},
after_place_node = function(pos, placer, itemstack, pointed_thing)
local meta = minetest.get_meta(pos)
meta:set_int("silk_count", 1)
meta:set_string("infotext", S("Silk Count").." = "..meta:get_int("silk_count"))
end,
on_rightclick = function(pos, node, player, itemstack, pointed_thing)
local player_name = player:get_player_name()
local meta = minetest.get_meta(pos)
local silk_count = meta:get_int("silk_count")
if itemstack:get_name() == "petz:cocoon" then
if silk_count == 3 then
minetest.chat_send_player(player_name, S("First, extract the silk bobbin from the spinning wheel."))
elseif silk_count == 2 then
silk_count = silk_count + 1
meta:set_int("silk_count", silk_count)
meta:set_string("infotext", S("Silk Count").." = "..tostring(silk_count))
itemstack:take_item()
minetest.chat_send_player(player_name, S("A silk bobbin has been created!"))
else
silk_count = silk_count + 1
meta:set_int("silk_count", silk_count)
meta:set_string("infotext", S("Silk Count").." = "..tostring(silk_count))
itemstack:take_item()
minetest.chat_send_player(player_name, S("There are still").." ".. tostring(3-silk_count).." "..S("more to create the bobbin."))
end
elseif silk_count == 3 then --get the bobbin
local inv = player:get_inventory()
if inv:room_for_item("main", "petz:silk_bobbin") then --firstly check for room in the inventory
inv:add_item("main", "petz:silk_bobbin")
meta:set_int("silk_count", 0) --reset the silk count
meta:set_string("infotext", S("Silk Count").." = 0")
minetest.chat_send_player(player_name, S("You got the bobbin!"))
else
minetest.chat_send_player(player_name, S("No room in your inventory for the silk bobbin."))
end
end
return itemstack
end,
})

View File

@ -3,6 +3,8 @@
##Important: All the values separated by commas have to be without spaces.
##
petz_list = kitty,puppy,ducky,lamb,lion,calf,panda,grizzly,pony,parrot,chicken,piggy,wolf,elephant,elephant_female,pigeon,moth,camel,clownfish,bat,silkworm
##Type of model [mesh -or- cubic]
type_model = mesh

View File

@ -2,6 +2,7 @@ local modpath, S = ...
local settings = Settings(modpath .. "/petz.conf")
petz.settings.petz_list = settings:get("petz_list", "")
petz.settings.type_model = settings:get("type_model", "mesh")
petz.settings.tamagochi_mode = settings:get_bool("tamagochi_mode", true)
petz.settings.tamagochi_check_time = tonumber(settings:get("tamagochi_check_time"))

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB