Conditional Backdrops

version 2/110428 by Mike Ciul

  • Home page
  • Complete text



  • Version 2/110428 of Conditional Backdrops by Mike Ciul begins here.

    "An extension to allow a single rulebook to determine the presence of multiple backdrops."

    Include (-
    [ MoveFloatingObjects i k l m address flag;
        if (real_location == nothing) return;
    objectloop (i) {
            if (ObjectFloats(i)) {
                if (ObjectFoundIn(i, real_location)) move i to real_location;
                else remove i;
            }
        }
    ];

    [ ObjectFloats B address;
        return (B.&found_in ~= 0 && B hasnt absent);
    ];

    [ ObjectFoundIn B R k l m address;
        if (~~ObjectFloats( B )) rfalse;
        address = B.&found_in;
        if (ZRegion(address-->0) == 2) {
            return (B.found_in(R) ~= 0);
        }
        else {
            k = B.#found_in;
            for (l=0 : l<k/WORDSIZE : l++) {
                m = address-->l;
                if (ZRegion(m) == 2 && m.call(R) ~= 0) rtrue;
                if (m == R || m in R) rtrue;
            }
        }
        rfalse;
    ];

    [ MoveBackdrop bd D x address;
        if (~~(bd ofclass K7_backdrop)) return RunTimeProblem(RTP_BACKDROPONLY, bd);
        if (bd.#found_in > WORDSIZE) {
            address = bd.&found_in;
            address-->0 = D;
        } else bd.found_in = D;
        give bd ~absent;
        MoveFloatingObjects();
    ];
    -) instead of "Floating Objects" in "WorldModel.i6t"

    A conditional backdrop is a kind of thing.

    A conditional backdrop is always fixed in place. A conditional backdrop is never portable. A conditional backdrop is usually scenery.

    Include (- with found_in [ ; ProcessRulebook( (+ Backdrop condition rules +), self ); return (RulebookSucceeded()); ] -) when defining a conditional backdrop.

    The specification of conditional backdrop is "Like a backdrop, but allows rules for determining presence or absence in a given room."

    Backdrop condition rules are an object-based rulebook.

    Backdrop condition rules have outcomes present (success), it is present (success), it is absent (failure) and absent (failure - the default).

    Conditional Backdrops ends here.