Inmplemented the sentences. Full powered, baby!

This commit is contained in:
Alexander Yakovlev 2011-11-17 15:26:23 +07:00
parent 3d8193c92a
commit 561738742a
2 changed files with 65 additions and 4 deletions

View file

@ -1,5 +1,18 @@
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 = '',
@ -20,6 +33,22 @@ word_simple = function(word)
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("Проверено: цензор ███████████^^"))

View file

@ -7,16 +7,48 @@ dofile 'engine.lua'
main = room{
nam = 'Почтовый ящик 107. Ул. Елизарова, 76 -- г. Новосибирск, Красный проспект, 23-12',
--_enabled = 0,
--_words = 0,
dsc = "",
obj = {
word_simple('Дорогая'), space, word_simple('мамочка!'), newline,
word_simple('Пишет'), space, word_simple('тебе'), space, word_simple('твой'), space, word_simple('любимый'), space, word_simple('сын'), space, word_simple('Степан.'), newline,
word_simple('Я'), space, word_simple('живу'), space, word_simple('хорошо.'), newline,
sentence(word_simple('Дорогая'), word_simple('мамочка'), 'exclamation'), newline,
sentence(word_simple('Пишет'), word_simple('тебе'), word_simple('твой'), word_simple('любимый'), word_simple('сын'), word_simple('Степан'), 'dot'), newline,
sentence(word_simple('Я'), word_simple('живу'), word_simple('хорошо'), 'dot'), newline,
signed, 'sign_main'
}
};
sign_main = obj{
nam = 'send',
dsc = txtc(txtu('{ОТПРАВИТЬ}')),
act = true
act = function()
return goto('maximov_1');
end,
}
maximov_1 = room{
nam = 'Почтовый ящик 107. -- г. Красноярск, ул. Третьего Призрака 13-2',
dsc = "",
obj = {
sentence(word_simple('Уважаемый'), word_simple('господин'), word_simple('Цветников'), 'exclamation'), newline,
word_simple('Ситуация'), space, word_simple('с'), space, word_simple('Сибирским'), space, word_simple('музеем'), space, word_simple('действительно'), space, word_simple('серьёзна.'), newline,
word_simple('После'), space, word_simple('ошибки'), space, word_simple('в'), space, word_simple('приобретении'), space, word_simple('экспонатов'), space, word_simple('на'), space, word_simple('Московской'), space, word_simple('выставке'),
space, word_simple('наши'), space, word_simple('друзья'), space, word_simple('из'), space, word_simple('города'), space, word_simple('Кирова'), space, word_simple('обратились'), space, word_simple('к'), space, word_simple('другим'), space, word_simple('музейным'), space, word_simple('работникам.'),newline,
word_simple('Если'), space, word_simple('вам'), space, word_simple('так'), space, word_simple('будет'), space, word_simple('угодно'), space, word_simple('посмотреть'), space, word_simple('на'), space, word_simple('фрески'), space, word_simple('Владимирской'),
space, word_simple('центральной'), space, word_simple('коллекции,'),space, word_simple('я'), space, word_simple('не'), space, word_simple('буду'), space, word_simple('вас'), space, word_simple('останавливать.'), space, word_simple('Пожалуйста,'),
space, word_simple('продолжайте'),space, word_simple('общение'), space, word_simple('с'), space, word_simple('частными'), space, word_simple('коллекциями.'),newline,
space, word_simple('Почему'), space, word_simple('до'), space, word_simple('сих'), space, word_simple('пор'), space, word_simple('нет'), space, word_simple('известий'), space, word_simple('от'), space, word_simple('Мурманского'), space, word_simple('филиала?'),
space, word_simple('Наша'), space, word_simple('маленькая'), space, word_simple('экспедиционная'), space, word_simple('группа'), space, word_simple('давно'), space, word_simple('должна'), space, word_simple('была'), space, word_simple('вернуться'), space, word_simple('с'),space, word_simple('новостями'), space, word_simple('от'), space, word_simple('эскимосов.'), space, word_simple('Я'), space, word_simple('жду'), space, word_simple('сувениров'), space, word_simple('уже'), space, word_simple('два'),
space, word_simple('месяца.'),newline,
space, word_simple('Неужели'), space, word_simple('музейное'), space, word_simple('дело'), space,dash,space, word_simple('такое'),space, word_simple('сложное'), space, word_simple('занятие?'), space, word_simple('Не'), space, word_simple('вынуждайте'),
space, word_simple('меня'), space, word_simple('прибегать'), space, word_simple('к'), space, word_simple('строгим'), space, word_simple('мерам.'), space, word_simple('Будьте'), space, word_simple('уверены:'), space, word_simple('для'),
space, word_simple('вас'), space, word_simple('и'), space, word_simple('всей'), space, word_simple('вашей'), space, word_simple('коллегии'), space, word_simple('это'), space, word_simple('ничем'), space, word_simple('хорошим'), space, word_simple('не'),
space, word_simple('закончится.'), newline, vobj("", txtr('Максим В.')),newline,
signed, 'sign_maximov_1'
}
};
sign_maximov_1 = obj{
nam = 'send',
dsc = txtc(txtu('{ОТПРАВИТЬ}')),
act = function()
return true;
end,
}