Compare commits

...

3 commits

Author SHA1 Message Date
philipmi
4733f7e6c7 Merge branch 'master' of https://github.com/MT-CTF/shooter
 Conflicts:
	shooter_rocket/init.lua
2021-07-21 22:13:52 +02:00
ksandr
d4a450cd5b
Update minetest.setting_getbool to minetest.settings:get_bool (#6) 2021-07-12 07:24:30 -07:00
ksandr
ee6aacbb51
Fix Flaregun (#5) 2021-07-12 07:13:08 -07:00
5 changed files with 9 additions and 9 deletions

View file

@ -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()

View file

@ -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

View file

@ -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

View file

@ -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)

View file

@ -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()