Class:Typewriter
Extends: adventurejs.Thing
Defined in: adventure/assets/tangibles/things/Typewriter.js, line 5
More info: AboutTangibles
Constructor:
MyGame.createAsset({ "class":"Typewriter", "name":"foo", [...] })
Description
Typewriter is a subclass of Thing with a subscription to the Verb type. (For more information about verb subscriptions, see Verb Subscriptions.) It accepts input in the form oftype "foo" on typewriter
where "foo" is a
string with quotes around it. If keyboard's
typing_targets
property
contains any asset IDs, the input string will display on
those assets. See the following
transcript to get an idea how this plays out.
> x typewriter It's a typewriter. > type "foo" on typewriter There's no paper in the typewriter. You bang out "foo" on the keys but nothing comes of it. > open middle drawer You open the middle drawer. In the middle drawer you see a blue sheet. > take blue sheet You take the blue sheet from the middle drawer. > put blue sheet in typewriter You put the blue sheet in the typewriter. > type "cordon bleu" on typewriter You type "cordon bleu" on the blue sheet. > x blue sheet It's a blue sheet of paper. Printed on the blue sheet is a phrase: "cordon bleu".
Example:
MyGame.createAsset({
class: "Typewriter",
name: "typewriter",
place: { on: "desk" },
descriptions: { look: "It's an old fashioned Corona typewriter. ", },
dov: { take: false, },
});
MyGame.createAsset({
class: "Paper",
name: "blue sheet",
descriptions: { look: "It's a blue sheet of paper. ", },
place: { in: "middle drawer" },
});
Demo
// WritingDemo.js
// ----------
/*global adventurejs WritingDemo*/
var WritingDemo = new adventurejs.Game("WritingDemo", "WritingDemoDisplay").set(
{
// title, version, and author are shown in the title bar
title: "Writing Demo",
version: "0.0.1",
author: "Ivan Cockrum",
description: "This is my great game! Thanks for playing!",
}
);
// Let's set some Game settings
WritingDemo.settings.set({
// apply_color_classes_to_written_strings: true,
// if any of these are true, adventurejs will log
// messages to the browser's console
// See the full list of available settings in
// /doc/adventure_Settings.js.html
log_keywords: {
verbaction: true,
verbreaction: true,
verbphase: true,
game: true,
parser: true,
verb: true,
},
// if any of these are true, adventurejs will print
// debug messages to the game display
debug_keywords: {
general: true,
verbaction: true,
verbreaction: true,
verbphase: true,
},
// if this is true, the game won't infer objects
// until player has already used them
// good for preventing spoilers but can be annoying
objects_must_be_used_before_inferring: false,
// if this is true, lists of exits will
// show the names of rooms they lead to
show_room_names_in_exit_descriptions: true,
// if this is true, lists of exits will
// only include room names known to player
show_room_names_in_exit_descriptions_only_when_room_is_known: false,
// if this is true, lists of exits will only
// show room names for exits player has used
show_room_names_in_exit_descriptions_only_after_exit_has_been_used: false,
// if this is true, verbose room descriptions will be
// shown on first visit regardless of verbosity settings
print_verbose_room_descriptions_on_first_visit: true,
// set this to set a default response to
// player input that is not understood
if_parser_has_no_response_print_this: "I have no response to your input. ",
// set this to provide a default
// response to blank input
if_input_is_empty_print_this: "I didn't see any input. ",
// alternately, game can be set to print
// the current room description with
// if_input_is_empty_print_room_description: true
// when the parser infers an action, it may print
// the inference, such as "take pot (from stove)"
// for this game we want to turn these off
print_inferred: false,
});
WritingDemo.createAsset({
class: "Room",
name: "Writing Demo Foyer",
// setting definite_article to "the" sets it so the room
// name appears as "the Writing Demo Foyer" in lists
definite_article: "the",
descriptions: {
look: `Welcome to the Writing Demo, where you can try interacting with assets of several related classes including
WritingImplement
(Pen,
Pencil,
Chalk,
Marker),
WritingSurface
(Paper,
Blackboard,
Whiteboard),
PenCap,
Typewriter, and
Eraser. Try
writing,
typing, and
erasing things.
Visit the other rooms in this demo to find some
demonstrations. `,
brief: `Try verbs.
Read,
write,
type,
erase. `,
},
exits: {
north: "Classroom",
south: "Library",
east: "Office",
west: "Playroom",
},
}); // Writing Demo Foyer
WritingDemo.createAsset({
class: "Player",
name: "Will",
place: { in: "Writing Demo Foyer" },
is: { active: true },
pronouns: "second",
});
// createClass()
// We're going to create several pieces of paper for this game.
// AdventureJS has a Paper class, but we want to add some
// specific properties to every instance of Paper. First, we
// want to specify several subclasses of WritingImplements that
// can write on them - Pen, Pencil, Crayon - but not Chalk or
// Marker. Then, we want to specify a particular Eraser that
// can erase them - the rubber eraser but not the Whiteboard
// eraser or Blackboard eraser.
//
// This is a minimal class definition. It extends the
// Paper class by customizing its write and erase verb
// subscriptions.
//
// Creating custom classes is an advanced move, so if you decide
// to create some, be sure to RTFM and test them extensively.
// See https://adventurejs.com/doc/Advanced_CustomClasses.html
// for more info.
WritingDemo.createClass(
class CustomPaper extends adventurejs.Paper {
constructor(name, game_name) {
super(name, game_name);
this.class = "CustomPaper";
// Limit what classes can write on this class.
this.setIOV({
write: { with_classes: ["Crayon", "Pen", "Pencil"] },
});
// Limit what assets can erase this class.
this.setDOV({
erase: { with_assets: ["rubber eraser"] },
});
// We want to set a custom message when a player tries
// and fails to type on this class. Though it seems
// that "type on paper" would have paper be a direct
// object, type is tricky to parse because technically,
// the information being typed is the direct object,
// even if no information is specified. So, for type,
// the paper and the typewriter are both indirect
// objects.
this.setIOV({
write: {
on_success: function () {
WritingDemo.scorecard.completeEvent("write on paper");
},
},
type: {
// This is a valid way to return a message, but...
// on_failure: `{We} might try putting it in a typewriter. `,
// ...we're going to be nitpicky about how we refer
// to the typewriter. If it's present we'll say
// "the typewriter" and if it's not we'll say
// "a typewriter". We'll use some embedded Javascript
// to test the typewriter's presence.
on_failure: () => {
return `{We} might try putting it in ${
WritingDemo.$("typewriter").$is("present") ? "the" : "a"
} typewriter. `;
},
},
});
}
}
);
// now we can create an instance of our new CustomPaper class
WritingDemo.createAsset({
class: "CustomPaper",
name: "pink paper",
indefinite_article: "a sheet of",
synonyms: ["sheet", "sheet of pink paper"],
description: "It's a sheet of pink paper. ",
place: { in: "Writing Demo Foyer" },
});
// Office.js
// ----------
/*global adventurejs A WritingDemo*/
WritingDemo.createAsset({
class: "Room",
name: "Office",
definite_article: "the",
descriptions: {
look: `This office is dominated by an oak mission style desk
with an old fashioned office chair. One wall is covered by a
whiteboard, with a narrow ledge for accessories. Try writing
on things with other things. See the example code
in Office.js for particulars. `,
brief: "Time to get to work. ",
},
exits: { west: "Writing Demo Foyer" },
}); // Office
// createClass()
// Later in this file, we'll create several whiteboard markers.
// We already have a class, Marker, but we want a specific
// WhiteboardMarker class that will be the only class of
// Assets that are allowed to write on a Whiteboard.
//
// This is the bare minimum needed for a class definition.
// The only thing that sets it apart from Marker is the class
// name, but that's how instances of the class will be
// identified by verb methods trying to determine whether
// the classes can be used together.
//
// Creating custom classes is an advanced move, so if you decide
// to create some, be sure to RTFM and test them extensively.
// See https://adventurejs.com/doc/Advanced_CustomClasses.html
// for more info.
WritingDemo.createClass(
class WhiteboardMarker extends adventurejs.Marker {
constructor(name, game_name) {
super(name, game_name);
this.class = "WhiteboardMarker";
}
}
);
WritingDemo.createAsset({
class: "Whiteboard",
name: "whiteboard",
place: { in: "Office" },
description: `It's a classic office whiteboard. `,
// Because the whiteboard is mentioned in the room description,
// we don't need it listed as a piece of inventory in the room.
// We can prevent it from being listed by setting
// is.listed to false.
is: { listed: false },
dov: {
// Though player can use an eraser to erase the whiteboard,
// setting whiteboard.dov.erase.with_nothing = true allows
// the player to erase the whiteboard without another asset,
// which we'll understand to mean that they're using their hand.
// (In fact this is the default setting for class Whiteboard,
// but we're redefining it here just to make this point.)
erase: {
with_nothing: true,
on_success: function () {
WritingDemo.scorecard.completeEvent("erase whiteboard");
},
},
},
iov: {
// Remember where we set up our custom WhiteboardMarker class?
// setting whiteboard.dov.write.with_classes = ["WhiteboardMarker"]
// establishes that only WhiteboardMarkers can write on Whiteboard.
write: {
with_classes: ["WhiteboardMarker"],
on_success: function () {
WritingDemo.scorecard.completeEvent("write on whiteboard");
},
},
},
// Should a player erase the whiteboard without an eraser,
// the verb action doEraseThis() will be called and we can
// treat it as if player is using their hand as an eraser.
doEraseThis: function () {
WritingDemo.appendTurn(`It leaves a smudge of ink on {our} hand. `);
},
}); //
// We don't have any special class for this whiteboard
// ledge so we'll just use the generic Thing class,
// and set whatever properties we might need.
WritingDemo.createAsset({
class: "Thing",
name: "whiteboard ledge",
description: `A narrow ledge that runs the length of the whiteboard, on which to store whiteboard accessories. `,
place: { in: "Office" },
// ensure that player can take things from and put things on the ledge
iov: { take: true, put: true },
// Because the ledge is mentioned in the room description,
// we don't need it listed as a piece of inventory in the room.
// We can prevent it from being listed by setting
// is.listed to false.
is: { listed: false },
// Thing has no aspects by default, so we'll do the bare
// minimum to define an "on" aspect. Now we can put things
// on it.
aspects: { on: true },
}); //
WritingDemo.createAsset({
class: "Eraser",
name: "microfiber eraser",
place: { on: "whiteboard ledge" },
descriptions: { look: "It's a microfiber eraser. " },
// Verb subscriptions
// By setting iov.erase.with_classes to ["Whiteboard"]
// we're customizing this asset's erase verb subscription
// to establish that the whiteboard is the only
// thing this eraser can erase.
//
// This is similar to what we did with the WhiteboardMarker
// class, but we didn't bother to create a new class for
// WhiteboardErasers because there's only one of them,
// so we're just adjusting its individual properties.
iov: { erase: { with_classes: ["Whiteboard"] } },
// Verb action hooks - doEraseThatWithThis()
// Verb action hooks allow authors
// to call custom code after specific actions.
//
// Verb action hooks can be formatted in different
// ways depending on the level of specificity needed.
//
// In this case, since the whiteboard is the only thing
// the eraser can erase, we know that the "That" in
// doEraseThatWithThis must be the whiteboard, and we can
// refer to it unambiguously in this verb action hook.
doEraseThatWithThis: function () {
WritingDemo.appendTurn(
`The eraser squeaks as it's dragged across the board. `
);
},
}); //
WritingDemo.createAsset({
class: "WhiteboardMarker",
name: "red marker",
adjectives: ["red", "dry erase", "red dry erase"],
place: { on: "whiteboard ledge" },
descriptions: { look: "It's a red dry erase marker. " },
appearance: { color: "red" },
}); // RedMarker
WritingDemo.createAsset({
class: "WhiteboardMarker",
name: "orange marker",
indefinite_article: "an",
adjectives: ["orange", "dry erase", "orange dry erase"],
place: { on: "whiteboard ledge" },
descriptions: { look: "It's a orange dry erase marker. " },
appearance: { color: "orange" },
}); // OrangeMarker
WritingDemo.createAsset({
class: "WhiteboardMarker",
name: "cyan marker",
adjectives: ["cyan", "dry erase", "cyan dry erase"],
place: { on: "whiteboard ledge" },
descriptions: { look: "It's a cyan dry erase marker. " },
appearance: { color: "cyan" },
}); // CyanMarker
WritingDemo.createAsset({
class: "Desk",
name: "desk",
place: { in: "Office" },
// describeDeskDrawers() is an example of a custom function.
// See the function description below for more information.
// Note how we've set description to be a function rather than
// a string, as we've done elsewhere. That is because we're
// using a Javascript ${template literal}, which is always
// evaluated immediately, and so if we set this as a string,
// it would be evaluated at runtime, before the game has built,
// and throw an error. By making it a function, it won't be
// evaluated until we call it.
description: () =>
`It's an oak mission style desk, with an old fashioned office
chair. It has three drawers stacked vertically.
${describeDeskDrawers()}`,
synonyms: [""],
adjectives: ["mission style", "mission", "style", "oak"],
// Just for fun, let's say the player can go under the desk.
aspects: {
under: {
list_contents_in_room: false,
list_contents_in_examine: true,
nest: {
posture: "kneel",
can: { enter: true, exit: true, kneel: true, stand: false },
},
},
},
// Because the desk is mentioned in the room description,
// we don't need it listed as a piece of inventory in the room.
// We can prevent it from being listed by setting
// is.listed to false.
is: { listed: false },
});
WritingDemo.createAsset({
class: "Drawer",
name: "top drawer",
synonyms: [
"top desk drawer",
"top drawer lock",
"top drawer lock plate",
"lock",
"lock plate",
],
adjectives: ["brass"],
// Here we're using an AdventureJS custom template
// to print whether the drawer is open or closed.
// Custom templates are like Javascript template literals,
// but a little different.
description: `The top drawer has a small brass lock plate. The drawer is { top drawer [is] open [or] closed }. `,
adjectives: "desk",
place: { attached: "desk" },
// We're setting this drawer closed and locked.
// We set listed to false so it doesn't
// get listed like a piece of inventory.
is: {
closed: true,
locked: true,
listed: false,
},
// Setting dov.unlock.with_assets["tiny brass key"]
// means that only the tiny brass key can unlock this.
dov: { unlock: { with_assets: ["tiny brass key"] } },
});
WritingDemo.createAsset({
class: "Drawer",
name: "middle drawer",
synonyms: "middle desk drawer",
description: "The middle drawer is { middle drawer [is] open [or] closed }. ",
adjectives: "desk",
place: { attached: "desk" },
is: {
closed: true,
listed: false,
},
});
WritingDemo.createAsset({
class: "Drawer",
name: "bottom drawer",
synonyms: "bottom desk drawer",
description: "The bottom drawer is { bottom drawer [is] open [or] closed }. ",
adjectives: "desk",
place: { attached: "desk" },
is: {
closed: true,
listed: false,
},
});
// Collections
// In our current example, the desk has three drawers. Though
// the parser understands plurals, if a player asked for
// "desk drawers", the parser's default behavior would be
// to prompt for disambiguation: "which drawer did you mean?"
//
// From a player's perspective, that's just tedious, because
// it's perfectly reasonable to expect "examine desk drawers"
// to return a description that includes all three. That's what
// Collections are for. Collections describe a group of assets,
// so that players can refer to multiple assets with one term.
//
// In this case, "desk drawers" is a Collection that represents
// all three desk drawers.
WritingDemo.createAsset({
class: "Collection",
name: "desk drawers",
place: { attached: "desk" },
collection: "top drawer, middle drawer, bottom drawer",
synonyms: ["drawers", "three drawers"],
is: {
listed: false,
},
// describeDeskDrawers() is an example of a custom function.
// See the function description below for more information.
// Note how we've set description to be a function rather than
// a string, as we've done elsewhere. That is because we're
// using a Javascript ${template literal}, which is always
// evaluated immediately, and so if we set this as a string,
// it would be evaluated at runtime, before the game has built,
// and throw an error. By making it a function, it won't be
// evaluated until we call it.
description: () =>
`The desk has three drawers stacked vertically: top, middle and bottom. ${describeDeskDrawers()}`,
});
// describeDeskDrawers()
// Here, we've made a custom function that describes the state
// of all three desk drawers. The reason we've done this
// is so that we can show it in two places without repeating
// code. We use this in the desk's description, and also in
// the desk drawers collection. This function exists in the
// global scope, aka the browser window, which means that
// you can call it from anywhere. (Technically, this is kind
// of sloppy, and you probably shouldn't do it in other
// environments, but it won't hurt anything in AdventureJS.)
// @returns string
function describeDeskDrawers() {
const open = [];
const closed = [];
let msg = "The top drawer has a small brass lockplate. ";
// get a list of all the open drawers
// and a list of all the closed drawers
WritingDemo.$("top drawer").is.closed ? closed.push("top") : open.push("top");
WritingDemo.$("middle drawer").is.closed
? closed.push("middle")
: open.push("middle");
WritingDemo.$("bottom drawer").is.closed
? closed.push("bottom")
: open.push("bottom");
// print a slightly different description based
// on however many drawers are open or closed
switch (open.length) {
case 0:
msg += `All three drawers are closed. `;
break;
case 1:
msg += `The ${closed[0]} and ${closed[1]} drawers are closed. The ${open[0]} drawer is open. `;
break;
case 2:
msg += `The ${open[0]} and ${open[1]} drawers are open. The ${closed[0]} drawer is closed. `;
break;
case 3:
msg += `All three drawers are open. `;
break;
}
return msg;
}
WritingDemo.createAsset({
class: "Chair",
name: "office chair",
indefinite_article: "an",
place: { in: "Office" },
// It's a swivel chair, so we're going to allow
// the verb turn to act on it.
dov: { turn: true },
description: `It's an old fashioned wooden office chair that rolls on swiveling castors. `,
// Because the chair is mentioned in the room description,
// we don't need it listed as a piece of inventory in the room.
// We can prevent it from being listed by setting
// is.listed to false.
is: { listed: false },
// Use as many adjectives and synonyms as you like.
// Adding more words makes it easier for you and your
// player. It reduces players' chances of getting stuck
// playing guess-the-word, and increases your chances
// of correctly parsing players' input.
synonyms: ["castor", "castors"],
adjectives: ["old", "fashioned", "old fashioned", "heavy", "wooden"],
// This is an example of a verb reaction hook. Any time
// Will (the player character of this game) gets out of
// the chair, this string will be prepended to the
// game's default output. It's also possible to
// appendTurn or overrideTurn.
doUnnestThatFromThis: {
Will: function () {
WritingDemo.prependTurn(
`The office chair creaks as {we} climb out of it. `
);
},
},
aspects: {
on: {
// Because we're not listing the chair, things placed on it
// won't be listed either. We're explicitly setting it so
// that they will be.
list_contents_in_room: true,
// By default, when the player is nested in one asset,
// they can't reach things in/on other assets.
// Setting aspects.on.nest.can.reach["student desk"] enables
// the player to reach the desk and items in/on it,
// such as the drawers and typewriter, while sitting
// in the office chair.
nest: { can: { reach: ["desk"] } },
},
},
});
WritingDemo.createAsset({
class: "Key",
name: "tiny brass key",
image: "brasskey",
description: "It's a tiny key, made of brass. ",
adjectives: ["tiny", "brass"],
place: { on: "desk" },
});
WritingDemo.createAsset({
class: "Pencil",
name: "mechanical pencil",
adjectives: "brass",
synonyms: ["design", "designs"],
place: { on: "desk" },
description:
"It's a mechanical pencil made out of pressed brass, with intricate designs stamped into it. ",
}); // BrassPencil
WritingDemo.createAsset({
class: "Eraser",
name: "rubber eraser",
place: { on: "desk" },
description: `It's an ordinary rubber eraser. `,
iov: {
erase: {
on_success: function () {
WritingDemo.scorecard.completeEvent("erase paper");
},
},
},
}); // BrassPencil
WritingDemo.createAsset({
class: "Pen",
name: "indigo pen",
indefinite_article: "an",
adjectives: "indigo",
place: { in: "top drawer" },
descriptions: { look: "It's a pen with indigo ink. " },
appearance: { color: "indigo" },
}); // IndigoPen
WritingDemo.createAsset({
class: "Pen",
name: "yellow pen",
adjectives: "yellow",
place: { in: "top drawer" },
descriptions: { look: "It's a pen with yellow ink. " },
appearance: { color: "yellow" },
}); // YellowPen
WritingDemo.createAsset({
class: "Pen",
name: "green pen",
adjectives: "green",
place: { in: "top drawer" },
descriptions: { look: "It's a pen with green ink. " },
appearance: { color: "green" },
}); //GreenPen
WritingDemo.createAsset({
class: "PenCap",
name: "pen cap",
place: { attached: "green pen" },
descriptions: { look: "It's a cap for a pen. " },
}); //
WritingDemo.createAsset({
class: "CustomPaper",
name: "white paper",
indefinite_article: "a sheet of",
synonyms: ["sheet", "sheet of white paper"],
adjectives: [""],
description: "It's a sheet of white paper. ",
place: { on: "desk" },
dov: { erase: { with_assets: ["rubber eraser"] } },
});
// Playroom.js
// ----------
/*global adventurejs A WritingDemo*/
WritingDemo.createAsset({
class: "Room",
name: "Playroom",
definite_article: "the",
descriptions: {
look: `Generations of children have lounged upon floor cushions scattered around a low activity table.
See the example code in Playroom.js for particulars. `,
brief: "Table. Cushions. Please take your seat. ",
},
exits: { east: "Writing Demo Foyer" },
}); // Playroom
WritingDemo.createAsset({
class: "Table",
name: "activity table",
place: { in: "Playroom" },
description: `It's a low table, perfect for arts and crafting. `,
adjectives: [""],
// The activity table is mentioned in the room description,
// so we don't need it listed in the room, but we do want
// the things on it to be listed in the room.
is: { listed: false },
// By default, Table class has an under aspect which is not
// revealed until player examines table, but in this case,
// we want player to see what's under the table as soon
// as they enter the room.
aspects: {
under: { know_contents_with_parent: true, list_contents_in_room: true },
},
});
WritingDemo.createAsset({
class: "Thing",
name: "cushions",
synonyms: ["cushion"],
adjectives: ["floor"],
place: { in: "Playroom" },
description: `A gang of comfortable floor cushions. `,
is: { listed: false },
// Because we're building on the basic Thing class, we have
// to define some basic setup stuff that might otherwise have
// been preset if we'd used a more specialized class.
// (The Furniture class would been suitable for these cushions.)
// Here, we need to set up an on aspect with a nest for the
// player to enter, and specify that the activity table is
// reachable while sitting in it.
aspects: {
on: {
nest: {
posture: "sit",
can: { enter: true, exit: true, sit: true, reach: ["activity table"] },
},
},
},
// Continuing with the basic setup...
// If player says "get up", which gets parsed as "stand up",
// while sitting on the cushions, we want to ensure they
// get off the cushions, as opposed to trying to stand up
// in place on the cushions, which is the default behavior
// for stand.
quirks: { stand_means_get_off: true },
// We want to print a custom message when the player sits here.
doNestThatToThis: {
Will: () => {
WritingDemo.scorecard.completeEvent("sit on cushions");
WritingDemo.overrideTurn(
`{We} settle down cross legged among the floor cushions, {our} knees pressed against the low activity table. `
);
},
},
// We want to print a custom message when the player leaves this.
doUnnestThatFromThis: {
Will: () => {
WritingDemo.overrideTurn(
`{We} climb up off the cushions, bumping the table along the way. `
);
},
},
}); // Cushions
WritingDemo.createAsset({
class: "Pencil",
name: "blue pencil",
adjectives: ["blue", "colored"],
place: { on: "activity table" },
description: "It's a blue colored pencil. ",
appearance: { color: "blue" },
}); // BluePencil
WritingDemo.createAsset({
class: "Pencil",
name: "pink pencil",
adjectives: ["pink", "colored"],
place: { on: "activity table" },
description: `It's an pink colored pencil. `,
appearance: { color: "pink" },
}); // PinkPencil
WritingDemo.createAsset({
class: "Pencil",
name: "teal pencil",
adjectives: ["teal", "colored"],
place: { on: "activity table" },
description: `It's a teal colored pencil. `,
appearance: { color: "teal" },
}); // TealPencil
WritingDemo.createAsset({
class: "CustomPaper",
name: "drawing paper",
indefinite_article: "a sheet of",
synonyms: ["sheet", "sheet of drawing paper"],
adjectives: [""],
description: "It's a sheet of drawing paper. ",
place: { on: "activity table" },
// It isn't necessary to include this next line because it is
// baked into the Paper class, but it's worth seeing how we
// determine which WritingImplements may write on which
// WritingSurfaces. Here, we're saying that Paper is
// subscribed to the verb write with these classes. If
// player tries to write on Paper with anything else, they'll
// get an error message.
// dov: { write: { with_classes: ["Crayon", "Pen", "Pencil"] } },
dov: { erase: { with_assets: ["rubber eraser"] } },
});
WritingDemo.createAsset({
class: "Crayon",
name: "purple crayon",
adjectives: [""],
place: { under: "activity table" },
description: `It's a purple crayon. `,
// Assigning a color to a WritingImplement is optional.
// If provided, the text that is written will be printed
// back with a CSS class with the name of that color, and
// a CSS class of the particular WritingImplement subclass.
// You can use this to make that text print in that color,
// or in a different font, etc.
//
// For example, strings written with this purple crayon
// will be printed like this and appear in purple:
// foo
//
// adventurejs.css has a few standard color classes defined.
// You're welcome to customize such classes as you like.
appearance: { color: "purple" },
}); //
// Classroom.js
// ----------
/*global adventurejs A WritingDemo*/
WritingDemo.createAsset({
class: "Room",
name: "Classroom",
definite_article: "the",
descriptions: {
look: `This classroom features an antique student desk with
an attached bench, facing a large blackboard
with a narrow ledge for accessories. Try writing
on things and erasing things. See the example code in
Classroom.js for particulars. `,
brief: "Blackboard. Desk. Bench. Please take your seat. ",
},
exits: { south: "Writing Demo Foyer" },
}); // Classroom
WritingDemo.createAsset({
class: "Blackboard",
name: "blackboard",
place: { in: "Classroom" },
description: `It's a classic schoolroom blackboard. `,
// Because the blackboard is mentioned in the room description,
// we don't need it listed as a piece of inventory in the room.
// We can prevent it from being listed by setting
// is.listed to false.
is: { listed: false },
dov: {
// Though player can use an eraser to erase the blackboard,
// setting dov.erase.with_nothing = true allows the player
// to erase the blackboard without another asset.
// (This is the default setting for class Blackboard.
// We're redefining it here just to make the point.)
erase: {
with_nothing: true,
on_success: function () {
WritingDemo.scorecard.completeEvent("erase blackboard");
},
},
},
iov: {
// setting iov.write.with_classes = ["Chalk"]
// establishes that assets of class Chalk are the
// only assets allowed to write on Blackboard.
// (This is the default setting for class Blackboard.
// We're redefining it here just to make the point.)
//
// The reason why write is defined under iov rather
// than dov is because when writing, the thing being
// written is always the direct object, while both
// the writing implement and the writing surface are
// indirect objects.
write: {
with_classes: ["Chalk"],
on_success: function () {
WritingDemo.scorecard.completeEvent("write on blackboard");
},
},
},
// Should a player erase the blackboard without an eraser,
// the verb action doEraseThis() will be called and we can
// treat it as if player is using their hand as an eraser.
doEraseThis: function () {
WritingDemo.appendTurn(
`It leaves a powdering of chalk dust on {our} hand. `
);
},
}); //
// We don't have any special class for this blackboard
// ledge so we'll just use the generic Thing class,
// and set whatever properties we might need.
WritingDemo.createAsset({
class: "Thing",
name: "blackboard ledge",
description: `A narrow ledge that runs the length of the blackboard, on which to store blackboard accessories. `,
place: { in: "Classroom" },
// ensure that player can take things from and put things on the ledge
iov: { take: true, put: true },
// Because the ledge is mentioned in the room description,
// we don't need it listed as a piece of inventory in the room.
// We can prevent it from being listed by setting
// is.listed to false.
is: { listed: false },
// Thing has no aspects by default, so we'll do the bare
// minimum to define an "on" aspect. Now we can put things
// on it. Though the ledge's listed is false,
// we can still have its contents listed in the room by
// setting the on aspect's list_contents_in_room to true.
aspects: { on: { list_contents_in_room: true } },
}); //
WritingDemo.createAsset({
class: "Eraser",
name: "felt eraser",
place: { on: "blackboard ledge" },
descriptions: { look: "It's a felt eraser. " },
// Verb subscriptions
// By setting iov.erase.with_classes to ["Blackboard"]
// we're customizing this asset's erase verb subscription
// to establish that the blackboard is the only
// thing this eraser can erase.
iov: { erase: { with_classes: ["Blackboard"] } },
// Verb action hooks - doEraseThatWithThis()
// Verb action hooks allow authors
// to call custom code after specific actions.
//
// Verb action hooks can be formatted in different
// ways depending on the level of specificity needed.
//
// In this case, since the whiteboard is the only thing
// the eraser can erase, we know that the "That" in
// doEraseThatWithThis must be the whiteboard, and we can
// refer to it unambiguously in this verb action hook.
doEraseThatWithThis: {
blackboard: function () {
WritingDemo.appendTurn(`A small cloud of chalk dust puffs out. `);
},
},
}); //
WritingDemo.createAsset({
class: "Chalk",
name: "stick of white chalk",
synonyms: "white chalk",
adjectives: "white",
place: { on: "blackboard ledge" },
descriptions: { look: "It's a stick of white chalk. " },
appearance: { color: "white" },
}); //
WritingDemo.createAsset({
class: "Chalk",
name: "stick of pink chalk",
synonyms: "pink chalk",
adjectives: "pink",
place: { on: "blackboard ledge" },
descriptions: { look: "It's a stick of pink chalk. " },
// Setting appearance.color is optional, but when it's set
// for WritingImplements, anything written with that tool
// will be printed to the game display with that color as
// a CSS class name. For example:
// whatever player wrote
appearance: { color: "pink" },
}); //
WritingDemo.createAsset({
class: "Chalk",
name: "stick of blue chalk",
synonyms: "blue chalk",
adjectives: "blue",
place: { on: "blackboard ledge" },
descriptions: { look: "It's a stick of blue chalk. " },
appearance: { color: "blue" },
}); //
WritingDemo.createAsset({
class: "Paper",
name: "blue paper",
synonyms: ["sheet", "sheet of blue paper"],
indefinite_article: "a sheet of",
adjectives: [""],
description: "It's a sheet of blue paper. ",
place: { in: "student desk" },
dov: { erase: { with_assets: ["rubber eraser"] } },
});
WritingDemo.createAsset({
class: "Desk",
name: "student desk",
place: { in: "Classroom" },
description: () =>
`It's an old-fashioned lift top school desk with an
attached bench. The desk top is {student desk [is] open [or] closed}. `,
synonyms: [""],
adjectives: [""],
dov: { open: true, close: true },
// Because the desk is mentioned in the room description,
// we don't need it listed as a piece of inventory in the room.
// We can prevent it from being listed by setting
// is.listed to false.
is: { closed: true, listed: false },
// If the desk's listed were true, the things sitting
// on it would be automatically listed. But since we've made
// the desk unlisted, we need to explicitly tell the game
// to list the things on the desk.
aspects: {
on: { list_contents_in_room: true },
in: { list_contents_in_room: true },
attached: {
// We've included the bench in the desk's description, so
// we don't want it listed as an inventory item when
// the desk is examined.
list_contents_in_examine: false,
// However, we do want the bench known/seen with the desk.
// The Desk class sets know_contents_with_parent and
// see_contents_with_parent to false, because the class
// definition assumes that anything attached to the desk
// is a drawer or something similar, where you might not
// want the player knowing about their contents until they
// open the drawer. We're going to override these properties
// to ensure that the player knows/sees the bench.
know_contents_with_parent: true,
see_contents_with_parent: true,
},
},
});
WritingDemo.createAsset({
class: "Chair",
name: "bench",
place: { attached: "student desk" },
synonyms: [""],
adjectives: ["uncomfortable", "wooden"],
description: `It's an uncomfortable looking wooden bench. `,
// Because the chair is mentioned in the room description,
// we don't need it listed as a piece of inventory in the room.
// We can prevent it from being listed by setting
// is.listed to false.
is: {
listed: false,
// Because the bench is attached to the desk, it needs the
// is.deep_nest flag to allow player to nest to it.
// Technically it wasn't necessary to attach the bench to
// the desk - we could have just described it as being
// attached without actually attaching it. In this case it's
// just a matter of organizational preference.
deep_nest: true,
},
aspects: {
on: {
// Because we're not listing the chair, things placed on it
// won't be listed either. We're explicitly setting it so
// that they will be.
list_contents_in_room: true,
// By default, when the player is nested in one asset,
// they can't reach things in/on other assets.
// Setting aspects.on.nest.can.reach["student desk"] enables
// the player to reach the desk and items in/on it,
// such as the drawers and typewriter, while sitting
// in the office chair.
nest: { can: { reach: ["student desk"] } },
},
},
// doNestThatToThis()
// This is an example of a verb reaction hook. Any time
// Will (the player character of this game) gets into or
// out of the bench, the provided string will override the
// game's default output. It's also possible to
// appendTurn or prependTurn.
doNestThatToThis: {
Will: function () {
WritingDemo.overrideTurn(`{We} fold {ourself} into the small bench. `);
},
},
doUnnestThatFromThis: {
Will: function () {
WritingDemo.overrideTurn(`{We} unfold {ourself} from the small bench. `);
},
},
});
// Library.js
// ----------
/*global adventurejs A WritingDemo*/
WritingDemo.createAsset({
class: "Room",
name: "Library",
definite_article: "the",
descriptions: {
look: `Cramped shelves full of dusty books, but they're unimportant right now. A modest rolltop desk is permanently open to display an antique typewriter. Try typing. See the example code in Library.js for particulars. `,
brief: "Shelves. Books. Desk. Type! ",
},
exits: { north: "Writing Demo Foyer" },
}); // Library
WritingDemo.createAsset({
class: "Desk",
name: "rolltop desk",
adjectives: ["modest"],
place: { in: "Library" },
description: `It's a modest rolltop desk, locked in the open position. `,
// Because the desk is mentioned in the room description,
// we don't need it listed as a piece of inventory in the room.
// We can prevent it from being listed by setting
// is.listed to false.
is: { listed: false },
}); // RolltopDesk
WritingDemo.createAsset({
class: "Scenery",
name: "cramped shelves",
place: { in: "Library" },
description: `The cramped shelves are just a scenery object. You know. For verisimilitude. `,
// The shelves, being a scenery asset, aren't
// subscribed to verb climb and can't be climbed,
// but if a player should try to climb them, we
// want to offer a snappy response.
// We have a variety of verb hooks to work with.
// In this case, tryClimb() is the simplest option.
tryClimb: () => {
WritingDemo.print(`In Soviet Russia, shelves climb you! `);
// return false ends the turn without further processing
return false;
},
}); // cramped shelves
WritingDemo.createAsset({
class: "Scenery",
name: "dusty books",
place: { in: "Library" },
description: `The dusty books are just another lousy scenery object. `,
// The books, like the shelves, are a scenery object
// that can't be interacted with, but we want to
// offer snappy responses to a few likely player actions.
tryRead: () => {
WritingDemo.print(`In Soviet Russia, books read you! `);
// return false ends the turn without further processing
return false;
},
tryTake: () => {
WritingDemo.print(`In Soviet Russia, books take you! `);
// return false ends the turn without further processing
return false;
},
}); // dusty books
WritingDemo.createAsset({
class: "CustomPaper",
name: "onionskin paper",
indefinite_article: "a sheet of",
synonyms: ["sheet", "sheet of onionskin paper"],
description: "It's a sheet of onionskin paper. ",
place: { on: "rolltop desk" },
});
WritingDemo.createAsset({
class: "Typewriter",
name: "typewriter",
adjectives: ["spindly", "old", "mechanical"],
place: { on: "rolltop desk" },
description: `It's a spindly old mechanical typewriter. `,
// By default, instances of Typewriter can be carried
// as inventory but we don't want this one to be moved
// so we're going to unset these verb subscriptions.
dov: {
take: false,
put: false,
get: false,
give: false,
move: false,
},
// Here, we want to check if there is a piece of paper
// in the typewriter when player types on it.
// There are several different ways to hook into verbs,
// ranging from broad to very granular, and taking into
// account whether the asset was the direct or indirect
// object of the verb. That gets a little tricky with
// the verb type, because player may input
// "type on typewriter", "type on paper",
// "type 'Hello, World!' on paper,"
// "type 'Hello, World!' on typewriter," etc.
// All of these will work, and the typewriter may be
// direct or indirect, depending on how the input was
// structured. So we're going to use a broad hook:
// doType is called any time the verb type is used on
// the typewriter, regardless of direct / indirect,
// and we're going to check if the typewriter has paper in it.
// See https://adventurejs.com/doc/Scripting_VerbHooks.html
// for more info on verb hooks.
doType: function () {
if (this.hasContents("in")) {
// Paper is the only class that can be put in Typewriter
// so if it's not empty, it's got a piece of paper in it
// and we can confidently refer to paper in our appended
// output.
WritingDemo.appendTurn(`Now try reading the paper. `);
WritingDemo.scorecard.completeEvent("type on paper");
} else {
// The typewriter is empty so let's append the default
// verb message to help inform the player.
WritingDemo.appendTurn(`{We} might try putting a piece of paper in it. `);
}
},
});
WritingDemo.createAsset({
class: "Thing",
name: "small placard",
place: { on: "rolltop desk" },
// See how this placard description uses custom HTML/CSS.
// We defined the CSS for this style inside the Styles.css
// file that loads with this game. You can load CSS
// via the html link tag, or embed it in a style tag
// in the HTML page that loads your game.
descriptions: {
look: `{We} see a neat typewritten note.
To use the typewriter,
insert a sheet of paper, use the verb type,
and put quotes around the string to be typed.
type "hello world"
`,
// We want to return the same description whether
// player looks at the placard or reads it, and we
// don't want to duplicate that code, so we set
// placard.descriptions.read to point to
// placard.descriptions.look
read: function () {
return this.descriptions.look;
},
// Sometimes we use ()=> arrow functions, but in this
// case, in order to get the right scope when we refer
// to this.descriptions, we need to use a standard function.
},
dov: { read: true },
});
// Scorecard.js
// ----------
/*global adventurejs WritingDemo*/
// Scoring
WritingDemo.scorecard.set({
// This is how you set score events for your game.
// You can add as few or as many as you like,
// and set points to whatever number you like.
// The names are up to you, so set them however you like.
// See http://adventurejs.com/doc/Scripting_Scorecard.html
// for more info.
score_events: {
"write on whiteboard": 1,
"erase whiteboard": 1,
"write on blackboard": 1,
"erase blackboard": 1,
"type on paper": 1,
"write on paper": 1,
"erase paper": 1,
// You can also assign "bonus" points. These won't be
// counted in the total, allowing player to earn a
// score like 110/100.
"try to climb shelves": {
points: 1,
bonus: true,
// Customize the score message by setting message
// to a string or array or function.
message: "[ ** {We} got a bonus point! ** ]",
},
},
});
Source files
Private Constructor:
var foo = new adventurejs.Typewriter(game_name, name)
Though all in-game glasses use a standard constructor method under the hood, it's unlikely that you'd need to call it directly. To create an instance of the Typewriter class, it must be defined in a game file as a generic object. That object will be used at runtime to construct a new game class instance, which will be validated and initialized before adding it to the Game. See above for the public constructor, or see Game#createAsset to learn more.
Parameters:
-
game_name
String
The name of the top level game object. -
name
String
A name for the object, to be serialized and used as ID.
- Index
- Methods
- Properties
Index
Methods:
- Inherited from Asset $can
- Inherited from Tangible $contains
- Inherited from Tangible $is
- Inherited from Tangible $moveTo
- Inherited from Asset $must
- Inherited from Asset $quirks
- Inherited from Tangible addAssetAt
- Inherited from Asset addWordsToLookup
- Inherited from Asset aliases
- Inherited from Asset allowVerbOnce
- Inherited from Asset allowVerbWithAnything
- Inherited from Asset allowVerbWithAsset
- Inherited from Asset allowVerbWithNothing
- Inherited from Asset allowVerbWithPreposition
- Inherited from Tangible areAnscestorsClosed
- Inherited from Tangible areAnscestorsKnown
- Inherited from Tangible areAnscestorsOpen
- Inherited from Tangible areAnscestorsUnknown
- Inherited from Tangible canAnyPartContainSubstances
- Inherited from Tangible canBePut
- Inherited from Tangible canContainAssetAt
- Inherited from Tangible canContainSubstances
- Inherited from Asset canDoVerbAutomatically
- Inherited from Tangible canNestPlayerAt
- Inherited from Asset canSetVerbState
- Inherited from Tangible canThisAutoOpen
- Inherited from Tangible containsAnyAsset
- Inherited from Tangible containsAnyAssetAt
- Inherited from Tangible containsAnySubstance
- Inherited from Tangible containsAnySubstanceAt
- Inherited from Tangible containsAsset
- Inherited from Tangible containsAssetAt
- Inherited from Tangible containsSubstance
- Inherited from Tangible containsSubstanceAt
- Inherited from Tangible destroy
- Inherited from Asset didDoVerbs
- Inherited from Asset didIoVerbs
- Inherited from Asset didVerb
- Inherited from Asset didVerbCount
- Inherited from Asset doVerbAction
- Inherited from Tangible findNestedAssetsWithClass
- Inherited from Tangible findNestedAssetsWithProperty
- Inherited from Tangible findNestedIndirectObjects
- Inherited from Tangible get
- Inherited from Tangible getAllContents
- Inherited from Tangible getAllNestedContents
- Inherited from Tangible getAncestorId
- Inherited from Tangible getAnyPartContainingAnySubstance
- Inherited from Tangible getAnyPartContainingSubstance
- Inherited from Tangible getAnySubstanceThisContains
- Inherited from Tangible getAspectAt
- Inherited from Atom getClassInheritance
- Inherited from Tangible getClosedAnscestors
- Inherited from Tangible getContentsAt
- Inherited from Tangible getCountOfListableContentsAt
- Inherited from Tangible getDepth
- Inherited from Tangible getHeight
- Inherited from Tangible getListableContents
- Inherited from Tangible getNestOrPlaceAsset
- Inherited from Tangible getNestOrPlacePreposition
- Inherited from Tangible getOpenOrClosed
- Inherited from Tangible getPlaceAspect
- Inherited from Tangible getPlaceAsset
- Inherited from Tangible getPlaceAssetId
- Inherited from Tangible getPlacePreposition
- Inherited from Tangible getPrettyPlacePreposition
- Inherited from Tangible getPrintableListOfContents
- Inherited from Tangible getPrintableListOfContentsAt
- Inherited from Tangible getRoomAsset
- Inherited from Tangible getRoomId
- Inherited from Tangible getRopesThatBlockTravel
- Inherited from Tangible getSubstanceAt
- Inherited from Tangible getThingThisIsTiedToPlayerBy
- Inherited from Tangible getTiedThingsThatDragOnTravel
- Inherited from Asset getVerbConnectionCount
- Inherited from Asset getVerbConnections
- Inherited from Asset getVerbMaxConnections
- Inherited from Asset getVerbParam
- Inherited from Asset getVerbState
- Inherited from Tangible getVessel
- Inherited from Tangible getVesselAt
- Inherited from Tangible getVesselPreposition
- Inherited from Tangible getWidth
- Inherited from Tangible getY
- Inherited from Tangible getYBottom
- Inherited from Tangible getYRange
- Inherited from Tangible getYTop
- Inherited from Asset has
- Inherited from Asset hasAction
- Inherited from Tangible hasAnyPartContainingAnySubstance
- Inherited from Tangible hasAnyPartContainingSubstance
- Inherited from Tangible hasAspectAt
- Inherited from Atom hasClass
- Inherited from Tangible hasContents
- Inherited from Tangible hasContentsAtAspect
- Inherited from Asset hasDescription
- Inherited from Asset hasDirectObjects
- Inherited from Asset hasIndirectObjects
- Inherited from Tangible hasListableContents
- Inherited from Tangible hasPlace
- Inherited from Tangible hasPropertyOnAspectAt
- Inherited from Tangible hasRopesThatBlockTravel
- Inherited from Tangible hasTiedThingsThatDragOnTravel
- Inherited from Asset hasVerbMaxConnections
- Inherited from Asset hasVerbParam
- Inherited from Tangible hasVessel
- Inherited from Tangible hasVesselAtAspect
- Inherited from Asset iDidVerb
- Inherited from Asset iDidVerbCount
- Inherited from Asset incrementDoVerbCount
- Inherited from Asset incrementTryVerbCount
- Inherited from Tangible initialize
- Inherited from Tangible isAttached
- Inherited from Tangible isBehind
- Inherited from Asset isConnectedToAnything
- Inherited from Asset isConnectedToAsset
- Inherited from Asset isConnectedToNothing
- Inherited from Asset isDOV
- Inherited from Tangible isIn
- Inherited from Asset isIOV
- Inherited from Tangible isOn
- Inherited from Asset isOV
- Inherited from Tangible isPlacedAtAspect
- Inherited from Tangible isPlacedAtAspectAndAsset
- Inherited from Tangible isUnder
- Inherited from Asset isVerbState
- Inherited from Tangible isWithin
- Inherited from Tangible isWithinYRange
- Inherited from Asset iTriedVerb
- Inherited from Asset iTriedVerbCount
- Inherited from Tangible linkComponents
- Inherited from Tangible moveFrom
- Inherited from Tangible moveTo
- Inherited from Tangible onAddSubstanceToThis
- Inherited from Tangible onChangeGravity
- Inherited from Tangible onChangeMoisture
- Inherited from Tangible onChangeTemperature
- Inherited from Tangible onIngestThat
- Inherited from Tangible onMoistenThisWithThat
- Inherited from Tangible onMoveThatToThis
- Inherited from Tangible onNestThatToThis
- Inherited from Tangible onRemoveThatFromThis
- Inherited from Tangible onSubtractSubstanceFromThis
- Inherited from Tangible onTieThisToThat
- Inherited from Tangible onUnnestThatFromThis
- Inherited from Tangible onUntieThisFromThat
- Inherited from Tangible placePreventsNesting
- Inherited from Tangible put
- Inherited from Asset redirectVerb
- Inherited from Tangible registerComponents
- Inherited from Tangible removeAssetAt
- Inherited from Tangible removeThatFromThis
- Inherited from Atom set
- Inherited from Tangible setAspectAt
- Inherited from Asset setDOV
- Inherited from Asset setDOVs
- Inherited from Asset setIOV
- Inherited from Asset setIOVs
- Inherited from Asset setIs
- Inherited from Asset setLinkedState
- Inherited from Asset setObjectOfVerbs
- Inherited from Tangible setPlace
- Inherited from Tangible setPosition
- Inherited from Asset setVerbState
- Inherited from Asset setVerbSubscription
- Inherited from Asset setVerbSubscriptionsWithAssets
- Inherited from Asset setVerbWithAsset
- Inherited from Asset setVerbWithClass
- Inherited from Tangible setVesselAt
- Inherited from Tangible setX
- Inherited from Tangible setY
- Inherited from Tangible setZ
- Inherited from Asset toggleState
- Inherited from Asset triedVerb
- Inherited from Asset triedVerbCount
- Inherited from Asset undestroy
- Inherited from Tangible unfasten
- Inherited from Asset unredirectVerb
- Inherited from Asset unsetDOV
- Inherited from Asset unsetDOVs
- Inherited from Asset unsetIOV
- Inherited from Asset unsetIOVs
- Inherited from Asset unsetVerbSubscription
- Inherited from Tangible validate
- Inherited from Asset validateVerbConnections
Properties:
- Inherited from Tangible absorption_quantity
- Inherited from Asset adjectives
- Inherited from Tangible aperture
- Inherited from Tangible append_typed_strings_to_description
- Inherited from Tangible append_written_strings_to_description
- Inherited from Asset article_name
- Inherited from Asset articlename
- Inherited from Asset Articlename
- Inherited from Asset articlename_is
- Inherited from Asset Articlename_is
- Inherited from Asset articlename_isnt
- Inherited from Asset Articlename_isnt
- Inherited from Asset articlename_was
- Inherited from Asset Articlename_was
- Inherited from Asset articlename_wasnt
- Inherited from Asset Articlename_wasnt
- Inherited from Tangible aspects
- Inherited from Tangible buoyancy
- Inherited from Asset can
- Inherited from Tangible can.be_swung_at
- Inherited from Asset collection
- Inherited from Tangible components
- Inherited from Tangible contains
- Inherited from Tangible control_target_id
- Inherited from Tangible default_aspect
- Inherited from Asset definite_article
- Inherited from Asset definite_name
- Inherited from Asset description
- Inherited from Asset descriptions
- Inherited from Asset did
- Inherited from Tangible dimensions
- Inherited from Tangible direction
- Inherited from Asset dont_use_articles
- Inherited from Asset dov
- Inherited from Tangible emits
- Inherited from Asset exclude_from_disambiguation
- Inherited from Asset exclude_from_lookup
- Inherited from Tangible exit
- Inherited from Atom game
- Inherited from Asset image
- Inherited from Asset indefinite_article
- Inherited from Asset indefinite_name
- Inherited from Asset iov
- Inherited from Asset is
- Inherited from Asset is.abstract
- Inherited from Tangible is.buttoned
- Inherited from Tangible is.carried
- Inherited from Tangible is.closed
- Inherited from Tangible is.cold_source
- Inherited from Asset is.collection
- Inherited from Tangible is.connected_by
- Inherited from Asset is.data
- Inherited from Tangible is.deep_nest
- Inherited from Asset is.destroyed
- Inherited from Tangible is.distant
- Inherited from Asset is.extant
- Inherited from Tangible is.false_nest
- Inherited from Tangible is.fixed
- Inherited from Asset is.global
- Inherited from Tangible is.heat_source
- Inherited from Tangible is.hidden
- Inherited from Tangible is.hollow
- Inherited from Tangible is.inhands
- Inherited from Asset is.initialized
- Inherited from Asset is.known
- Inherited from Tangible is.light_source
- Inherited from Tangible is.listed
- Inherited from Tangible is.locked
- Inherited from Asset is.nameless
- Inherited from Tangible is.on
- Inherited from Asset is.placeholder
- Inherited from Asset is.plugged
- Inherited from Asset is.pluggedIn
- Inherited from Asset is.plural
- Inherited from Tangible is.present
- Inherited from Tangible is.reachable
- Inherited from Tangible is.reservoir
- Inherited from Tangible is.screwed
- Inherited from Tangible is.sealed
- Inherited from Asset is.singleton
- Inherited from Tangible is.supported
- Inherited from Tangible is.takeable
- Inherited from Asset is.validated
- Inherited from Tangible is.viewport
- Inherited from Tangible is.visible
- Inherited from Tangible is.watertight
- Inherited from Tangible is.worn
- Inherited from Tangible is.zipped
- Inherited from Tangible linkableClasses
- Inherited from Tangible linked_components
- Inherited from Tangible linked_parent
- Inherited from Tangible location_required
- Inherited from Tangible location_unneccessary
- Inherited from Tangible min_light_required_to_see
- Inherited from Asset must
- Inherited from Tangible must.hold_to_read
- Inherited from Tangible must.hold_to_see_through
- Inherited from Tangible must.hold_to_see_with
- Inherited from Tangible must.let_go_after_swing
- Inherited from Tangible must.wear_to_see_through
- Inherited from Tangible must.wear_to_see_with
- Inherited from Atom Name
- Inherited from Asset name_is_proper
- Inherited from Asset noun
- Inherited from Tangible on_tie_to_drag_behind_rope
- Inherited from Tangible on_tie_to_this_take_this
- Inherited from Tangible place
- Inherited from Tangible player_knows_its_hidden
- Inherited from Asset plural
- Inherited from Tangible position
- Inherited from Tangible posture_position
- Inherited from Asset print_bold
- Inherited from Asset print_class
- Inherited from Asset print_italic
- Inherited from Tangible print_open_or_closed
- Inherited from Asset print_style
- Inherited from Asset pronouns
- Inherited from Asset propername
- Inherited from Asset proxy
- Inherited from Asset quirks
- Inherited from Tangible quirks.climb_means_go_on
- Inherited from Tangible quirks.climb_means_stand_on
- Inherited from Tangible quirks.flick_means_toggle
- Inherited from Tangible quirks.flip_means_toggle
- Inherited from Tangible quirks.get_off_means_go_down
- Inherited from Tangible quirks.get_on_means_go_up
- Inherited from Tangible quirks.get_up_means_get_off
- Inherited from Tangible quirks.in_means_on
- Inherited from Tangible quirks.jump_means_jump_off
- Inherited from Tangible quirks.jump_means_jump_on
- Inherited from Tangible quirks.let_go_of_means_go_down
- Inherited from Tangible quirks.let_go_of_means_go_off
- Inherited from Tangible quirks.look_with_means_look_through
- Inherited from Tangible quirks.pick_means_unlock
- Inherited from Tangible quirks.point_means_aim
- Inherited from Tangible quirks.press_means_toggle
- Inherited from Tangible quirks.pull_means_open
- Inherited from Tangible quirks.pull_means_toggle
- Inherited from Tangible quirks.push_means_toggle
- Inherited from Tangible quirks.put_means_pour
- Inherited from Tangible quirks.stand_means_get_off
- Inherited from Tangible quirks.step_on_means_stamp_on
- Inherited from Tangible quirks.step_on_means_stand_on
- Inherited from Tangible quirks.take_means_hold
- Inherited from Tangible quirks.write_on_means_write_in
- Inherited from Tangible redirected_verbs
- Inherited from Asset short_name
- Inherited from Tangible show_things_this_is_tied_to_in_description
- Inherited from Asset singlePluralPairs
- Inherited from Asset split_name_for_world_lookup
- Inherited from Asset to_be
- Inherited from Asset tried
- Inherited from Tangible typed_strings
- Inherited from Tangible typing_targets
- Inherited from Asset use_definite_article_in_lists
- Inherited from Tangible use_once_message
- Inherited from Tangible written_strings
Methods Collapse all |
$can
$can()
Defined in: adventure/asset/$can.js, line 6
Inherited from: adventurejs.Asset#$can
$contains
$contains(id) → {Boolean}
Defined in: adventure/assets/tangible/$contains.js, line 5
Inherited from: adventurejs.Tangible#$contains
Parameters:
-
id
String
Returns:
Boolean
$is
$is(property, asset)
Defined in: adventure/assets/tangible/$is.js, line 5
Inherited from: adventurejs.Tangible#$is
Todos: Leaving open the possibility for other params.
Parameters:
-
property
String -
asset
Object
- assetA.$is("emitting")
- asking, is this asset an enabled substance emitter?
- assetA.$is("reservoir")
- asking, is this asset a substance reservoir such as a lake or desert?
- assetA.$is("broken")
- asking, is this asset broken?
- assetA.$is("carried")
- asking, is this asset in the player's inventory?
- assetA.$is("closed")
- asking, is this asset closed?
- assetA.$is("dead")
- asking, is this character dead?
- assetA.$is("held", assetB)
- asking, is this asset held by that asset, as in a bannister held by player?
- assetA.$is("holding", assetB)
- asking, is this asset holding that asset, as in player holding a rope?
- assetA.$is("in"|"on"|"under"|"behind"|"attached", assetB)
- accepts any preposition, asking, is this asset in that aspect of that asset?
- assetA.$is("inhands")
- asking, is this asset in the player's hands?
- assetA.$is("known")
- asking, is this asset known by player?
- assetA.$is("locked")
- asking, is this asset locked?
- assetA.$is("nested in", assetB)
- nested in, specific to character classes, asking, is this asset nested in that asset?
- assetA.$is("open")
- asking, is this asset open?
- assetA.$is("plugged")
- asking, is this asset plugged?
- assetA.$is("present")
- asking, is this asset present in player's location?
- assetA.$is("reachable")
- asking, is this asset reachable by player?
- assetA.$is("sealed")
- asking, is this asset sealed?
- assetA.$is("takeable")
- asking, can this asset be taken?
- assetA.$is("unlocked")
- asking, is this asset unlocked?
- assetA.$is("unplugged")
- asking, is this asset unplugged?
- assetA.$is("unsealed")
- asking, is this asset unsealed?
- assetA.$is("visible")
- asking, is this asset visible to player?
- assetA.$is("worn")
- asking, is this asset being worn?
- assetA.$is("zipped")
- asking, is this asset zipped?
$moveTo
$moveTo(aspect, asset)
Defined in: adventure/assets/tangible/$moveTo.js, line 5
Inherited from: adventurejs.Tangible#$moveTo
Parameters:
-
aspect
String -
asset
Object
$must
$must()
Defined in: adventure/asset/$must.js, line 6
Inherited from: adventurejs.Asset#$must
$quirks
$quirks() → {Boolean}
Defined in: adventure/asset/$quirk.js, line 6
Inherited from: adventurejs.Asset#$quirks
Returns:
Boolean
addAssetAt
addAssetAt() → {Array}
Defined in: adventure/assets/tangible/addAssetAt.js, line 5
Inherited from: adventurejs.Tangible#addAssetAt
Returns:
Array
addWordsToLookup
addWordsToLookup(words, type)
Defined in: adventure/asset/addWordsToLookup.js, line 5
Inherited from: adventurejs.Asset#addWordsToLookup
Parameters:
-
words
Array -
type
String
aliases
aliases()
Defined in: adventure/Asset.js, line 832
Inherited from: adventurejs.Asset#aliases
allowVerbOnce
allowVerbOnce(verb, ov) → {Boolean}
Defined in: adventure/asset/allowVerbOnce.js, line 5
Inherited from: adventurejs.Asset#allowVerbOnce
Parameters:
-
verb
String
The name of a verb. -
ov
String
Direct or indirect object of verb.
Returns:
Boolean
allowVerbWithAnything
allowVerbWithAnything(verb, ov) → {Boolean}
Defined in: adventure/asset/allowVerbWithAnything.js, line 5
Inherited from: adventurejs.Asset#allowVerbWithAnything
Parameters:
-
verb
String
The name of a verb. -
ov
String
Direct or indirect object of verb.
Returns:
Boolean
allowVerbWithAsset
allowVerbWithAsset(options) → {Boolean}
Defined in: adventure/asset/allowVerbWithAsset.js, line 5
Inherited from: adventurejs.Asset#allowVerbWithAsset
Parameters:
-
options
Object
An object of options.Properties
-
verb
String
Default value:
The name of a verb. -
asset
Object
Default value:
A game asset. -
ov
String <optional>
Default value: "dov"
Direct or indirect object of verb (default is "dov").
-
Returns:
Boolean
allowVerbWithNothing
allowVerbWithNothing(verb, ov) → {Boolean}
Defined in: adventure/asset/allowVerbWithNothing.js, line 5
Inherited from: adventurejs.Asset#allowVerbWithNothing
Parameters:
-
verb
String
The name of a verb. -
ov
String
Direct or indirect object of verb.
Returns:
Boolean
allowVerbWithPreposition
allowVerbWithPreposition(verb, prep, ov) → {Boolean}
Defined in: adventure/asset/allowVerbWithPreposition.js, line 5
Inherited from: adventurejs.Asset#allowVerbWithPreposition
Parameters:
-
verb
String
A verb name. -
prep
String
A preposition. -
ov
String
Direct or indirect object of verb.
Returns:
Boolean
areAnscestorsClosed
areAnscestorsClosed() → {Boolean}
Defined in: adventure/assets/tangible/areAnscestorsClosed.js, line 5
Inherited from: adventurejs.Tangible#areAnscestorsClosed
Returns:
Boolean
areAnscestorsKnown
areAnscestorsKnown() → {Boolean}
Defined in: adventure/assets/tangible/areAnscestorsKnown.js, line 5
Inherited from: adventurejs.Tangible#areAnscestorsKnown
Returns:
Boolean
areAnscestorsOpen
areAnscestorsOpen() → {Boolean}
Defined in: adventure/assets/tangible/areAnscestorsOpen.js, line 5
Inherited from: adventurejs.Tangible#areAnscestorsOpen
Returns:
Boolean
areAnscestorsUnknown
areAnscestorsUnknown(nestlevel) → {Boolean}
Defined in: adventure/assets/tangible/areAnscestorsUnknown.js, line 5
Inherited from: adventurejs.Tangible#areAnscestorsUnknown
Parameters:
-
nestlevel
int
Returns:
Boolean
canAnyPartContainSubstances
canAnyPartContainSubstances() → {boolean}
Defined in: adventure/assets/tangible/canAnyPartContainSubstances.js, line 5
Inherited from: adventurejs.Tangible#canAnyPartContainSubstances
Returns:
boolean
canBePut
canBePut(aspect, asset) → {Boolean}
Defined in: adventure/assets/tangible/canBePut.js, line 5
Inherited from: adventurejs.Tangible#canBePut
Parameters:
-
aspect
String -
asset
Object
with_assets
and
with_classes
properties.
Returns:
Boolean
canContainAssetAt
canContainAssetAt(object) → {Boolean}
Defined in: adventure/assets/tangible/canContainAssetAt.js, line 5
Inherited from: adventurejs.Tangible#canContainAssetAt
Parameters:
-
object
Object
Returns:
Boolean
canContainSubstances
canContainSubstances() → {Boolean}
Defined in: adventure/assets/tangible/canContainSubstances.js, line 5
Inherited from: adventurejs.Tangible#canContainSubstances
Returns:
Boolean
canDoVerbAutomatically
canDoVerbAutomatically(verb) → {Boolean}
Defined in: adventure/asset/canDoVerbAutomatically.js, line 5
Inherited from: adventurejs.Asset#canDoVerbAutomatically
Parameters:
-
verb
String
Returns:
Boolean
canNestPlayerAt
canNestPlayerAt(aspect) → {Boolean}
Defined in: adventure/assets/tangible/canNestPlayerAt.js, line 8
Inherited from: adventurejs.Tangible#canNestPlayerAt
Parameters:
-
aspect
String
A Tangible Aspect ID.
Returns:
Boolean
canSetVerbState
canSetVerbState(verb) → {Boolean}
Defined in: adventure/asset/canSetVerbState.js, line 5
Inherited from: adventurejs.Asset#canSetVerbState
Parameters:
-
verb
String
Returns:
Boolean
canThisAutoOpen
canThisAutoOpen() → {Boolean}
Defined in: adventure/assets/tangible/canThisAutoOpen.js, line 5
Inherited from: adventurejs.Tangible#canThisAutoOpen
Returns:
Boolean
containsAnyAsset
containsAnyAsset() → {Boolean}
Defined in: adventure/assets/tangible/containsAnyAsset.js, line 5
Inherited from: adventurejs.Tangible#containsAnyAsset
Returns:
Boolean
containsAnyAssetAt
containsAnyAssetAt(aspect) → {Boolean}
Defined in: adventure/assets/tangible/containsAnyAssetAt.js, line 5
Inherited from: adventurejs.Tangible#containsAnyAssetAt
Parameters:
-
aspect
String
Returns:
Boolean
containsAnySubstance
containsAnySubstance() → {Boolean}
Defined in: adventure/assets/tangible/containsAnySubstance.js, line 5
Inherited from: adventurejs.Tangible#containsAnySubstance
Returns:
Boolean
containsAnySubstanceAt
containsAnySubstanceAt(aspect) → {Boolean}
Defined in: adventure/assets/tangible/containsAnySubstanceAt.js, line 5
Inherited from: adventurejs.Tangible#containsAnySubstanceAt
Parameters:
-
aspect
String
Returns:
Boolean
containsAsset
containsAsset(id) → {String}
Defined in: adventure/assets/tangible/containsAsset.js, line 5
Inherited from: adventurejs.Tangible#containsAsset
Parameters:
-
id
String
Returns:
String
containsAssetAt
containsAssetAt(id, aspect) → {Boolean}
Defined in: adventure/assets/tangible/containsAssetAt.js, line 5
Inherited from: adventurejs.Tangible#containsAssetAt
Parameters:
-
id
String -
aspect
String
Returns:
Boolean
containsSubstance
containsSubstance(id) → {String}
Defined in: adventure/assets/tangible/containsSubstance.js, line 5
Inherited from: adventurejs.Tangible#containsSubstance
Parameters:
-
id
String
Returns:
String
containsSubstanceAt
containsSubstanceAt(id, aspect) → {Boolean}
Defined in: adventure/assets/tangible/containsSubstanceAt.js, line 5
Inherited from: adventurejs.Tangible#containsSubstanceAt
Parameters:
-
id
String -
aspect
String
Returns:
Boolean
destroy
destroy()
Defined in: adventure/assets/Tangible.js, line 948
Inherited from: adventurejs.Tangible#destroy
didDoVerbs
didDoVerbs(verbs) → {Boolean}
Defined in: adventure/asset/didDoVerbs.js, line 5
Inherited from: adventurejs.Asset#didDoVerbs
Parameters:
-
verbs
Array
Returns:
Boolean
didIoVerbs
didIoVerbs(verbs) → {Boolean}
Defined in: adventure/asset/didIoVerbs.js, line 5
Inherited from: adventurejs.Asset#didIoVerbs
Parameters:
-
verbs
Array
Returns:
Boolean
didVerb
didVerb(verb, ov) → {Boolean}
Defined in: adventure/asset/didVerb.js, line 5
Inherited from: adventurejs.Asset#didVerb
Parameters:
-
verb
String
The name of a verb. -
ov
String
Direct or indirect object of verb.
$did is an alias for authors.
Returns:
Boolean
didVerbCount
didVerbCount(verb, ov) → {Int}
Defined in: adventure/asset/didVerbCount.js, line 5
Inherited from: adventurejs.Asset#didVerbCount
Parameters:
-
verb
String
The name of a verb. -
ov
String
Direct or indirect object of verb.
$didCount is an alias for authors.
Returns:
Int
doVerbAction
doVerbAction(action, asset2, asset3, params) → {Boolean}
Defined in: adventure/asset/doVerbAction.js, line 5
Inherited from: adventurejs.Asset#doVerbAction
Parameters:
-
action
string -
asset2
string
We use asset.name here instead of asset.id in support of authors, because we're never asking them to deal in IDs, only names. Hooks will only be defined by authors, so we let them use asset.name as their identifier. We do however make an effort to see if an id has been passed instead of a name, because Ivan. -
asset3
string -
params
object
Arbitrary parameter object.
Returns:
Boolean
findNestedAssetsWithClass
findNestedAssetsWithClass(instanceClass) → {Array}
Defined in: adventure/assets/tangible/findNestedAssetsWithClass.js, line 5
Inherited from: adventurejs.Tangible#findNestedAssetsWithClass
Parameters:
-
instanceClass
String
Returns:
Array
findNestedAssetsWithProperty
findNestedAssetsWithProperty(property) → {Array}
Defined in: adventure/assets/tangible/findNestedAssetsWithProperty.js, line 5
Inherited from: adventurejs.Tangible#findNestedAssetsWithProperty
Parameters:
-
property
String
Returns:
Array
findNestedIndirectObjects
findNestedIndirectObjects(verb, direct_object) → {Array}
Defined in: adventure/assets/tangible/findNestedIndirectObjects.js, line 5
Inherited from: adventurejs.Tangible#findNestedIndirectObjects
Parameters:
-
verb
String
The name of a verb. -
direct_object
Object | String
An asset or asset ID of a direct object that the player has tried to perform an indirect verb on.
Returns:
Array
An array of indirect objects, if found.
get
get(property, qualifier)
Defined in: adventure/assets/tangible/$get.js, line 5
Inherited from: adventurejs.Tangible#get
Parameters:
-
property
String -
qualifier
String
- all - list all children in all aspects of this
- allnested - list all descendents in all aspects of this
- behind - list things behind this
- in - list things in this
- on - list things on this
- under - list things under this
- attached - list things attached to this
getAllContents
getAllContents() → {Array}
Defined in: adventure/assets/tangible/getAllContents.js, line 5
Inherited from: adventurejs.Tangible#getAllContents
Returns:
Array
getAllNestedContents
getAllNestedContents() → {Array}
Defined in: adventure/assets/tangible/getAllNestedContents.js, line 5
Inherited from: adventurejs.Tangible#getAllNestedContents
Returns:
Array
getAncestorId
getAncestorId() → {String}
Defined in: adventure/assets/tangible/getAncestorId.js, line 5
Inherited from: adventurejs.Tangible#getAncestorId
Returns:
String
getAnyPartContainingAnySubstance
getAnyPartContainingAnySubstance() → {object|null}
Defined in: adventure/assets/tangible/getAnyPartContainingAnySubstance.js, line 5
Inherited from: adventurejs.Tangible#getAnyPartContainingAnySubstance
Returns:
object
|
null
getAnyPartContainingSubstance
getAnyPartContainingSubstance(id) → {object}
Defined in: adventure/assets/tangible/getAnyPartContainingSubstance.js, line 5
Inherited from: adventurejs.Tangible#getAnyPartContainingSubstance
Parameters:
-
id
String
Returns:
object
getAnySubstanceThisContains
getAnySubstanceThisContains() → {String}
Defined in: adventure/assets/tangible/getAnySubstanceThisContains.js, line 5
Inherited from: adventurejs.Tangible#getAnySubstanceThisContains
Returns:
String
getAspectAt
getAspectAt(aspect) → {Object|Null}
Defined in: adventure/assets/tangible/getAspectAt.js, line 5
Inherited from: adventurejs.Tangible#getAspectAt
Parameters:
-
aspect
string
The aspect to get.
Returns:
Object
|
Null
getClassInheritance
getClassInheritance() → {Array}
Defined in: adventure/Atom.js, line 168
Inherited from: adventurejs.Atom#getClassInheritance
Returns:
Array
getClosedAnscestors
getClosedAnscestors() → {Array}
Defined in: adventure/assets/tangible/getClosedAnscestors.js, line 5
Inherited from: adventurejs.Tangible#getClosedAnscestors
Returns:
Array
getContentsAt
getContentsAt() → {Array}
Defined in: adventure/assets/tangible/getContentsAt.js, line 5
Inherited from: adventurejs.Tangible#getContentsAt
Returns:
Array
getCountOfListableContentsAt
getCountOfListableContentsAt(where) → {int}
Defined in: adventure/assets/tangible/getCountOfListableContentsAt.js, line 5
Inherited from: adventurejs.Tangible#getCountOfListableContentsAt
Parameters:
-
where
String
Returns:
int
getDepth
getDepth() → {Float}
Defined in: adventure/assets/tangible/getDepth.js, line 5
Inherited from: adventurejs.Tangible#getDepth
Returns:
Float
getHeight
getHeight() → {Float}
Defined in: adventure/assets/tangible/getHeight.js, line 5
Inherited from: adventurejs.Tangible#getHeight
Returns:
Float
getListableContents
getListableContents() → {Array}
Defined in: adventure/assets/tangible/getListableContents.js, line 5
Inherited from: adventurejs.Tangible#getListableContents
Returns:
Array
getNestOrPlaceAsset
getNestOrPlaceAsset() → {Boolean}
Defined in: adventure/assets/tangible/getNestOrPlaceAsset.js, line 5
Inherited from: adventurejs.Tangible#getNestOrPlaceAsset
Returns:
Boolean
getNestOrPlacePreposition
getNestOrPlacePreposition() → {Boolean}
Defined in: adventure/assets/tangible/getNestOrPlacePreposition.js, line 5
Inherited from: adventurejs.Tangible#getNestOrPlacePreposition
Returns:
Boolean
getOpenOrClosed
getOpenOrClosed() → {Array}
Defined in: adventure/assets/tangible/getOpenOrClosed.js, line 5
Inherited from: adventurejs.Tangible#getOpenOrClosed
Returns:
Array
getPlaceAspect
getPlaceAspect() → {Object|null}
Defined in: adventure/assets/tangible/getPlaceAspect.js, line 5
Inherited from: adventurejs.Tangible#getPlaceAspect
Returns:
Object
|
null
getPlaceAsset
getPlaceAsset() → {Object|Boolean}
Defined in: adventure/assets/tangible/getPlaceAsset.js, line 5
Inherited from: adventurejs.Tangible#getPlaceAsset
Returns:
Object
|
Boolean
getPlaceAssetId
getPlaceAssetId() → {String}
Defined in: adventure/assets/tangible/getPlaceAssetId.js, line 5
Inherited from: adventurejs.Tangible#getPlaceAssetId
Returns:
String
getPlacePreposition
getPlacePreposition() → {String}
Defined in: adventure/assets/tangible/getPlacePreposition.js, line 5
Inherited from: adventurejs.Tangible#getPlacePreposition
Returns:
String
getPrettyPlacePreposition
getPrettyPlacePreposition() → {String}
Defined in: adventure/assets/tangible/getPrettyPlacePreposition.js, line 5
Inherited from: adventurejs.Tangible#getPrettyPlacePreposition
Returns:
String
getPrintableListOfContents
getPrintableListOfContents(params) → {String}
Defined in: adventure/assets/tangible/getPrintableListOfContents.js, line 5
Inherited from: adventurejs.Tangible#getPrintableListOfContents
Parameters:
-
params
Object
Returns:
String
getPrintableListOfContentsAt
getPrintableListOfContentsAt(aspect, params) → {String}
Defined in: adventure/assets/tangible/getPrintableListOfContentsAt.js, line 5
Inherited from: adventurejs.Tangible#getPrintableListOfContentsAt
Todos: reconsider this logic because it assumes that aspect can be not enabled while substance within it can be enabled and that is not how I see it right now
Parameters:
-
aspect
String | Object -
params
Object
Returns:
String
getRoomAsset
getRoomAsset() → {String}
Defined in: adventure/assets/tangible/getRoomAsset.js, line 5
Inherited from: adventurejs.Tangible#getRoomAsset
Returns:
String
getRoomId
getRoomId() → {String}
Defined in: adventure/assets/tangible/getRoomId.js, line 5
Inherited from: adventurejs.Tangible#getRoomId
Returns:
String
getRopesThatBlockTravel
getRopesThatBlockTravel() → {Array}
Defined in: adventure/assets/tangible/getRopesThatBlockTravel.js, line 5
Inherited from: adventurejs.Tangible#getRopesThatBlockTravel
Returns:
Array
getSubstanceAt
getSubstanceAt() → {String}
Defined in: adventure/assets/tangible/getSubstanceAt.js, line 5
Inherited from: adventurejs.Tangible#getSubstanceAt
Returns:
String
getThingThisIsTiedToPlayerBy
getThingThisIsTiedToPlayerBy() → {Object}
Defined in: adventure/assets/tangible/getThingThisIsTiedToPlayerBy.js, line 5
Inherited from: adventurejs.Tangible#getThingThisIsTiedToPlayerBy
Returns:
Object
getTiedThingsThatDragOnTravel
getTiedThingsThatDragOnTravel() → {Array}
Defined in: adventure/assets/tangible/getTiedThingsThatDragOnTravel.js, line 5
Inherited from: adventurejs.Tangible#getTiedThingsThatDragOnTravel
Returns:
Array
getVerbConnectionCount
getVerbConnectionCount(verb, to_ov) → {Int}
Defined in: adventure/asset/getVerbConnectionCount.js, line 5
Inherited from: adventurejs.Asset#getVerbConnectionCount
Parameters:
-
verb
String
The name of a verb. -
to_ov
String
Connection to direct or indirect objects of verb.
Returns:
Int
getVerbConnections
getVerbConnections(verb, to_ov) → {Array}
Defined in: adventure/asset/getVerbConnections.js, line 5
Inherited from: adventurejs.Asset#getVerbConnections
Parameters:
-
verb
String
The name of a verb. -
to_ov
String
Connection to direct or indirect objects of verb.
Returns:
Array
getVerbMaxConnections
getVerbMaxConnections(verb, ov) → {Boolean}
Defined in: adventure/asset/getVerbMaxConnections.js, line 5
Inherited from: adventurejs.Asset#getVerbMaxConnections
Parameters:
-
verb
String
The name of a verb. -
ov
String
Direct or indirect object of verb.
Returns:
Boolean
getVerbParam
getVerbParam(verb, param) → {*}
Defined in: adventure/asset/getVerbParam.js, line 5
Inherited from: adventurejs.Asset#getVerbParam
Parameters:
-
verb
String
The name of a verb. -
param
String
The name of a param in with_params.
Returns:
*
getVerbState
getVerbState()
Defined in: adventure/asset/getVerbState.js, line 5
Inherited from: adventurejs.Asset#getVerbState
getVessel
getVessel() → {Object|Null}
Defined in: adventure/assets/tangible/getVessel.js, line 5
Inherited from: adventurejs.Tangible#getVessel
Returns:
Object
|
Null
getVesselAt
getVesselAt(aspect) → {Object|Null}
Defined in: adventure/assets/tangible/getVesselAt.js, line 5
Inherited from: adventurejs.Tangible#getVesselAt
Parameters:
-
aspect
string
The aspect to check.
Returns:
Object
|
Null
getVesselPreposition
getVesselPreposition() → {String}
Defined in: adventure/assets/tangible/getVesselPreposition.js, line 5
Inherited from: adventurejs.Tangible#getVesselPreposition
Returns:
String
getWidth
getWidth() → {Float}
Defined in: adventure/assets/tangible/getWidth.js, line 5
Inherited from: adventurejs.Tangible#getWidth
Returns:
Float
getY
getY() → {Float}
Defined in: adventure/assets/tangible/getY.js, line 5
Inherited from: adventurejs.Tangible#getY
Returns:
Float
getYBottom
getYBottom() → {Float}
Defined in: adventure/assets/tangible/getYBottom.js, line 5
Inherited from: adventurejs.Tangible#getYBottom
Returns:
Float
getYRange
getYRange() → {Object}
Defined in: adventure/assets/tangible/getYRange.js, line 5
Inherited from: adventurejs.Tangible#getYRange
Returns:
Object
getYTop
getYTop() → {Float}
Defined in: adventure/assets/tangible/getYTop.js, line 5
Inherited from: adventurejs.Tangible#getYTop
Returns:
Float
has
has(asset)
Defined in: adventure/asset/$has.js, line 6
Inherited from: adventurejs.Asset#has
Parameters:
-
asset
Object
if( MyGame.$('crown').$has('jewel') ){ // do stuff }
hasAction
hasAction(hook_name, asset1_name, asset2_name) → {Boolean}
Defined in: adventure/asset/hasAction.js, line 5
Inherited from: adventurejs.Asset#hasAction
Parameters:
-
hook_name
string -
asset1_name
string
We use asset.name here instead of asset.id to make life slightly easier for authors. Asset IDs are formed from asset names, but generally we don't expect authors to be aware of IDs. Hooks will only be defined by authors, so let them use asset.name as their identifier. We do however make an effort to see if an id has been passed instead of a name. -
asset2_name
string
Returns:
Boolean
hasAnyPartContainingAnySubstance
hasAnyPartContainingAnySubstance() → {object|null}
Defined in: adventure/assets/tangible/hasAnyPartContainingAnySubstance.js, line 5
Inherited from: adventurejs.Tangible#hasAnyPartContainingAnySubstance
Returns:
object
|
null
hasAnyPartContainingSubstance
hasAnyPartContainingSubstance(id) → {boolean}
Defined in: adventure/assets/tangible/hasAnyPartContainingSubstance.js, line 5
Inherited from: adventurejs.Tangible#hasAnyPartContainingSubstance
Parameters:
-
id
String
Returns:
boolean
hasAspectAt
hasAspectAt(aspect) → {Boolean}
Defined in: adventure/assets/tangible/hasAspectAt.js, line 5
Inherited from: adventurejs.Tangible#hasAspectAt
Parameters:
-
aspect
String
Returns:
Boolean
hasClass
hasClass(prop) → {Boolean}
Defined in: adventure/Atom.js, line 148
Inherited from: adventurejs.Atom#hasClass
Parameters:
-
prop
String
Name of the class to test for.
Returns:
Boolean
hasContents
hasContents(preposition) → {Boolean}
Defined in: adventure/assets/tangible/hasContents.js, line 5
Inherited from: adventurejs.Tangible#hasContents
Parameters:
-
preposition
String
Optionally provide a preposition to specify an aspect.
Returns:
Boolean
hasContentsAtAspect
hasContentsAtAspect(aspect) → {Boolean}
Defined in: adventure/assets/tangible/hasContentsAtAspect.js, line 5
Inherited from: adventurejs.Tangible#hasContentsAtAspect
Parameters:
-
aspect
String
Returns:
Boolean
hasDescription
hasDescription(identifier) → {String|Boolean}
Defined in: adventure/asset/hasDescription.js, line 5
Inherited from: adventurejs.Asset#hasDescription
Parameters:
-
identifier
String
Returns:
String
|
Boolean
hasDirectObjects
hasDirectObjects(verb) → {Boolean}
Defined in: adventure/asset/hasDirectObjects.js, line 5
Inherited from: adventurejs.Asset#hasDirectObjects
Parameters:
-
verb
String
Returns:
Boolean
hasIndirectObjects
hasIndirectObjects(verb) → {Boolean}
Defined in: adventure/asset/hasIndirectObjects.js, line 5
Inherited from: adventurejs.Asset#hasIndirectObjects
Parameters:
-
verb
String
Returns:
Boolean
hasListableContents
hasListableContents() → {Boolean}
Defined in: adventure/assets/tangible/hasListableContents.js, line 5
Inherited from: adventurejs.Tangible#hasListableContents
Returns:
Boolean
hasPlace
hasPlace() → {Boolean}
Defined in: adventure/assets/tangible/hasPlace.js, line 5
Inherited from: adventurejs.Tangible#hasPlace
Returns:
Boolean
hasPropertyOnAspectAt
hasPropertyOnAspectAt() → {Boolean}
Defined in: adventure/assets/tangible/hasPropertyOnAspectAt.js, line 5
Inherited from: adventurejs.Tangible#hasPropertyOnAspectAt
- this will likely go away
Returns:
Boolean
hasRopesThatBlockTravel
hasRopesThatBlockTravel() → {Boolean}
Defined in: adventure/assets/tangible/hasRopesThatBlockTravel.js, line 5
Inherited from: adventurejs.Tangible#hasRopesThatBlockTravel
Returns:
Boolean
hasTiedThingsThatDragOnTravel
hasTiedThingsThatDragOnTravel() → {Boolean}
Defined in: adventure/assets/tangible/hasTiedThingsThatDragOnTravel.js, line 5
Inherited from: adventurejs.Tangible#hasTiedThingsThatDragOnTravel
Returns:
Boolean
hasVerbMaxConnections
hasVerbMaxConnections(verb, to_ov) → {Boolean}
Defined in: adventure/asset/hasVerbMaxConnections.js, line 5
Inherited from: adventurejs.Asset#hasVerbMaxConnections
Todos: dov/iov or both
Parameters:
-
verb
String
The name of a verb. -
to_ov
String
Connection to direct or indirect objects of verb.
Returns:
Boolean
hasVerbParam
hasVerbParam(verb, param) → {*}
Defined in: adventure/asset/hasVerbParam.js, line 5
Inherited from: adventurejs.Asset#hasVerbParam
Parameters:
-
verb
String
The name of a verb. -
param
String
The name of a param in with_params.
Returns:
*
hasVessel
hasVessel() → {Boolean}
Defined in: adventure/assets/tangible/hasVessel.js, line 5
Inherited from: adventurejs.Tangible#hasVessel
Returns:
Boolean
hasVesselAtAspect
hasVesselAtAspect(aspect) → {Boolean}
Defined in: adventure/assets/tangible/hasVesselAtAspect.js, line 5
Inherited from: adventurejs.Tangible#hasVesselAtAspect
Parameters:
-
aspect
String
Returns:
Boolean
iDidVerb
iDidVerb(verb, ov) → {Boolean}
Defined in: adventure/asset/iDidVerb.js, line 5
Inherited from: adventurejs.Asset#iDidVerb
Parameters:
-
verb
String
The name of a verb. -
ov
String
Direct or indirect object of verb.
$iDidDo is an alias for authors.
Returns:
Boolean
iDidVerbCount
iDidVerbCount(verb, ov) → {Int}
Defined in: adventure/asset/iDidVerbCount.js, line 5
Inherited from: adventurejs.Asset#iDidVerbCount
Parameters:
-
verb
String
The name of a verb. -
ov
String
Direct or indirect object of verb.
$iDidCount is an alias for authors.
Returns:
Int
incrementDoVerbCount
incrementDoVerbCount(verb, ov)
Defined in: adventure/asset/incrementDoVerbCount.js, line 5
Inherited from: adventurejs.Asset#incrementDoVerbCount
Parameters:
-
verb
String -
ov
String
"dov" or "iov" representing a direct or indirect object.
incrementTryVerbCount
incrementTryVerbCount(verb, index)
Defined in: adventure/asset/incrementTryVerbCount.js, line 5
Inherited from: adventurejs.Asset#incrementTryVerbCount
Parameters:
-
verb
String -
index
Int
initialize
initialize(game) → {Boolean}
Defined in: adventure/assets/Tangible.js, line 925
Inherited from: adventurejs.Tangible#initialize
Parameters:
-
game
Object
- link related assets
- register components
Returns:
Boolean
isAttached
isAttached(asset) → {boolean}
Defined in: adventure/assets/tangible/$isAttached.js, line 6
Inherited from: adventurejs.Tangible#isAttached
Parameters:
-
asset
Object | String
Can be string or object.
behind
aspect of another asset.
This is a one-to-one check that doesn't take nesting into consideration.
if( MyGame.$('trophy').$isAttached('plaque') ){ // do stuff }
Returns:
boolean
isBehind
isBehind(asset) → {boolean}
Defined in: adventure/assets/tangible/$isBehind.js, line 6
Inherited from: adventurejs.Tangible#isBehind
Parameters:
-
asset
Object | String
Can be string or object.
behind
aspect of another asset.
This is a one-to-one check that doesn't take nesting into consideration.
if( MyGame.$('killer').$isBehind('curtain') ){ // do stuff }
Returns:
boolean
isConnectedToAnything
isConnectedToAnything(verb, to_ov) → {Boolean}
Defined in: adventure/asset/isConnectedToAnything.js, line 5
Inherited from: adventurejs.Asset#isConnectedToAnything
Parameters:
-
verb
String
The name of a verb. -
to_ov
String
Direct or indirect object of verb.
plugIn
or tie
. For example, if this asset
is a computer plugged into an outlet, this method would return true.
Returns:
Boolean
isConnectedToAsset
isConnectedToAsset(verb, asset, to_ov) → {Boolean}
Defined in: adventure/asset/isConnectedToAsset.js, line 5
Inherited from: adventurejs.Asset#isConnectedToAsset
Parameters:
-
verb
String
The name of the verb to test. -
asset
Object | String
A game asset or asset id to test. -
to_ov
String
Connection to direct or indirect objects of verb.
Returns:
Boolean
isConnectedToNothing
isConnectedToNothing(verb, ov) → {Boolean}
Defined in: adventure/asset/isConnectedToNothing.js, line 5
Inherited from: adventurejs.Asset#isConnectedToNothing
Parameters:
-
verb
String
The name of a verb. -
ov
String
Direct or indirect object of verb.
asset.is.connected_by.plugIn.to_iov
to represent the computer's plugged in state.
Returns:
Boolean
isDOV
isDOV(verb) → {Boolean}
Defined in: adventure/asset/isDOV.js, line 5
Inherited from: adventurejs.Asset#isDOV
Parameters:
-
verb
String
Returns:
Boolean
isIn
isIn(asset) → {boolean}
Defined in: adventure/assets/tangible/$isIn.js, line 6
Inherited from: adventurejs.Tangible#isIn
Parameters:
-
asset
Object | String
Can be string or object.
in
aspect of another asset.
This is a one-to-one check that doesn't take nesting into consideration.
if( MyGame.$('rabbit').$isIn('hat') ){ // do stuff }
Returns:
boolean
isIOV
isIOV(verb) → {Boolean}
Defined in: adventure/asset/isIOV.js, line 5
Inherited from: adventurejs.Asset#isIOV
Parameters:
-
verb
String
Returns:
Boolean
isOn
isOn(asset) → {boolean}
Defined in: adventure/assets/tangible/$isOn.js, line 6
Inherited from: adventurejs.Tangible#isOn
Parameters:
-
asset
Object | String
Can be string or object.
on
aspect of another asset.
This is a one-to-one check that doesn't take nesting into consideration.
if( MyGame.$('fishbowl').$isOn('credenza') ){ // do stuff }
Returns:
boolean
isOV
isOV(verb) → {Boolean}
Defined in: adventure/asset/isOV.js, line 5
Inherited from: adventurejs.Asset#isOV
Parameters:
-
verb
String
Returns:
Boolean
isPlacedAtAspect
isPlacedAtAspect() → {Boolean}
Defined in: adventure/assets/tangible/isPlacedAtAspect.js, line 5
Inherited from: adventurejs.Tangible#isPlacedAtAspect
Returns:
Boolean
isPlacedAtAspectAndAsset
isPlacedAtAspectAndAsset(aspect, asset) → {Boolean}
Defined in: adventure/assets/tangible/isPlacedAtAspectAndAsset.js, line 5
Inherited from: adventurejs.Tangible#isPlacedAtAspectAndAsset
Parameters:
-
aspect
String -
asset
String
Returns:
Boolean
isUnder
isUnder(asset) → {boolean}
Defined in: adventure/assets/tangible/$isUnder.js, line 6
Inherited from: adventurejs.Tangible#isUnder
Parameters:
-
asset
Object | String
Can be string or object.
under
aspect of another asset.
This is a one-to-one check that doesn't take nesting into consideration.
if( MyGame.$('monster').$isUnder('bed') ){ // do stuff }
Returns:
boolean
isVerbState
isVerbState(verb) → {Boolean}
Defined in: adventure/asset/isVerbState.js, line 5
Inherited from: adventurejs.Asset#isVerbState
Parameters:
-
verb
String
Returns:
Boolean
isWithin
isWithin(asset) → {boolean}
Defined in: adventure/assets/tangible/$isWithin.js, line 6
Inherited from: adventurejs.Tangible#isWithin
Parameters:
-
asset
Object | String
Can be string or object.
if( MyGame.$('jewel').$isWithin('crown') ){ // do stuff }
Returns:
boolean
isWithinYRange
isWithinYRange(asset) → {Boolean}
Defined in: adventure/assets/tangible/isWithinYRange.js, line 5
Inherited from: adventurejs.Tangible#isWithinYRange
Parameters:
-
asset
Object
Returns:
Boolean
iTriedVerb
iTriedVerb(verb, ov) → {Boolean}
Defined in: adventure/asset/iTriedVerb.js, line 5
Inherited from: adventurejs.Asset#iTriedVerb
Parameters:
-
verb
String
The name of a verb. -
ov
String
Direct or indirect object of verb.
$iTried is an alias for authors.
Returns:
Boolean
iTriedVerbCount
iTriedVerbCount(verb, ov) → {Boolean}
Defined in: adventure/asset/iTriedVerbCount.js, line 5
Inherited from: adventurejs.Asset#iTriedVerbCount
Parameters:
-
verb
String
The name of a verb. -
ov
String
Direct or indirect object of verb.
$iTryCount is an alias for authors.
Returns:
Boolean
linkComponents
linkComponents()
Defined in: adventure/assets/tangible/linkComponents.js, line 5
Inherited from: adventurejs.Tangible#linkComponents
moveFrom
moveFrom(asset) → {Boolean}
Defined in: adventure/assets/tangible/$moveFrom.js, line 5
Inherited from: adventurejs.Tangible#moveFrom
Parameters:
-
asset
Object
Returns:
Boolean
moveTo
moveTo(aspect, asset)
Defined in: adventure/assets/tangible/moveTo.js, line 5
Inherited from: adventurejs.Tangible#moveTo
Parameters:
-
aspect
String -
asset
Object
onAddSubstanceToThis
onAddSubstanceToThis(asset)
Defined in: adventure/assets/tangible/onAddSubstanceToThis.js, line 5
Inherited from: adventurejs.Tangible#onAddSubstanceToThis
Parameters:
-
asset
Object
onChangeGravity
onChangeGravity()
Defined in: adventure/assets/tangible/onChangeGravity.js, line 5
Inherited from: adventurejs.Tangible#onChangeGravity
onChangeMoisture
onChangeMoisture(asset)
Defined in: adventure/assets/tangible/onChangeMoisture.js, line 5
Inherited from: adventurejs.Tangible#onChangeMoisture
Todos: This should probably take a moisture value rather than an asset.
Parameters:
-
asset
Object
onChangeTemperature
onChangeTemperature()
Defined in: adventure/assets/tangible/onChangeTemperature.js, line 5
Inherited from: adventurejs.Tangible#onChangeTemperature
onIngestThat
onIngestThat(asset) → {*}
Defined in: adventure/assets/tangible/onIngestThat.js, line 5
Inherited from: adventurejs.Tangible#onIngestThat
Parameters:
-
asset
Object
Returns:
*
onMoistenThisWithThat
onMoistenThisWithThat(asset)
Defined in: adventure/assets/tangible/onMoistenThisWithThat.js, line 5
Inherited from: adventurejs.Tangible#onMoistenThisWithThat
Parameters:
-
asset
Object
onMoveThatToThis
onMoveThatToThis(asset, where) → {*}
Defined in: adventure/assets/tangible/onMoveThatToThis.js, line 5
Inherited from: adventurejs.Tangible#onMoveThatToThis
Parameters:
-
asset
Object -
where
String
Returns:
*
onNestThatToThis
onNestThatToThis(player) → {Boolean}
Defined in: adventure/assets/tangible/onNestThatToThis.js, line 5
Inherited from: adventurejs.Tangible#onNestThatToThis
Parameters:
-
player
Object
Returns:
Boolean
onRemoveThatFromThis
onRemoveThatFromThis(asset) → {Boolean}
Defined in: adventure/assets/tangible/onRemoveThatFromThis.js, line 5
Inherited from: adventurejs.Tangible#onRemoveThatFromThis
Parameters:
-
asset
Object
Returns:
Boolean
onSubtractSubstanceFromThis
onSubtractSubstanceFromThis(asset)
Defined in: adventure/assets/tangible/onSubtractSubstanceFromThis.js, line 5
Inherited from: adventurejs.Tangible#onSubtractSubstanceFromThis
Parameters:
-
asset
Object
onTieThisToThat
onTieThisToThat(asset) → {Boolean}
Defined in: adventure/assets/tangible/onTieThisToThat.js, line 5
Inherited from: adventurejs.Tangible#onTieThisToThat
Parameters:
-
asset
Object
Returns:
Boolean
onUnnestThatFromThis
onUnnestThatFromThis(player) → {Boolean}
Defined in: adventure/assets/tangible/onUnnestThatFromThis.js, line 5
Inherited from: adventurejs.Tangible#onUnnestThatFromThis
Parameters:
-
player
Object
Returns:
Boolean
onUntieThisFromThat
onUntieThisFromThat(asset) → {Boolean}
Defined in: adventure/assets/tangible/onUntieThisFromThat.js, line 5
Inherited from: adventurejs.Tangible#onUntieThisFromThat
Parameters:
-
asset
Object
Returns:
Boolean
placePreventsNesting
placePreventsNesting(player) → {Boolean}
Defined in: adventure/assets/tangible/placePreventsNesting.js, line 5
Inherited from: adventurejs.Tangible#placePreventsNesting
Parameters:
-
player
Object
Returns:
Boolean
put
put(preposition, indirect_object)
Defined in: adventure/assets/tangible/$put.js, line 8
Inherited from: adventurejs.Tangible#put
Parameters:
-
preposition
String -
indirect_object
Object | String
asset object or name/id
redirectVerb
redirectVerb(oldVerb, newVerb)
Defined in: adventure/asset/redirectVerb.js, line 6
Inherited from: adventurejs.Asset#redirectVerb
Parameters:
-
oldVerb
String -
newVerb
String
registerComponents
registerComponents()
Defined in: adventure/assets/tangible/registerComponents.js, line 5
Inherited from: adventurejs.Tangible#registerComponents
removeAssetAt
removeAssetAt() → {Array}
Defined in: adventure/assets/tangible/removeAssetAt.js, line 5
Inherited from: adventurejs.Tangible#removeAssetAt
Returns:
Array
removeThatFromThis
removeThatFromThis(asset)
Defined in: adventure/assets/tangible/removeThatFromThis.js, line 5
Inherited from: adventurejs.Tangible#removeThatFromThis
Parameters:
-
asset
Object
set
set(props) → {Object}
Defined in: adventure/Atom.js, line 136
Inherited from: adventurejs.Atom#set
Parameters:
-
props
Object
A generic object containing properties to copy to the Object instance.
Returns:
Object
Returns the instance the method is called on (useful for chaining calls.)
setAspectAt
setAspectAt(aspect) → {Array}
Defined in: adventure/assets/tangible/setAspectAt.js, line 5
Inherited from: adventurejs.Tangible#setAspectAt
Parameters:
-
aspect
string
The aspect to add.
Returns:
Array
setDOV
setDOV(verb, params)
Defined in: adventure/asset/setDOV.js, line 6
Inherited from: adventurejs.Asset#setDOV
Parameters:
-
verb
String -
params
Object
setVerbSubscription
with direct object specified.
setDOVs
setDOVs(verb, params)
Defined in: adventure/asset/setDOVs.js, line 6
Inherited from: adventurejs.Asset#setDOVs
Parameters:
-
verb
String -
params
Object
setVerbSubscription
with direct object specified.
setIOV
setIOV(verb, params)
Defined in: adventure/asset/setIOV.js, line 6
Inherited from: adventurejs.Asset#setIOV
Parameters:
-
verb
String -
params
Object
setVerbSubscription
with indirect object specified.
setIOVs
setIOVs(verb, params)
Defined in: adventure/asset/setIOVs.js, line 6
Inherited from: adventurejs.Asset#setIOVs
Parameters:
-
verb
String -
params
Object
setVerbSubscription
with indirect object specified.
setIs
setIs(bool)
Defined in: adventure/asset/setIs.js, line 6
Inherited from: adventurejs.Asset#setIs
Parameters:
-
bool
Boolean
setLinkedState
setLinkedState(bool)
Defined in: adventure/asset/setLinkedState.js, line 6
Inherited from: adventurejs.Asset#setLinkedState
Parameters:
-
bool
Boolean
setObjectOfVerbs
setObjectOfVerbs(object_of, verb)
Defined in: adventure/asset/setObjectOfVerbs.js, line 6
Inherited from: adventurejs.Asset#setObjectOfVerbs
Parameters:
-
object_of
String -
verb
String
setVerbSubscription
.
setPlace
setPlace(aspect, asset_id) → {Object}
Defined in: adventure/assets/tangible/setPlace.js, line 5
Inherited from: adventurejs.Tangible#setPlace
Parameters:
-
aspect
String -
asset_id
String
Returns:
Object
setPosition
setPosition(params) → {Object}
Defined in: adventure/assets/tangible/setPosition.js, line 5
Inherited from: adventurejs.Tangible#setPosition
Parameters:
-
params
Object
Returns:
Object
setVerbState
setVerbState()
Defined in: adventure/asset/setVerbState.js, line 5
Inherited from: adventurejs.Asset#setVerbState
setVerbSubscription
setVerbSubscription(object_of, verb, params)
Defined in: adventure/asset/setVerbSubscription.js, line 5
Inherited from: adventurejs.Asset#setVerbSubscription
Todos: phase out earlier version
Parameters:
-
object_of
String -
verb
String | Object
An early version takes a string, with separate params object. A later version takes an object that includes the verb name as an object key and params as value. -
params
Object
An optional param that works with the earlier version.
setVerbSubscriptionsWithAssets
setVerbSubscriptionsWithAssets(description) → {String}
Defined in: adventure/asset/setVerbSubscriptionsWithAssets.js, line 5
Inherited from: adventurejs.Asset#setVerbSubscriptionsWithAssets
Parameters:
-
description
String
Returns:
String
setVerbWithAsset
setVerbWithAsset(verb, asset, ov) → {Boolean}
Defined in: adventure/asset/setVerbWithAsset.js, line 5
Inherited from: adventurejs.Asset#setVerbWithAsset
Parameters:
-
verb
String
The name of a verb. -
asset
Object -
ov
String
Direct or indirect object of verb.
Returns:
Boolean
setVerbWithClass
setVerbWithClass(verb, klass, ov) → {Boolean}
Defined in: adventure/asset/setVerbWithClass.js, line 5
Inherited from: adventurejs.Asset#setVerbWithClass
Parameters:
-
verb
String
The name of a verb. -
klass
String -
ov
String
Direct or indirect object of verb.
Returns:
Boolean
setVesselAt
setVesselAt(aspect) → {Array}
Defined in: adventure/assets/tangible/setVesselAt.js, line 5
Inherited from: adventurejs.Tangible#setVesselAt
Parameters:
-
aspect
string
The aspect to add.
Returns:
Array
setX
setX(value) → {Float}
Defined in: adventure/assets/tangible/setX.js, line 5
Inherited from: adventurejs.Tangible#setX
Parameters:
-
value
Float
Returns:
Float
setY
setY(value) → {Float}
Defined in: adventure/assets/tangible/setY.js, line 5
Inherited from: adventurejs.Tangible#setY
Parameters:
-
value
Float
Returns:
Float
setZ
setZ(value) → {Float}
Defined in: adventure/assets/tangible/setZ.js, line 5
Inherited from: adventurejs.Tangible#setZ
Parameters:
-
value
Float
Returns:
Float
toggleState
toggleState(verb) → {Boolean}
Defined in: adventure/asset/toggleState.js, line 5
Inherited from: adventurejs.Asset#toggleState
Parameters:
-
verb
String
Returns:
Boolean
triedVerb
triedVerb(verb, ov) → {Boolean}
Defined in: adventure/asset/triedVerb.js, line 5
Inherited from: adventurejs.Asset#triedVerb
Parameters:
-
verb
String
The name of a verb. -
ov
String
Direct or indirect object of verb.
$tried is an alias for authors.
Returns:
Boolean
triedVerbCount
triedVerbCount(verb, ov) → {Boolean}
Defined in: adventure/asset/triedVerbCount.js, line 5
Inherited from: adventurejs.Asset#triedVerbCount
Parameters:
-
verb
String
The name of a verb. -
ov
String
Direct or indirect object of verb.
$triedCount is an alias for authors.
Returns:
Boolean
undestroy
undestroy()
Defined in: adventure/asset/undestroy.js, line 6
Inherited from: adventurejs.Asset#undestroy
unfasten
unfasten() → {string}
Defined in: adventure/assets/tangible/unfasten.js, line 6
Inherited from: adventurejs.Tangible#unfasten
Returns:
string
unredirectVerb
unredirectVerb(oldVerb)
Defined in: adventure/asset/unredirectVerb.js, line 6
Inherited from: adventurejs.Asset#unredirectVerb
Parameters:
-
oldVerb
String
unsetDOV
unsetDOV(verb)
Defined in: adventure/asset/unsetDOV.js, line 6
Inherited from: adventurejs.Asset#unsetDOV
Parameters:
-
verb
String
unsetVerbSubscription
.
unsetDOVs
unsetDOVs(verbs)
Defined in: adventure/asset/unsetDOVs.js, line 6
Inherited from: adventurejs.Asset#unsetDOVs
Parameters:
-
verbs
Array
unsetVerbSubscription
.
unsetIOV
unsetIOV(verb)
Defined in: adventure/asset/unsetIOV.js, line 6
Inherited from: adventurejs.Asset#unsetIOV
Parameters:
-
verb
String
unsetVerbSubscription
.
unsetIOVs
unsetIOVs(verbs)
Defined in: adventure/asset/unsetIOVs.js, line 6
Inherited from: adventurejs.Asset#unsetIOVs
Parameters:
-
verbs
Array
unsetVerbSubscription
.
unsetVerbSubscription
unsetVerbSubscription(object_of, verb)
Defined in: adventure/asset/unsetVerbSubscription.js, line 5
Inherited from: adventurejs.Asset#unsetVerbSubscription
Parameters:
-
object_of
String -
verb
String
validate
validate(game) → {Boolean}
Defined in: adventure/assets/Tangible.js, line 867
Inherited from: adventurejs.Tangible#validate
Parameters:
-
game
Object
- check for implied dependencies and make them explicit
- check for proper asset location
- set parent associations
Returns:
Boolean
validateVerbConnections
validateVerbConnections()
Defined in: adventure/asset/validateVerbConnections.js, line 5
Inherited from: adventurejs.Asset#validateVerbConnections
dov[verb]
and some verbs can make connections between assets
that they act upon. Connections are stored in
asset.is.connected_by.verbname.to_iov["array of asset ids"]
.
Authors can preset connections in their game file,
so we validate any preset connections here.
Properties |
absorption_quantity
absorption_quantity :Boolean
Defined in: adventure/assets/Tangible.js, line 308
Inherited from: adventurejs.Tangible#absorption_quantity
Default value: 0
adjectives
adjectives :Getter/Setter
Defined in: adventure/Asset.js, line 329
Inherited from: adventurejs.Asset#adjectives
aperture
aperture :String
Defined in: adventure/assets/tangibles/Exit.js, line 290
Inherited from: adventurejs.Tangible#aperture
Default value: ""
append_typed_strings_to_description
append_typed_strings_to_description :Boolean
Defined in: adventure/assets/Tangible.js, line 416
Inherited from: adventurejs.Tangible#append_typed_strings_to_description
Default value: false
append_written_strings_to_description
append_written_strings_to_description :Boolean
Defined in: adventure/assets/Tangible.js, line 409
Inherited from: adventurejs.Tangible#append_written_strings_to_description
Default value: false
article_name
article_name :Getter
Defined in: adventure/Asset.js, line 411
Inherited from: adventurejs.Asset#article_name
articlename
articlename :Getter
Defined in: adventure/Asset.js, line 425
Inherited from: adventurejs.Asset#articlename
Articlename
Articlename :Getter
Defined in: adventure/Asset.js, line 492
Inherited from: adventurejs.Asset#Articlename
articlename_is
articlename_is :Getter
Defined in: adventure/Asset.js, line 452
Inherited from: adventurejs.Asset#articlename_is
Articlename_is
Articlename_is :Getter
Defined in: adventure/Asset.js, line 501
Inherited from: adventurejs.Asset#Articlename_is
articlename_isnt
articlename_isnt :Getter
Defined in: adventure/Asset.js, line 462
Inherited from: adventurejs.Asset#articlename_isnt
Articlename_isnt
Articlename_isnt :Getter
Defined in: adventure/Asset.js, line 510
Inherited from: adventurejs.Asset#Articlename_isnt
articlename_was
articlename_was :Getter
Defined in: adventure/Asset.js, line 472
Inherited from: adventurejs.Asset#articlename_was
Articlename_was
Articlename_was :Getter
Defined in: adventure/Asset.js, line 519
Inherited from: adventurejs.Asset#Articlename_was
articlename_wasnt
articlename_wasnt :Getter
Defined in: adventure/Asset.js, line 482
Inherited from: adventurejs.Asset#articlename_wasnt
Articlename_wasnt
Articlename_wasnt :Getter
Defined in: adventure/Asset.js, line 528
Inherited from: adventurejs.Asset#Articlename_wasnt
aspects
aspects :Object
Defined in: adventure/assets/Tangible.js, line 70
Inherited from: adventurejs.Tangible#aspects
Default value: {}
buoyancy
buoyancy :float
Defined in: adventure/assets/Tangible.js, line 300
Inherited from: adventurejs.Tangible#buoyancy
Default value: 0
Todos: Implement.
can
can :Object
Defined in: adventure/Asset.js, line 58
Inherited from: adventurejs.Asset#can
can.be_swung_at
can.be_swung_at :Boolean
Defined in: adventure/assets/Tangible.js, line 377
Inherited from: adventurejs.Tangible#can.be_swung_at
Default value: true
Nested property of Can
collection
collection :Getter/Setter
Defined in: adventure/Asset.js, line 201
Inherited from: adventurejs.Asset#collection
components
components :Array
Defined in: adventure/assets/Tangible.js, line 652
Inherited from: adventurejs.Tangible#components
Default value: []
MyGame.createAsset({
class: "Sink",
name: "sink",
place: { in: "Bathroom" },
descriptions:{
look: function()
{
return "A pedestal sink with porcelain handles and
a stainless steel faucet. Its drain appears to be
{ sink drain [is] open [or] closed }. ";
}
},
components: [
// each of these is a name of another Asset
"hot water handle",
"cold water handle",
"faucet",
"drain",
"plug"
],
});
contains
contains :Object
Defined in: adventure/assets/Tangible.js, line 820
Inherited from: adventurejs.Tangible#contains
this.aspects.in = new adventurejs.Aspect( "in", this.game_name, this.id );
this.aspects.in.vessel = new adventurejs.Vessel( "in", game_name, this.id )
.set({
"volume": Infinity,
"maxvolume": Infinity,
"substance_id": substance_id,
});
This is to make it easier and more intuitive for authors to set things like sand in a desert room or water in a swamp room, so that if player inputs "fill bowl with water", it can be assumed that the room is the source of the substance. When multiple substance containers are available, usually disambiguation occurs, but in the case of a room containing a substance, the room is assumed to be the source.
control_target_id
control_target_id :String
Defined in: adventure/assets/tangibles/things/GraduatedController.js, line 86
Inherited from: adventurejs.Tangible#control_target_id
Default value: ""
default_aspect
default_aspect :String
Defined in: adventure/assets/Tangible.js, line 102
Inherited from: adventurejs.Tangible#default_aspect
Default value: "on"
definite_article
definite_article :String
Defined in: adventure/Asset.js, line 232
Inherited from: adventurejs.Asset#definite_article
Default value: 'the'
definite_name
definite_name :Getter
Defined in: adventure/Asset.js, line 370
Inherited from: adventurejs.Asset#definite_name
description
description :*
Defined in: adventure/Asset.js, line 557
Inherited from: adventurejs.Asset#description
descriptions
descriptions :Object
Defined in: adventure/Asset.js, line 177
Inherited from: adventurejs.Asset#descriptions
description
is required, all others
are optional. Most of these apply only to Tangible Asset.
descriptions.description
-descriptions.brief
- used for room descriptions if player has typed "brief"descriptions.verbose
- used for room descriptions if player has typed "verbose"descriptions.listen
- used if player types "listen" or "listen to thing"descriptions.in
- used if player types "look in thing"descriptions.through
- used if player types "look through thing"descriptions.smell
- used if player types "smell thing"descriptions.taste
- used if player types "taste thing"descriptions.touch
- used if player types "touch thing"descriptions.careful
- used if player types "carefully examine thing"
did
did :Object
Defined in: adventure/Asset.js, line 339
Inherited from: adventurejs.Asset#did
dimensions
dimensions :Object
Defined in: adventure/assets/Tangible.js, line 534
Inherited from: adventurejs.Tangible#dimensions
Default value: {}
direction
direction :String
Defined in: adventure/assets/tangibles/things/Aperture.js, line 79
Inherited from: adventurejs.Tangible#direction
Default value: ""
Todos: Use lookup table for this? In a GUI this would be a pull-down menu.
dont_use_articles
dont_use_articles :Boolean
Defined in: adventure/Asset.js, line 260
Inherited from: adventurejs.Asset#dont_use_articles
Default value: false
dov
dov :Boolean
Defined in: adventure/Asset.js, line 72
Inherited from: adventurejs.Asset#dov
Default value: {}
emits
emits :Boolean
Defined in: adventure/assets/Tangible.js, line 482
Inherited from: adventurejs.Tangible#emits
Default value: false
Todos: Write logic for this.
exclude_from_disambiguation
exclude_from_disambiguation :Boolean
Defined in: adventure/Asset.js, line 151
Inherited from: adventurejs.Asset#exclude_from_disambiguation
Default value: false
exclude_from_lookup
exclude_from_lookup :Boolean
Defined in: adventure/Asset.js, line 142
Inherited from: adventurejs.Asset#exclude_from_lookup
Default value: false
exit
exit :String
Defined in: adventure/assets/tangibles/things/Aperture.js, line 88
Inherited from: adventurejs.Tangible#exit
Default value: ""
game
game :Getter
Defined in: adventure/Atom.js, line 115
Inherited from: adventurejs.Atom#game
this.game
.
image
image :String
Defined in: adventure/Asset.js, line 353
Inherited from: adventurejs.Asset#image
indefinite_article
indefinite_article :String
Defined in: adventure/Asset.js, line 241
Inherited from: adventurejs.Asset#indefinite_article
Default value: 'a'
indefinite_name
indefinite_name :Getter
Defined in: adventure/Asset.js, line 397
Inherited from: adventurejs.Asset#indefinite_name
iov
iov :Boolean
Defined in: adventure/Asset.js, line 90
Inherited from: adventurejs.Asset#iov
Default value: {}
is
is :Object
Defined in: adventure/Asset.js, line 47
Inherited from: adventurejs.Asset#is
asset.is.state
.
Note that there is also an asset.$is() method which
is related to this, but is a distinct function.
is.abstract
is.abstract :Boolean
Defined in: adventure/Asset_Is.js, line 88
Inherited from: adventurejs.Asset#is.abstract
Default value: false
Nested property of Is
is.buttoned
is.buttoned :Boolean
Defined in: adventure/assets/Tangible_Is.js, line 125
Inherited from: adventurejs.Tangible#is.buttoned
Default value: false
Nested property of Is
is.carried
is.carried :Getter
Defined in: adventure/assets/Tangible_Is.js, line 345
Inherited from: adventurejs.Tangible#is.carried
Nested property of Is
is.closed
is.closed :Boolean
Defined in: adventure/assets/Tangible_Is.js, line 147
Inherited from: adventurejs.Tangible#is.closed
Default value: false
Nested property of Is
is.cold_source
is.cold_source :Boolean
Defined in: adventure/assets/Tangible_Is.js, line 199
Inherited from: adventurejs.Tangible#is.cold_source
Default value: false
Nested property of Is
is.collection
is.collection :Boolean
Defined in: adventure/Asset_Is.js, line 48
Inherited from: adventurejs.Asset#is.collection
Default value: true
Nested property of Is
is.connected_by
is.connected_by :Boolean
Defined in: adventure/assets/Tangible_Is.js, line 213
Inherited from: adventurejs.Tangible#is.connected_by
Default value: {}
Nested property of Is
is.data
is.data :Boolean
Defined in: adventure/Asset_Is.js, line 103
Inherited from: adventurejs.Asset#is.data
Default value: false
Nested property of Is
is.deep_nest
is.deep_nest :Boolean
Defined in: adventure/assets/Tangible_Is.js, line 169
Inherited from: adventurejs.Tangible#is.deep_nest
Default value: false
Nested property of Is
is.destroyed
is.destroyed :Boolean
Defined in: adventure/Asset_Is.js, line 33
Inherited from: adventurejs.Asset#is.destroyed
Default value: false
Nested property of Is
is.distant
is.distant :Boolean
Defined in: adventure/assets/Tangible_Is.js, line 87
Inherited from: adventurejs.Tangible#is.distant
Default value: false
Nested property of Is
is.extant
is.extant :Boolean
Defined in: adventure/Asset_Is.js, line 41
Inherited from: adventurejs.Asset#is.extant
Default value: true
Nested property of Is
is.false_nest
is.false_nest :Boolean
Defined in: adventure/assets/Tangible_Is.js, line 178
Inherited from: adventurejs.Tangible#is.false_nest
Default value: false
Nested property of Is
is.fixed
is.fixed :Boolean
Defined in: adventure/assets/Tangible_Is.js, line 132
Inherited from: adventurejs.Tangible#is.fixed
Default value: false
Nested property of Is
is.global
is.global :Boolean
Defined in: adventure/Asset_Is.js, line 79
Inherited from: adventurejs.Asset#is.global
Default value: false
Nested property of Is
is.heat_source
is.heat_source :Boolean
Defined in: adventure/assets/Tangible_Is.js, line 192
Inherited from: adventurejs.Tangible#is.heat_source
Default value: false
Nested property of Is
is.hidden
is.hollow
is.hollow :Boolean
Defined in: adventure/assets/Tangible_Is.js, line 67
Inherited from: adventurejs.Tangible#is.hollow
Default value: false
Nested property of Is
is.inhands
is.inhands :Getter
Defined in: adventure/assets/Tangible_Is.js, line 354
Inherited from: adventurejs.Tangible#is.inhands
Nested property of Is
is.initialized
is.initialized :Boolean
Defined in: adventure/Asset_Is.js, line 62
Inherited from: adventurejs.Asset#is.initialized
Default value: false
Nested property of Is
is.known
is.known :Boolean
Defined in: adventure/Asset_Is.js, line 26
Inherited from: adventurejs.Asset#is.known
Default value: false
Nested property of Is
is.light_source
is.light_source :Boolean
Defined in: adventure/assets/Tangible_Is.js, line 185
Inherited from: adventurejs.Tangible#is.light_source
Default value: false
Nested property of Is
is.listed
is.listed :Boolean
Defined in: adventure/assets/Tangible_Is.js, line 74
Inherited from: adventurejs.Tangible#is.listed
Default value: true
Nested property of Is
is.locked
is.locked :Boolean
Defined in: adventure/assets/Tangible_Is.js, line 140
Inherited from: adventurejs.Tangible#is.locked
Default value: false
Nested property of Is
is.nameless
is.nameless :Boolean
Defined in: adventure/Asset_Is.js, line 69
Inherited from: adventurejs.Asset#is.nameless
Default value: false
Nested property of Is
is.on
is.on :Boolean
Defined in: adventure/assets/Tangible_Is.js, line 206
Inherited from: adventurejs.Tangible#is.on
Default value: false
Nested property of Is
is.placeholder
is.placeholder :Boolean
Defined in: adventure/Asset_Is.js, line 95
Inherited from: adventurejs.Asset#is.placeholder
Default value: false
Nested property of Is
is.plugged
is.plugged :Boolean
Defined in: adventure/assets/Tangible_Is.js, line 35
Inherited from: adventurejs.Asset#is.plugged
Default value: false
Nested property of Is
is.pluggedIn
is.pluggedIn :Boolean
Defined in: adventure/assets/Tangible_Is.js, line 42
Inherited from: adventurejs.Asset#is.pluggedIn
Default value: false
Nested property of Is
is.plural
is.plural :Boolean
Defined in: adventure/Asset_Is.js, line 121
Inherited from: adventurejs.Asset#is.plural
Default value: false
Nested property of Is
is.present
is.present :Getter
Defined in: adventure/assets/Tangible_Is.js, line 334
Inherited from: adventurejs.Tangible#is.present
Nested property of Is
is.reachable
is.reachable :Getter
Defined in: adventure/assets/Tangible_Is.js, line 363
Inherited from: adventurejs.Tangible#is.reachable
Nested property of Is
is.reservoir
is.reservoir :Getter
Defined in: adventure/assets/Tangible_Is.js, line 325
Inherited from: adventurejs.Tangible#is.reservoir
Nested property of Is
is.screwed
is.screwed :Boolean|Int
Defined in: adventure/assets/Tangible_Is.js, line 111
Inherited from: adventurejs.Tangible#is.screwed
Default value: false
Nested property of Is
is.sealed
is.sealed :Boolean
Defined in: adventure/assets/Tangible_Is.js, line 154
Inherited from: adventurejs.Tangible#is.sealed
Default value: false
Nested property of Is
is.singleton
is.singleton :Boolean
Defined in: adventure/Asset_Is.js, line 111
Inherited from: adventurejs.Asset#is.singleton
Default value: false
Nested property of Is
Todos: Have only applied this to several special global assets, and have not implemented any code around it. Is it still useful?
is.supported
is.supported :Boolean
Defined in: adventure/assets/Tangible_Is.js, line 57
Inherited from: adventurejs.Tangible#is.supported
Default value: false
Nested property of Is
is.takeable
is.takeable :Getter
Defined in: adventure/assets/Tangible_Is.js, line 381
Inherited from: adventurejs.Tangible#is.takeable
Nested property of Is
is.validated
is.validated :Boolean
Defined in: adventure/Asset_Is.js, line 55
Inherited from: adventurejs.Asset#is.validated
Default value: false
Nested property of Is
is.viewport
is.viewport :Boolean
Defined in: adventure/assets/Tangible_Is.js, line 161
Inherited from: adventurejs.Tangible#is.viewport
Default value: false
Nested property of Is
is.visible
is.visible :Getter
Defined in: adventure/assets/Tangible_Is.js, line 372
Inherited from: adventurejs.Tangible#is.visible
Nested property of Is
is.watertight
is.watertight :Boolean
Defined in: adventure/assets/Tangible_Is.js, line 95
Inherited from: adventurejs.Tangible#is.watertight
Default value: false
Nested property of Is
Todos: Write logic for this. Is this the same as airtight?
is.worn
is.worn :Boolean
Defined in: adventure/assets/Tangible_Is.js, line 104
Inherited from: adventurejs.Tangible#is.worn
Default value: false
Nested property of Is
is.zipped
is.zipped :Boolean
Defined in: adventure/assets/Tangible_Is.js, line 118
Inherited from: adventurejs.Tangible#is.zipped
Default value: false
Nested property of Is
linkableClasses
linkableClasses :Object
Defined in: adventure/assets/Tangible.js, line 711
Inherited from: adventurejs.Tangible#linkableClasses
Default value: {}
linked_components
linked_components :Object
Defined in: adventure/assets/Tangible.js, line 695
Inherited from: adventurejs.Tangible#linked_components
Default value: {}
linked_parent
linked_parent :Object
Defined in: adventure/assets/Tangible.js, line 702
Inherited from: adventurejs.Tangible#linked_parent
Default value: ""
location_required
location_required :Boolean
Defined in: adventure/assets/Tangible.js, line 508
Inherited from: adventurejs.Tangible#location_required
Default value: false
location_unneccessary
location_unneccessary :Boolean
Defined in: adventure/assets/Tangible.js, line 517
Inherited from: adventurejs.Tangible#location_unneccessary
Default value: false
min_light_required_to_see
min_light_required_to_see :float
Defined in: adventure/assets/Tangible.js, line 525
Inherited from: adventurejs.Tangible#min_light_required_to_see
Default value: 0.5
Todos: Write logic for this in selectVisible.js
must
must :Object
Defined in: adventure/Asset.js, line 65
Inherited from: adventurejs.Asset#must
must.hold_to_read
must.hold_to_read :Boolean
Defined in: adventure/assets/Tangible_Must.js, line 54
Inherited from: adventurejs.Tangible#must.hold_to_read
Default value: false
Nested property of Must
must.hold_to_see_through
must.hold_to_see_through :Boolean
Defined in: adventure/assets/Tangible_Must.js, line 33
Inherited from: adventurejs.Tangible#must.hold_to_see_through
Default value: false
Nested property of Must
must.hold_to_see_with
must.hold_to_see_with :Boolean
Defined in: adventure/assets/Tangible_Must.js, line 26
Inherited from: adventurejs.Tangible#must.hold_to_see_with
Default value: false
Nested property of Must
must.let_go_after_swing
must.let_go_after_swing :Boolean
Defined in: adventure/assets/Tangible_Must.js, line 61
Inherited from: adventurejs.Tangible#must.let_go_after_swing
Default value: false
Nested property of Must
must.wear_to_see_through
must.wear_to_see_through :Boolean
Defined in: adventure/assets/Tangible_Must.js, line 47
Inherited from: adventurejs.Tangible#must.wear_to_see_through
Default value: false
Nested property of Must
must.wear_to_see_with
must.wear_to_see_with :Boolean
Defined in: adventure/assets/Tangible_Must.js, line 40
Inherited from: adventurejs.Tangible#must.wear_to_see_with
Default value: false
Nested property of Must
Name
Name :String
Defined in: adventure/Atom.js, line 102
Inherited from: adventurejs.Atom#Name
name_is_proper
name_is_proper :Boolean
Defined in: adventure/Asset.js, line 216
Inherited from: adventurejs.Asset#name_is_proper
Default value: false
noun
noun :String
Defined in: adventure/Asset.js, line 270
Inherited from: adventurejs.Asset#noun
on_tie_to_drag_behind_rope
on_tie_to_drag_behind_rope :Boolean
Defined in: adventure/assets/Tangible.js, line 441
Inherited from: adventurejs.Tangible#on_tie_to_drag_behind_rope
Default value: false
on_tie_to_this_take_this
on_tie_to_this_take_this :Boolean
Defined in: adventure/assets/Tangible.js, line 432
Inherited from: adventurejs.Tangible#on_tie_to_this_take_this
Default value: false
place
place :Object
Defined in: adventure/assets/Tangible.js, line 744
Inherited from: adventurejs.Tangible#place
player_knows_its_hidden
plural
plural :String
Defined in: adventure/Asset.js, line 300
Inherited from: adventurejs.Asset#plural
position
position :Object
Defined in: adventure/assets/Tangible.js, line 609
Inherited from: adventurejs.Tangible#position
Default value: {x:0,y:0,z:0}
- managing reachability of objects that are on top of other things
- managing reachability of objects in the room while player is climbing or standing atop a thing
- dividing a room up into reachable/unreachable spaces
- managing player depth in an underwater location
- managing player position while flying/floating/levitating
MyGame.createAsset({
class: "Stalactite",
name: "stalactite",
place: { on: "Colossal Cave" },
descriptions: {look: "It clings tight to the ceiling. ",},
height: -2,
position: { x:0, y:5, z:0 },
});
Also see related height.
posture_position
posture_position :Boolean
Defined in: adventure/assets/Tangible.js, line 275
Inherited from: adventurejs.Tangible#posture_position
Default value: "default"
this.game.dictionary.getStringLookup( type, value )
.
Can be referenced in custom code through
MyGame.dictionary.getStringLookup( type, value )
.
print_bold
print_bold :Boolean
Defined in: adventure/Asset.js, line 112
Inherited from: adventurejs.Asset#print_bold
Default value: false
print_class
print_class :String
Defined in: adventure/Asset.js, line 134
Inherited from: adventurejs.Asset#print_class
Default value: ""
print_italic
print_italic :Boolean
Defined in: adventure/Asset.js, line 119
Inherited from: adventurejs.Asset#print_italic
Default value: false
print_open_or_closed
print_open_or_closed :Boolean
Defined in: adventure/assets/Tangible.js, line 732
Inherited from: adventurejs.Tangible#print_open_or_closed
Default value: false
print_style
print_style :String
Defined in: adventure/Asset.js, line 126
Inherited from: adventurejs.Asset#print_style
Default value: ""
pronouns
pronouns :String
Defined in: adventure/Asset.js, line 279
Inherited from: adventurejs.Asset#pronouns
propername
propername :String
Defined in: adventure/Asset.js, line 223
Inherited from: adventurejs.Asset#propername
proxy
proxy :Getter
Defined in: adventure/Asset.js, line 547
Inherited from: adventurejs.Asset#proxy
quirks
quirks :Object
Defined in: adventure/Asset.js, line 101
Inherited from: adventurejs.Asset#quirks
quirks.stand_means_get_off
set to true, player
will get off the chair, as opposed to trying to stand in
place on the chair.
quirks.climb_means_go_on
quirks.climb_means_go_on :Boolean
Defined in: adventure/assets/Tangible.js, line 110
Inherited from: adventurejs.Tangible#quirks.climb_means_go_on
Default value: false
Nested property of Quirks
quirks.climb_means_stand_on
quirks.climb_means_stand_on :Boolean
Defined in: adventure/assets/Tangible.js, line 119
Inherited from: adventurejs.Tangible#quirks.climb_means_stand_on
Default value: false
Nested property of Quirks
quirks.flick_means_toggle
quirks.flick_means_toggle :Boolean
Defined in: adventure/assets/Tangible.js, line 267
Inherited from: adventurejs.Tangible#quirks.flick_means_toggle
Default value: false
Nested property of Quirks
quirks.flip_means_toggle
quirks.flip_means_toggle :Boolean
Defined in: adventure/assets/Tangible.js, line 235
Inherited from: adventurejs.Tangible#quirks.flip_means_toggle
Default value: false
Nested property of Quirks
quirks.get_off_means_go_down
quirks.get_off_means_go_down :Boolean
Defined in: adventure/assets/Tangible.js, line 171
Inherited from: adventurejs.Tangible#quirks.get_off_means_go_down
Default value: false
Nested property of Quirks
quirks.get_on_means_go_up
quirks.get_on_means_go_up :Boolean
Defined in: adventure/assets/Tangible.js, line 162
Inherited from: adventurejs.Tangible#quirks.get_on_means_go_up
Default value: false
Nested property of Quirks
quirks.get_up_means_get_off
quirks.get_up_means_get_off :Boolean
Defined in: adventure/assets/Tangible.js, line 153
Inherited from: adventurejs.Tangible#quirks.get_up_means_get_off
Default value: false
Nested property of Quirks
quirks.in_means_on
quirks.in_means_on :Boolean
Defined in: adventure/assets/Tangible.js, line 182
Inherited from: adventurejs.Tangible#quirks.in_means_on
Default value: false
Nested property of Quirks
quirks.jump_means_jump_off
quirks.jump_means_jump_off :Boolean
Defined in: adventure/assets/Tangible.js, line 210
Inherited from: adventurejs.Tangible#quirks.jump_means_jump_off
Default value: false
Nested property of Quirks
quirks.jump_means_jump_on
quirks.jump_means_jump_on :Boolean
Defined in: adventure/assets/Tangible.js, line 202
Inherited from: adventurejs.Tangible#quirks.jump_means_jump_on
Default value: true
Nested property of Quirks
quirks.let_go_of_means_go_down
quirks.let_go_of_means_go_down :Boolean
Defined in: adventure/assets/Tangible.js, line 473
Inherited from: adventurejs.Tangible#quirks.let_go_of_means_go_down
Default value: false
Nested property of Quirks
quirks.let_go_of_means_go_off
quirks.let_go_of_means_go_off :Boolean
Defined in: adventure/assets/Tangible.js, line 464
Inherited from: adventurejs.Tangible#quirks.let_go_of_means_go_off
Default value: false
Nested property of Quirks
quirks.look_with_means_look_through
quirks.look_with_means_look_through :Boolean
Defined in: adventure/assets/Tangible.js, line 365
Inherited from: adventurejs.Tangible#quirks.look_with_means_look_through
Default value: false
Nested property of Quirks
quirks.pick_means_unlock
quirks.pick_means_unlock :Boolean
Defined in: adventure/assets/Tangible.js, line 316
Inherited from: adventurejs.Tangible#quirks.pick_means_unlock
Default value: false
Nested property of Quirks
quirks.point_means_aim
quirks.point_means_aim :Boolean
Defined in: adventure/assets/Tangible.js, line 642
Inherited from: adventurejs.Tangible#quirks.point_means_aim
Default value: false
Nested property of Quirks
quirks.press_means_toggle
quirks.press_means_toggle :Boolean
Defined in: adventure/assets/Tangible.js, line 243
Inherited from: adventurejs.Tangible#quirks.press_means_toggle
Default value: false
Nested property of Quirks
quirks.pull_means_open
quirks.pull_means_open :Boolean
Defined in: adventure/assets/Tangible.js, line 128
Inherited from: adventurejs.Tangible#quirks.pull_means_open
Default value: false
Nested property of Quirks
quirks.pull_means_toggle
quirks.pull_means_toggle :Boolean
Defined in: adventure/assets/Tangible.js, line 259
Inherited from: adventurejs.Tangible#quirks.pull_means_toggle
Default value: false
Nested property of Quirks
quirks.push_means_toggle
quirks.push_means_toggle :Boolean
Defined in: adventure/assets/Tangible.js, line 251
Inherited from: adventurejs.Tangible#quirks.push_means_toggle
Default value: false
Nested property of Quirks
quirks.put_means_pour
quirks.put_means_pour :Boolean
Defined in: adventure/assets/Tangible.js, line 192
Inherited from: adventurejs.Tangible#quirks.put_means_pour
Default value: false
Nested property of Quirks
quirks.stand_means_get_off
quirks.stand_means_get_off :Boolean
Defined in: adventure/assets/Tangible.js, line 144
Inherited from: adventurejs.Tangible#quirks.stand_means_get_off
Default value: false
Nested property of Quirks
quirks.step_on_means_stamp_on
quirks.step_on_means_stamp_on :Boolean
Defined in: adventure/assets/Tangible.js, line 218
Inherited from: adventurejs.Tangible#quirks.step_on_means_stamp_on
Default value: false
Nested property of Quirks
quirks.step_on_means_stand_on
quirks.step_on_means_stand_on :Boolean
Defined in: adventure/assets/Tangible.js, line 226
Inherited from: adventurejs.Tangible#quirks.step_on_means_stand_on
Default value: false
Nested property of Quirks
quirks.take_means_hold
quirks.take_means_hold :Boolean
Defined in: adventure/assets/Tangible.js, line 456
Inherited from: adventurejs.Tangible#quirks.take_means_hold
Default value: false
Nested property of Quirks
quirks.write_on_means_write_in
quirks.write_on_means_write_in :Boolean
Defined in: adventure/assets/Tangible.js, line 386
Inherited from: adventurejs.Tangible#quirks.write_on_means_write_in
Default value: false
Nested property of Quirks
redirected_verbs
redirected_verbs :Boolean
Defined in: adventure/Asset.js, line 361
Inherited from: adventurejs.Tangible#redirected_verbs
Default value: {}
short_name
short_name :Getter
Defined in: adventure/Asset.js, line 384
Inherited from: adventurejs.Asset#short_name
show_things_this_is_tied_to_in_description
show_things_this_is_tied_to_in_description :Boolean
Defined in: adventure/assets/Tangible.js, line 449
Inherited from: adventurejs.Tangible#show_things_this_is_tied_to_in_description
Default value: true
singlePluralPairs
singlePluralPairs :Array
Defined in: adventure/Asset.js, line 288
Inherited from: adventurejs.Asset#singlePluralPairs
split_name_for_world_lookup
split_name_for_world_lookup :Boolean
Defined in: adventure/Asset.js, line 160
Inherited from: adventurejs.Asset#split_name_for_world_lookup
Default value: true
But, an author might want to name a thing, eg, "hole in the ground", in which case we wind up with lookup table entries for "hole" and "in" and "the" and "ground", which is likely to lead to bad input parsing. To avoid name splitting, set split_name_for_world_lookup to false. The object's full name will still be added to the lookup.
to_be
to_be :Getter
Defined in: adventure/Asset.js, line 591
Inherited from: adventurejs.Asset#to_be
tried
tried :Object
Defined in: adventure/Asset.js, line 346
Inherited from: adventurejs.Asset#tried
typed_strings
typed_strings :Array
Defined in: adventure/assets/Tangible.js, line 402
Inherited from: adventurejs.Tangible#typed_strings
Default value: []
typing_targets
typing_targets :String
Defined in: adventure/assets/Tangible.js, line 423
Inherited from: adventurejs.Tangible#typing_targets
Default value: ""
use_definite_article_in_lists
use_definite_article_in_lists :Boolean
Defined in: adventure/Asset.js, line 249
Inherited from: adventurejs.Asset#use_definite_article_in_lists
Default value: false
use_once_message
use_once_message :Boolean
Defined in: adventure/assets/Tangible.js, line 325
Inherited from: adventurejs.Tangible#use_once_message
Default value: false
written_strings
written_strings :Array
Defined in: adventure/assets/Tangible.js, line 395
Inherited from: adventurejs.Tangible#written_strings
Default value: []