Inform - Support - Source

Back to List

Inventory
Complete

Backward
Forward

Plain
Coloured
Gaudy

This code
in plain text

Browsing verblibm.h

ObjectIsUntouchable (lines 963-1024)

0963  [ ObjectIsUntouchable item flag1 flag2 ancestor i;
0964   
0965    ! Determine if there's any barrier preventing the player from moving
0966    ! things to "item".  Return false if no barrier; otherwise print a
0967    ! suitable message and return true.
0968    ! If flag1 is set, do not print any message.
0969    ! If flag2 is set, also apply Take/Remove restrictions.
0970   
0971    ! If the item has been added to scope by something, it's first necessary
0972    ! for that something to be touchable.
0973   
0974    i = ObjectScopedBySomething(item);
0975    if (i ~= 0)
0976    {   if (ObjectIsUntouchable(i)) return;
0977        ! An item immediately added to scope
0978    }
0979   
0980    ancestor = CommonAncestor(player, item);
0981   
0982    ! First, a barrier between the player and the ancestor.  The player
0983    ! can only be in a sequence of enterable objects, and only closed
0984    ! containers form a barrier.
0985   
0986    if (player ~= ancestor)
0987    {   i = parent(player);
0988        while (i~=ancestor)
0989        {   if (i has container && i hasnt open)
0990            {   if (flag1) rtrue;
0991                return L__M(##Take,9,i);
0992            }
0993            i = parent(i);
0994        }
0995    }
0996   
0997    ! Second, a barrier between the item and the ancestor.  The item can
0998    ! be carried by someone, part of a piece of machinery, in or on top
0999    ! of something and so on.
1000   
1001    if (item ~= ancestor)
1002    {   i = parent(item);
1003        while (i~=ancestor)
1004        {   if (flag2 && i hasnt container && i hasnt supporter)
1005            {   if (i has animate)
1006                {   if (flag1) rtrue;
1007                    return L__M(##Take,6,i);
1008                }
1009                if (i has transparent)
1010                {   if (flag1) rtrue;
1011                    return L__M(##Take,7,i);
1012                }
1013                if (flag1) rtrue;
1014                return L__M(##Take,8,item);
1015            }
1016            if (i has container && i hasnt open)
1017            {   if (flag1) rtrue;
1018                return L__M(##Take,9,i);
1019            }
1020            i = parent(i);
1021        }
1022    }
1023    rfalse;
1024  ];


Last updated 27 February 2004. This site is no longer supported; information may be out of date.
Maintained as a historical archive by the Interactive Fiction Technology Foundation. Copyright 1993-2018 IFTF, CC-BY-SA unless otherwise noted.
This page was originally managed by Graham Nelson (graham@gnelson.demon.co.uk) assisted by C Knight.