Module: Lich::DragonRealms::DRDefsPattern

Defined in:
documented/dragonrealms/drinfomon/drdefs.rb

Constant Summary collapse

TRAILING_AND =

Pattern to extract the final "and X" portion of room player lists Pattern to extract the final "and X" portion of room player lists.

/ and (?<last>.*)$/.freeze
PLAYER_STATUS =

Pattern to match player status descriptions Pattern to match player status descriptions.

Examples:

Matches:

"who is glowing"
"whose body appears dead"
/ (who|whose body)? ?(has|is|appears|glows) .+/.freeze
PARENTHETICAL =

Pattern to match parenthetical info after player names Pattern to match parenthetical info after player names.

Examples:

Matches:

"(injured)"
"(asleep)"
/ \(.+\)/.freeze
PLAYER_NAME =

Pattern to extract player name (word characters at end) Pattern to extract player name (word characters at end).

Examples:

Matches:

"John"
"Doe"
/\w+$/.freeze
LYING_DOWN =

Pattern for lying down players Pattern for lying down players.

Examples:

Matches:

"who is lying down"
/who is lying down/i.freeze
SITTING =

Pattern for sitting players Pattern for sitting players.

Examples:

Matches:

"who is sitting"
/who is sitting/i.freeze
YOU_ALSO_SEE =

Pattern for "You also see" prefix Pattern for "You also see" prefix.

Examples:

Matches:

"You also see a dragon"
/You also see/.freeze
MOUNT_DESCRIPTION =

Pattern for mount descriptions Pattern for mount descriptions.

Examples:

Matches:

"with a horse sitting astride its back"
/ with a [\w\s]+ sitting astride its back/.freeze
NPC_SCAN =

Pattern to find NPCs in room objects (bold tags indicate creatures) Pattern to find NPCs in room objects (bold tags indicate creatures).

Examples:

Matches:

"<pushBold/>Goblin<popBold/> which appears dead"
%r{<pushBold/>[^<>]*<popBold/> which appears dead|<pushBold/>[^<>]*<popBold/> \(dead\)|<pushBold/>[^<>]*<popBold/>}.freeze
DEAD_NPC =

Pattern for dead NPCs Pattern for dead NPCs.

Examples:

Matches:

"which appears dead"
"(dead)"
/which appears dead|\(dead\)/.freeze
PUSH_BOLD =

Pattern for pushBold tags (indicates creature, not object) Pattern for pushBold tags (indicates creature, not object).

Examples:

Matches:

"pushBold"
/pushBold/.freeze
LEADING_ARTICLE =

Pattern for leading articles Pattern for leading articles.

Examples:

Matches:

"a dragon"
"some goblins"
/^(a|some) /.freeze
TRAILING_PERIOD =

Pattern for trailing period Pattern for trailing period.

Examples:

Matches:

"This is a test."
/\.$/.freeze
COMMA_OR_AND =

Pattern for splitting on comma or "and" Pattern for splitting on comma or "and".

Examples:

Matches:

"a, b, and c"
/,|\sand\s/.freeze
CREATURE_NAME =

Pattern for extracting creature name (letters, hyphens, apostrophes only) Note: Using [A-Za-z] instead of [A-z] to avoid matching []^_` characters Pattern for extracting creature name (letters, hyphens, apostrophes only).

Examples:

Matches:

"dragon"
"elf-king"
/[A-Za-z'-]+$/.freeze
WHO_STATUS =

Pattern for "who has/is" descriptions Pattern for "who has/is" descriptions.

Examples:

Matches:

"who has a sword"
"who is glowing"
/ who (has|is) .+/.freeze
GLOWING_WITH =

Pattern for "glowing with" modifiers Pattern for "glowing with" modifiers.

Examples:

Matches:

"glowing with magic"
/(?:\sglowing)?\swith\s.*/.freeze
GELAPOD =

Gelapod replacement pattern Gelapod replacement pattern.

Examples:

Matches:

"<pushBold/>a domesticated gelapod<popBold/>"
"<pushBold/>a domesticated gelapod<popBold/>".freeze
GELAPOD_REPLACEMENT =
'domesticated gelapod'.freeze
ALFAR_WARRIOR_PATTERN =

Creature name normalization patterns (creatures with variant descriptions) Creature name normalization patterns (creatures with variant descriptions).

Examples:

Matches:

"alfar warrior"
/.*alfar warrior.*/.freeze
SINEWY_LEOPARD_PATTERN =

Creature name normalization patterns (creatures with variant descriptions).

Examples:

Matches:

"sinewy leopard"
/.*sinewy leopard.*/.freeze
LESSER_NAGA_PATTERN =

Creature name normalization patterns (creatures with variant descriptions).

Examples:

Matches:

"lesser naga"
/.*lesser naga.*/.freeze