Add rocket crafting

This commit is contained in:
rubenwardy 2020-03-14 22:48:50 +00:00
parent 43b4b761cc
commit 59d199a7a5
5 changed files with 29 additions and 2 deletions

View file

@ -119,6 +119,11 @@ function ctf_classes.update(player)
physics.set(player:get_player_name(), "ctf_classes:speed", {
speed = speed,
})
crafting.lock_all(player:get_player_name())
for i=1, #(class.properties.crafting or {}) do
crafting.unlock(player:get_player_name(), class.properties.crafting[i])
end
end
local function sqdist(a, b)

View file

@ -96,5 +96,9 @@ ctf_classes.register("rocketeer", {
"shooter_guns:smg",
"shooter_guns:shotgun",
},
crafting = {
"shooter_rocket:rocket"
},
},
})

View file

@ -1,3 +1,3 @@
name = ctf_classes
depends = ctf, ctf_flag, ctf_colors, ctf_map_core, ctf_bandages, physics, shooter, hpregen, give_initial_stuff, dropondie
depends = ctf, ctf_flag, ctf_colors, ctf_map_core, ctf_bandages, physics, shooter, hpregen, give_initial_stuff, dropondie, crafting
description = Adds classes, including knight, shooter, and medic

View file

@ -11,6 +11,24 @@ local upgrades = {
mese = "diamond",
}
-- Rocket <== Gold ingot x16 + Coal lump x5
crafting.register_recipe({
type = "inv",
output = "shooter_rocket:rocket",
items = { "default:gold_ingot 16", "default:coal_lump 5" },
always_known = false,
level = 1,
})
-- Rocket <== Mese x5 + Coal lump x5
crafting.register_recipe({
type = "inv",
output = "shooter_rocket:rocket",
items = { "default:mese 5", "default:coal_lump 5" },
always_known = false,
level = 1,
})
-- Swords
for from, to in pairs(upgrades) do
crafting.register_recipe({

@ -1 +1 @@
Subproject commit c6cd6ad62d9f4076a22d985defc8a966a17f569d
Subproject commit 60723159bba3893e9750177b2d6a6f09e077bd72