2017-03-30 06:16:18 +03:00
|
|
|
|
global "char" ({})
|
2017-02-26 11:45:05 +02:00
|
|
|
|
init = function ()
|
2017-03-06 08:39:18 +02:00
|
|
|
|
std.dlg.noinv = true
|
2017-04-06 14:47:16 +03:00
|
|
|
|
std.phrase_show = false
|
2017-04-03 20:28:37 +03:00
|
|
|
|
game.player = std.menu_player {
|
|
|
|
|
nam = 'player'
|
|
|
|
|
}
|
2017-03-07 13:11:34 +02:00
|
|
|
|
game.talk = 'Вы не знаете, что спросить.'
|
2017-03-07 14:20:05 +02:00
|
|
|
|
game.take = function()
|
|
|
|
|
pn('КАК?!')
|
|
|
|
|
return false
|
|
|
|
|
end
|
2017-03-06 07:31:09 +02:00
|
|
|
|
char.quests = {}
|
2017-03-15 12:31:30 +02:00
|
|
|
|
char.wounds = 0
|
|
|
|
|
char.actions = 50
|
|
|
|
|
char.reputation = 50
|
2017-03-17 11:21:26 +02:00
|
|
|
|
char.can_leave = false
|
2017-03-20 14:32:21 +02:00
|
|
|
|
char.quests.chos = 0
|
2017-03-15 12:31:30 +02:00
|
|
|
|
place(menu {
|
|
|
|
|
nam = "Персонаж",
|
|
|
|
|
menu = function()
|
|
|
|
|
walk('character')
|
|
|
|
|
end
|
|
|
|
|
}, me())
|
2017-03-07 08:51:27 +02:00
|
|
|
|
place(menu {
|
2017-02-26 11:45:05 +02:00
|
|
|
|
nam = "Карта",
|
2017-03-05 19:37:27 +02:00
|
|
|
|
menu = function()
|
2017-02-26 11:45:05 +02:00
|
|
|
|
walk('map')
|
|
|
|
|
end
|
2017-03-07 08:51:27 +02:00
|
|
|
|
}, me())
|
|
|
|
|
place(menu {
|
2017-02-26 11:45:05 +02:00
|
|
|
|
nam = "Квесты",
|
2017-03-05 19:37:27 +02:00
|
|
|
|
menu = function()
|
2017-02-26 11:45:05 +02:00
|
|
|
|
walk('quests')
|
|
|
|
|
end
|
2017-03-07 08:51:27 +02:00
|
|
|
|
}, me())
|
|
|
|
|
place(menu {
|
2017-03-31 12:42:37 +03:00
|
|
|
|
nam = 'телефон',
|
|
|
|
|
disp = function()
|
|
|
|
|
if char.call ~= nil then
|
|
|
|
|
return fmt.b("Телефон")
|
|
|
|
|
end
|
|
|
|
|
return "Телефон"
|
|
|
|
|
end,
|
2017-03-05 19:37:27 +02:00
|
|
|
|
menu = function()
|
2017-02-26 11:45:05 +02:00
|
|
|
|
walk('inventory')
|
|
|
|
|
end
|
2017-03-07 08:51:27 +02:00
|
|
|
|
}, me())
|
2017-03-15 16:28:15 +02:00
|
|
|
|
place(menu {
|
|
|
|
|
nam = "end-game",
|
2017-03-17 11:21:26 +02:00
|
|
|
|
disp = function()
|
|
|
|
|
if char.can_leave then
|
|
|
|
|
return fmt.b("Уехать")
|
|
|
|
|
end
|
|
|
|
|
return false
|
|
|
|
|
end,
|
2017-03-15 16:28:15 +02:00
|
|
|
|
menu = function()
|
|
|
|
|
walk('ending')
|
|
|
|
|
end
|
2017-03-17 11:21:26 +02:00
|
|
|
|
}, me())
|
2017-02-26 11:45:05 +02:00
|
|
|
|
char.act = nil
|
2017-03-30 11:54:47 +03:00
|
|
|
|
if not isduel then
|
|
|
|
|
place( proxy_menu {
|
|
|
|
|
disp = function()
|
|
|
|
|
if stead.table.maxn(here().obj) > 0 then
|
|
|
|
|
return 'ОСМОТРЕТЬ';
|
|
|
|
|
end
|
|
|
|
|
return false
|
|
|
|
|
end;
|
|
|
|
|
acts = { inv = 'act' };
|
|
|
|
|
sources = { scene = true, inv = false }; -- осмотр инвентаря вынесен отдельно
|
|
|
|
|
}, me())
|
2017-03-09 13:14:16 +02:00
|
|
|
|
--[[
|
2017-03-05 19:34:59 +02:00
|
|
|
|
place( proxy_menu {
|
|
|
|
|
disp = 'ВЗЯТЬ';
|
|
|
|
|
acts = { inv = 'take' };
|
|
|
|
|
sources = { scene = true, inv = false };
|
|
|
|
|
}, me())
|
|
|
|
|
place( proxy_menu {
|
|
|
|
|
disp = 'ВЫБРОСИТЬ';
|
|
|
|
|
acts = { inv = 'drop' };
|
|
|
|
|
sources = { scene = false, inv = true };
|
|
|
|
|
}, me())
|
|
|
|
|
place( proxy_menu {
|
|
|
|
|
disp = 'ОТКРЫТЬ';
|
|
|
|
|
acts = { inv = 'open' };
|
|
|
|
|
sources = { scene = false, inv = true };
|
|
|
|
|
}, me())
|
|
|
|
|
place( proxy_menu {
|
|
|
|
|
disp = 'ЗАКРЫТЬ';
|
|
|
|
|
acts = { inv = 'close' };
|
|
|
|
|
sources = { scene = false, inv = true };
|
|
|
|
|
}, me())
|
2017-03-09 13:14:16 +02:00
|
|
|
|
]]
|
2017-03-30 11:54:47 +03:00
|
|
|
|
place( proxy_menu {
|
|
|
|
|
disp = function()
|
|
|
|
|
if stead.table.maxn( here().obj ) > 0 then
|
|
|
|
|
return 'ГОВОРИТЬ С';
|
|
|
|
|
end
|
|
|
|
|
return false
|
|
|
|
|
end;
|
|
|
|
|
acts = { inv = 'talk' };
|
|
|
|
|
sources = { scene = true, inv = false };
|
|
|
|
|
}, me())
|
|
|
|
|
end
|
2017-02-26 11:45:05 +02:00
|
|
|
|
end
|
2017-03-05 08:13:15 +02:00
|
|
|
|
game.after_take = function(s, w)
|
|
|
|
|
take(w)
|
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
game.after_drop = function(s, w)
|
|
|
|
|
drop(w)
|
|
|
|
|
end
|
|
|
|
|
game.exam = 'Ничего необычного.'
|
2017-02-26 11:45:05 +02:00
|
|
|
|
|
2017-02-20 18:40:12 +02:00
|
|
|
|
engineer = function()
|
2017-03-02 19:37:19 +02:00
|
|
|
|
if char.plural == true then
|
2017-02-20 18:40:12 +02:00
|
|
|
|
return 'инженеры'
|
|
|
|
|
end
|
|
|
|
|
return 'инженер'
|
|
|
|
|
end
|
2017-03-02 19:37:19 +02:00
|
|
|
|
that = function()
|
|
|
|
|
if char.plural == true then
|
|
|
|
|
return 'те'
|
|
|
|
|
end
|
|
|
|
|
return 'тот'
|
|
|
|
|
end
|
2017-02-20 18:40:12 +02:00
|
|
|
|
pronoun_3 = function()
|
2017-02-21 16:16:48 +02:00
|
|
|
|
if char.gender == 'she' then
|
2017-02-20 18:40:12 +02:00
|
|
|
|
return 'она'
|
|
|
|
|
end
|
2017-02-21 16:16:48 +02:00
|
|
|
|
if char.gender == 'he' then
|
2017-02-20 18:40:12 +02:00
|
|
|
|
return 'он'
|
|
|
|
|
end
|
2017-02-21 16:16:48 +02:00
|
|
|
|
if char.gender == 'it' then
|
2017-02-20 18:40:12 +02:00
|
|
|
|
return 'оно'
|
|
|
|
|
end
|
|
|
|
|
return 'они'
|
|
|
|
|
end
|
|
|
|
|
pronoun_1 = function()
|
2017-03-02 19:37:19 +02:00
|
|
|
|
if char.plural == true then
|
2017-02-20 18:40:12 +02:00
|
|
|
|
return 'мы'
|
|
|
|
|
end
|
|
|
|
|
return 'я'
|
|
|
|
|
end
|
2017-03-20 14:32:21 +02:00
|
|
|
|
pronoun_2 = function()
|
|
|
|
|
if char.plural == true then
|
|
|
|
|
return 'вы'
|
|
|
|
|
end
|
|
|
|
|
return 'ты'
|
|
|
|
|
end
|
2017-02-20 18:40:12 +02:00
|
|
|
|
endings = function()
|
2017-03-02 19:37:19 +02:00
|
|
|
|
if char.plural == true then
|
2017-02-20 18:40:12 +02:00
|
|
|
|
return 'и'
|
|
|
|
|
end
|
2017-02-21 16:16:48 +02:00
|
|
|
|
if char.gender == 'she' then
|
2017-02-20 18:40:12 +02:00
|
|
|
|
return 'а'
|
|
|
|
|
end
|
2017-02-20 18:49:39 +02:00
|
|
|
|
return ''
|
2017-02-20 18:40:12 +02:00
|
|
|
|
end
|
2017-03-06 08:39:18 +02:00
|
|
|
|
plural = function(a, b)
|
|
|
|
|
if char.plural == true then
|
|
|
|
|
return b
|
|
|
|
|
end
|
|
|
|
|
return a
|
|
|
|
|
end
|
2017-02-20 18:40:12 +02:00
|
|
|
|
rndstr = function(strings)
|
|
|
|
|
return strings[rnd(stead.table.maxn(strings))];
|
|
|
|
|
end
|
2017-02-26 13:24:21 +02:00
|
|
|
|
rndalt = function(yes, no)
|
|
|
|
|
if rnd(2) == 1 then
|
|
|
|
|
return yes
|
|
|
|
|
end
|
|
|
|
|
return no
|
|
|
|
|
end
|
2017-03-15 12:31:30 +02:00
|
|
|
|
gendered = function(he, she, it, they)
|
|
|
|
|
if char.gender == 'she' then
|
|
|
|
|
return she
|
|
|
|
|
end
|
|
|
|
|
if char.gender == 'he' then
|
|
|
|
|
return he
|
|
|
|
|
end
|
|
|
|
|
if char.gender == 'they' then
|
|
|
|
|
return they
|
|
|
|
|
end
|
|
|
|
|
return it
|
|
|
|
|
end
|
2017-03-25 07:32:14 +02:00
|
|
|
|
wrong_gendered = function(he, she)
|
|
|
|
|
if char.gender == 'she' then
|
|
|
|
|
return he
|
|
|
|
|
end
|
|
|
|
|
return she
|
|
|
|
|
end
|
2017-03-07 08:51:27 +02:00
|
|
|
|
official = function()
|
|
|
|
|
if char.gender == 'she' then
|
|
|
|
|
return 'уважаемая'
|
|
|
|
|
end
|
|
|
|
|
if char.gender == 'he' then
|
|
|
|
|
return 'уважаемый'
|
|
|
|
|
end
|
|
|
|
|
if char.gender == 'it' then
|
|
|
|
|
return 'уважаемое'
|
|
|
|
|
end
|
|
|
|
|
return 'уважаемые'
|
|
|
|
|
end
|
2017-03-15 12:31:30 +02:00
|
|
|
|
opposed = function(value)
|
|
|
|
|
local retval = '['
|
|
|
|
|
for i=1,10,1 do
|
|
|
|
|
retval = retval .. '='
|
|
|
|
|
if math.floor(value/10) == i then
|
|
|
|
|
retval = retval .. '*'
|
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
retval = retval ..']'
|
|
|
|
|
return retval
|
|
|
|
|
end
|
|
|
|
|
changeop = function(name, delta)
|
|
|
|
|
rawset(char, name, fairadd(rawget(char, name), delta))
|
|
|
|
|
end
|
|
|
|
|
fairadd = function(value, add)
|
2017-03-15 16:28:15 +02:00
|
|
|
|
return math.floor(value + (100-value)*(add/100))
|
2017-03-15 12:31:30 +02:00
|
|
|
|
end
|
2017-03-25 07:04:31 +02:00
|
|
|
|
-- TODO: глючное перечисление инвентаря. Пропускает вещи.
|
|
|
|
|
listinv = function()
|
|
|
|
|
local out = ''
|
2017-03-31 12:52:28 +03:00
|
|
|
|
local comma = false
|
|
|
|
|
for k, v in std.ipairs(inv()) do
|
|
|
|
|
if v.disp and not v:disabled() then
|
|
|
|
|
if comma then
|
|
|
|
|
out = out .. ', '
|
|
|
|
|
else
|
|
|
|
|
comma = true
|
|
|
|
|
end
|
|
|
|
|
out = out .. v.disp
|
2017-03-25 07:04:31 +02:00
|
|
|
|
end
|
|
|
|
|
end
|
|
|
|
|
if out == '' then
|
|
|
|
|
out = 'ничего, кроме телефона.'
|
|
|
|
|
else
|
|
|
|
|
out = out .. '.'
|
|
|
|
|
end
|
|
|
|
|
return out
|
|
|
|
|
end
|
2017-03-30 18:04:15 +03:00
|
|
|
|
wounds = function()
|
|
|
|
|
char.wounds = char.wounds + 1
|
|
|
|
|
end
|