mirror of
https://github.com/appgurueu/deathlist.git
synced 2024-08-19 12:14:04 +02:00
rolling-3
This commit is contained in:
parent
b26d52e404
commit
5298d0df20
@ -5,7 +5,7 @@
|
|||||||
"hud_pos":{"x":0.75,"y":1},
|
"hud_pos":{"x":0.75,"y":1},
|
||||||
"hud_base_offset": {"x":0,"y":-122},
|
"hud_base_offset": {"x":0,"y":-122},
|
||||||
"enable_environmental": true,
|
"enable_environmental": true,
|
||||||
"enable_unknown": false,
|
"enable_unknown": true,
|
||||||
"enable_forbidden_playernames": true,
|
"enable_forbidden_playernames": true,
|
||||||
"environmental_reasons": {
|
"environmental_reasons": {
|
||||||
"falling":{
|
"falling":{
|
||||||
|
16
main.lua
16
main.lua
@ -1,9 +1,3 @@
|
|||||||
---
|
|
||||||
--- Generated by EmmyLua(https://github.com/EmmyLua)
|
|
||||||
--- Created by lars.
|
|
||||||
--- DateTime: 11.03.19 18:28
|
|
||||||
---
|
|
||||||
|
|
||||||
modlib.log.create_channel("deathlist") -- Create modlib.log channel
|
modlib.log.create_channel("deathlist") -- Create modlib.log channel
|
||||||
|
|
||||||
local coordinate={type="table",
|
local coordinate={type="table",
|
||||||
@ -29,10 +23,10 @@ local config=modlib.conf.import("deathlist",{
|
|||||||
mode={type="string", possible_values={list=true,stack=true}},
|
mode={type="string", possible_values={list=true,stack=true}},
|
||||||
autoremove_interval={func=function(interval)
|
autoremove_interval={func=function(interval)
|
||||||
if type(interval) ~= "number" and interval ~= false then
|
if type(interval) ~= "number" and interval ~= false then
|
||||||
return "Wrong type : Expected number or false, found "..type(interval)
|
return "Wrong type: Expected number or false, found "..type(interval)
|
||||||
end
|
end
|
||||||
if interval <= 0 then
|
if interval <= 0 then
|
||||||
return "Too small : Interval has to be > 0"
|
return "Too small: Interval has to be > 0"
|
||||||
end
|
end
|
||||||
end},
|
end},
|
||||||
hud_pos=coordinate,
|
hud_pos=coordinate,
|
||||||
@ -98,7 +92,7 @@ modlib.table.map(environmental_reasons.node_damage.nodes, function(v)
|
|||||||
return v
|
return v
|
||||||
end)
|
end)
|
||||||
|
|
||||||
hud_channels ={ killers={}, items={}, victims={}} -- in order to reduce overhead
|
hud_channels = {killers={}, items={}, victims={}} -- in order to reduce overhead
|
||||||
|
|
||||||
minetest.register_on_joinplayer(function(player)
|
minetest.register_on_joinplayer(function(player)
|
||||||
hud_channels.killers[player:get_player_name()]={}
|
hud_channels.killers[player:get_player_name()]={}
|
||||||
@ -126,7 +120,7 @@ function remove_last_kill_msg_from_hud(listname, x_offset)
|
|||||||
for j=2,i do
|
for j=2,i do
|
||||||
local new={x=hud_base_offset.x+x_offset,y=hud_base_offset.y-((j-2)*20)}
|
local new={x=hud_base_offset.x+x_offset,y=hud_base_offset.y-((j-2)*20)}
|
||||||
player:hud_change(hud_ids[j],"offset",new)
|
player:hud_change(hud_ids[j],"offset",new)
|
||||||
hud_ids[j-1]=hud_ids[j] --Perform index shift
|
hud_ids[j-1]=hud_ids[j] -- Perform index shift
|
||||||
end
|
end
|
||||||
hud_ids[i]=nil
|
hud_ids[i]=nil
|
||||||
end
|
end
|
||||||
@ -240,7 +234,7 @@ if enable_environmental then
|
|||||||
end
|
end
|
||||||
add_node_kill_message(killing_node, "node_damage", victim)
|
add_node_kill_message(killing_node, "node_damage", victim)
|
||||||
modlib.log.write("deathlist","Player "..victim.name.." died due to node damage of "..killing_node.name)
|
modlib.log.write("deathlist","Player "..victim.name.." died due to node damage of "..killing_node.name)
|
||||||
elseif reason.type~="punch" and enable_unknown then
|
elseif reason.type ~= "punch" and enable_unknown then
|
||||||
add_environmental_kill_message("unknown", victim)
|
add_environmental_kill_message("unknown", victim)
|
||||||
modlib.log.write("deathlist","Player "..victim.name.." died for unknown reasons.")
|
modlib.log.write("deathlist","Player "..victim.name.." died for unknown reasons.")
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user