Formalize schema for town definition file

This commit is contained in:
2014-11-28 14:10:40 -05:00
parent de7489d47d
commit f21ef07111
4 changed files with 322 additions and 235 deletions

View File

@@ -1,241 +1,62 @@
<?xml version="1.0" encoding="UTF-8"?>
<town boes="1.0">
<size>
<x>48</x>
<y>48</y>
</size>
<size>48</size>
<name>Town name</name>
<bounds>
<bound id="0">
<tl>4</tl>
<br>44</br>
</bound>
</bounds>
<terrain>
<row x="1">
<tiles>2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2</tiles>
<bounds top="4" left="4" bottom="44" right="44"/>
<!-- Town's difficulty rating -->
<difficulty>1</difficulty>
<!-- Town's lighting type -->
<lighting>0</lighting>
<!-- Town entry locations -->
<enter dir="n" x="22" y="4"/>
<enter dir="s" x="22" y="44"/>
<enter dir="w" x="4" y="22"/>
<enter dir="e" x="22" y="22"/>
<!-- Entry specials; omitting condition is equivalent to ="alive" -->
<onenter>12</onenter>
<onenter condition="dead">13</onenter>
<!-- Town exit location/special -->
<onexit dir="n">5</onexit>
<!-- Various optional flags; <flags/> is perfectly valid here -->
<flags>
</flags>
<!-- Wandering locs and monsters -->
<wandering>
<!-- Need exactly four locs -->
<loc x="5" y="12"/>
<loc x="5" y="12"/>
<loc x="5" y="12"/>
<loc x="5" y="12"/>
<!-- Monsters are optional -->
<monster group="0">21</monster>
</wandering>
<!-- comma-seperated, tile type -->
</row>
<row x="2">
<tiles>2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2</tiles>
</row>
<row x="3">
<tiles>2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2</tiles>
</row>
<row x="4">
<tiles>2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2</tiles>
</row>
<row x="5">
<tiles>2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2</tiles>
</row>
<row x="6">
<tiles>2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2</tiles>
</row>
<row x="7">
<tiles>2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2</tiles>
</row>
<row x="8">
<tiles>2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2</tiles>
</row>
<row x="9">
<tiles>2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2</tiles>
</row>
<row x="10">
<tiles>2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2</tiles>
</row>
<row x="11">
<tiles>2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2</tiles>
</row>
<row x="12">
<tiles>2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2</tiles>
</row>
<row x="13">
<tiles>2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2</tiles>
</row>
<row x="14">
<tiles>2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2</tiles>
</row>
<row x="15">
<tiles>2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2</tiles>
</row>
<row x="16">
<tiles>2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2</tiles>
</row>
<row x="17">
<tiles>2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2</tiles>
</row>
<row x="18">
<tiles>2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2</tiles>
</row>
<row x="19">
<tiles>2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2</tiles>
</row>
<row x="20">
<tiles>2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2</tiles>
</row>
<row x="21">
<tiles>2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2</tiles>
</row>
<row x="22">
<tiles>2,2,2,2,2,2,2,2,2,2,2,2,2,122,122,122,122,122,122,122,122,122,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2</tiles>
</row>
<row x="23">
<tiles>2,2,2,2,2,2,2,2,2,2,2,2,2,122,170,170,170,170,170,170,170,122,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2</tiles>
</row>
<row x="24">
<tiles>2,2,2,2,2,2,2,2,2,2,2,2,2,122,170,170,170,170,170,170,170,122,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2</tiles>
</row>
<row x="25">
<tiles>2,2,2,2,2,2,2,2,2,2,2,2,2,125,170,170,247:0,170,170,170,170,122,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2</tiles>
<sign id="0">This is a sample sign!</sign>
<!-- add a : to specify a special is there. 247:0 is 247 with special 0 -->
</row>
<row x="26">
<tiles>2,2,2,2,2,2,2,2,2,2,2,2,121!0,122,170,170,170,170,170,170,170,122,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2</tiles>
<!-- add a ! to specify a sign is there. 121!0 is 121 with sign 0 -->
</row>
<row x="27">
<tiles>2,2,2,2,2,2,2,2,2,2,2,2,2,122,170,170,170,170,170,170,170,122,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2</tiles>
</row>
<row x="28">
<tiles>2,2,2,2,2,2,2,2,2,2,2,2,2,122,170,170,170,170,170,170,170,122,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2</tiles>
</row>
<row x="29">
<tiles>2,2,2,2,2,2,2,2,2,2,2,2,2,122,170,170,170,170,170,170,170,122,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2</tiles>
</row>
<row x="30">
<tiles>2,2,2,2,2,2,2,2,2,2,2,2,2,122,122,122,122,122,122,122,122,122,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2</tiles>
</row>
<row x="31">
<tiles>2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2</tiles>
</row>
<row x="32">
<tiles>2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2</tiles>
</row>
<row x="33">
<tiles>2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2</tiles>
</row>
<row x="34">
<tiles>2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2</tiles>
</row>
<row x="35">
<tiles>2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2</tiles>
</row>
<row x="36">
<tiles>2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2</tiles>
</row>
<row x="37">
<tiles>2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2</tiles>
</row>
<row x="38">
<tiles>2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2</tiles>
</row>
<row x="39">
<tiles>2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2</tiles>
</row>
<row x="40">
<tiles>2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2</tiles>
</row>
<row x="41">
<tiles>2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2</tiles>
</row>
<row x="42">
<tiles>2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2</tiles>
</row>
<row x="43">
<tiles>2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2</tiles>
</row>
<row x="44">
<tiles>2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2</tiles>
</row>
<row x="45">
<tiles>2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2</tiles>
</row>
<row x="46">
<tiles>2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2</tiles>
</row>
<row x="47">
<tiles>2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2</tiles>
</row>
</terrain>
<specials>
<special id="0">
<type>181</type> <!-- consts.h. maybe this will allow custom nodes sometime, although that could be...fun -->
<sdf>
<x>-1</x>
<y>-1</y>
</sdf>
<messages>
<m1>0</m1>
<m2>1</m2>
</messages>
<extra1>
<a>26</a>
<b>16</b>
</extra1>
<extra2>
<a>1</a>
<b>1</b>
</extra2>
<jump>-1</jump>
</special>
</specials>
<signs>
<sign id="0">120</sign><!-- refers to text node -->
</signs>
<fields>
<field id="0">
<x>25</x>
<y>17</y>
<type>128</type><!-- fields.h, bitmask thing -->
</field>
</fields>
<sfxs>
<sfx id="0">
<x>27</x>
<y>17</y>
<type>4</type><!-- fields.h, bitmask thing -->
</sfx>
</sfxs>
<!-- these code both fields and sfx -->
<fields x="25" y="17">128</fields><!-- fields.h, bitmask thing -->
<!-- preset items -->
<item x="12" y="13">
<id>17</id>
<property>true</property>
<charges>3</charges>
</item>
<!-- preset creatures -->
<creature x="15" y="32">
<id>12</id>
<personality>0</personality>
<attitude>0</attitude>
<mobility>1</mobility>
</creature>
</town>