Rapid Prototyping

version 1 by B David Paulsen

  • Home page
  • Beginning
  • Previous
  • Next



  • Chapter - Spontaneous item-creation
    Spawning is an action applying to one topic. Understand "add [text]" as spawning.
    Check spawning:
        let t be a text;
        repeat with I running through object kinds:
            let t be "[the singular of I]";
            if t exactly matches the text the topic understood:
                if there is no unplaced thing of kind I:
                    say "There's no [substituted form of t] left, you need to declare a new one." instead;
                continue the action;
        say "That is not a placeable object." instead.
    Carry out spawning:
        let t be a text;
        repeat with I running through object kinds:
            let n be 0;
            let t be "[the singular of I]";
            if t exactly matches the text the topic understood:
                repeat with item running through unplaced things:
                    if the object kind of the item is I:
                        move the item to the location of the player;
                        now the item is placed;
                        now the printed name of the item is "fresh [substituted form of t]";
                        now the true-name of the item is "[substituted form of t] #[n]";
                        increment n;
                        rule succeeds.
    Report spawning:
        say "Added."
    A room can be marked for deletion.
    After going from a room (called place) which is marked for deletion:
        repeat with item running through things held by the place:
            if the item is not a backdrop:
                 try item-deleting the item;
        now the printed name of the place is "";
        now the description of the place is "";
        now the true-name of the place is "";
        now the place is unplaced;
        unmap the place;
        say "The path [opposite of noun] disintegrates behind you."
    To unmap (r - a room):
        repeat with dir running through directions:
            if the room dir from the location is not nothing:
                let x be the room dir from the location;
                change the dir exit of the location to nothing;
                change the opposite of dir exit of the x to nothing.
    Item-deleting is an action applying to one object.
    The item-deleting action has a text called the thing destroyed.
    Setting action variables for item-deleting:
        if the noun is a thing:
            let x be the printed name of the noun;
            if the noun is improper-named, let x be "The [x]";
            now the thing destroyed is the substituted form of x.
    Understand "delete [something]" as item-deleting. Understand "delete [direction]" as item-deleting.
    Check item-deleting when the noun is the player: say "The editor won't let you unmake yourself." instead.
    Check item-deleting when the noun is a backdrop and the noun is not the locality: say "[The true-name of noun] cannot be unmade." instead.
    Carry out item-deleting when the noun is the locality:
        now the location is marked for deletion.
    Carry out item-deleting when the noun is a direction:
        let x be the room noun from the location;
        change the noun exit of the location to nothing;
        change the opposite of noun exit of the x to nothing.
        
    Carry out item-deleting when the noun is a thing and the noun is not a backdrop:
        now the printed name of the noun is "";
        now the true-name of the noun is "";
        now the description of the noun is "";
        now the noun is not scenery;
        now the noun is not fixed in place;
        now the noun is unplaced;
        remove the noun from play.
        
    Report item-deleting when the noun is a thing and the noun is not the locality:
        say "[The thing destroyed] vanishes in a puff of logic."
    Report item-deleting when the noun is the locality:
        say "This room will be deleted upon exit.";
    Report item-deleting when the noun is a direction:
        say "The path to [the noun] vanishes."