Merge branch 'master' of https://github.com/MT-CTF/shooter
Conflicts: shooter_rocket/init.lua
This commit is contained in:
commit
4733f7e6c7
5 changed files with 9 additions and 9 deletions
|
@ -217,7 +217,7 @@ for _, color in pairs(dye_basecolors) do
|
|||
groups = {not_in_creative_inventory=1},
|
||||
on_use = function(itemstack, user)
|
||||
minetest.sound_play("shooter_click", {object=user})
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
if not minetest.settings:get_bool("creative_mode") then
|
||||
itemstack:add_wear(65535 / config.crossbow_uses)
|
||||
end
|
||||
itemstack = "shooter_crossbow:crossbow 1 "..itemstack:get_wear()
|
||||
|
@ -265,7 +265,7 @@ minetest.register_tool("shooter_crossbow:crossbow", {
|
|||
local color = string.match(stack:get_name(), "shooter_crossbow:arrow_(%a+)")
|
||||
if color then
|
||||
minetest.sound_play("shooter_reload", {object=user})
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
if not minetest.settings:get_bool("creative_mode") then
|
||||
inv:remove_item("main", "shooter_crossbow:arrow_"..color.." 1")
|
||||
end
|
||||
return "shooter_crossbow:crossbow_loaded_"..color.." 1 "..itemstack:get_wear()
|
||||
|
@ -273,7 +273,7 @@ minetest.register_tool("shooter_crossbow:crossbow", {
|
|||
for _, clr in pairs(dye_basecolors) do
|
||||
if inv:contains_item("main", "shooter_crossbow:arrow_"..clr) then
|
||||
minetest.sound_play("shooter_reload", {object=user})
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
if not minetest.settings:get_bool("creative_mode") then
|
||||
inv:remove_item("main", "shooter_crossbow:arrow_"..clr.." 1")
|
||||
end
|
||||
return "shooter_crossbow:crossbow_loaded_"..clr.." 1 "..itemstack:get_wear()
|
||||
|
|
|
@ -85,7 +85,7 @@ minetest.register_entity("shooter_flaregun:flare_entity", {
|
|||
if minetest.get_node(pos).name == "air" and
|
||||
node.name ~= "default:water_source" and
|
||||
node.name ~= "default:water_flowing" then
|
||||
minetest.place_node(pos, {name="shooter_flaregun:flare_light"})
|
||||
minetest.set_node(pos, {name="shooter_flaregun:flare_light"})
|
||||
local meta = minetest.get_meta(pos)
|
||||
pos.y = pos.y - 0.1
|
||||
local id = minetest.add_particlespawner({
|
||||
|
@ -135,7 +135,7 @@ minetest.register_tool("shooter_flaregun:flaregun", {
|
|||
minetest.sound_play("shooter_click", {object=user})
|
||||
return itemstack
|
||||
end
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
if not minetest.settings:get_bool("creative_mode") then
|
||||
inv:remove_item("main", "shooter:flare 1")
|
||||
itemstack:add_wear(65535 / 100)
|
||||
end
|
||||
|
|
|
@ -63,7 +63,7 @@ minetest.register_tool("shooter_grenade:grenade", {
|
|||
description = "Grenade",
|
||||
inventory_image = "shooter_hand_grenade.png",
|
||||
on_use = function(itemstack, user, pointed_thing)
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
if not minetest.settings:get_bool("creative_mode") then
|
||||
itemstack:clear()
|
||||
end
|
||||
if pointed_thing.type ~= "nothing" then
|
||||
|
|
|
@ -22,7 +22,7 @@ local function throw_hook(itemstack, user, vel)
|
|||
local dir = user:get_look_dir()
|
||||
local yaw = user:get_look_horizontal()
|
||||
if pos and dir and yaw then
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
if not minetest.settings:get_bool("creative_mode") then
|
||||
local before = itemstack:get_wear()
|
||||
itemstack:add_wear(65535 / 100)
|
||||
|
||||
|
|
|
@ -84,7 +84,7 @@ minetest.register_tool("shooter_rocket:rocket_gun_loaded", {
|
|||
value = "Your rocket has a cooldown!"
|
||||
})
|
||||
else
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
if not minetest.settings:get_bool("creative_mode") then
|
||||
itemstack:add_wear(65535 / 50)
|
||||
end
|
||||
itemstack = "shooter_rocket:rocket_gun 1 "..itemstack:get_wear()
|
||||
|
@ -131,7 +131,7 @@ minetest.register_tool("shooter_rocket:rocket_gun", {
|
|||
local inv = user:get_inventory()
|
||||
if inv:contains_item("main", "shooter_rocket:rocket") then
|
||||
minetest.sound_play("shooter_reload", {object=user})
|
||||
if not minetest.setting_getbool("creative_mode") then
|
||||
if not minetest.settings:get_bool("creative_mode") then
|
||||
inv:remove_item("main", "shooter_rocket:rocket 1")
|
||||
end
|
||||
itemstack = "shooter_rocket:rocket_gun_loaded 1 "..itemstack:get_wear()
|
||||
|
|
Loading…
Reference in a new issue