summaryrefslogtreecommitdiff
path: root/extranodes/trampoline.lua
blob: 5616a7373c155c30e394a19437894a2dfc241cec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
-- bouncy-bouncy
-- this adds two useful kinds of nodes. Two fall damage dampeners (50% and 100%)
-- and a trampoline. Unlike on the mushroom spores from ethereal, players can
-- freely jump on the dampeners.
-- The latex foam adds use to sulphur, and may be employed for something else later.

local S = rawget(_G, "intllib") and intllib.Getter() or function(s) return s end


minetest.register_craftitem(":technic:latex_foam", {
	description = S("Latex Foam"),
	inventory_image = "technic_latex_foam.png",
})

minetest.register_node(":technic:fall_dampener_50", {
	description = S("Fall Dampener 50%"),
	drawtype = "nodebox",
	node_box = {
		type = "fixed",
		fixed = {-0.5,-0.5,-0.5,0.5,0,0.5}
		},
	collision_box = {
		type = "fixed",
		fixed = {-0.5,-0.5,-0.5,0.5,0,0.5}
		},
	selection_box = {
		type = "fixed",
		fixed = {-0.5,-0.5,-0.5,0.5,0,0.5}
		},
	tiles = { "technic_fall_dampener_top.png", 
               "technic_fall_dampener_bottom.png", 
               "technic_fall_dampener_side.png",
               "technic_fall_dampener_side.png",
               "technic_fall_dampener_side.png",
               "technic_fall_dampener_side.png"},
	groups = {crumbly = 3, fall_damage_add_percent = -50},
	sounds = default.node_sound_dirt_defaults(),
	paramtype2 = "facedir",
})

minetest.register_node(":technic:fall_dampener_100", {
	description = S("Fall Dampener 100%"),
	drawtype = "normal",
	tiles = {"technic_fall_dampener_top.png", 
               "technic_fall_dampener_bottom.png", 
               "technic_fall_dampener_side.png",
               "technic_fall_dampener_side.png",
               "technic_fall_dampener_side.png",
               "technic_fall_dampener_side.png"},
	groups = {crumbly = 3, fall_damage_add_percent = -100},
	sounds = default.node_sound_dirt_defaults(),
	paramtype2 = "facedir",
})

minetest.register_node(":technic:trampoline", {
	description = S("Trampoline"),
	drawtype = "normal",
	tiles = {"technic_trampoline_top.png", 
		"technic_fall_dampener_bottom.png", -- cost cuts
		"technic_trampoline_side.png",
		"technic_trampoline_side.png",
		"technic_trampoline_side.png",
		"technic_trampoline_side.png"},
	groups = {crumbly = 3, bouncy = 100, fall_damage_add_percent = -100},
	sounds = {footstep = {name = "trampoline_boing", gain = 1.0}},
	paramtype2 = "facedir",
})


minetest.register_craft({
	output = "technic:fall_dampener_50",
	recipe = {
		{ "", "", ""},
		{ "technic:raw_latex", "technic:raw_latex", "technic:raw_latex"},
		{ "technic:latex_foam", "technic:latex_foam", "technic:latex_foam"},
	}
})

minetest.register_craft({
	output = "technic:fall_dampener_100",
	recipe = {
		{ "technic:raw_latex", "technic:raw_latex", "technic:raw_latex"},
		{ "technic:latex_foam", "technic:latex_foam", "technic:latex_foam"},
		{ "technic:latex_foam", "technic:latex_foam", "technic:latex_foam"},
	}
})

minetest.register_craft({
	output = "technic:trampoline",
	recipe = {
		{ "dye:green", "dye:green", "dye:green"},
		{ "technic:rubber", "technic:rubber", "technic:rubber"},
		{ "technic:rubber", "technic:rubber", "technic:rubber"},
	}
})