Merge pull request 'Add Firework Rocket for elytra boost' (#1551) from NO11/MineClone2:elytra_rocket into master
Reviewed-on: https://git.minetest.land/MineClone2/MineClone2/pulls/1551
This commit is contained in:
commit
a93562a60c
7
mods/ITEMS/mcl_fireworks/README.txt
Normal file
7
mods/ITEMS/mcl_fireworks/README.txt
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
Firework mod for Mineclone 2
|
||||||
|
|
||||||
|
by NO11 and and some parts by j45
|
||||||
|
|
||||||
|
Sound credits:
|
||||||
|
|
||||||
|
* mcl_firework_rocket.ogg (tnt_ignite.ogg): Own derivate work of sound by Ned Bouhalassa (CC0) created in 2005, source: <https://freesound.org/people/Ned Bouhalassa/sounds/8320/>
|
2
mods/ITEMS/mcl_fireworks/config.txt
Normal file
2
mods/ITEMS/mcl_fireworks/config.txt
Normal file
|
@ -0,0 +1,2 @@
|
||||||
|
name = mcl_firework
|
||||||
|
author = NO11, j45
|
17
mods/ITEMS/mcl_fireworks/crafting.lua
Normal file
17
mods/ITEMS/mcl_fireworks/crafting.lua
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
minetest.register_craft({
|
||||||
|
type = "shapeless",
|
||||||
|
output = "mcl_fireworks:rocket_1 3",
|
||||||
|
recipe = {"mcl_core:paper", "mcl_mobitems:gunpowder"},
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
type = "shapeless",
|
||||||
|
output = "mcl_fireworks:rocket_2 3",
|
||||||
|
recipe = {"mcl_core:paper", "mcl_mobitems:gunpowder", "mcl_mobitems:gunpowder"},
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craft({
|
||||||
|
type = "shapeless",
|
||||||
|
output = "mcl_fireworks:rocket_3 3",
|
||||||
|
recipe = {"mcl_core:paper", "mcl_mobitems:gunpowder", "mcl_mobitems:gunpowder", "mcl_mobitems:gunpowder"},
|
||||||
|
})
|
4
mods/ITEMS/mcl_fireworks/init.lua
Normal file
4
mods/ITEMS/mcl_fireworks/init.lua
Normal file
|
@ -0,0 +1,4 @@
|
||||||
|
local path = minetest.get_modpath("mcl_fireworks")
|
||||||
|
|
||||||
|
dofile(path .. "/register.lua")
|
||||||
|
dofile(path .. "/crafting.lua")
|
3
mods/ITEMS/mcl_fireworks/locale/mcl_fireworks.de.tr
Normal file
3
mods/ITEMS/mcl_fireworks/locale/mcl_fireworks.de.tr
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
# textdomain: mcl_fireworks
|
||||||
|
Firework Rocket=Feuerwerksrakete
|
||||||
|
Flight Duration:=Flugdauer:
|
55
mods/ITEMS/mcl_fireworks/register.lua
Normal file
55
mods/ITEMS/mcl_fireworks/register.lua
Normal file
|
@ -0,0 +1,55 @@
|
||||||
|
local S = minetest.get_translator("mcl_fireworks")
|
||||||
|
|
||||||
|
local help = S("Flight Duration:")
|
||||||
|
local description = S("Firework Rocket")
|
||||||
|
local rocket_sound = function()
|
||||||
|
minetest.sound_play("mcl_fireworks_rocket")
|
||||||
|
end
|
||||||
|
|
||||||
|
minetest.register_craftitem("mcl_fireworks:rocket_1", {
|
||||||
|
description = description,
|
||||||
|
_tt_help = help.." 1",
|
||||||
|
inventory_image = "mcl_fireworks_rocket.png",
|
||||||
|
stack_max = 64,
|
||||||
|
on_use = function(itemstack, user, pointed_thing)
|
||||||
|
itemstack:take_item()
|
||||||
|
local torso = user:get_inventory():get_stack("armor", 3)
|
||||||
|
if torso and torso:get_name() == "mcl_armor:elytra" then
|
||||||
|
user:add_player_velocity(vector.multiply(user:get_look_dir(), 20))
|
||||||
|
rocket_sound()
|
||||||
|
end
|
||||||
|
return itemstack
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craftitem("mcl_fireworks:rocket_2", {
|
||||||
|
description = description,
|
||||||
|
_tt_help = help.." 2",
|
||||||
|
inventory_image = "mcl_fireworks_rocket.png",
|
||||||
|
stack_max = 64,
|
||||||
|
on_use = function(itemstack, user, pointed_thing)
|
||||||
|
itemstack:take_item()
|
||||||
|
local torso = user:get_inventory():get_stack("armor", 3)
|
||||||
|
if torso and torso:get_name() == "mcl_armor:elytra" then
|
||||||
|
user:add_player_velocity(vector.multiply(user:get_look_dir(), 30))
|
||||||
|
rocket_sound()
|
||||||
|
end
|
||||||
|
return itemstack
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
||||||
|
minetest.register_craftitem("mcl_fireworks:rocket_3", {
|
||||||
|
description = description,
|
||||||
|
_tt_help = help.." 3",
|
||||||
|
inventory_image = "mcl_fireworks_rocket.png",
|
||||||
|
stack_max = 64,
|
||||||
|
on_use = function(itemstack, user, pointed_thing, player)
|
||||||
|
itemstack:take_item()
|
||||||
|
local torso = user:get_inventory():get_stack("armor", 3)
|
||||||
|
if torso and torso:get_name() == "mcl_armor:elytra" then
|
||||||
|
user:add_player_velocity(vector.multiply(user:get_look_dir(), 40))
|
||||||
|
rocket_sound()
|
||||||
|
end
|
||||||
|
return itemstack
|
||||||
|
end,
|
||||||
|
})
|
BIN
mods/ITEMS/mcl_fireworks/sounds/mcl_fireworks_rocket.ogg
Normal file
BIN
mods/ITEMS/mcl_fireworks/sounds/mcl_fireworks_rocket.ogg
Normal file
Binary file not shown.
BIN
mods/ITEMS/mcl_fireworks/textures/mcl_fireworks_rocket.png
Normal file
BIN
mods/ITEMS/mcl_fireworks/textures/mcl_fireworks_rocket.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 356 B |
Loading…
Reference in New Issue
Block a user