Skip to content

Latest commit

 

History

History
162 lines (158 loc) · 9.33 KB

paragraph.md

File metadata and controls

162 lines (158 loc) · 9.33 KB

Paragraph Language Guide

Paragraph is a custom language used to define content, locations and encounters in The Seven Spells Of Destruction. It's syntax is somewhat HTML like, except it is stricter in some ways about positioning of elements.

Paragraph tags are never considered to be a DOM. Only certain tags have range and can contain other content, such as <if> and <endif>. Tags which do this cannot be nested, e.g. you **cannot have two levels of <if>.

  • Spacing between tags is essential
  • You should only ever have one space between attributes in a tag.
  • You MUST have at least one space or newline between the leading or terminating < > and any text outside the tag, e.g. Go to <LINK=5> and not Go to<LINK=5>
  • Ordering of items within a tag is important and must follow the examples in this documentation (e.g. with the <I> tag). This is for simplicity of the parser, and speed of parsing.
Tag Description Example
<LINK=ID> Link to another location <LINK=111>
<AUTOLINK=ID> Link to another location. These are used with score tests, you must use two of them after each <TEST> tag. The tag for the failing condition will be grayed. <TEST LUCK> are you lucky <AUTOLINK=1> or unlucky <AUTOLINK=2>
<paylink=X,ID> Link to another location. Upon clicking the link, X gold is subtracted from the purse of the player. If the player does not have enough gold the link is grayed. <paylink=10,150>
<pickup ITEM [STAT+-N]> Automatically add an item to a players possessions list. The item name ITEM is shown in the backpack, STAT is the score it modifies (optional) followed by a +N or -N value for that score. See the example for information.

Special: <pickup gold X> to pick up gold, <pickup silver X> to pick up silver. Negative figures drop gold or silver.

Spells are special items where STAT+-N == "SPELL".

Herbs are special items where STAT+-N == "HERB"

<pickup Special item that adds stm [ST+6]>

<pickup Rating 5 Sword [W5]>

<pickup gold 6>

<drop ITEM> Drops ITEM from the backpack of the player, case insensitive. If the item does not exist nothing happens. <drop sword>
<mod STAT +-N> Modify a player score. Valid values for STAT are: stm - stamina; skl - skill; wpn - weapon; arm - armour; exp - experience; luck - luck; spd - speed; mana - mana <mod stm -5>
<if STAT eq|gt|lt|ne N> ... [<else>] ... <endif>

<if flag FLAG_ID> ... [<else>] .. <endif>

<if dice eq|gt|lt|ne N> ... [<else>] ... <endif>

<if STAT eq|gt|lt|ne dice> ... [<else>] ... <endif>

<if race orc>, <if race human>....

<if prof wizard>, <if prof warrior>

<if premium>

<if mounted>

Display next part of the paragraph if STAT is equal (eq), greater than (gt), less than (lt) or not equal (ne) to the value you provide. Valid values for STAT are: stm - stamina; skl - skill; wpn - weapon; arm - armour; exp - experience; luck - luck; spd - speed; scrolls - scrolls; level - level; mana - mana; notoriety - notoriety; rations - rations

When checking with the <if flag> tag, you may check against a local flag (set with <set>) or a global flag (set with <setglobal>).

With the <if dice> tag, you must have used the <dice> tag previously to have a result to check against. N must be in the range 1-6.

When using the <if prof> or <if race> tags, these compare against the current players race or profession, only use the ones valid in the game, in lower case only.

<if stm lt 5> you have less than 5 stamina <else> you have 5 or more stamina <endif>

<if stm gt 20> you're a hard bastard <endif>

<if dice eq 1> You rolled a 1 <endif>

<I NAME="Item Name" COST="X">

<I NAME="Item Name" VALUE="STAT+-N" COST="X">

A buyable item, e.g. from a shop. Item Name will be displayed in backpack if bought. The cost value X is the cost in gold of the item. If a VALUE parameter is included it indicates the special STAT value of the item. Valid values for STAT are: ST - stamina; SK - skill; W - weapon; A - armour; EX - experience; LK - luck; SD - speed; MA - mana.

Spells are special items where STAT+-N == "SPELL".

Herbs are special items where STAT+-N == "HERB"

<I NAME="Stamina restorer +6" VALUE="ST+6" COST="10">

<I NAME="Pointless junk" COST="100">

<I NAME="fly" VALUE="SPELL" COST="1">

<TEST STAT> Used to test a stat. See AUTOLINK. Valid values for STAT are SKILL, STAMINA, ARMOUR, WEAPON, LUCK <TEST LUCK>
<SET FLAG_ID> Sets a flag which you can later check against with the <if> tag. Flags are saved to the player's entry in the database and so are permanent until removed. <set killed_some_boss>
<COMBAT NAME="monster" SKILL=X STAMINA=Y ARMOUR=Z WEAPON=T> Creates a monster to fight, with the stats X, Y, Z and T. The name "monster" is shown to the player on their screen. Progress through the location will not continue until after the monster is defeated. Multiple combats may be placed one after the other. It is important to preserve the order of attributes. <COMBAT NAME="1ST ORC" SKILL=5 STAMINA=8 ARMOUR=6 WEAPON=6>
<PICK NAME="item name" VALUE="STAT+-N"> A pickable item, for a "you may take only one item" event. Item Name will be displayed in backpack if bought. The VALUE parameter must be included and it indicates the special STAT value of the item. Valid values for STAT are: ST - stamina; SK - skill; W - weapon; A - armour; EX - experience; LK - luck; SD - speed; MA - mana.

Spells are special items where STAT+-N == "SPELL".

Herbs are special items where STAT+-N == "HERB"

You may take one item only:

<pick name="Item 1" VALUE="ST+5">

<pick name="Item 2" VALUE="SK+5">

<EAT> Eats a ration from a players inventory, or subtracts two stamina if there is not enough food for the player to eat. <eat>
<D12> Roll a 12 sided dice, store score in engine for later. <d12>
<2D6> Roll two dice, store total sum score in engine for later. <2d6>
<SETGLOBAL FLAG_ID> This tag sets a global flag. A global flag is stored in a mysql table which all users can access, therefore if a global flag is set for one user it is set for them all. Useful for game persistence, e.g. if one user opens a door and it cannot be closed again, you may want to use <setglobal> to mark the door as open to all other users that encounter it. You may check against a global flag with the <if> tag, in the same way you can check against a flag which is specific to a user, placed with <set>. Note that global flags, like user specific flags, cannot contain spaces, and global and local flags may not conflict (have the same names) otherwise a condition will occur if either of the two flags is set) <setglobal blew_up_the_door>
<UNSETGLOBAL FLAG_ID> Use this tag to unset a global flag that has been set with setglobal. <unsetglobal blew_up_the_door>
<INPUT PROMPT="prompt line" LOCATION="ID" VALUE="correct_answer"> This tag asks the user for an answer to some form of text riddle or question, e.g. "how many fingers am i holding up". If the user enters the correct answer (which cannot be more then one word) then the location referred to by ID is jumped to, same as if they'd clicked a link. See the example. Note that the answer is CaSe SeNsiTiVe! <input prompt="What creature beginning with A eats ants?" location="666" value="anteater">
<DICE> Roll a dice, store score in engine for later. <dice>