scene_use logic
This commit is contained in:
parent
24fef87d46
commit
834d2af9bd
|
@ -17,7 +17,7 @@ iface.xref = function(self, str, obj)
|
|||
cmd = 'go ';
|
||||
elseif isMenu(o) then
|
||||
cmd = 'act ';
|
||||
elseif isSceneuse(o) then
|
||||
elseif isSceneUse(o) then
|
||||
cmd = 'use ';
|
||||
end
|
||||
|
||||
|
@ -135,3 +135,7 @@ function isMenu(v)
|
|||
end
|
||||
return false
|
||||
end
|
||||
|
||||
function isSceneUse(v)
|
||||
return call_bool(v, 'scene_use');
|
||||
end
|
||||
|
|
|
@ -911,18 +911,25 @@ end
|
|||
|
||||
function player_use(self, what, onwhat)
|
||||
local obj, obj2, v, vv, r;
|
||||
local use_mode
|
||||
obj = self:srch(what);
|
||||
if not obj then
|
||||
if call_bool(game, 'scene_use') then
|
||||
use_mode = true
|
||||
obj = ref(self.where):srch(what);
|
||||
if obj and not isSceneuse(obj) then
|
||||
obj = nil;
|
||||
end
|
||||
end
|
||||
if not obj then
|
||||
return
|
||||
end
|
||||
else
|
||||
return game.err, false;
|
||||
end
|
||||
end
|
||||
if onwhat == nil then
|
||||
if use_mode then
|
||||
return player_action(self, what);
|
||||
else
|
||||
v, r = call(ref(obj),'inv');
|
||||
end
|
||||
if not v and r ~= true then
|
||||
v, r = call(game, 'inv', obj);
|
||||
end
|
||||
|
@ -1394,16 +1401,6 @@ function isForcedsc(v)
|
|||
return g and r ~= false
|
||||
end
|
||||
|
||||
function isSceneuse(v)
|
||||
local o,g
|
||||
o = call_bool(v, 'scene_use');
|
||||
if o then
|
||||
return true
|
||||
end
|
||||
g = call_bool(game, 'scene_use');
|
||||
return g and o ~= false
|
||||
end
|
||||
|
||||
iface = {
|
||||
img = function(self, str)
|
||||
return '';
|
||||
|
|
Loading…
Reference in a new issue