Player Experience Upgrade

version 2/111127 by Aaron Reed

  • Home page
  • Beginning
  • Previous
  • Next



  • Chapter - Applicable Examples

    Definition: a thing is sp_alive: if it is yourself, yes; if it is a person, yes; if it is the player, yes; no.

    Definition: a thing is appropriate for taking: if it is sp_alive, no; if it is part of something, no; if it is not touchable, no; if it is scenery, no; if it is fixed in place, no; yes.

    Definition: a thing is bestial if it is an animal.

    To say get noun example:
        let fake_example be false;
        let noun_example be indexed text;
        [Check to see if the player tried to reference something nearby]
        let candidate be indexed text;
        let first misunderstood word be indexed text;
        now first misunderstood word is word number ( the number of words in the rejected command ) in the rejected command;
        repeat with item running through things enclosed by location:
            if item is visible:
                now candidate is printed name of item in lower case;
                repeat with wordcounter running from 1 to the number of words in candidate:
                    if word number wordcounter in candidate matches the regular expression "\b[first misunderstood word]":
                        now noun_example is the printed name of item;
        if noun_example is empty:
            [Otherwise, choose the most sensible example possible.]
            if the number of visible appropriate for taking things which are not enclosed by the player > 0:
                now noun_example is "[random visible appropriate for taking things which are not enclosed by the player]";
            otherwise if the number of visible things which are not sp_alive > 0:
                now noun_example is "[random visible thing which is not sp_alive]";
            otherwise:
                now noun_example is "flower";
                now fake_example is true;
        say "[noun_example in upper case][if fake_example is true] (if one were here)".

    To get person example, in normal case:
        let subj be a random visible not bestial person who is not the player;
        if subj is not a person, now subj is a random visible person who is not the player;
        let person_example be indexed text;
        if subj is a person:
            now person_example is "[subj]";
            let name_length be the number of words in person_example;
            now person_example is "[word number name_length in person_example]";
        otherwise:
            now person_example is "John";
        if in normal case:
            say "[person_example]";
        otherwise:
            say "[person_example in upper case]".

    To say get person example: get person example. To say get person example in normal case: get person example, in normal case.

    The standard directions list is a list of directions variable. The standard directions list is {north, northeast, east, southeast, south, southwest, west, northwest, up, down}.

    Definition: a direction is sp_standard if it is listed in the standard directions list.
    Definition: a direction is sp_viable if the room it from location is a room.

    To get direction example, omitting superfluous details:
        let randdir be a random sp_standard sp_viable direction;
        if randdir is not a direction, now randdir is a random sp_viable direction;
        if randdir is not a direction, now randdir is north;
        let dir_example be indexed text;
        now dir_example is "[randdir]";
        now dir_example is "[dir_example in upper case]";
        if omitting superfluous details:
            say "[dir_example]";
        otherwise:
            if randdir is sp_standard:
                let dir_shorthand be indexed text;
                now dir_shorthand is "[character number 1 in dir_example]";
                if randdir is northeast, now dir_shorthand is "NE";
                if randdir is northwest, now dir_shorthand is "NW";
                if randdir is southeast, now dir_shorthand is "SE";
                if randdir is southwest, now dir_shorthand is "SW";
                say "(for example) [dir_example] or [dir_shorthand]";
            otherwise:
                say "(for example) [dir_example]".

    To say get direction example: get direction example.
    To say get direction example omitting superfluous details: get direction example, omitting superfluous details.