Compare commits

12 Commits

Author SHA1 Message Date
02eeafdc03 Protect nodes from being overwritten by mapgen (#12) 2024-02-28 17:37:04 +01:00
4345462384 General mod maintenance (#11) 2022-06-26 17:57:40 +02:00
b5205e4e7d opt-depend on default [squash] (#9)
* more detailed dep checks for recipes

* remove (opt-) depends on default

Co-authored-by: BuckarooBanzay <BuckarooBanzay@users.noreply.github.com>
2021-11-02 19:45:07 +01:00
811847b0e7 Update mod.conf
Fix typo
2021-02-12 08:00:56 +01:00
f375986e33 Update mod.conf
Fix #8
2021-02-12 08:00:25 +01:00
fdd5bbd1e1 beter recipes - use the jumping cushion to build the trampoline
recipes have soft-dependency in recipe to farming and wool
2018-04-23 19:59:07 -07:00
dd985c9a80 use swap_node instead of add_node 2018-04-23 19:59:07 -07:00
5559e591a7 the trampoline 1 only is in creative inventory 2018-04-23 19:59:07 -07:00
c7223539f6 increade by punch, decrease by rightclick 2018-04-23 19:59:07 -07:00
ea83c64fee add infotext 2018-04-23 19:59:07 -07:00
7f4fd224a5 README.md updated
octatican (16b9e2f1ef)
2018-04-23 19:59:07 -07:00
15a953d3b2 Modernify this mod. 2018-04-21 00:21:55 -07:00
16 changed files with 139 additions and 78 deletions

View File

@ -1,7 +1,36 @@
Jumping
# Jumping
Jumping is a mod for minetest that adds trampolines, cushions, ...
Jumping is a mod for Minetest that adds trampolines of different power levels, and cushions! The trampolines allow you to jump higher, while the cushions let you fall farther and not take as much damage.
License: GPLv3
## Recipes
### Cushion
![Cushion Recipe](textures/.example/cushion_recipe.png)
Creator: Jeija
* ![Cotton](textures/.example/farming_cotton.png) - Cotton
* ![Wool (can be any colour)](textures/.example/wool.png) - Wool (can be any colour, as long as it is wool)
The wool can be any colour, however, different coloured cushions and trampolines will soon be added creating a use for the different colours of wool.
Two wool is required because you would probably want as much "cushioning" as possible in a cushion. The cotton is meant as an outline creating the cloth surrounding the wool.
### Trampoline
![Trampoline Recipe](textures/.example/trampoline_recipe.png)
* ![Steel Ingot](textures/.example/default_steel_ingot.png) - Steel Ingot
* ![Cushion](textures/.example/jumping_cushion.png) - Cushion
When coloured cushions are implemented, colour will become not only an indicator to show how bouncy the trampoline is, but also a decoration on the top. You can also look at the InfoText to find the value showing how bouncy said trampoline is. This is called the "bouncy level."
To change the bouncy level, simply left click (punch) any trampoline. This will increase the bouncy level by 1 until 6. Right click to decrease the bouncy level by 1, until 1.
The steel ingots are used for the legs, while the cushions are obviously acting as the canvas. In fact, when some type of canvas is added, it will be used instead for the trampoline recipe.
## Development Repositories
* **Jeija **: [Jeija/minetest-mod-jumping](http://github.com/Jeija/minetest-mod-jumping)
## License and Information
**License**: [GPLv3](http://www.gnu.org/licenses/gpl-3.0.en.html)
**Creator**: [Jeija](http://github.com/Jeija)

104
init.lua Normal file
View File

@ -0,0 +1,104 @@
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)
if id < "6" then
id = id + 1
minetest.swap_node(pos, {name = string.sub(node.name, 1, #node.name - 1)..id})
minetest.get_meta(pos):set_string("infotext", "Bouncy Level: "..id)
end
end
local power_decrease = function(pos, node)
local id = string.sub(node.name, #node.name)
if id > "1" then
id = id - 1
minetest.swap_node(pos, {name = string.sub(node.name, 1, #node.name - 1)..id})
minetest.get_meta(pos):set_string("infotext", "Bouncy Level: "..id)
end
end
local use_texture_alpha = minetest.features.use_texture_alpha_string_modes and "clip" or nil
for i = 1, 6 do
minetest.register_node("jumping:trampoline"..i, {
description = "Trampoline",
drawtype = "nodebox",
node_box = trampolinebox,
selection_box = trampolinebox,
paramtype = "light",
on_construct = function(pos)
minetest.get_meta(pos):set_string("infotext", "Bouncy Level: "..i)
end,
on_punch = trampoline_punch,
on_rightclick = power_decrease,
drop = "jumping:trampoline1",
use_texture_alpha = use_texture_alpha,
tiles = {
"jumping_trampoline_top.png",
"jumping_trampoline_bottom.png",
"jumping_trampoline_sides.png^jumping_trampoline_sides_overlay"..i..".png"
},
is_ground_content = false,
groups = {
dig_immediate = 2,
bouncy = 20 + i * 20,
fall_damage_add_percent = -70,
not_in_creative_inventory = ( i > 1 and 1 or nil),
},
})
end
minetest.register_node("jumping:cushion", {
description = "Cushion",
drawtype = "nodebox",
node_box = cushionbox,
selection_box = cushionbox,
paramtype = "light",
use_texture_alpha = use_texture_alpha,
tiles = {
"jumping_cushion_tb.png",
"jumping_cushion_tb.png",
"jumping_cushion_sides.png"
},
is_ground_content = false,
groups = {dig_immediate=2, disable_jump=1, fall_damage_add_percent=-100},
})
-- register recipes if the corresponding mods are present
if minetest.get_modpath("default") then
minetest.register_craft({
output = "jumping:trampoline1",
recipe = {
{"jumping:cushion", "jumping:cushion", "jumping:cushion"},
{"default:steel_ingot", "", "default:steel_ingot"}
}
})
end
if minetest.get_modpath("farming") and minetest.get_modpath("wool") then
minetest.register_craft({
output = "jumping:cushion",
recipe = {
{"farming:cotton", "group:wool", "farming:cotton"},
{"farming:cotton", "group:wool", "farming:cotton"},
{"farming:cotton", "farming:cotton", "farming:cotton"}
}
})
end

View File

@ -1,74 +0,0 @@
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"}
}
})

2
mod.conf Normal file
View File

@ -0,0 +1,2 @@
name = jumping
description = adds trampolines, cushions, ...

View File

View File

Before

Width:  |  Height:  |  Size: 284 B

After

Width:  |  Height:  |  Size: 284 B

View File

Before

Width:  |  Height:  |  Size: 618 B

After

Width:  |  Height:  |  Size: 618 B

View File

Before

Width:  |  Height:  |  Size: 451 B

After

Width:  |  Height:  |  Size: 451 B

View File

Before

Width:  |  Height:  |  Size: 216 B

After

Width:  |  Height:  |  Size: 216 B

View File

Before

Width:  |  Height:  |  Size: 185 B

After

Width:  |  Height:  |  Size: 185 B

View File

Before

Width:  |  Height:  |  Size: 188 B

After

Width:  |  Height:  |  Size: 188 B

View File

Before

Width:  |  Height:  |  Size: 178 B

After

Width:  |  Height:  |  Size: 178 B

View File

Before

Width:  |  Height:  |  Size: 180 B

After

Width:  |  Height:  |  Size: 180 B

View File

Before

Width:  |  Height:  |  Size: 176 B

After

Width:  |  Height:  |  Size: 176 B

View File

Before

Width:  |  Height:  |  Size: 171 B

After

Width:  |  Height:  |  Size: 171 B

View File

Before

Width:  |  Height:  |  Size: 539 B

After

Width:  |  Height:  |  Size: 539 B