7
mods/jumping/README.md
Executable file
@ -0,0 +1,7 @@
|
||||
Jumping
|
||||
|
||||
Jumping is a mod for minetest that adds trampolines, cushions, ...
|
||||
|
||||
License: GPLv3
|
||||
|
||||
Creator: Jeija
|
82
mods/jumping/init.lua
Executable file
@ -0,0 +1,82 @@
|
||||
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
|
||||
|
||||
local u = 6
|
||||
|
||||
for i = 1, u do
|
||||
local bnc_pct = math.ceil((150/u)*i)+25
|
||||
minetest.register_node("jumping:trampoline_" .. i, {
|
||||
description = "Trampoline (bounce : " .. bnc_pct .. "%)",
|
||||
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",
|
||||
},
|
||||
drop = "jumping:trampoline_1",
|
||||
groups = {dig_immediate = 2, bouncy = bnc_pct, fall_damage_add_percent = -65, disable_jump = 1},
|
||||
})
|
||||
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:trampoline_1",
|
||||
recipe = {
|
||||
{"group:ingot", "group:ingot", "group:ingot"},
|
||||
{"default:leaves", "default:leaves", "default:leaves"},
|
||||
{"default:stick", "default:stick", "default:stick"},
|
||||
}
|
||||
})
|
||||
|
||||
minetest.register_craft({
|
||||
output = "jumping:cushion",
|
||||
recipe = {
|
||||
{"default:junglegrass", "default:junglegrass", "default:junglegrass"},
|
||||
{"default:leaves", "default:leaves", "default:leaves"},
|
||||
{"default:stick", "default:stick", "default:stick"},
|
||||
}
|
||||
})
|
||||
|
||||
if minetest.setting_getbool("log_mods") then
|
||||
minetest.log("action", "Carbone: [jumping] loaded.")
|
||||
end
|
BIN
mods/jumping/textures/jumping_cushion_sides.png
Executable file
After Width: | Height: | Size: 268 B |
BIN
mods/jumping/textures/jumping_cushion_tb.png
Executable file
After Width: | Height: | Size: 621 B |
BIN
mods/jumping/textures/jumping_trampoline_bottom.png
Executable file
After Width: | Height: | Size: 232 B |
BIN
mods/jumping/textures/jumping_trampoline_sides.png
Executable file
After Width: | Height: | Size: 164 B |
BIN
mods/jumping/textures/jumping_trampoline_sides_overlay_1.png
Executable file
After Width: | Height: | Size: 110 B |
BIN
mods/jumping/textures/jumping_trampoline_sides_overlay_2.png
Executable file
After Width: | Height: | Size: 114 B |
BIN
mods/jumping/textures/jumping_trampoline_sides_overlay_3.png
Executable file
After Width: | Height: | Size: 113 B |
BIN
mods/jumping/textures/jumping_trampoline_sides_overlay_4.png
Executable file
After Width: | Height: | Size: 111 B |
BIN
mods/jumping/textures/jumping_trampoline_sides_overlay_5.png
Executable file
After Width: | Height: | Size: 120 B |
BIN
mods/jumping/textures/jumping_trampoline_sides_overlay_6.png
Executable file
After Width: | Height: | Size: 105 B |
BIN
mods/jumping/textures/jumping_trampoline_top.png
Executable file
After Width: | Height: | Size: 240 B |
@ -87,7 +87,7 @@ load_mod_paintings = true
|
||||
load_mod_multitest = true
|
||||
load_mod_lavalamp = true
|
||||
load_mod_lantern = true
|
||||
load_mod_jumping = false
|
||||
load_mod_jumping = true
|
||||
|
||||
load_mod_mesecons = true
|
||||
load_mod_warps = true
|
||||
|