Module: Lich::Gemstone::Infomon::XMLParser::Pattern

Defined in:
lib/gemstone/infomon/xmlparser.rb

Constant Summary collapse

Group_Short =
/(?:group|following you|IconJOINED)|^You are leading|(?:'s<\/a>|your) hand(?: tenderly)?\.\r?\n?$/
Also_Here_Arrival =
/^Also here: /
NpcDeathPrefix =
Regexp.union(
  /The fire in the/,
  /With a surprised grunt, the/,
  /A sudden blue fire bursts over the hair of a/,
  /You hear a sound like a weeping child as a white glow separates itself from the/,
  /A low gurgling sound comes from deep within the chest of the/,
  /(?:The|An?)/,
  /One last prolonged bovine moan escapes from the/
)
NpcDeathPostfix =
Regexp.union(
  /body as it rises, disappearing into the heavens/,
  /falls to the ground and dies(?:, its feelers twitching)?/,
  /falls back into a heap and dies/,
  /body goes rigid and collapses to the ground, dead/,
  /body goes rigid and collapses to the floor, dead/,
  /slowly settles to the ground and begins to dissipate/,
  /falls to the ground motionless/,
  /body goes rigid and <pushBold\/><a.*?>\w+<\/a><popBold\/> eyes roll back into <pushBold\/><a.*?>\w+<\/a><popBold\/> head as <pushBold\/><a.*?>\w+<\/a><popBold\/> dies/,
  /growls one last time, and crumples to the ground in a heap/,
  /spins backwards and collapses dead/,
  /falls to the ground as the stillness of death overtakes <pushBold\/><a.*?>(?:him|her|it)<\/a><popBold\/>/,
  /crumples to the ground motionless/,
  /howls in agony one last time and dies/,
  /howls in agony while falling to the ground motionless/,
  /moans pitifully as <pushBold\/><a.*?>(?:he|she|it)<\/a><popBold\/> is released/,
  /careens to the ground and crumples in a heap/,
  /hisses one last time and dies/,
  /flutters its wings one last time and dies/,
  /slumps to the ground with a final snarl/,
  /horn dims as (?:his|her) lifeforce fades away/,
  /blinks in astonishment, then collapses in a motionless heap/,
  /collapses in a heap, its huge girth shaking the floor around it/,
  /goes limp and .*? falls over as the fire slowly fades from .*? eyes/,
  /eyes slowly fades/,
  /sputters violently, cascading flames all around as .*? collapses in a final fiery display/,
  /falls to the ground in a clattering, motionless heap/,
  /goes limp and .*? falls over as the fire slowly fades from .*? eyes/,
  /collapses to the ground and shudders once before finally going still/,
  /crumbles into a pile of rubble/,
  /shudders once before .*? finally goes still/,
  /totters for a moment and then falls to the ground like a pillar, breaking into pieces that fly out in every direction/,
  /collapses into a pile of rubble/,
  /rumbles in agony as .*? teeters for a moment, then falls directly at you/,
  /twists and coils violently in .*? death throes, finally going still/,
  /twitches one final time before falling still upon the floor/,
  /, consuming .*? form in the space of a breath/,
  /screams one last time and dies/,
  /breathes .*? last gasp and dies/,
  /rolls over and dies/,
  /as .*? falls (?:slack|still) against the (?:floor|ground)/,
  /collapses to the ground, emits a final squeal, and dies/,
  /cries out in pain one last time and dies/,
  /crumples to a heap on the ground and dies/,
  /collapses to the ground, emits a final sigh, and dies/,
  /crumples to the ground and dies/,
  /lets out a final caterwaul and dies/,
  /screams evilly one last time and goes still/,
  /gurgles eerily and collapses into a puddle of water/,
  /shudders, then topples to the ground/,
  /shudders one last time before lying still/,
  /violently for a moment, then goes still/,
  /grumbles in pain one last time before lying still/,
  /rumbles in agony and goes still/,
  /falls to the ground dead/,
  /collapses to the ground, emits a final bleat, and dies/,
  /topples to the ground motionless/,
  /shudders violently for a moment, then goes still/,
  /rumbles in agony as .*? teeters for a moment, then tumbles to the ground with a thundering crash/,
  /sinks to the ground, the fell light in (?:his|her) eyes guttering before going out entirely/,
)
NpcDeathMessage =
/^(?:<pushBold\/>)?#{NpcDeathPrefix} (?:<pushBold\/>)?<a.*?exist=["'](?<npc_id>\-?[0-9]+)["'].*?>.*?<\/a>(?:<popBold\/>)?(?:'s)? #{NpcDeathPostfix}[\.!]\r?\n?$/
StowListOutputStart =

The following are for parsing STOW LIST and setting of STOW containers.

/^You have the following containers set as stow targets:\r?\n?$/
StowListContainer =
/^  (?:an?|some) <a exist="(?<id>\d+)" noun="(?<noun>[^"]+)">(?<name>[^<]+)<\/a>(?<after> [^\(]+)?\((?<type>box|gem|herb|skin|wand|scroll|potion|trinket|reagent|lockpick|treasure|forageable|collectible|default)\)\r?\n?$/
StowSetContainer1 =
/^Set "a <a exist="(?<id>[^"]+)" noun="(?<noun>[^"]+)">(?<name>[^<]+)<\/a>(?<after> [^"]+)?" to be your STOW (?<type>BOX|GEM|HERB|SKIN|WAND|SCROLL|POTION|TRINKET|REAGENT|LOCKPICK|TREASURE|FORAGEABLE|COLLECTIBLE) container\.\r?\n?$/
StowSetContainer2 =
/Set "a <a exist="(?<id>[^"]+)" noun="(?<noun>[^"]+)">(?<name>[^<]+)<\/a>(?<after> [^"]+)?" to be your (?<type>default) STOW container\.\r?\n?$/
ReadyListOutputStart =

The following are for parsing READY LIST and setting of READY items.

/^Your current settings are:\r?\n?$/
ReadyListNormal =
/^  (?<type>shield|(?:secondary |ranged )?weapon|ammo bundle): <d cmd="store (?:SHIELD|2?WEAPON|RANGED|AMMO) clear">(?:an?|some) <a exist="(?<id>[^"]+)" noun="(?<noun>[^"]+)">(?<name>[^<]+)<\/a>(?<after> [^<]+)?<\/d> \(<d cmd='store set'>(?:worn if possible, stowed otherwise|stowed|put in (?:secondary )?sheath)<\/d>\)\r?\n?$/
ReadyListAmmo2 =
/^  (?<type>ammo2 bundle): <d cmd="store AMMO2 clear">(?:an?|some) <a exist="(?<id>[^"]+)" noun="(?<noun>[^"]+)">(?<name>[^<]+)<\/a>(?<after> [^<]+)?<\/d>\r?\n?$/
ReadyListSheathsSet =
/^  (?<type>(?:secondary )?sheath): <d cmd="store 2?SHEATH clear">(?:an?|some) <a exist="(?<id>[^"]+)" noun="(?<noun>[^"]+)">(?<name>[^<]+)<\/a>(?<after> [^<]+)?<\/d>\r?\n?$/
ReadyListFinished =
/To change your default item for a category that is already set, clear the category first by clicking on the item in the list above.  Click <d cmd="ready list">here<\/d> to update the list\.\r?\n?$/
ReadyItemClear =
/^Cleared your default (?<type>shield|(?:secondary |ranged )?weapon|ammo2? bundle|(?:secondary )?sheath)\.\r?\n?$/
ReadyItemSet =
/^Setting (?:an?|some) <a exist="(?<id>[^"]+)" noun="(?<noun>[^"]+)">(?<name>[^<]+)<\/a>(?<after> [^<]+)? to be your default (?<type>shield|(?:secondary |ranged )?weapon|ammo2? bundle|(?:secondary )?sheath)\.\r?\n?$/
All =

A union of all patterns for parsing game lines.

Regexp.union(NpcDeathMessage, Group_Short, Also_Here_Arrival, StowListOutputStart, StowListContainer, StowSetContainer1, StowSetContainer2,
ReadyListOutputStart, ReadyListNormal, ReadyListAmmo2, ReadyListSheathsSet, ReadyListFinished, ReadyItemClear, ReadyItemSet)