init.lua 2.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. local dots = {
  2. {"Red","red","mypachisi_b3.png^mypachisi_r.png"},
  3. {"Blue","blue","mypachisi_b3.png^mypachisi_b.png"},
  4. {"Green","green","mypachisi_b3.png^mypachisi_g.png"},
  5. {"Orange","orange","mypachisi_b3.png^mypachisi_o.png"},
  6. {"Base","base","mypachisi_b1.png^mypachisi_p.png"},
  7. {"Base X","basex","mypachisi_b1.png^mypachisi_p.png^mypachisi_x.png"},
  8. {"Main","main","mypachisi_b2.png"},
  9. {"Main 2","main2","mypachisi_b4.png"},
  10. {"Main 3","main3","mypachisi_b3.png"},
  11. }
  12. for i in ipairs(dots) do
  13. local desc = dots[i][1]
  14. local col = dots[i][2]
  15. local img = dots[i][3]
  16. minetest.register_node("mypachisi:dot_"..col,{
  17. description = desc.." Dot",
  18. tiles = {img},
  19. drawtype = "normal",
  20. paramtype = "light",
  21. groups = {cracky = 1,not_in_creative_inventory=1}
  22. })
  23. end
  24. local pieces = {
  25. {"Red","red","^[colorize:red:120"},
  26. {"Green","green","^[colorize:green:120"},
  27. {"Yellow","yellow","^[colorize:yellow:120"},
  28. {"Blue","blue","^[colorize:blue:120"},
  29. }
  30. for i in ipairs (pieces) do
  31. local desc = pieces[i][1]
  32. local item = pieces[i][2]
  33. local col = pieces[i][3]
  34. minetest.register_node("mypachisi:"..item,{
  35. description = desc.." Player",
  36. tiles = {"default_gravel.png"..col},
  37. drawtype = "nodebox",
  38. paramtype = "light",
  39. light_source = 11,
  40. groups = {cracky = 1, dig_immediate=3, not_in_creative_inventory=1},
  41. node_box = {
  42. type = "fixed",
  43. fixed = {
  44. {-0.3125, -0.5, -0.3125, 0.3125, -0.3125, 0.3125},
  45. {-0.125, -0.3125, -0.125, 0.125, 0.125, 0.125},
  46. {-0.1875, 0.125, -0.1875, 0.1875, 0.3125, 0.1875},
  47. }
  48. }
  49. })
  50. end
  51. minetest.register_node("mypachisi:placer",{
  52. description = "Pachisi",
  53. inventory_image = "mypachisi_inv.png",
  54. wield_image = "mypachisi_inv.png",
  55. tiles = {
  56. "mypachisi_b2.png^mytrouble_o.png",
  57. "mypachisi_b2.png",
  58. "mypachisi_b2.png",
  59. "mypachisi_b2.png",
  60. "mypachisi_b2.png",
  61. "mypachisi_b2.png",
  62. },
  63. drawtype = "normal",
  64. paramtype = "light",
  65. paramtype2 = "facedir",
  66. groups = {cracky=3},
  67. on_rightclick = function(pos, node, player, itemstack, pointed_thing)
  68. local schem = minetest.get_modpath("mypachisi").."/schems/mypachisi.mts"
  69. minetest.place_schematic(pos,schem,0, "air", true)
  70. end,
  71. after_place_node = function(pos, placer, itemstack, pointed_thing)
  72. if placer and minetest.check_player_privs(placer:get_player_name(), {myboardgames = true}) then
  73. else
  74. minetest.remove_node(pos)
  75. return true
  76. end
  77. end,
  78. })
  79. dofile(minetest.get_modpath("mypachisi").."/dice.lua")