1
0
Fork 0
mirror of https://gitlab.com/Oreolek/duel.git synced 2024-06-28 12:55:09 +03:00

Updates WIP

This commit is contained in:
Alexander Yakovlev 2019-03-07 21:43:57 +07:00
parent b5390b66d0
commit d8dc936c3a
Signed by: oreolek
GPG key ID: 1CDC4B7820C93BD3
2 changed files with 44 additions and 30 deletions

View file

@ -1,6 +1,7 @@
--$Author: Alexander Yakolev$ --$Author: Alexander Yakolev$
--$Version: 1.2$ --$Version: 1.2$
--$Name: Инженер$ --$Name: Инженер$
-- instead_version "3.2.0"
require "fmt" require "fmt"
require "noinv" require "noinv"
declare "isdebug" (false) declare "isdebug" (false)
@ -10,7 +11,7 @@ require "proxymenu"
if isdebug then if isdebug then
require "dbg" require "dbg"
require "dbg-ru" require "dbg-ru"
include("transcript") loadmod("transcript")
end end
-- Мы не шифруемся, у нас Creative Commons -- Мы не шифруемся, у нас Creative Commons

View file

@ -1,40 +1,53 @@
local std = stead local std = stead
local filename = "game.log" local hooked = false
local orig_onwalk
local orig_afteract
function writelog(s) local function writelog(s)
local filename = "game.log"
local f = io.open(filename, "a") local f = io.open(filename, "a")
f:seek("end", 0) f:seek("end", 0)
f:write("\n", s, "\n") f:write("\n", s, "\n")
return f:flush() return f:flush()
end end
game.onwalk = function(f, inwalk) std.mod_start(function()
if inwalk.dsc then if hooked then
local dsc = std.call(inwalk, 'dsc') return
if dsc then
writelog(dsc)
end
end end
if inwalk.decor then orig_onwalk = std.rawget(game, 'onwalk');
local decor = std.call(inwalk, 'decor') orig_afteract = std.rawget(game, 'afteract');
if decor then
writelog(decor)
end
end
return true
end
game.afteract = function(this, that) std.hook(game.onwalk, function(f, inwalk)
local nam1 = this.decor print(inwalk.nam);
local nam2 = that.decor if inwalk.dsc then
if that:type('phr') then local dsc = std.call(inwalk, 'dsc')
nam2 = std.call(that, 'dsc') if dsc then
else writelog(dsc)
nam2 = that.nam end
end end
if nam2 then if inwalk.decor then
writelog("> "..nam2) local decor = std.call(inwalk, 'decor')
end if decor then
end writelog(decor)
end
end
return true
end)
std.mod_start(function() writelog("--- НАЧАЛО ИГРЫ ---") end) std.hook(game.afteract, function(this, that)
writelog("> "..this.nam..' @ '..that.nam)
if that:type('phr') then
writelog(std.call(that, 'dsc'))
end
end)
hooked = true
writelog("--- НАЧАЛО ИГРЫ ---")
end)
std.mod_done(function(load)
hooked = false
std.rawset(game, 'onwalk', orig_onwalk);
std.rawset(game, 'afteract', orig_afteract);
end)