mirror of
https://github.com/APercy/airutils.git
synced 2025-03-23 03:12:20 +00:00
added option to disable blast damage
This commit is contained in:
parent
beddd07827
commit
cc10bd1fef
2 changed files with 28 additions and 1 deletions
24
init.lua
24
init.lua
|
@ -1,5 +1,7 @@
|
||||||
-- Minetest 5.4.1 : airutils
|
-- Minetest 5.4.1 : airutils
|
||||||
|
|
||||||
|
local storage = minetest.get_mod_storage()
|
||||||
|
|
||||||
airutils = {}
|
airutils = {}
|
||||||
|
|
||||||
airutils.colors ={
|
airutils.colors ={
|
||||||
|
@ -20,6 +22,11 @@ airutils.colors ={
|
||||||
yellow='#ffe400',
|
yellow='#ffe400',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
local load_blast_damage = storage:get_int("blast_damage")
|
||||||
|
airutils.blast_damage = true
|
||||||
|
-- 1 == true ---- 2 == false
|
||||||
|
if load_blast_damage == 2 then airutils.blast_damage = false end
|
||||||
|
|
||||||
airutils.is_minetest = minetest.get_modpath("player_api")
|
airutils.is_minetest = minetest.get_modpath("player_api")
|
||||||
airutils.is_mcl = minetest.get_modpath("mcl_player")
|
airutils.is_mcl = minetest.get_modpath("mcl_player")
|
||||||
|
|
||||||
|
@ -449,3 +456,20 @@ end
|
||||||
function airutils.normalize_rotations(rotations)
|
function airutils.normalize_rotations(rotations)
|
||||||
return {x = get_norm_angle(rotations.x), y = get_norm_angle(rotations.y), z = get_norm_angle(rotations.z)}
|
return {x = get_norm_angle(rotations.x), y = get_norm_angle(rotations.y), z = get_norm_angle(rotations.z)}
|
||||||
end
|
end
|
||||||
|
|
||||||
|
minetest.register_chatcommand("enable_blast_damage", {
|
||||||
|
func = function(name, param)
|
||||||
|
local command = param
|
||||||
|
|
||||||
|
if command == "false" then
|
||||||
|
airutils.blast_damage = false
|
||||||
|
minetest.chat_send_player(name, ">>> Blast damage by explosion is disabled")
|
||||||
|
else
|
||||||
|
airutils.blast_damage = true
|
||||||
|
minetest.chat_send_player(name, ">>> Blast damage by explosion is enabled")
|
||||||
|
end
|
||||||
|
local save = 2
|
||||||
|
if airutils.blast_damage == true then save = 1 end
|
||||||
|
storage:set_int("blast_damage", save)
|
||||||
|
end,
|
||||||
|
})
|
||||||
|
|
|
@ -283,7 +283,9 @@ function airutils.destroy(self, by_name)
|
||||||
airutils.destroy_inventory(self)
|
airutils.destroy_inventory(self)
|
||||||
self.object:remove()
|
self.object:remove()
|
||||||
|
|
||||||
airutils.add_blast_damage(pos, 5 + 4, 10)
|
if airutils.blast_damage == true and with_fire == true then
|
||||||
|
airutils.add_blast_damage(pos, 7, 10)
|
||||||
|
end
|
||||||
|
|
||||||
--[[pos.y=pos.y+2
|
--[[pos.y=pos.y+2
|
||||||
minetest.add_item({x=pos.x+math.random()-0.5,y=pos.y,z=pos.z+math.random()-0.5},'hidroplane:wings')
|
minetest.add_item({x=pos.x+math.random()-0.5,y=pos.y,z=pos.z+math.random()-0.5},'hidroplane:wings')
|
||||||
|
@ -1010,3 +1012,4 @@ function airutils.get_adf_angle(self, pos)
|
||||||
return adf
|
return adf
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue