Added trouble and pachisi
|
@ -0,0 +1 @@
|
|||
default
|
|
@ -0,0 +1,48 @@
|
|||
local dice = {
|
||||
{"mypachisi:1",{"mylittle_bg_1.png","mylittle_bg_2.png","mylittle_bg_3.png","mylittle_bg_4.png","mylittle_bg_5.png","mylittle_bg_6.png"},"1"},
|
||||
{"mypachisi:2",{"mylittle_bg_2.png","mylittle_bg_3.png","mylittle_bg_4.png","mylittle_bg_5.png","mylittle_bg_6.png","mylittle_bg_1.png"},"2"},
|
||||
{"mypachisi:3",{"mylittle_bg_3.png","mylittle_bg_4.png","mylittle_bg_5.png","mylittle_bg_6.png","mylittle_bg_1.png","mylittle_bg_2.png"},"3"},
|
||||
{"mypachisi:4",{"mylittle_bg_4.png","mylittle_bg_5.png","mylittle_bg_6.png","mylittle_bg_1.png","mylittle_bg_2.png","mylittle_bg_3.png"},"4"},
|
||||
{"mypachisi:5",{"mylittle_bg_5.png","mylittle_bg_6.png","mylittle_bg_1.png","mylittle_bg_2.png","mylittle_bg_3.png","mylittle_bg_4.png"},"5"},
|
||||
{"mypachisi:6",{"mylittle_bg_6.png","mylittle_bg_1.png","mylittle_bg_2.png","mylittle_bg_3.png","mylittle_bg_4.png","mylittle_bg_5.png"},"6"},
|
||||
}
|
||||
for i in ipairs (dice) do
|
||||
local d1 = dice [i][1]
|
||||
local d2 = dice [i][2]
|
||||
local d3 = dice [i][3]
|
||||
|
||||
minetest.register_node(d1,{
|
||||
description = d3,
|
||||
tiles = d2,
|
||||
drawtype = "normal",
|
||||
paramtype = "light",
|
||||
groups = {cracky = 1, not_in_creative_inventory=1},
|
||||
|
||||
on_punch = function(pos, node, puncher, pointed_thing)
|
||||
local timer = minetest.get_node_timer(pos)
|
||||
local ran = math.random(1,6)
|
||||
minetest.set_node(pos,{name="mypachisi:roll"})
|
||||
timer:start(2)
|
||||
end,
|
||||
|
||||
})
|
||||
end
|
||||
minetest.register_node("mypachisi:roll",{
|
||||
description = "roll",
|
||||
tiles = {
|
||||
{name="mylittle_bg_ani.png", animation={type="vertical_frames",aspect_w=16, aspect_h=16, length=0.3}},
|
||||
{name="mylittle_bg_ani.png", animation={type="vertical_frames",aspect_w=16, aspect_h=16, length=0.3}},
|
||||
{name="mylittle_bg_ani.png", animation={type="vertical_frames",aspect_w=16, aspect_h=16, length=0.3}},
|
||||
{name="mylittle_bg_ani.png", animation={type="vertical_frames",aspect_w=16, aspect_h=16, length=0.3}},
|
||||
{name="mylittle_bg_ani.png", animation={type="vertical_frames",aspect_w=16, aspect_h=16, length=0.3}},
|
||||
{name="mylittle_bg_ani.png", animation={type="vertical_frames",aspect_w=16, aspect_h=16, length=0.3}},
|
||||
},
|
||||
drawtype = "normal",
|
||||
paramtype = "light",
|
||||
groups = {cracky = 3, not_in_creative_inventory=1},
|
||||
|
||||
on_timer = function(pos, elapsed)
|
||||
local ran = math.random(1,6)
|
||||
minetest.set_node(pos,{name="mypachisi:"..ran})
|
||||
end
|
||||
})
|
|
@ -0,0 +1,74 @@
|
|||
local dots = {
|
||||
{"Red","red","mypachisi_b3.png^mypachisi_r.png"},
|
||||
{"Blue","blue","mypachisi_b3.png^mypachisi_b.png"},
|
||||
{"Green","green","mypachisi_b3.png^mypachisi_g.png"},
|
||||
{"Orange","orange","mypachisi_b3.png^mypachisi_o.png"},
|
||||
{"Base","base","mypachisi_b1.png^mypachisi_p.png"},
|
||||
{"Base X","basex","mypachisi_b1.png^mypachisi_p.png^mypachisi_x.png"},
|
||||
{"Main","main","mypachisi_b2.png"},
|
||||
{"Main 2","main2","mypachisi_b4.png"},
|
||||
{"Main 3","main3","mypachisi_b3.png"},
|
||||
}
|
||||
for i in ipairs(dots) do
|
||||
local desc = dots[i][1]
|
||||
local col = dots[i][2]
|
||||
local img = dots[i][3]
|
||||
|
||||
minetest.register_node("mypachisi:dot_"..col,{
|
||||
description = desc.." Dot",
|
||||
tiles = {img},
|
||||
drawtype = "normal",
|
||||
paramtype = "light",
|
||||
groups = {cracky = 1,not_in_creative_inventory=1}
|
||||
})
|
||||
|
||||
end
|
||||
local pieces = {
|
||||
{"Red","red","^[colorize:red:120"},
|
||||
{"Green","green","^[colorize:green:120"},
|
||||
{"Yellow","yellow","^[colorize:yellow:120"},
|
||||
{"Blue","blue","^[colorize:blue:120"},
|
||||
}
|
||||
for i in ipairs (pieces) do
|
||||
local desc = pieces[i][1]
|
||||
local item = pieces[i][2]
|
||||
local col = pieces[i][3]
|
||||
|
||||
minetest.register_node("mypachisi:"..item,{
|
||||
description = desc.." Player",
|
||||
tiles = {"default_gravel.png"..col},
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
light_source = 11,
|
||||
groups = {cracky = 1, dig_immediate=3, not_in_creative_inventory=1},
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.3125, -0.5, -0.3125, 0.3125, -0.3125, 0.3125},
|
||||
{-0.125, -0.3125, -0.125, 0.125, 0.125, 0.125},
|
||||
{-0.1875, 0.125, -0.1875, 0.1875, 0.3125, 0.1875},
|
||||
}
|
||||
}
|
||||
})
|
||||
end
|
||||
minetest.register_node("mypachisi:placer",{
|
||||
description = "Pachisi",
|
||||
inventory_image = "mypachisi_inv.png",
|
||||
tiles = {
|
||||
"mypachisi_b2.png^mytrouble_o.png",
|
||||
"mypachisi_b2.png",
|
||||
"mypachisi_b2.png",
|
||||
"mypachisi_b2.png",
|
||||
"mypachisi_b2.png",
|
||||
"mypachisi_b2.png",
|
||||
},
|
||||
drawtype = "normal",
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
groups = {cracky=3},
|
||||
on_rightclick = function(pos, node, player, itemstack, pointed_thing)
|
||||
local schem = minetest.get_modpath("mypachisi").."/schems/mypachisi.mts"
|
||||
minetest.place_schematic(pos,schem,0, "air", true)
|
||||
end,
|
||||
})
|
||||
dofile(minetest.get_modpath("mypachisi").."/dice.lua")
|
After Width: | Height: | Size: 161 B |
After Width: | Height: | Size: 162 B |
After Width: | Height: | Size: 178 B |
After Width: | Height: | Size: 160 B |
After Width: | Height: | Size: 172 B |
After Width: | Height: | Size: 163 B |
After Width: | Height: | Size: 230 B |
After Width: | Height: | Size: 362 B |
After Width: | Height: | Size: 144 B |
After Width: | Height: | Size: 144 B |
After Width: | Height: | Size: 144 B |
After Width: | Height: | Size: 144 B |
After Width: | Height: | Size: 367 B |
After Width: | Height: | Size: 257 B |
After Width: | Height: | Size: 363 B |
After Width: | Height: | Size: 405 B |
After Width: | Height: | Size: 365 B |
After Width: | Height: | Size: 418 B |
|
@ -0,0 +1 @@
|
|||
default
|
|
@ -0,0 +1,48 @@
|
|||
local dice = {
|
||||
{"mytrouble:1",{"mylittle_bg_1.png","mylittle_bg_2.png","mylittle_bg_3.png","mylittle_bg_4.png","mylittle_bg_5.png","mylittle_bg_6.png"},"1"},
|
||||
{"mytrouble:2",{"mylittle_bg_2.png","mylittle_bg_3.png","mylittle_bg_4.png","mylittle_bg_5.png","mylittle_bg_6.png","mylittle_bg_1.png"},"2"},
|
||||
{"mytrouble:3",{"mylittle_bg_3.png","mylittle_bg_4.png","mylittle_bg_5.png","mylittle_bg_6.png","mylittle_bg_1.png","mylittle_bg_2.png"},"3"},
|
||||
{"mytrouble:4",{"mylittle_bg_4.png","mylittle_bg_5.png","mylittle_bg_6.png","mylittle_bg_1.png","mylittle_bg_2.png","mylittle_bg_3.png"},"4"},
|
||||
{"mytrouble:5",{"mylittle_bg_5.png","mylittle_bg_6.png","mylittle_bg_1.png","mylittle_bg_2.png","mylittle_bg_3.png","mylittle_bg_4.png"},"5"},
|
||||
{"mytrouble:6",{"mylittle_bg_6.png","mylittle_bg_1.png","mylittle_bg_2.png","mylittle_bg_3.png","mylittle_bg_4.png","mylittle_bg_5.png"},"6"},
|
||||
}
|
||||
for i in ipairs (dice) do
|
||||
local d1 = dice [i][1]
|
||||
local d2 = dice [i][2]
|
||||
local d3 = dice [i][3]
|
||||
|
||||
minetest.register_node(d1,{
|
||||
description = d3,
|
||||
tiles = d2,
|
||||
drawtype = "normal",
|
||||
paramtype = "light",
|
||||
groups = {cracky = 1, not_in_creative_inventory=1},
|
||||
|
||||
on_punch = function(pos, node, puncher, pointed_thing)
|
||||
local timer = minetest.get_node_timer(pos)
|
||||
local ran = math.random(1,6)
|
||||
minetest.set_node(pos,{name="mytrouble:roll"})
|
||||
timer:start(2)
|
||||
end,
|
||||
|
||||
})
|
||||
end
|
||||
minetest.register_node("mytrouble:roll",{
|
||||
description = "roll",
|
||||
tiles = {
|
||||
{name="mylittle_bg_ani.png", animation={type="vertical_frames",aspect_w=16, aspect_h=16, length=0.3}},
|
||||
{name="mylittle_bg_ani.png", animation={type="vertical_frames",aspect_w=16, aspect_h=16, length=0.3}},
|
||||
{name="mylittle_bg_ani.png", animation={type="vertical_frames",aspect_w=16, aspect_h=16, length=0.3}},
|
||||
{name="mylittle_bg_ani.png", animation={type="vertical_frames",aspect_w=16, aspect_h=16, length=0.3}},
|
||||
{name="mylittle_bg_ani.png", animation={type="vertical_frames",aspect_w=16, aspect_h=16, length=0.3}},
|
||||
{name="mylittle_bg_ani.png", animation={type="vertical_frames",aspect_w=16, aspect_h=16, length=0.3}},
|
||||
},
|
||||
drawtype = "normal",
|
||||
paramtype = "light",
|
||||
groups = {cracky = 3, not_in_creative_inventory=1},
|
||||
|
||||
on_timer = function(pos, elapsed)
|
||||
local ran = math.random(1,6)
|
||||
minetest.set_node(pos,{name="mytrouble:"..ran})
|
||||
end
|
||||
})
|
|
@ -0,0 +1,78 @@
|
|||
local dots = {
|
||||
{"Red","red","r"},
|
||||
{"Blue","blue","b"},
|
||||
{"Green","green","g"},
|
||||
{"Orange","orange","o"},
|
||||
{"Base","base","a"},
|
||||
}
|
||||
for i in ipairs(dots) do
|
||||
local desc = dots[i][1]
|
||||
local col = dots[i][2]
|
||||
local let = dots[i][3]
|
||||
|
||||
minetest.register_node("mytrouble:dot_"..col,{
|
||||
description = desc.." Dot",
|
||||
tiles = {"default_clay.png^mytrouble_"..let..".png"},
|
||||
drawtype = "normal",
|
||||
paramtype = "light",
|
||||
groups = {cracky = 1,not_in_creative_inventory=1}
|
||||
})
|
||||
minetest.register_node("mytrouble:squ_"..col,{
|
||||
description = desc.." Dot",
|
||||
tiles = {
|
||||
"default_clay.png^mytrouble_"..let.."s.png",
|
||||
"default_clay.png",
|
||||
"default_clay.png",
|
||||
"default_clay.png",
|
||||
"default_clay.png",
|
||||
"default_clay.png",
|
||||
},
|
||||
drawtype = "normal",
|
||||
paramtype = "light",
|
||||
groups = {cracky = 1,not_in_creative_inventory=1}
|
||||
})
|
||||
end
|
||||
local pieces = {
|
||||
{"Red","red","^[colorize:red:120"},
|
||||
{"Green","green","^[colorize:green:120"},
|
||||
{"Yellow","yellow","^[colorize:yellow:120"},
|
||||
{"Blue","blue","^[colorize:blue:120"},
|
||||
}
|
||||
for i in ipairs (pieces) do
|
||||
local desc = pieces[i][1]
|
||||
local item = pieces[i][2]
|
||||
local col = pieces[i][3]
|
||||
|
||||
minetest.register_node("mytrouble:"..item,{
|
||||
description = desc.." Player",
|
||||
tiles = {"default_gravel.png"..col},
|
||||
drawtype = "nodebox",
|
||||
paramtype = "light",
|
||||
light_source = 11,
|
||||
groups = {cracky = 1, dig_immediate=3, not_in_creative_inventory=1},
|
||||
node_box = {
|
||||
type = "fixed",
|
||||
fixed = {
|
||||
{-0.3125, -0.5, -0.3125, 0.3125, -0.3125, 0.3125},
|
||||
{-0.125, -0.3125, -0.125, 0.125, 0.125, 0.125},
|
||||
{-0.1875, 0.125, -0.1875, 0.1875, 0.3125, 0.1875},
|
||||
}
|
||||
}
|
||||
})
|
||||
end
|
||||
minetest.register_node("mytrouble:placer",{
|
||||
description = "Trouble",
|
||||
inventory_image = "mytrouble_inv.png",
|
||||
tiles = {
|
||||
"default_clay.png^mytrouble_o.png"
|
||||
},
|
||||
drawtype = "normal",
|
||||
paramtype = "light",
|
||||
paramtype2 = "facedir",
|
||||
groups = {cracky=3},
|
||||
on_rightclick = function(pos, node, player, itemstack, pointed_thing)
|
||||
local schem = minetest.get_modpath("mytrouble").."/schems/mytrouble.mts"
|
||||
minetest.place_schematic({x=pos.x-1,y=pos.y,z=pos.z-1},schem,0, "air", true)
|
||||
end,
|
||||
})
|
||||
dofile(minetest.get_modpath("mytrouble").."/dice.lua")
|
After Width: | Height: | Size: 161 B |
After Width: | Height: | Size: 162 B |
After Width: | Height: | Size: 178 B |
After Width: | Height: | Size: 160 B |
After Width: | Height: | Size: 172 B |
After Width: | Height: | Size: 163 B |
After Width: | Height: | Size: 230 B |
After Width: | Height: | Size: 400 B |
After Width: | Height: | Size: 367 B |
After Width: | Height: | Size: 397 B |
After Width: | Height: | Size: 362 B |
After Width: | Height: | Size: 400 B |
After Width: | Height: | Size: 367 B |
After Width: | Height: | Size: 277 B |
After Width: | Height: | Size: 397 B |
After Width: | Height: | Size: 363 B |
After Width: | Height: | Size: 402 B |
After Width: | Height: | Size: 365 B |