!-- Questa libreria aggiunge l'attributo untouchable (intoccabile) e la proprietà untouchable_msg
!-- che contiene un messaggio (o una routine) di risposta al tentativo di compiere una azione che comporti
!-- il contatto con tale oggetto. L'attributo è utile per quegli oggetti che pur essendo presenti
!-- nella locazione e liberamente esaminabili con la vista non dovrebbero essere a portata di mano.

!-- le seguenti tre istruzioni vanno inserite nel file principale prima dell'inclusione di parser.h
!-- naturalmente rimuovendo il commento...

!-- Replace ObjectIsUntouchable;
!-- Attribute untouchable; 
!-- Property untouchable_msg;

!-- L'inclusione di questo file può essere fatta li dove avete inserito le altre vostre routine personalizzate.

!-- Include untouchable_it.h;

!-- Versione 1: Tratta da untouchable.h di Mike Tulloch
!-- Traduzione all'italiano di Marco Falcinelli


!-- La seguente routine è quella presente nel file verlibm.h, non viene modificata in nulla
!-- se non per l'aggiunta di un paio di istruzioni per controllare se l'oggetto ha l'attributo untouchable
!-- o meno.
#ifdef DEBUG; message "Compiling untouchable_it.h"; #endif;

[ ObjectIsUntouchable item flag1 flag2 ancestor i;
    ! Determine if there's any barrier preventing the player from moving
    ! things to "item".  Return false if no barrier; otherwise print a
    ! suitable message and return true.
    ! If flag1 is set, do not print any message.
    ! If flag2 is set, also apply Take/Remove restrictions.

    ! If the item has been added to scope by something, it's first necessary
    ! for that something to be touchable.

    ancestor = CommonAncestor(player, item);
    if (ancestor == 0) {
        ancestor = item;
        while (ancestor && (i = ObjectScopedBySomething(ancestor)) == 0)
            ancestor = parent(ancestor);
        if (i ~= 0) {
            if (ObjectIsUntouchable(i, flag1, flag2)) return;
            ! An item immediately added to scope
        }
    }
    else

    ! First, a barrier between the player and the ancestor.  The player
    ! can only be in a sequence of enterable objects, and only closed
    ! containers form a barrier.

    if (player ~= ancestor) {
        i = parent(player);
        while (i ~= ancestor) {
            if (i has container && i hasnt open) {
                if (flag1) rtrue;
                return L__M(##Take, 9, i);
            }
            i = parent(i);
        }
    }

    ! Second, a barrier between the item and the ancestor.  The item can
    ! be carried by someone, part of a piece of machinery, in or on top
    ! of something and so on.

    if (item ~= ancestor) {
        i = parent(item);
        while (i ~= ancestor) {
            if (flag2 && i hasnt container && i hasnt supporter) {
                if (i has animate) {
                    if (flag1) rtrue;
                    return L__M(##Take, 6, i);
                }
                if (i has transparent) {
                    if (flag1) rtrue;
                    return L__M(##Take, 7, i);
                }
                if (flag1) rtrue;
                return L__M(##Take, 8, item);
            }
            if (i has container && i hasnt open) {
                if (flag1) rtrue;
                return L__M(##Take, 9, i);
            }
            i = parent(i);
        }
    }
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!    
!-- Ecco le istruzioni che controllano se l'oggetto è intoccabile o meno
!--
    if (item has untouchable) {
           if (item provides untouchable_msg) return PrintOrRun(item,untouchable_msg);
           else { !messaggio di defaut
                       print (The) item;
                       if (item has pluralname) print " sono"; else print " è";
                       print " fuori portata.";
                       rtrue;
                   } 
    }
!-- fine aggiunta
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!       
    rfalse;
];

!-- FINE
