More read/write tests for town and outdoors, including maps/dialogue

Fixes:
- For towns, the "has tavern" flag was not saved or loaded
- Outdoor roads were not saved or loaded
- For outdoor encounters, the "can't flee" and "forced" flags were not loaded, and "forced" was not saved
--> These two flags have also been separated in the code
This commit is contained in:
2015-09-30 17:00:05 -04:00
parent 16a09988f3
commit 43e82281af
26 changed files with 576 additions and 20 deletions

View File

@@ -3,4 +3,5 @@
0&9,0&10,0&11,0&12
0&13,0&14,0&15,0&16
0&17,0&18,0&19,0&20
0&21,0&22,0&23,0&24
0&21,0&22,0&23,0&24
0&25

View File

@@ -0,0 +1,5 @@
1,2,3,4,5
6,7,8,9,10
11,12,13&9,14,15
16,17,18&25,19,20
21,22,23&25,24,25

View File

@@ -1,5 +1,3 @@
<sector boes="2.0.0">
<encounter>
<monster human='false'/>
</encounter>
<encounter bad='no'/>
</sector>

View File

@@ -0,0 +1,5 @@
<sector boes="2.0.0">
<encounter>
<monster human='false'/>
</encounter>
</sector>

View File

@@ -0,0 +1,26 @@
<sector boes="2.0.0">
<name>Test Sector</name>
<comment>Hello World!</comment>
<sound>birds</sound>
<encounter can-flee='false' force='true'>
<monster>12</monster>
<monster friendly='true'>15</monster>
<onmeet>90</onmeet>
<onwin>92</onwin>
<onflee>84</onflee>
<sdf x='202' y='19'/>
</encounter>
<wandering can-flee='false' force='true'>
<monster>12</monster>
<monster friendly='true'>15</monster>
<onmeet>90</onmeet>
<onwin>92</onwin>
<onflee>84</onflee>
<sdf x='202' y='19'/>
</wandering>
<sign id='7'>The best sign ever!</sign>
<area top='4' left='8' bottom='9' right='12'>
<![CDATA[Some random area Amazing!]]>
</area>
<string id='9'>A random special string</string>
</sector>

View File

@@ -0,0 +1,4 @@
<sector boes="2.0.0">
<name>Test Sector</name>
<sound>42</sound>
</sector>

37
test/files/talk/full.xml Normal file
View File

@@ -0,0 +1,37 @@
<dialogue boes="2.0.0">
<personality id='0'>
<title>Billy Kumquat</title>
<look>You see a small boy juggling fruit.</look>
<name>"I'm Billy Kumquat!"</name>
<job>"I juggle!"</job>
<unknown>"No clue!"</unknown>
</personality>
<node for='0'>
<keyword>jugg</keyword>
<type>reg</type>
<text>"It's fun!"</text>
</node>
<node for='0'>
<keyword>info</keyword>
<type>buy-sdf</type>
<param>1</param>
<param>2</param>
<param>3</param>
<text>"There's a treasure hidden in the old tree!"</text>
<text>"For a gold piece I'll tell you something interesting!"</text>
</node>
<node for='0'>
<keyword>purc</keyword>
<type>shop</type>
<param>0</param>
<param>4</param>
<text>Billy Kumquat's Oddest Fruit</text>
</node>
<node for='0'>
<keyword>kumq</keyword>
<type>quest</type>
<param>5</param>
<text>"I'll reward you if you find me some bigger kumquats!"</text>
<text>"Thanks for finding the bigger kumquats!"</text>
</node>
</dialogue>

View File

@@ -0,0 +1,6 @@
<town boes="2.0.0">
<size>32</size>
<name>Hello World</name>
<onenter condition='alive'>1</onenter>
<onenter condition='alive'>2</onenter>
</town>

56
test/files/town/full.xml Normal file
View File

@@ -0,0 +1,56 @@
<town boes="2.0.0">
<size>32</size>
<name>Test Town</name>
<comment>This is a silly little comment.</comment>
<bounds top='4' left='4' right='28' bottom='28'/>
<difficulty>1</difficulty>
<lighting>lit</lighting>
<onenter condition='alive'>12</onenter>
<onenter condition='dead'>13</onenter>
<exit dir='n' x='4' y='16'/>
<onexit dir='n'>52</onexit>
<onoffend>42</onoffend>
<timer freq='100'>15</timer>
<flags>
<chop day='18' event='4' kills='50000'/>
<hidden>true</hidden>
<strong-barriers>true</strong-barriers>
<defy-mapping>true</defy-mapping>
<defy-scrying>true</defy-scrying>
<tavern>true</tavern>
</flags>
<wandering>
<monster>40</monster>
<monster>41</monster>
<monster>42</monster>
<monster>43</monster>
</wandering>
<sign id='1'>This is a sample sign.</sign>
<string id='7'>Here is a town string.</string>
<item id='2'>
<type>120</type>
<mod>2</mod>
<charges>17</charges>
<always>true</always>
<property>true</property>
<contained>true</contained>
</item>
<creature id='12'>
<type>140</type>
<attitude>hostile-b</attitude>
<mobility>1</mobility>
<sdf x='12' y='13'/>
<encounter>50</encounter>
<time type='after-event'>
<day>17</day>
<event>14</event>
</time>
<face>142</face>
<personality>1</personality>
<onkill>80</onkill>
<ontalk>81</ontalk>
</creature>
<area top='14' left='16' bottom='20' right='22'>
<![CDATA[This is a sample area description.]]>
</area>
</town>