censored/engine.lua

54 lines
1.1 KiB
Lua

function room_scene(self) return true; end
function par(space,...)
local i, res
local a = {...};
for i = 1, stead.table.maxn(a) do
if type(a[i]) == 'string' then
if res == nil then res = "" end
res = res..a[i];
end
end
return res;
end
stead.par = par
word_simple = function(word)
return obj{
nam = '',
_word = word,
_enabled = true,
dsc = function(this)
value = ""
if (this._enabled == true) then
value = this._word
else
value = string.rep("",string.len(this._word)/2)
end
return "{".. value .."}"
end,
act = function(this)
this._enabled = not this._enabled
return true
end
}
end
sentence = function(...)
value = obj{
nam = '',
dsc = '',
obj = {}
}
for i,v in ipairs(arg) do
if (i > 1 and v ~= 'comma' and v ~= 'dot' and v ~= 'exclamation' and v ~= 'space') then table.insert(value.obj,'space') end
table.insert(value.obj,v)
end
return value
end
newline = vobj("^^", "^^")
space = vobj(" ", " ")
dash = vobj("--", "--")
comma = vobj(",", ",")
dot = vobj(".", ".")
exclamation = vobj("!", "!")
signed = vobj(" ", txtr("Проверено: цензор ███████████^^"))