"more boxes" perk.

Obtained at 3 accepted boxes.

Grants 5 boxes as build max, up from 3.
This commit is contained in:
Auke Kok 2019-12-05 22:20:54 -08:00
parent 6a311f930b
commit b38334d484

View File

@ -433,6 +433,28 @@ local function grant_perks(box_id, boxes)
})
end
end
if accepted >= 3 then
local limit = tonumber(builder:get_attribute("box_create_limit") or "3")
if limit <= 3 then
minetest.log("perks: granted more boxes to " .. builder)
announce.all(builder .. " has been granted the more boxes perk!")
telex.send({
to = builder,
from = "sofar",
subject = "Congratulations! You've been awarded a perk!",
content = {
"Dear player,",
" ",
"We really appreciate the hard work you put in building boxes.",
" ",
"As a thank you, you have been granted the \"more boxes\" perk!",
" ",
"--sofar"
}
})
builder:set_attribute("box_create_limit", "5")
end
end
if accepted >= 5 then
local privs = minetest.get_player_privs(builder)
if not privs.sprint then