summaryrefslogtreecommitdiff
path: root/jumping/jumping/init.lua
diff options
context:
space:
mode:
authorVanessa Ezekowitz <vanessaezekowitz@gmail.com>2016-04-01 20:02:19 -0400
committerVanessa Ezekowitz <vanessaezekowitz@gmail.com>2016-04-01 21:09:33 -0400
commitda66780a569712c23ae4f2996cfb4608a9f9d69d (patch)
tree217556029a78bc23ad4564720afc86de97228a04 /jumping/jumping/init.lua
parent615b22df4d423aded3613db7716943a2f389b047 (diff)
downloaddreambuilder_modpack-da66780a569712c23ae4f2996cfb4608a9f9d69d.tar
dreambuilder_modpack-da66780a569712c23ae4f2996cfb4608a9f9d69d.tar.gz
dreambuilder_modpack-da66780a569712c23ae4f2996cfb4608a9f9d69d.tar.bz2
dreambuilder_modpack-da66780a569712c23ae4f2996cfb4608a9f9d69d.tar.xz
dreambuilder_modpack-da66780a569712c23ae4f2996cfb4608a9f9d69d.zip
copy all standard Dreambuilder mods in from the old subgame
(exactly as last supplied there, updates to these mods will follow later)
Diffstat (limited to 'jumping/jumping/init.lua')
-rw-r--r--jumping/jumping/init.lua74
1 files changed, 74 insertions, 0 deletions
diff --git a/jumping/jumping/init.lua b/jumping/jumping/init.lua
new file mode 100644
index 0000000..7937c63
--- /dev/null
+++ b/jumping/jumping/init.lua
@@ -0,0 +1,74 @@
+local trampolinebox = {
+ type = "fixed",
+ fixed = {
+ {-0.5, -0.2, -0.5, 0.5, 0, 0.5},
+
+ {-0.5, -0.5, -0.5, -0.4, -0.2, -0.4},
+ { 0.4, -0.5, -0.5, 0.5, -0.2, -0.4},
+ { 0.4, -0.5, 0.4, 0.5, -0.2, 0.5},
+ {-0.5, -0.5, 0.4, -0.4, -0.2, 0.5},
+ }
+}
+
+local cushionbox = {
+ type = "fixed",
+ fixed = {
+ {-0.5, -0.5, -0.5, 0.5, -0.3, 0.5},
+ }
+}
+
+local trampoline_punch = function(pos, node)
+ local id = string.sub(node.name, #node.name)
+ id = id + 1
+ if id == 7 then id = 1 end
+ minetest.add_node(pos, {name = string.sub(node.name, 1, #node.name - 1)..id})
+end
+
+for i = 1, 6 do
+ minetest.register_node("jumping:trampoline"..i, {
+ description = "Trampoline",
+ drawtype = "nodebox",
+ node_box = trampolinebox,
+ selection_box = trampolinebox,
+ paramtype = "light",
+ on_punch = trampoline_punch,
+ tiles = {
+ "jumping_trampoline_top.png",
+ "jumping_trampoline_bottom.png",
+ "jumping_trampoline_sides.png^jumping_trampoline_sides_overlay"..i..".png"
+ },
+ groups = {dig_immediate=2, bouncy=20+i*20, fall_damage_add_percent=-70},
+ })
+end
+
+minetest.register_node("jumping:cushion", {
+ description = "Cushion",
+ drawtype = "nodebox",
+ node_box = cushionbox,
+ selection_box = cushionbox,
+ paramtype = "light",
+ tiles = {
+ "jumping_cushion_tb.png",
+ "jumping_cushion_tb.png",
+ "jumping_cushion_sides.png"
+ },
+ groups = {dig_immediate=2, disable_jump=1, fall_damage_add_percent=-100},
+})
+
+minetest.register_craft({
+ output = "jumping:trampoline1",
+ recipe = {
+ {"default:wood", "default:wood", "default:wood"},
+ {"default:leaves", "default:leaves", "default:leaves"},
+ {"default:stick", "default:stick", "default:stick"}
+ }
+})
+
+minetest.register_craft({
+ output = "jumping:cushion",
+ recipe = {
+ {"default:leaves", "default:leaves", "default:leaves"},
+ {"default:leaves", "default:leaves", "default:leaves"},
+ {"default:stick", "default:stick", "default:stick"}
+ }
+})