Removed fall damage

master
Giov4 2020-09-20 22:10:31 +02:00
parent 42e6ef560b
commit 4de9f2358f
5 changed files with 41 additions and 10 deletions

View File

@ -22,7 +22,7 @@ skywars_settings.loading_time = 10
skywars_settings.queue_waiting_time = 10
-- The time between the end of the match and the respawn at the hub.
skywars_settings.celebration_time = 3
skywars_settings.celebration_time = 5
-- What's going to appear in most of the lines printed by murder.
skywars_settings.prefix = "Skywars > "
@ -33,6 +33,9 @@ skywars_settings.player_speed = 1
-- The match duration in seconds
skywars_settings.timer = 600
-- true = on/false = off (case sensitive)
skywars_settings.fall_damage_disabled = true

View File

@ -22,16 +22,15 @@ local function treasure_to_itemstack(treasure)
itemstack.name = treasure.name
itemstack.count = determine_count(treasure)
if ItemStack(itemstack):is_known() == false then
minetest.log("error","[Skywars Treasures] I was asked to put "..treasure.name.." inside a chest, but it doesn't exist.")
end
return ItemStack(itemstack)
end
function skywars.select_random_treasures(treasure_amount, min_preciousness, max_preciousness, arena)
if #arena.treasures == 0 and treasure_amount >= 1 then
minetest.log("info","[treasurer] I was asked to return "..treasure_amount.." treasure(s) but I cant return any because no treasure was registered to me.")
return {}
end
if treasure_amount == nil or treasure_amount == 0 then treasure_amount = 1 end
-- sorting the table from the rarest to the least rare treasure

View File

@ -1,13 +1,36 @@
--[[local function override_formspec(formspec, original)
local orig_get = sfinv.pages[original].get
sfinv.override_page("sfinv:crafting", {
get = function(self, player, context)
local fs = orig_get(self, player, context)
fs = fs:gsub("list[current_player;craft;1%.75%,0%.5;3%,3;]", "list[current_player;craft;1.25,0.5;3,3;]")
fs = fs:gsub("list[current_player;craftpreview;5%.75,1%.5;1%,1;]", "list[current_player;craftpreview;5.25,1.5;1,1;]")
fs = fs:gsub("image[1,5%.2;1%,1;gui_hb_bg%.png]", "image[0.5,5.2;1,1;gui_hb_bg.png]")
fs = fs:gsub("list[current_player;craftpreview;5%.75,1%.5;1%,1;]", "list[current_player;craftpreview;5.25,1.5;1,1;]")
fs = fs:gsub("list[current_player;craftpreview;5%.75,1%.5;1%,1;]", "list[current_player;craftpreview;5.25,1.5;1,1;]")
return fs
end
})
end]]
function skywars.activate_hotbar(player)
local meta = player:get_meta()
--local formspec = ""
--meta:set_string("original_formspec", sfinv.pages[original].get)
meta:set_string("hotbar", player:hud_get_hotbar_image())
meta:set_int("itemcount", player:hud_get_hotbar_itemcount())
meta:set_string("hotbar_selected", player:hud_get_hotbar_selected_image())
player:hud_set_hotbar_itemcount(10)
player:hud_set_hotbar_image("hotbar.png")
player:hud_set_hotbar_selected_image("hotbar_selected.png")
--override_formspec(formspec, original)
end
@ -18,4 +41,4 @@ function skywars.deactivate_hotbar(player)
player:hud_set_hotbar_itemcount(meta:get_int("itemcount"))
player:hud_set_hotbar_image(meta:get_string("hotbar"))
player:hud_set_hotbar_selected_image(meta:get_string("hotbar_selected"))
end
end

View File

@ -1,8 +1,8 @@
function skywars.generate_HUD(arena, pl_name)
local player = minetest.get_player_by_name(pl_name)
local players_
local players_count_
local players_killed_
local background_players_
local background_players_counter_
local background_kill_counter_
local x_pos = 0.45
local y_pos = 0

View File

@ -3,6 +3,11 @@ dofile(minetest.get_modpath("skywars") .. "/SETTINGS.lua")
skywars = {}
skywars.T = minetest.get_translator("skywars")
local disabled_damage_types_ = {}
if skywars_settings.fall_damage_disabled then
disabled_damage_types_ = {"fall"}
end
arena_lib.register_minigame("skywars", {
prefix = skywars_settings.prefix,
hub_spawn_point = skywars_settings.hub_spawn_point,
@ -27,7 +32,8 @@ arena_lib.register_minigame("skywars", {
player_properties = {
speed = skywars_settings.player_speed
},
timer = skywars_settings.timer
timer = skywars_settings.timer,
disabled_damage_types = disabled_damage_types_
})