Merge pull request #14 from ennorehling/exparse

expat replaces libxml2
This commit is contained in:
Enno Rehling 2018-05-18 21:58:59 +02:00 committed by GitHub
commit e5218781d6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
95 changed files with 2427 additions and 4083 deletions

1
.gitignore vendored
View File

@ -42,3 +42,4 @@ tests/data/185.dat
/quicklist/
/cutest/
/critbit/
*.mo

View File

@ -50,7 +50,7 @@ else()
find_package (SQLite3 REQUIRED QUIET)
endif()
find_package (LibXml2 REQUIRED)
find_package(EXPAT REQUIRED)
find_package (ToLua REQUIRED)
if (TOLUA_FOUND)
if (${TOLUA_VERSION_STRING} VERSION_EQUAL "5.2")
@ -70,6 +70,7 @@ add_subdirectory (process)
add_subdirectory (src eressea)
install(DIRECTORY etc DESTINATION ${CMAKE_INSTALL_PREFIX} FILES_MATCHING PATTERN "*.txt")
install(DIRECTORY res conf DESTINATION ${CMAKE_INSTALL_PREFIX} FILES_MATCHING PATTERN "*.po")
install(DIRECTORY res conf DESTINATION ${CMAKE_INSTALL_PREFIX} FILES_MATCHING PATTERN "*.xml")
install(DIRECTORY res conf DESTINATION ${CMAKE_INSTALL_PREFIX} FILES_MATCHING PATTERN "*.json")
install(DIRECTORY scripts DESTINATION ${CMAKE_INSTALL_PREFIX} FILES_MATCHING PATTERN "*.lua")

View File

@ -6,8 +6,8 @@
<item weight="200" score="200">
<construction skill="mining" minskill="8"/>
</item>
<modifier building="mine" type="skill" value="1"/>
<modifier type="require" building="mine"/>
<modifier building="mine" type="skill" value="1"/>
<modifier type="require" building="mine"/>
</resource>
<resource name="adamantiumaxe">

View File

@ -34,8 +34,8 @@
<item weight="0" score="6000"/>
</resource>
<resource name="presspass" cursed="yes">
<item weight="0" score="6000"/>
<resource name="presspass">
<item weight="0" score="6000" cursed="yes"/>
</resource>
<resource name="aurafocus">

File diff suppressed because it is too large Load Diff

View File

@ -2,9 +2,9 @@
<eressea>
<resources>
<resource name="laen" limited="yes" material="yes">
<item weight="200" score="100">
<construction skill="mining" minskill="7"/>
</item>
<item weight="200" score="100">
<construction skill="mining" minskill="7"/>
</item>
<modifier building="mine" type="skill" value="1"/>
<modifier type="require" building="mine"/>
</resource>

View File

@ -192,7 +192,7 @@
<!-- end player races -->
<race name="kraken" maxaura="0" regaura="0" weight="500" capacity="540" speed="2.000000" hp="300" damage="2d10" unarmedattack="0" unarmeddefense="0" attackmodifier="7" defensemodifier="7" coastal="yes" swim="yes" teach="no" getitem="yes">
<race name="kraken" maxaura="0.000000" regaura="0.000000" weight="500" capacity="540" speed="2.000000" hp="300" damage="2d10" unarmedattack="0" unarmeddefense="0" attackmodifier="7" defensemodifier="7" coastal="yes" swim="yes" teach="no" getitem="yes">
<ai splitsize="5000"/>
<skill name="crossbow" modifier="-99"/>
<skill name="mining" modifier="-99"/>
@ -218,7 +218,7 @@
<attack type="4" damage="1d10"/>
<attack type="4" damage="1d10"/>
</race>
<race name="giantturtle" maxaura="0" regaura="0" weight="1600" capacity="600" speed="1.0" hp="900" ac="7" damage="2d50" unarmedattack="0" unarmeddefense="0" attackmodifier="10" defensemodifier="5" coastal="yes" swim="yes" walk="yes" teach="no" getitem="yes">
<race name="giantturtle" maxaura="0.000000" regaura="0.000000" weight="1600" capacity="600" speed="1.0" hp="900" ac="7" damage="2d50" unarmedattack="0" unarmeddefense="0" attackmodifier="10" defensemodifier="5" coastal="yes" swim="yes" walk="yes" teach="no" getitem="yes">
<ai splitsize="5000"/>
<skill name="crossbow" modifier="-99"/>
<skill name="mining" modifier="-99"/>
@ -239,7 +239,7 @@
<skill name="cartmaking" modifier="-99"/>
<attack type="4" damage="2d50"/>
</race>
<race name="dolphin" maxaura="0" regaura="0" weight="500" capacity="540" speed="2.000000" hp="24" damage="1d6" unarmedattack="0" unarmeddefense="0" attackmodifier="5" defensemodifier="5" coastal="yes" swim="yes" teach="no" getitem="yes">
<race name="dolphin" maxaura="0.000000" regaura="0.000000" weight="500" capacity="540" speed="2.000000" hp="24" damage="1d6" unarmedattack="0" unarmeddefense="0" attackmodifier="5" defensemodifier="5" coastal="yes" swim="yes" teach="no" getitem="yes">
<ai splitsize="5000"/>
<skill name="crossbow" modifier="-99"/>
<skill name="mining" modifier="-99"/>
@ -260,7 +260,7 @@
<skill name="cartmaking" modifier="-99"/>
<attack type="4" damage="1d6"/>
</race>
<race name="tiger" maxaura="0" regaura="0" weight="500" capacity="540" speed="1.0" hp="30" damage="2d6" unarmedattack="0" unarmeddefense="0" attackmodifier="6" defensemodifier="3" walk="yes" teach="no" getitem="yes">
<race name="tiger" maxaura="0.000000" regaura="0.000000" weight="500" capacity="540" speed="1.0" hp="30" damage="2d6" unarmedattack="0" unarmeddefense="0" attackmodifier="6" defensemodifier="3" walk="yes" teach="no" getitem="yes">
<ai splitsize="5000"/>
<skill name="crossbow" modifier="-99"/>
<skill name="mining" modifier="-99"/>
@ -283,7 +283,7 @@
<attack type="4" damage="1d6"/>
<attack type="4" damage="1d6"/>
</race>
<race name="hellcat" magres="50" maxaura="0" regaura="0" weight="500" capacity="540" speed="1.0" hp="40" damage="2d6" unarmedattack="0" unarmeddefense="0" attackmodifier="6" defensemodifier="4" walk="yes" teach="no" getitem="yes" resistpierce="yes">
<race name="hellcat" magres="50" maxaura="0.000000" regaura="0.000000" weight="500" capacity="540" speed="1.0" hp="40" damage="2d6" unarmedattack="0" unarmeddefense="0" attackmodifier="6" defensemodifier="4" walk="yes" teach="no" getitem="yes" resistpierce="yes">
<ai splitsize="5000"/>
<skill name="crossbow" modifier="-99"/>
<skill name="mining" modifier="-99"/>
@ -306,7 +306,7 @@
<attack type="4" damage="1d6"/>
<attack type="4" damage="1d6"/>
</race>
<race name="owl" maxaura="0" regaura="0" weight="500" capacity="540" speed="1.0" hp="9" damage="1d4" unarmedattack="0" unarmeddefense="0" attackmodifier="2" defensemodifier="4" fly="yes" walk="yes" teach="no" getitem="yes">
<race name="owl" maxaura="0.000000" regaura="0.000000" weight="500" capacity="540" speed="1.0" hp="9" damage="1d4" unarmedattack="0" unarmeddefense="0" attackmodifier="2" defensemodifier="4" fly="yes" walk="yes" teach="no" getitem="yes">
<ai splitsize="5000"/>
<skill name="crossbow" modifier="-99"/>
<skill name="mining" modifier="-99"/>
@ -328,7 +328,7 @@
<skill name="cartmaking" modifier="-99"/>
<attack type="4" damage="1d4"/>
</race>
<race name="fairy" magres="80" maxaura="1" regaura="1.5" weight="200" capacity="540" speed="1.0" hp="6" damage="1d3" unarmedattack="0" unarmeddefense="0" attackmodifier="6" defensemodifier="14" fly="yes" walk="yes" teach="no" getitem="yes" equipment="yes">
<race name="fairy" magres="80" maxaura="1.0" regaura="1.500000" weight="200" capacity="540" speed="1.0" hp="6" damage="1d3" unarmedattack="0" unarmeddefense="0" attackmodifier="6" defensemodifier="14" fly="yes" walk="yes" teach="no" getitem="yes" equipment="yes">
<ai splitsize="5000"/>
<skill name="magic" modifier="1"/>
<skill name="riding" modifier="-1"/>
@ -354,7 +354,7 @@
<attack type="4" damage="1d3"/>
<attack type="4" damage="1d3"/>
</race>
<race name="dreamcat" magres="50" maxaura="1" regaura="1" weight="500" capacity="540" speed="1.0" hp="10" damage="1d5" unarmedattack="0" unarmeddefense="0" attackmodifier="5" defensemodifier="6" fly="yes" walk="yes" teach="no" getitem="yes" invinciblenonmagic="yes">
<race name="dreamcat" magres="50" maxaura="1.0" regaura="1.0" weight="500" capacity="540" speed="1.0" hp="10" damage="1d5" unarmedattack="0" unarmeddefense="0" attackmodifier="5" defensemodifier="6" fly="yes" walk="yes" teach="no" getitem="yes" invinciblenonmagic="yes">
<ai splitsize="5000"/>
<skill name="magic" modifier="1"/>
<skill name="crossbow" modifier="-99"/>
@ -376,7 +376,7 @@
<attack type="4" damage="1d5"/>
<attack type="4" damage="1d5"/>
</race>
<race name="imp" magres="50" maxaura="1" regaura="1" weight="500" capacity="540" speed="1.0" hp="10" ac="1" damage="1d4" unarmedattack="0" unarmeddefense="0" attackmodifier="5" defensemodifier="4" fly="yes" walk="yes" teach="no" getitem="yes" equipment="yes">
<race name="imp" magres="50" maxaura="1.0" regaura="1.0" weight="500" capacity="540" speed="1.0" hp="10" ac="1" damage="1d4" unarmedattack="0" unarmeddefense="0" attackmodifier="5" defensemodifier="4" fly="yes" walk="yes" teach="no" getitem="yes" equipment="yes">
<ai splitsize="5000"/>
<skill name="crossbow" modifier="-99"/>
<skill name="mining" modifier="-99"/>
@ -400,7 +400,7 @@
<attack type="1" damage="1d4"/>
<attack type="6" spell="fiery_dragonbreath" level="3" />
</race>
<race name="ghost" magres="80" maxaura="0.5" regaura="0.1" weight="500" capacity="540" speed="1.0" hp="30" ac="5" damage="2d6" unarmedattack="0" unarmeddefense="0" attackmodifier="5" defensemodifier="8" scarepeasants="yes" fly="yes" walk="yes" teach="no" getitem="yes" equipment="yes" invinciblenonmagic="yes">
<race name="ghost" magres="80" maxaura="0.500000" regaura="0.100000" weight="500" capacity="540" speed="1.0" hp="30" ac="5" damage="2d6" unarmedattack="0" unarmeddefense="0" attackmodifier="5" defensemodifier="8" scarepeasants="yes" fly="yes" walk="yes" teach="no" getitem="yes" equipment="yes" invinciblenonmagic="yes">
<ai splitsize="5000"/>
<skill name="crossbow" modifier="-99"/>
<skill name="mining" modifier="-99"/>
@ -425,7 +425,7 @@
<attack type="2" damage="2d30"/>
<attack type="3" damage="1d1"/>
</race>
<race name="wolf" maxaura="0" regaura="0" weight="500" capacity="540" speed="1.0" hp="25" damage="2d6" unarmedattack="0" unarmeddefense="0" attackmodifier="6" defensemodifier="3" scarepeasants="yes" walk="yes" teach="no" getitem="yes">
<race name="wolf" maxaura="0.000000" regaura="0.000000" weight="500" capacity="540" speed="1.0" hp="25" damage="2d6" unarmedattack="0" unarmeddefense="0" attackmodifier="6" defensemodifier="3" scarepeasants="yes" walk="yes" teach="no" getitem="yes">
<ai splitsize="5000"/>
<skill name="crossbow" modifier="-99"/>
<skill name="mining" modifier="-99"/>
@ -471,7 +471,7 @@
<attack type="4" damage="3d12"/>
<attack type="4" damage="2d4"/>
</race>
<race name="nymph" magres="90" maxaura="1" regaura="1.500000" weight="1000" capacity="540" speed="1.0" hp="15" damage="1d4" unarmedattack="0" unarmeddefense="0" attackmodifier="3" defensemodifier="1" walk="yes" teach="no" getitem="yes" equipment="yes">
<race name="nymph" magres="90" maxaura="1.0" regaura="1.500000" weight="1000" capacity="540" speed="1.0" hp="15" damage="1d4" unarmedattack="0" unarmeddefense="0" attackmodifier="3" defensemodifier="1" walk="yes" teach="no" getitem="yes" equipment="yes">
<ai splitsize="9999"/>
<skill name="mining" modifier="-99"/>
<skill name="bow" modifier="2"/>
@ -493,7 +493,7 @@
<attack type="1" damage="1d4"/>
<attack type="2" damage="2d20"/>
</race>
<race name="songdragon" magres="99" maxaura="1" regaura="1" weight="1000" capacity="600" speed="1.500000" hp="40" ac="1" damage="2d4" unarmedattack="0" unarmeddefense="0" attackmodifier="3" defensemodifier="1" fly="yes" walk="yes" teach="no" getitem="yes">
<race name="songdragon" magres="99" maxaura="1.0" regaura="1.0" weight="1000" capacity="600" speed="1.500000" hp="40" ac="1" damage="2d4" unarmedattack="0" unarmeddefense="0" attackmodifier="3" defensemodifier="1" fly="yes" walk="yes" teach="no" getitem="yes">
<ai splitsize="9999"/>
<skill name="crossbow" modifier="-99"/>
<skill name="mining" modifier="-99"/>
@ -520,7 +520,7 @@
<attack type="6" spell="fiery_dragonbreath" level="3" />
</race>
<race name="rat" maxaura="0" regaura="0" weight="100" capacity="540" speed="1.0" hp="10" damage="1d4" unarmedattack="0" unarmeddefense="0" attackmodifier="1" defensemodifier="1" walk="yes" teach="no" getitem="yes">
<race name="rat" maxaura="0.000000" regaura="0.000000" weight="100" capacity="540" speed="1.0" hp="10" damage="1d4" unarmedattack="0" unarmeddefense="0" attackmodifier="1" defensemodifier="1" walk="yes" teach="no" getitem="yes">
<ai splitsize="9999"/>
<skill name="crossbow" modifier="-99"/>
<skill name="mining" modifier="-99"/>
@ -543,7 +543,7 @@
<attack type="4" damage="1d4"/>
<attack type="4" damage="1d4"/>
</race>
<race name="eagle" maxaura="0" regaura="0" weight="500" capacity="540" speed="1.500000" hp="15" damage="2d3" unarmedattack="0" unarmeddefense="0" attackmodifier="6" defensemodifier="2" fly="yes" walk="yes" teach="no" getitem="yes">
<race name="eagle" maxaura="0.000000" regaura="0.000000" weight="500" capacity="540" speed="1.500000" hp="15" damage="2d3" unarmedattack="0" unarmeddefense="0" attackmodifier="6" defensemodifier="2" fly="yes" walk="yes" teach="no" getitem="yes">
<ai splitsize="9999"/>
<skill name="crossbow" modifier="-99"/>
<skill name="mining" modifier="-99"/>
@ -565,7 +565,7 @@
<skill name="cartmaking" modifier="-99"/>
<attack type="4" damage="2d3"/>
</race>
<race name="tunnelworm" magres="80" maxaura="0" regaura="0" weight="30000" capacity="10000" speed="1.0" hp="300" ac="6" damage="3d20" unarmedattack="0" unarmeddefense="0" attackmodifier="6" defensemodifier="1" scarepeasants="yes" walk="yes" teach="no" getitem="yes">
<race name="tunnelworm" magres="80" maxaura="0.000000" regaura="0.000000" weight="30000" capacity="10000" speed="1.0" hp="300" ac="6" damage="3d20" unarmedattack="0" unarmeddefense="0" attackmodifier="6" defensemodifier="1" scarepeasants="yes" walk="yes" teach="no" getitem="yes">
<ai splitsize="99999"/>
<skill name="crossbow" modifier="-99"/>
<skill name="mining" modifier="10"/>
@ -589,15 +589,15 @@
<attack type="4" damage="3d20"/>
<attack type="8" damage="1d10"/>
</race>
<race name="direwolf" maxaura="0" regaura="0" weight="500" capacity="540" speed="1.0" hp="20" damage="2d4" unarmedattack="0" unarmeddefense="0" attackmodifier="3" defensemodifier="1" walk="yes" teach="no" giveperson="yes">
<race name="direwolf" maxaura="0.000000" regaura="0.000000" weight="500" capacity="540" speed="1.0" hp="20" damage="2d4" unarmedattack="0" unarmeddefense="0" attackmodifier="3" defensemodifier="1" walk="yes" teach="no" giveperson="yes">
<ai splitsize="5000"/>
<attack type="4" damage="2d4"/>
</race>
<race name="peasant" maxaura="1" regaura="1" weight="1000" capacity="540" speed="1.0" hp="20" damage="1d6" unarmedattack="0" unarmeddefense="0" cannotmove="yes" teach="no">
<race name="peasant" maxaura="1.0" regaura="1.0" weight="1000" capacity="540" speed="1.0" hp="20" damage="1d6" unarmedattack="0" unarmeddefense="0" cannotmove="yes" teach="no">
<ai splitsize="10000"/>
<attack type="1" damage="1d6"/>
</race>
<race name="braineater" magres="90" maxaura="1" regaura="1" weight="100" capacity="540" speed="1.0" hp="20" damage="0d0" unarmedattack="0" unarmeddefense="0" attackmodifier="6" defensemodifier="10" scarepeasants="yes" fly="yes" walk="yes" teach="no" invinciblenonmagic="yes">
<race name="braineater" magres="90" maxaura="1.0" regaura="1.0" weight="100" capacity="540" speed="1.0" hp="20" damage="0d0" unarmedattack="0" unarmeddefense="0" attackmodifier="6" defensemodifier="10" scarepeasants="yes" fly="yes" walk="yes" teach="no" invinciblenonmagic="yes">
<ai splitsize="500" killpeasants="yes" moverandom="yes" learn="yes"/>
<attack type="2" damage="3d15"/>
<attack type="3" damage="1d1"/>
@ -651,34 +651,34 @@
<skill name="stamina" modifier="-10"/>
<attack type="4" damage="1d2"/>
</race>
<race name="mountainguard" unarmedguard="yes" magres="50" maxaura="1" regaura="0.500000" weight="10000" capacity="2000" speed="0.000000" hp="1000" ac="12" damage="2d40" unarmedattack="0" unarmeddefense="0" attackmodifier="6" defensemodifier="8" cannotmove="yes" canlearn="no" teach="no" noweapons="yes">
<race name="mountainguard" unarmedguard="yes" magres="50" maxaura="1.0" regaura="0.500000" weight="10000" capacity="2000" speed="0.000000" hp="1000" ac="12" damage="2d40" unarmedattack="0" unarmeddefense="0" attackmodifier="6" defensemodifier="8" cannotmove="yes" learn="no" teach="no" noweapons="yes">
<ai splitsize="1"/>
<attack type="4" damage="2d40"/>
</race>
<race name="shadowmaster" cansail="no" cansteal="no" canlearn="no" magres="75" maxaura="1" regaura="2.000000" weight="500" capacity="540" speed="1.0" hp="150" ac="4" damage="2d5" unarmedattack="0" unarmeddefense="0" attackmodifier="11" defensemodifier="13" scarepeasants="yes" walk="yes" teach="no" desert="yes">
<race name="shadowmaster" cansail="no" cansteal="no" learn="no" magres="75" maxaura="1.0" regaura="2.000000" weight="500" capacity="540" speed="1.0" hp="150" ac="4" damage="2d5" unarmedattack="0" unarmeddefense="0" attackmodifier="11" defensemodifier="13" scarepeasants="yes" walk="yes" teach="no" desert="yes">
<ai splitsize="50" killpeasants="yes" moverandom="yes" learn="yes"/>
<attack type="4" damage="2d4"/>
<attack type="2" damage="2d30"/>
<attack type="3" damage="1d2"/>
</race>
<race name="shadowdemon" cansail="no" cansteal="no" canlearn="no" magres="75" maxaura="1" regaura="1" weight="500" capacity="540" speed="1.0" hp="50" ac="3" damage="2d4" unarmedattack="0" unarmeddefense="0" attackmodifier="8" defensemodifier="11" scarepeasants="yes" walk="yes" teach="no" desert="yes" recruitethereal="yes">
<race name="shadowdemon" cansail="no" cansteal="no" learn="no" magres="75" maxaura="1.0" regaura="1.0" weight="500" capacity="540" speed="1.0" hp="50" ac="3" damage="2d4" unarmedattack="0" unarmeddefense="0" attackmodifier="8" defensemodifier="11" scarepeasants="yes" walk="yes" teach="no" desert="yes" recruitethereal="yes">
<ai splitsize="1000" killpeasants="yes" moverandom="yes" learn="yes"/>
<attack type="4" damage="2d3"/>
<attack type="3" damage="1d1"/>
</race>
<race name="stonegolem" stonegolem="true" magres="25" maxaura="1" regaura="0.100000" weight="10000" capacity="2000" speed="1.0" hp="60" ac="4" damage="2d12+6" unarmedattack="0" unarmeddefense="0" attackmodifier="4" defensemodifier="2" walk="yes" canlearn="no" teach="no">
<race name="stonegolem" stonegolem="true" magres="25" maxaura="1.0" regaura="0.100000" weight="10000" capacity="2000" speed="1.0" hp="60" ac="4" damage="2d12+6" unarmedattack="0" unarmeddefense="0" attackmodifier="4" defensemodifier="2" walk="yes" learn="no" teach="no">
<ai splitsize="50"/>
<skill name="building" modifier="14"/>
<skill name="roadwork" modifier="14"/>
<attack type="4" damage="2d10+4"/>
</race>
<race name="irongolem" irongolem="true" magres="25" maxaura="1" regaura="0.100000" weight="10000" capacity="2000" speed="1.0" hp="50" ac="2" damage="2d10+4" unarmedattack="0" unarmeddefense="0" attackmodifier="4" defensemodifier="2" walk="yes" canlearn="no" teach="no">
<race name="irongolem" irongolem="true" magres="25" maxaura="1.0" regaura="0.100000" weight="10000" capacity="2000" speed="1.0" hp="50" ac="2" damage="2d10+4" unarmedattack="0" unarmeddefense="0" attackmodifier="4" defensemodifier="2" walk="yes" learn="no" teach="no">
<ai splitsize="50"/>
<skill name="armorer" modifier="14"/>
<skill name="weaponsmithing" modifier="14"/>
<attack type="4" damage="2d8+4"/>
</race>
<race name="spell" maxaura="1" regaura="0.100000" weight="0" capacity="0" speed="0.000000" hp="1" damage="1d4" unarmedattack="-2" unarmeddefense="-2" canlearn="no" noheal="yes" noweapons="yes" illusionary="yes" invisible="yes" fly="yes" swim="yes" walk="yes">
<race name="spell" maxaura="1" regaura="0.100000" weight="0" capacity="0" speed="0.000000" hp="1" damage="1d4" unarmedattack="-2" unarmeddefense="-2" learn="no" noheal="yes" noweapons="yes" illusionary="yes" invisible="yes" fly="yes" swim="yes" walk="yes">
<ai splitsize="1"/>
<attack type="1" damage="1d4"/>
</race>
@ -687,14 +687,14 @@
<attack type="1" damage="1d4"/>
</race>
<race name="dracoid" maxaura="1" regaura="1" weight="1000" capacity="540" speed="1.0" hp="24" damage="1d5" unarmedattack="-2" unarmeddefense="-2" walk="yes" teach="no" giveperson="yes" getitem="yes" equipment="yes">
<race name="dracoid" maxaura="1.0" regaura="1.0" weight="1000" capacity="540" speed="1.0" hp="24" damage="1d5" unarmedattack="-2" unarmeddefense="-2" walk="yes" teach="no" giveperson="yes" getitem="yes" equipment="yes">
<ai splitsize="10000" moverandom="yes" learn="yes"/>
<attack type="4" damage="1d6"/>
<attack type="4" damage="1d6"/>
<attack type="1" damage="1d5"/>
</race>
<race name="ent" magres="25" maxaura="1" regaura="0.500000" weight="5000" capacity="2500" speed="1.0" hp="50" ac="4" damage="2d4+12" unarmedattack="0" unarmeddefense="0" attackmodifier="9" defensemodifier="7" scarepeasants="yes" walk="yes" teach="no">
<race name="ent" magres="25" maxaura="1.0" regaura="0.500000" weight="5000" capacity="2500" speed="1.0" hp="50" ac="4" damage="2d4+12" unarmedattack="0" unarmeddefense="0" attackmodifier="9" defensemodifier="7" scarepeasants="yes" walk="yes" teach="no">
<ai splitsize="1000" moverandom="yes" learn="yes"/>
<attack type="4" damage="2d12"/>
<attack type="4" damage="2d12"/>
@ -703,14 +703,14 @@
<race name="undead" maxaura="1" regaura="1" weight="1000"
capacity="540" speed="1.0" hp="20" damage="1d7" unarmedattack="0"
unarmeddefense="0" attackmodifier="1" defensemodifier="1"
scarepeasants="yes" walk="yes" canlearn="no" teach="no" noheal="yes"
scarepeasants="yes" walk="yes" learn="no" teach="no" noheal="yes"
undead="yes" equipment="yes" giveperson="yes">
<ai splitsize="20000" moverandom="yes"/>
<attack type="4" damage="1d7"/>
<attack type="5"/>
</race>
<race name="clone" magres="90" maxaura="0" regaura="0" weight="1000" capacity="540" speed="1.0" hp="40" damage="0d0" unarmedattack="-2" unarmeddefense="-2" playerrace="yes" walk="yes" canlearn="no" teach="no" noheal="yes">
<race name="clone" magres="90" maxaura="0.000000" regaura="0.000000" weight="1000" capacity="540" speed="1.0" hp="40" damage="0d0" unarmedattack="-2" unarmeddefense="-2" playerrace="yes" walk="yes" learn="no" teach="no" noheal="yes">
<ai splitsize="10000"/>
<skill name="crossbow" modifier="-99"/>
<skill name="mining" modifier="-99"/>
@ -736,7 +736,7 @@
<attack type="1" damage="0d0"/>
</race>
<race name="ghast" magres="60" maxaura="1" regaura="1" weight="1000" capacity="540" speed="1.0" hp="60" ac="2" damage="1d7" unarmedattack="6" unarmeddefense="6" attackmodifier="6" defensemodifier="6" scarepeasants="yes" walk="yes" canlearn="no" teach="no" absorbpeasants="yes" noheal="yes" undead="yes" equipment="yes" giveperson="yes">
<race name="ghast" magres="60" maxaura="1.0" regaura="1.0" weight="1000" capacity="540" speed="1.0" hp="60" ac="2" damage="1d7" unarmedattack="6" unarmeddefense="6" attackmodifier="6" defensemodifier="6" scarepeasants="yes" walk="yes" learn="no" teach="no" absorbpeasants="yes" noheal="yes" undead="yes" equipment="yes" giveperson="yes">
<ai splitsize="2000" killpeasants="yes" moverandom="yes"/>
<skill name="crossbow" modifier="1"/>
<skill name="bow" modifier="1"/>
@ -754,7 +754,7 @@
<attack type="2" damage="1d30"/>
</race>
<race name="ghoul" magres="30" maxaura="1" regaura="1" weight="1000" capacity="540" speed="1.0" hp="30" ac="1" damage="1d7" unarmedattack="3" unarmeddefense="3" attackmodifier="3" defensemodifier="3" scarepeasants="yes" walk="yes" canlearn="no" teach="no" absorbpeasants="yes" noheal="yes" undead="yes" equipment="yes" giveperson="yes">
<race name="ghoul" magres="30" maxaura="1.0" regaura="1.0" weight="1000" capacity="540" speed="1.0" hp="30" ac="1" damage="1d7" unarmedattack="3" unarmeddefense="3" attackmodifier="3" defensemodifier="3" scarepeasants="yes" walk="yes" learn="no" teach="no" absorbpeasants="yes" noheal="yes" undead="yes" equipment="yes" giveperson="yes">
<ai splitsize="10000" killpeasants="yes" moverandom="yes"/>
<skill name="crossbow" modifier="1"/>
<skill name="bow" modifier="1"/>
@ -771,7 +771,7 @@
<attack type="2" damage="1d30"/>
</race>
<race name="juju" magres="50" maxaura="1" regaura="1" weight="1000" capacity="540" speed="1.0" hp="80" ac="2" damage="1d7" unarmedattack="6" unarmeddefense="6" attackmodifier="8" defensemodifier="8" scarepeasants="yes" walk="yes" canlearn="no" teach="no" absorbpeasants="yes" noheal="yes" undead="yes" equipment="yes" resistbash="yes" resistcut="yes" resistpierce="yes" giveperson="yes">
<race name="juju" magres="50" maxaura="1.0" regaura="1.0" weight="1000" capacity="540" speed="1.0" hp="80" ac="2" damage="1d7" unarmedattack="6" unarmeddefense="6" attackmodifier="8" defensemodifier="8" scarepeasants="yes" walk="yes" learn="no" teach="no" absorbpeasants="yes" noheal="yes" undead="yes" equipment="yes" resistbash="yes" resistcut="yes" resistpierce="yes" giveperson="yes">
<ai splitsize="2000" killpeasants="yes" moverandom="yes"/>
<skill name="crossbow" modifier="1"/>
<skill name="bow" modifier="1"/>
@ -787,7 +787,7 @@
<attack type="3" damage="1d1"/>
</race>
<race name="zombie" magres="20" maxaura="1" regaura="1" weight="1000" capacity="540" speed="1.0" hp="40" ac="1" damage="1d7" unarmedattack="2" unarmeddefense="2" attackmodifier="5" defensemodifier="5" scarepeasants="yes" walk="yes" canlearn="no" teach="no" noheal="yes" undead="yes" equipment="yes" resistcut="yes" resistpierce="yes" giveperson="yes">
<race name="zombie" magres="20" maxaura="1.0" regaura="1.0" weight="1000" capacity="540" speed="1.0" hp="40" ac="1" damage="1d7" unarmedattack="2" unarmeddefense="2" attackmodifier="5" defensemodifier="5" scarepeasants="yes" walk="yes" learn="no" teach="no" noheal="yes" undead="yes" equipment="yes" resistcut="yes" resistpierce="yes" giveperson="yes">
<ai splitsize="10000" killpeasants="yes" moverandom="yes"/>
<skill name="crossbow" modifier="1"/>
<skill name="bow" modifier="1"/>
@ -801,7 +801,7 @@
<attack type="1" damage="1d7"/>
</race>
<race name="skeletonlord" magres="30" maxaura="1" regaura="1" weight="1000" capacity="540" speed="1.0" hp="60" ac="4" damage="1d7" unarmedattack="6" unarmeddefense="6" attackmodifier="8" defensemodifier="8" scarepeasants="yes" walk="yes" canlearn="no" teach="no" absorbpeasants="yes" noheal="yes" undead="yes" equipment="yes" resistcut="yes" resistpierce="yes" giveperson="yes">
<race name="skeletonlord" magres="30" maxaura="1.0" regaura="1.0" weight="1000" capacity="540" speed="1.0" hp="60" ac="4" damage="1d7" unarmedattack="6" unarmeddefense="6" attackmodifier="8" defensemodifier="8" scarepeasants="yes" walk="yes" learn="no" teach="no" absorbpeasants="yes" noheal="yes" undead="yes" equipment="yes" resistcut="yes" resistpierce="yes" giveperson="yes">
<ai splitsize="2000" killpeasants="yes" moverandom="yes"/>
<skill name="crossbow" modifier="1"/>
<skill name="bow" modifier="1"/>
@ -816,7 +816,7 @@
<attack type="1" damage="1d7"/>
</race>
<race name="skeleton" magres="10" maxaura="1" regaura="1" weight="500" capacity="540" speed="1.0" hp="20" ac="1" damage="1d7" unarmedattack="1" unarmeddefense="1" attackmodifier="6" defensemodifier="6" scarepeasants="yes" walk="yes" canlearn="no" teach="no" noheal="yes" undead="yes" equipment="yes" resistcut="yes" resistpierce="yes" giveperson="yes">
<race name="skeleton" magres="10" maxaura="1.0" regaura="1.0" weight="500" capacity="540" speed="1.0" hp="20" ac="1" damage="1d7" unarmedattack="1" unarmeddefense="1" attackmodifier="6" defensemodifier="6" scarepeasants="yes" walk="yes" learn="no" teach="no" noheal="yes" undead="yes" equipment="yes" resistcut="yes" resistpierce="yes" giveperson="yes">
<ai splitsize="10000" killpeasants="yes" moverandom="yes"/>
<skill name="crossbow" modifier="1"/>
<skill name="bow" modifier="1"/>
@ -830,12 +830,12 @@
<attack type="1" damage="1d7"/>
</race>
<race name="shadowknight" maxaura="0" regaura="0" weight="0" capacity="540" speed="1.0" hp="1" damage="1d1" unarmedattack="0" unarmeddefense="0" attackmodifier="1" defensemodifier="1" scarepeasants="yes" walk="yes" canlearn="no" teach="no" noblock="yes">
<race name="shadowknight" maxaura="0.000000" regaura="0.000000" weight="0" capacity="540" speed="1.0" hp="1" damage="1d1" unarmedattack="0" unarmeddefense="0" attackmodifier="1" defensemodifier="1" scarepeasants="yes" walk="yes" learn="no" teach="no" noblock="yes">
<ai splitsize="20000" moverandom="yes"/>
<attack type="1" damage="1d1"/>
</race>
<race name="seaserpent" magres="50" maxaura="1" regaura="1" weight="20000" capacity="5000" speed="1.0" hp="600" ac="3" damage="2d15" unarmedattack="0" unarmeddefense="0" attackmodifier="4" defensemodifier="4" scarepeasants="yes" swim="yes" teach="no" getitem="yes" resistbash="yes">
<race name="seaserpent" magres="50" maxaura="1.0" regaura="1.0" weight="20000" capacity="5000" speed="1.0" hp="600" ac="3" damage="2d15" unarmedattack="0" unarmeddefense="0" attackmodifier="4" defensemodifier="4" scarepeasants="yes" swim="yes" teach="no" getitem="yes" resistbash="yes">
<ai splitsize="6" killpeasants="yes" moverandom="yes" learn="yes" moveattack="yes"/>
<skill name="tactics" modifier="4"/>
<attack type="4" damage="1d30"/>

190
res/eressea.dtd Normal file
View File

@ -0,0 +1,190 @@
<?xml version="1.0" encoding="UTF-8"?>
<!-- DTD generated by XMLSpy v2018 rel. 2 (x64) (http://www.altova.com) -->
<!ELEMENT ai EMPTY>
<!ATTLIST ai
splitsize (1 | 1000 | 10000 | 2 | 2000 | 20000 | 50 | 500 | 5000 | 6 | 9999 | 99999) #REQUIRED
moverandom CDATA #FIXED "yes"
learn CDATA #FIXED "yes"
killpeasants CDATA #FIXED "yes"
moveattack CDATA #FIXED "yes"
>
<!ELEMENT set ((item+, ((skill+, item*) | callback | subset+)?) | (skill+, ((item+, subset?) | callback | subset | spell+)?) | callback)?>
<!ATTLIST set
name (fam_direwolf | fam_dreamcat | fam_eagle | fam_fairy | fam_ghost | fam_hellcat | fam_imp | fam_lynx | fam_nymph | fam_owl | fam_rat | fam_songdragon | fam_tiger | fam_tunnelworm | fam_unicorn | i_bow | i_chain | i_plate | i_rustyshield | i_spear | i_sword | new_dracoid | new_orc | rand_bow | rand_crossbow | rand_desert | rand_forest | rand_glacier | rand_herbalist | rand_highland | rand_mountain | rand_plain | rand_rider | rand_spear | rand_swamp | rand_sword | rand_villagers | rising_undead | seed_aquarian | seed_braineater | seed_cat | seed_demon | seed_dragon | seed_dwarf | seed_elf | seed_goblin | seed_halfling | seed_human | seed_insect | seed_orc | seed_seaserpent | seed_troll | spo_dragon | spo_seaserpent | spo_wyrm | spo_youngdragon) #REQUIRED
chance (0.25 | 0.33 | 0.34) #IMPLIED
>
<!ELEMENT item (weapon?)>
<!ATTLIST item
name (axe | balm | bow | cart | chainmail | crossbow | dragonblood | dragonhead | fairyboot | horse | incense | jewel | money | myrrh | nestwarmth | oil | plate | roi | rustychainmail | rustyshield | rustysword | seaserpenthead | silk | spear | spice | stone | sword | wagon) #IMPLIED
amount CDATA #IMPLIED
notlost CDATA #FIXED "yes"
weight (0 | 1 | 100) #IMPLIED
use CDATA #FIXED "yes"
cursed (true | yes) #IMPLIED
score CDATA #FIXED "0"
>
<!ELEMENT race ((ai, ((skill+, attack+, familiar*) | (param, skill+, attack, familiar+) | attack+)) | attack+)>
<!ATTLIST race
name (aquarian | braineater | cat | catdragon | clone | demon | direwolf | dolphin | dracoid | dragon | dreamcat | dwarf | eagle | elf | ent | fairy | ghast | ghost | ghoul | giantturtle | gnome | goblin | halfling | hellcat | human | imp | insect | irongolem | juju | kraken | lynx | mountainguard | museumghost | nymph | orc | owl | peasant | rat | seaserpent | shadowdemon | shadowdragon | shadowknight | shadowmaster | skeleton | skeletonlord | smurf | snotling | snowman | songdragon | special | spell | stonegolem | template | tiger | toad | troll | tunnelworm | undead | unicorn | wolf | wyrm | youngdragon | zombie) #REQUIRED
magres (-0.050000 | -5 | 10 | 100 | 15 | 20 | 25 | 30 | 5 | 50 | 60 | 70 | 75 | 80 | 90 | 95 | 99) #IMPLIED
maxaura (0.000000 | 0.500000 | 1.000000 | 1.500000) #IMPLIED
regaura (0.000000 | 0.100000 | 0.500000 | 1.000000 | 1.250000 | 1.500000 | 2.000000 | 3.000000) #IMPLIED
weight (0 | 100 | 1000 | 10000 | 1600 | 18000 | 200 | 2000 | 20000 | 30000 | 500 | 5000 | 600) #REQUIRED
capacity (0 | 1000 | 10000 | 100000 | 1000000 | 1080 | 200 | 2000 | 2500 | 440 | 5000 | 540 | 600) #REQUIRED
equipment (no | yes) #IMPLIED
speed (0.000000 | 1.000000 | 1.500000 | 10.000000 | 2.000000) #REQUIRED
hp (1 | 10 | 1000 | 15 | 150 | 16 | 18 | 20 | 24 | 25 | 2700 | 30 | 300 | 40 | 50 | 6 | 60 | 600 | 80 | 9 | 900) #REQUIRED
ac (1 | 10 | 12 | 2 | 3 | 4 | 5 | 6 | 7 | 8) #IMPLIED
damage CDATA #REQUIRED
unarmedattack (-2 | 0 | 1 | 10 | 2 | 3 | 6) #REQUIRED
unarmeddefense (-2 | 0 | 1 | 10 | 2 | 3 | 6) #REQUIRED
attackmodifier (1 | 10 | 11 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9) #IMPLIED
defensemodifier (1 | 10 | 11 | 12 | 13 | 14 | 2 | 3 | 4 | 5 | 50 | 6 | 7 | 8) #IMPLIED
fly (no | yes) #IMPLIED
walk (no | yes) #IMPLIED
canteach CDATA #FIXED "no"
getitem CDATA #FIXED "yes"
recruitcost (110 | 130 | 150 | 40 | 70 | 75 | 80 | 90) #IMPLIED
maintenance (0 | 10) #IMPLIED
playerrace (no | yes) #IMPLIED
giveperson CDATA #FIXED "yes"
giveunit CDATA #FIXED "yes"
coastal CDATA #FIXED "yes"
swim CDATA #FIXED "yes"
teach CDATA #FIXED "no"
resistpierce CDATA #FIXED "yes"
invinciblenonmagic CDATA #FIXED "yes"
scarepeasants CDATA #FIXED "yes"
unarmedguard CDATA #FIXED "yes"
cannotmove CDATA #FIXED "yes"
canlearn CDATA #FIXED "no"
noweapons CDATA #FIXED "yes"
cansail CDATA #FIXED "no"
cansteal CDATA #FIXED "no"
desert CDATA #FIXED "yes"
recruitethereal CDATA #FIXED "yes"
stonegolem CDATA #FIXED "true"
irongolem CDATA #FIXED "true"
noheal CDATA #FIXED "yes"
illusionary CDATA #FIXED "yes"
invisible CDATA #FIXED "yes"
shapeshift CDATA #FIXED "yes"
dragon CDATA #FIXED "yes"
resistbash CDATA #FIXED "yes"
undead CDATA #FIXED "yes"
shipspeed CDATA #FIXED "yes"
shapeshiftany CDATA #FIXED "yes"
recruitunlimited CDATA #FIXED "yes"
absorbpeasants CDATA #FIXED "yes"
resistcut CDATA #FIXED "yes"
noblock CDATA #FIXED "yes"
studyspeed CDATA #FIXED "-5"
>
<!ELEMENT text (#PCDATA)>
<!ATTLIST text
locale (de | en | fr) #REQUIRED
>
<!ELEMENT param EMPTY>
<!ATTLIST param
name (hunger.damage | migrants.formula | recruit_multi) #REQUIRED
value CDATA #REQUIRED
>
<!ELEMENT races (race+)>
<!ELEMENT skill EMPTY>
<!ATTLIST skill
name (alchemy | armorer | bow | building | cartmaking | catapult | crossbow | entertainment | espionage | forestry | herbalism | magic | melee | mining | perception | polearm | quarrying | riding | roadwork | sailing | shipcraft | stamina | stealth | tactics | taxation | trade | training | unarmed | weaponsmithing) #REQUIRED
level CDATA #IMPLIED
modifier (-1 | -10 | -2 | -3 | -99 | 1 | 10 | 12 | 14 | 2 | 20 | 3 | 4 | 5 | 8) #IMPLIED
>
<!ELEMENT spell (#PCDATA | resource)*>
<!ATTLIST spell
name CDATA #REQUIRED
level (1 | 12 | 2 | 3 | 4 | 5 | 6 | 7 | 8) #IMPLIED
ship CDATA #FIXED "true"
rank (1 | 2 | 3 | 4 | 5 | 7) #IMPLIED
variable CDATA #FIXED "true"
combat (1 | 2 | 3) #IMPLIED
parameters CDATA #IMPLIED
los CDATA #FIXED "true"
far CDATA #FIXED "true"
ocean CDATA #FIXED "true"
syntax (aura | buildingtype | direction | race | spellid) #IMPLIED
regiontarget (false | true) #IMPLIED
unittarget CDATA #FIXED "false"
buildingtarget CDATA #FIXED "true"
shiptarget CDATA #FIXED "true"
globaltarget CDATA #FIXED "true"
>
<!ELEMENT attack EMPTY>
<!ATTLIST attack
type (1 | 2 | 3 | 4 | 5 | 6 | 8) #REQUIRED
damage CDATA #IMPLIED
spell (aura_of_fear | drain_skills | fiery_dragonbreath | icy_dragonbreath | powerful_dragonbreath) #IMPLIED
level (12 | 3 | 6) #IMPLIED
>
<!ELEMENT damage EMPTY>
<!ATTLIST damage
type (footman | rider) #REQUIRED
value CDATA #FIXED "3d8+8"
>
<!ELEMENT spells (spell+)>
<!ELEMENT string (text+)>
<!ATTLIST string
name (adamantium | adamantium_p | adamantiumaxe | adamantiumaxe_p | adamantiumplate | adamantiumplate_p | almond | analysedream | aoc | aoc_p | apple | artacademy | aurapotion50 | aurapotion50_p | bagpipeoffear | bagpipeoffear_p | balloon | birthdaycake | birthdaycake_p | cookie | eyeofdragon | headache | jadee_dress | jadee_dress_p | jadee_ring | jadee_ring_p | lifepotion | newbie_info_cr | nut | pavilion | portal | ring | ring_of_levitation | ring_of_levitation_p | ring_p | rm_adamantium | seaserpenthead | seaserpenthead_p | seashell | seashell_p | snowball | snowman | snowman_p | stardust | temple | wente_dress | wente_dress_p | wente_ring | wente_ring_p | xmastree) #REQUIRED
>
<!ELEMENT subset (set+)>
<!ATTLIST subset
chance (0.2 | 0.3 | 0.4 | 0.6) #IMPLIED
>
<!ELEMENT weapon (damage+, modifier+)>
<!ATTLIST weapon
bash CDATA #FIXED "true"
missile CDATA #FIXED "true"
skill CDATA #FIXED "unarmed"
offmod CDATA #FIXED "0"
defmod CDATA #FIXED "0"
reload CDATA #FIXED "0"
magres CDATA #FIXED "0.0"
>
<!ELEMENT eressea (equipment+, buildings, resources, races, strings, spells)>
<!ELEMENT strings (namespace+, string+)>
<!ELEMENT building EMPTY>
<!ATTLIST building
name (artacademy | pavilion | portal | temple) #REQUIRED
maxsize (100 | 2 | 50) #REQUIRED
maxcapacity CDATA #FIXED "2"
nobuild CDATA #FIXED "yes"
nodestroy CDATA #FIXED "yes"
unique CDATA #FIXED "yes"
auraregen CDATA #FIXED "1.00"
>
<!ELEMENT callback EMPTY>
<!ATTLIST callback
name CDATA #FIXED "equip_newunits"
>
<!ELEMENT familiar EMPTY>
<!ATTLIST familiar
race (demon | dolphin | dreamcat | eagle | fairy | ghost | giantturtle | goblin | hellcat | imp | kraken | lynx | nymph | owl | rat | songdragon | tiger | tunnelworm | unicorn | wolf) #REQUIRED
default CDATA #FIXED "yes"
>
<!ELEMENT modifier EMPTY>
<!ATTLIST modifier
type (missile_target | skill) #REQUIRED
value (-90 | 100 | 2) #REQUIRED
races CDATA #FIXED "snowman"
>
<!ELEMENT resource (item?)>
<!ATTLIST resource
name (almond | aoc | aog | apple | aura | birthdaycake | cookie | dragonblood | dragonhead | eyeofdragon | h12 | h20 | h7 | hp | iron | jadee_dress | jadee_ring | laen | laensword | lebkuchenherz | lifepotion | lmsreward | log | mallorn | money | museumexitticket | museumticket | nut | oil | p10 | peasant | permaura | questkey1 | questkey2 | ring_of_levitation | seaserpenthead | seashell | snowball | snowglobe | snowman | stardust | stone | sword | toadslime | wente_dress | wente_ring | xmastree) #REQUIRED
appearance (amulet | key | ring | vial) #IMPLIED
amount (1 | 10 | 100 | 1000 | 12 | 140 | 15 | 150 | 16 | 18 | 2 | 20 | 200 | 24 | 25 | 250 | 28 | 3 | 30 | 3000 | 30000 | 35 | 350 | 4 | 40 | 4000 | 5 | 50 | 5000 | 6 | 600 | 7 | 8 | 80 | 800 | 90) #IMPLIED
cost (fixed | level) #IMPLIED
>
<!ELEMENT buildings (building+)>
<!ELEMENT equipment (set+)>
<!ELEMENT namespace (string+)>
<!ATTLIST namespace
name (describe | iteminfo | race | shipinfo | spell | spellinfo) #REQUIRED
>
<!ELEMENT resources (resource+)>

View File

@ -11,9 +11,8 @@
<attack type="3" damage="2d6+2"/>
</race>
<race name="human" maxaura="1" regaura="1" recruitcost="75" maintenance="10" weight="1000" capacity="540" speed="1" hp="20" damage="1d5" unarmedattack="-2" unarmeddefense="-2" playerrace="yes" walk="yes" giveperson="yes" giveunit="yes" getitem="yes" equipment="yes">
<race name="human" maxaura="1.000000" regaura="1.000000" recruitcost="75" maintenance="10" weight="1000" capacity="540" speed="1.000000" hp="20" damage="1d5" unarmedattack="-2" unarmeddefense="-2" playerrace="yes" walk="yes" giveperson="yes" giveunit="yes" getitem="yes" equipment="yes" migrants="yes">
<ai splitsize="10000" moverandom="yes" learn="yes"/>
<param name="migrants.formula" value="1"/>
<skill name="trade" modifier="1"/>
<skill name="herbalism" modifier="-1"/>
<skill name="shipcraft" modifier="1"/>
@ -27,7 +26,7 @@
<familiar race="eagle"/>
<familiar race="imp"/>
</race>
<race name="kraken" maxaura="0" regaura="0" weight="500" capacity="540" speed="2" hp="300" damage="2d10" unarmedattack="0" unarmeddefense="0" attackmodifier="7" defensemodifier="7" coastal="yes" swim="yes" teach="no" getitem="yes">
<race name="kraken" maxaura="0.000000" regaura="0.000000" weight="500" capacity="540" speed="2.000000" hp="300" damage="2d10" unarmedattack="0" unarmeddefense="0" attackmodifier="7" defensemodifier="7" coastal="yes" swim="yes" teach="no" getitem="yes">
<ai splitsize="5000"/>
<skill name="perception" modifier="1"/>
<skill name="alchemy" modifier="-99"/>
@ -60,7 +59,7 @@
<attack type="4" damage="1d10"/>
<attack type="4" damage="1d10"/>
</race>
<race name="giantturtle" maxaura="0" regaura="0" weight="1600" capacity="600" speed="1" hp="900" ac="7" damage="2d50" unarmedattack="0" unarmeddefense="0" attackmodifier="10" defensemodifier="5" coastal="yes" swim="yes" walk="yes" teach="no" getitem="yes">
<race name="giantturtle" maxaura="0.000000" regaura="0.000000" weight="1600" capacity="600" speed="1.000000" hp="900" ac="7" damage="2d50" unarmedattack="0" unarmeddefense="0" attackmodifier="10" defensemodifier="5" coastal="yes" swim="yes" walk="yes" teach="no" getitem="yes">
<ai splitsize="5000"/>
<skill name="perception" modifier="1"/>
<skill name="alchemy" modifier="-99"/>
@ -88,7 +87,7 @@
<skill name="taxation" modifier="-99"/>
<attack type="4" damage="2d50"/>
</race>
<race name="dolphin" maxaura="0" regaura="0" weight="500" capacity="540" speed="2" hp="24" damage="1d6" unarmedattack="0" unarmeddefense="0" attackmodifier="5" defensemodifier="5" coastal="yes" swim="yes" teach="no" getitem="yes">
<race name="dolphin" maxaura="0.000000" regaura="0.000000" weight="500" capacity="540" speed="2.000000" hp="24" damage="1d6" unarmedattack="0" unarmeddefense="0" attackmodifier="5" defensemodifier="5" coastal="yes" swim="yes" teach="no" getitem="yes">
<ai splitsize="5000"/>
<skill name="alchemy" modifier="-99"/>
<skill name="crossbow" modifier="-99"/>
@ -115,7 +114,7 @@
<skill name="taxation" modifier="-99"/>
<attack type="4" damage="1d6"/>
</race>
<race name="tiger" maxaura="0" regaura="0" weight="500" capacity="540" speed="1" hp="30" damage="2d6" unarmedattack="0" unarmeddefense="0" attackmodifier="6" defensemodifier="3" walk="yes" teach="no" getitem="yes">
<race name="tiger" maxaura="0.000000" regaura="0.000000" weight="500" capacity="540" speed="1.000000" hp="30" damage="2d6" unarmedattack="0" unarmeddefense="0" attackmodifier="6" defensemodifier="3" walk="yes" teach="no" getitem="yes">
<ai splitsize="5000"/>
<skill name="alchemy" modifier="-99"/>
<skill name="crossbow" modifier="-99"/>
@ -144,7 +143,7 @@
<attack type="4" damage="1d6"/>
<attack type="4" damage="1d6"/>
</race>
<race name="hellcat" magres="50" maxaura="0" regaura="0" weight="500" capacity="540" speed="1" hp="40" damage="2d6" unarmedattack="0" unarmeddefense="0" attackmodifier="6" defensemodifier="4" walk="yes" teach="no" getitem="yes" resistpierce="yes">
<race name="hellcat" magres="50" maxaura="0.000000" regaura="0.000000" weight="500" capacity="540" speed="1.000000" hp="40" damage="2d6" unarmedattack="0" unarmeddefense="0" attackmodifier="6" defensemodifier="4" walk="yes" teach="no" getitem="yes" resistpierce="yes">
<ai splitsize="5000"/>
<skill name="perception" modifier="1"/>
<skill name="alchemy" modifier="-99"/>
@ -173,7 +172,7 @@
<attack type="4" damage="1d6"/>
<attack type="4" damage="1d6"/>
</race>
<race name="owl" maxaura="0" regaura="0" weight="500" capacity="540" speed="1" hp="9" damage="1d4" unarmedattack="0" unarmeddefense="0" attackmodifier="2" defensemodifier="4" fly="yes" walk="yes" teach="no" getitem="yes">
<race name="owl" maxaura="0.000000" regaura="0.000000" weight="500" capacity="540" speed="1.000000" hp="9" damage="1d4" unarmedattack="0" unarmeddefense="0" attackmodifier="2" defensemodifier="4" fly="yes" walk="yes" teach="no" getitem="yes">
<ai splitsize="5000"/>
<skill name="espionage" modifier="1"/>
<skill name="stealth" modifier="1"/>
@ -203,7 +202,7 @@
<skill name="taxation" modifier="-99"/>
<attack type="4" damage="1d4"/>
</race>
<race name="fairy" magres="80" maxaura="1" regaura="1.5" weight="200" capacity="540" speed="1" hp="6" damage="1d3" unarmedattack="0" unarmeddefense="0" attackmodifier="6" defensemodifier="14" fly="yes" walk="yes" teach="no" getitem="yes" equipment="yes">
<race name="fairy" magres="80" maxaura="1.000000" regaura="1.500000" weight="200" capacity="540" speed="1.000000" hp="6" damage="1d3" unarmedattack="0" unarmeddefense="0" attackmodifier="6" defensemodifier="14" fly="yes" walk="yes" teach="no" getitem="yes" equipment="yes">
<ai splitsize="5000"/>
<skill name="stealth" modifier="5"/>
<skill name="espionage" modifier="2"/>
@ -237,7 +236,7 @@
<attack type="4" damage="1d3"/>
<attack type="4" damage="1d3"/>
</race>
<race name="dreamcat" magres="50" maxaura="1" regaura="1" weight="500" capacity="540" speed="1" hp="10" damage="1d5" unarmedattack="0" unarmeddefense="0" attackmodifier="5" defensemodifier="6" fly="yes" walk="yes" teach="no" getitem="yes" invinciblenonmagic="yes">
<race name="dreamcat" magres="50" maxaura="1.000000" regaura="1.000000" weight="500" capacity="540" speed="1.000000" hp="10" damage="1d5" unarmedattack="0" unarmeddefense="0" attackmodifier="5" defensemodifier="6" fly="yes" walk="yes" teach="no" getitem="yes" invinciblenonmagic="yes">
<ai splitsize="5000"/>
<skill name="magic" modifier="1"/>
<skill name="espionage" modifier="1"/>
@ -267,7 +266,7 @@
<attack type="4" damage="1d5"/>
<attack type="4" damage="1d5"/>
</race>
<race name="imp" magres="50" maxaura="1" regaura="1" weight="500" capacity="540" speed="1" hp="10" ac="1" damage="1d4" unarmedattack="0" unarmeddefense="0" attackmodifier="5" defensemodifier="4" fly="yes" walk="yes" teach="no" getitem="yes" equipment="yes">
<race name="imp" magres="50" maxaura="1.000000" regaura="1.000000" weight="500" capacity="540" speed="1.000000" hp="10" ac="1" damage="1d4" unarmedattack="0" unarmeddefense="0" attackmodifier="5" defensemodifier="4" fly="yes" walk="yes" teach="no" getitem="yes" equipment="yes">
<ai splitsize="5000"/>
<skill name="alchemy" modifier="-99"/>
<skill name="crossbow" modifier="-99"/>
@ -299,7 +298,7 @@
<attack type="1" damage="1d4"/>
<attack type="6" spell="fiery_dragonbreath" level="3" />
</race>
<race name="ghost" magres="80" maxaura="0.5" regaura="0.1" weight="500" capacity="540" speed="1" hp="30" ac="5" damage="2d6" unarmedattack="0" unarmeddefense="0" attackmodifier="5" defensemodifier="8" scarepeasants="yes" fly="yes" walk="yes" teach="no" getitem="yes" equipment="yes" invinciblenonmagic="yes">
<race name="ghost" magres="80" maxaura="0.500000" regaura="0.100000" weight="500" capacity="540" speed="1.000000" hp="30" ac="5" damage="2d6" unarmedattack="0" unarmeddefense="0" attackmodifier="5" defensemodifier="8" scarepeasants="yes" fly="yes" walk="yes" teach="no" getitem="yes" equipment="yes" invinciblenonmagic="yes">
<ai splitsize="5000"/>
<skill name="alchemy" modifier="-99"/>
<skill name="crossbow" modifier="-99"/>
@ -329,7 +328,7 @@
<attack type="2" damage="2d30"/>
<attack type="3" damage="1d1"/>
</race>
<race name="wolf" maxaura="0" regaura="0" weight="500" capacity="540" speed="1" hp="25" damage="2d6" unarmedattack="0" unarmeddefense="0" attackmodifier="6" defensemodifier="3" scarepeasants="yes" walk="yes" teach="no" getitem="yes">
<race name="wolf" maxaura="0.000000" regaura="0.000000" weight="500" capacity="540" speed="1.000000" hp="25" damage="2d6" unarmedattack="0" unarmeddefense="0" attackmodifier="6" defensemodifier="3" scarepeasants="yes" walk="yes" teach="no" getitem="yes">
<ai splitsize="5000"/>
<skill name="alchemy" modifier="-99"/>
<skill name="crossbow" modifier="-99"/>
@ -358,7 +357,7 @@
<attack type="4" damage="1d4"/>
<attack type="4" damage="1d4"/>
</race>
<race name="unicorn" magres="90" maxaura="1.5" regaura="1.5" weight="5000" capacity="2000" speed="2" hp="40" damage="2d4" unarmedattack="0" unarmeddefense="0" attackmodifier="6" defensemodifier="4" walk="yes" teach="no" getitem="yes">
<race name="unicorn" magres="90" maxaura="1.500000" regaura="1.500000" weight="5000" capacity="2000" speed="2.000000" hp="40" damage="2d4" unarmedattack="0" unarmeddefense="0" attackmodifier="6" defensemodifier="4" walk="yes" teach="no" getitem="yes">
<ai splitsize="9999"/>
<skill name="alchemy" modifier="-99"/>
<skill name="crossbow" modifier="-99"/>
@ -388,7 +387,7 @@
<attack type="4" damage="3d12"/>
<attack type="4" damage="2d4"/>
</race>
<race name="nymph" magres="90" maxaura="1" regaura="1.5" weight="1000" capacity="540" speed="1" hp="15" damage="1d4" unarmedattack="0" unarmeddefense="0" attackmodifier="3" defensemodifier="1" walk="yes" teach="no" getitem="yes" equipment="yes">
<race name="nymph" magres="90" maxaura="1.000000" regaura="1.500000" weight="1000" capacity="540" speed="1.000000" hp="15" damage="1d4" unarmedattack="0" unarmeddefense="0" attackmodifier="3" defensemodifier="1" walk="yes" teach="no" getitem="yes" equipment="yes">
<ai splitsize="9999"/>
<skill name="mining" modifier="-99"/>
<skill name="bow" modifier="2"/>
@ -417,7 +416,7 @@
<attack type="1" damage="1d4"/>
<attack type="2" damage="2d20"/>
</race>
<race name="songdragon" magres="99" maxaura="1" regaura="1" weight="1000" capacity="600" speed="1.5" hp="40" ac="1" damage="2d4" unarmedattack="0" unarmeddefense="0" attackmodifier="3" defensemodifier="1" fly="yes" walk="yes" teach="no" getitem="yes" unarmedguard="yes">
<race name="songdragon" magres="99" maxaura="1.000000" regaura="1.000000" weight="1000" capacity="600" speed="1.500000" hp="40" ac="1" damage="2d4" unarmedattack="0" unarmeddefense="0" attackmodifier="3" defensemodifier="1" fly="yes" walk="yes" teach="no" getitem="yes" unarmedguard="yes">
<ai splitsize="9999"/>
<skill name="alchemy" modifier="-99"/>
<skill name="crossbow" modifier="-99"/>
@ -448,7 +447,7 @@
<attack type="4" damage="2d4"/>
<attack type="6" spell="fiery_dragonbreath" level="3" />
</race>
<race name="rat" maxaura="0" regaura="0" weight="100" capacity="540" speed="1" hp="10" damage="1d4" unarmedattack="0" unarmeddefense="0" attackmodifier="1" defensemodifier="1" walk="yes" teach="no" getitem="yes">
<race name="rat" maxaura="0.000000" regaura="0.000000" weight="100" capacity="540" speed="1.000000" hp="10" damage="1d4" unarmedattack="0" unarmeddefense="0" attackmodifier="1" defensemodifier="1" walk="yes" teach="no" getitem="yes">
<ai splitsize="9999"/>
<skill name="espionage" modifier="5"/>
<skill name="stealth" modifier="4"/>
@ -479,7 +478,7 @@
<attack type="4" damage="1d4"/>
<attack type="4" damage="1d4"/>
</race>
<race name="eagle" maxaura="0" regaura="0" weight="500" capacity="540" speed="1.5" hp="15" damage="2d3" unarmedattack="0" unarmeddefense="0" attackmodifier="6" defensemodifier="2" fly="yes" walk="yes" teach="no" getitem="yes">
<race name="eagle" maxaura="0.000000" regaura="0.000000" weight="500" capacity="540" speed="1.500000" hp="15" damage="2d3" unarmedattack="0" unarmeddefense="0" attackmodifier="6" defensemodifier="2" fly="yes" walk="yes" teach="no" getitem="yes">
<ai splitsize="9999"/>
<skill name="alchemy" modifier="-99"/>
<skill name="crossbow" modifier="-99"/>
@ -508,7 +507,7 @@
<skill name="taxation" modifier="-99"/>
<attack type="4" damage="2d3"/>
</race>
<race name="tunnelworm" magres="80" maxaura="0" regaura="0" weight="30000" capacity="10000" speed="1" hp="300" ac="6" damage="3d20" unarmedattack="0" unarmeddefense="0" attackmodifier="6" defensemodifier="1" scarepeasants="yes" walk="yes" teach="no" getitem="yes">
<race name="tunnelworm" magres="80" maxaura="0.000000" regaura="0.000000" weight="30000" capacity="10000" speed="1.000000" hp="300" ac="6" damage="3d20" unarmedattack="0" unarmeddefense="0" attackmodifier="6" defensemodifier="1" scarepeasants="yes" walk="yes" teach="no" getitem="yes">
<ai splitsize="99999"/>
<skill name="alchemy" modifier="-99"/>
<skill name="crossbow" modifier="-99"/>
@ -540,7 +539,7 @@
<attack type="4" damage="3d20"/>
<attack type="8" damage="1d10"/>
</race>
<race name="lynx" maxaura="0" regaura="0" weight="500" capacity="540" speed="1" hp="20" damage="2d3" unarmedattack="0" unarmeddefense="0" attackmodifier="4" defensemodifier="5" walk="yes" teach="no" getitem="yes">
<race name="lynx" maxaura="0.000000" regaura="0.000000" weight="500" capacity="540" speed="1.000000" hp="20" damage="2d3" unarmedattack="0" unarmeddefense="0" attackmodifier="4" defensemodifier="5" walk="yes" teach="no" getitem="yes">
<ai splitsize="99999"/>
<skill name="alchemy" modifier="-99"/>
<skill name="crossbow" modifier="-99"/>
@ -570,16 +569,16 @@
<skill name="taxation" modifier="-99"/>
<attack type="4" damage="2d3"/>
</race>
<race name="direwolf" maxaura="0" regaura="0" weight="500" capacity="540" speed="1" hp="20" damage="2d4" unarmedattack="0" unarmeddefense="0" attackmodifier="3" defensemodifier="1" walk="yes" teach="no" giveperson="yes">
<race name="direwolf" maxaura="0.000000" regaura="0.000000" weight="500" capacity="540" speed="1.000000" hp="20" damage="2d4" unarmedattack="0" unarmeddefense="0" attackmodifier="3" defensemodifier="1" walk="yes" teach="no" giveperson="yes">
<ai splitsize="5000"/>
<attack type="4" damage="2d4"/>
</race>
<race name="peasant" maxaura="1" regaura="1" weight="1000" capacity="540" speed="1" hp="20" damage="1d6" unarmedattack="0" unarmeddefense="0" cannotmove="yes" teach="no">
<race name="peasant" maxaura="1.000000" regaura="1.000000" weight="1000" capacity="540" speed="1.000000" hp="20" damage="1d6" unarmedattack="0" unarmeddefense="0" cannotmove="yes" teach="no">
<ai splitsize="10000"/>
<attack type="1" damage="1d6"/>
</race>
<race name="braineater" magres="90" maxaura="1"
regaura="1" weight="100" capacity="540" speed="1" hp="20" damage="0d0" unarmedattack="0" unarmeddefense="0" attackmodifier="6" defensemodifier="10" scarepeasants="yes" fly="yes" walk="yes" teach="no" invinciblenonmagic="yes">
<race name="braineater" magres="90" maxaura="1.000000"
regaura="1.000000" weight="100" capacity="540" speed="1.000000" hp="20" damage="0d0" unarmedattack="0" unarmeddefense="0" attackmodifier="6" defensemodifier="10" scarepeasants="yes" fly="yes" walk="yes" teach="no" invinciblenonmagic="yes">
<ai splitsize="500" killpeasants="yes" moverandom="yes" learn="yes"/>
<attack type="2" damage="3d15"/>
<attack type="3" damage="1d1"/>
@ -649,34 +648,34 @@
<skill name="stamina" modifier="-10"/>
<attack type="4" damage="1d2"/>
</race>
<race name="mountainguard" unarmedguard="yes" magres="50" maxaura="1" regaura="0.5" weight="10000" capacity="2000" speed="0" hp="1000" ac="12" damage="2d40" unarmedattack="0" unarmeddefense="0" attackmodifier="6" defensemodifier="8" cannotmove="yes" canlearn="no" teach="no" noweapons="yes">
<race name="mountainguard" unarmedguard="yes" magres="50" maxaura="1.000000" regaura="0.500000" weight="10000" capacity="2000" speed="0.000000" hp="1000" ac="12" damage="2d40" unarmedattack="0" unarmeddefense="0" attackmodifier="6" defensemodifier="8" cannotmove="yes" learn="no" teach="no" noweapons="yes">
<ai splitsize="1"/>
<attack type="4" damage="2d40"/>
</race>
<race name="shadowmaster" cansail="no" cansteal="no" canlearn="no" magres="75" maxaura="1" regaura="2" weight="500" capacity="540" speed="1" hp="150" ac="4" damage="2d5" unarmedattack="0" unarmeddefense="0" attackmodifier="11" defensemodifier="13" scarepeasants="yes" walk="yes" teach="no" desert="yes">
<race name="shadowmaster" cansail="no" cansteal="no" learn="no" magres="75" maxaura="1.000000" regaura="2.000000" weight="500" capacity="540" speed="1.000000" hp="150" ac="4" damage="2d5" unarmedattack="0" unarmeddefense="0" attackmodifier="11" defensemodifier="13" scarepeasants="yes" walk="yes" teach="no" desert="yes">
<ai splitsize="50" killpeasants="yes" moverandom="yes" learn="yes"/>
<attack type="4" damage="2d4"/>
<attack type="2" damage="2d30"/>
<attack type="3" damage="1d2"/>
</race>
<race name="shadowdemon" cansail="no" cansteal="no" canlearn="no" magres="75" maxaura="1" regaura="1" weight="500" capacity="540" speed="1" hp="50" ac="3" damage="2d4" unarmedattack="0" unarmeddefense="0" attackmodifier="8" defensemodifier="11" scarepeasants="yes" walk="yes" teach="no" desert="yes" recruitethereal="yes">
<race name="shadowdemon" cansail="no" cansteal="no" learn="no" magres="75" maxaura="1.000000" regaura="1.000000" weight="500" capacity="540" speed="1.000000" hp="50" ac="3" damage="2d4" unarmedattack="0" unarmeddefense="0" attackmodifier="8" defensemodifier="11" scarepeasants="yes" walk="yes" teach="no" desert="yes" recruitethereal="yes">
<ai splitsize="1000" killpeasants="yes" moverandom="yes" learn="yes"/>
<attack type="4" damage="2d3"/>
<attack type="3" damage="1d1"/>
</race>
<race name="stonegolem" stonegolem="true" magres="25" maxaura="1" regaura="0.100000" weight="10000" capacity="2000" speed="1" hp="60" ac="4" damage="2d12+6" unarmedattack="0" unarmeddefense="0" attackmodifier="4" defensemodifier="2" walk="yes" canlearn="no" teach="no">
<race name="stonegolem" stonegolem="true" magres="25" maxaura="1.000000" regaura="0.100000" weight="10000" capacity="2000" speed="1.000000" hp="60" ac="4" damage="2d12+6" unarmedattack="0" unarmeddefense="0" attackmodifier="4" defensemodifier="2" walk="yes" learn="no" teach="no">
<ai splitsize="50"/>
<skill name="building" modifier="14"/>
<skill name="roadwork" modifier="14"/>
<attack type="4" damage="2d10+4"/>
</race>
<race name="irongolem" irongolem="true" magres="25" maxaura="1" regaura="0.100000" weight="10000" capacity="2000" speed="1" hp="50" ac="2" damage="2d10+4" unarmedattack="0" unarmeddefense="0" attackmodifier="4" defensemodifier="2" walk="yes" canlearn="no" teach="no">
<race name="irongolem" irongolem="true" magres="25" maxaura="1.000000" regaura="0.100000" weight="10000" capacity="2000" speed="1.000000" hp="50" ac="2" damage="2d10+4" unarmedattack="0" unarmeddefense="0" attackmodifier="4" defensemodifier="2" walk="yes" learn="no" teach="no">
<ai splitsize="50"/>
<skill name="armorer" modifier="14"/>
<skill name="weaponsmithing" modifier="14"/>
<attack type="4" damage="2d8+4"/>
</race>
<race name="spell" maxaura="1" regaura="0.100000" weight="0" capacity="0" speed="0" hp="1" damage="1d4" unarmedattack="-2" unarmeddefense="-2" canlearn="no" noheal="yes" noweapons="yes" illusionary="yes" invisible="yes" fly="yes" swim="yes" walk="yes">
<race name="spell" maxaura="1" regaura="0.100000" weight="0" capacity="0" speed="0" hp="1" damage="1d4" unarmedattack="-2" unarmeddefense="-2" learn="no" noheal="yes" noweapons="yes" illusionary="yes" invisible="yes" fly="yes" swim="yes" walk="yes">
<ai splitsize="1"/>
<attack type="1" damage="1d4"/>
</race>
@ -684,25 +683,25 @@
<ai splitsize="1"/>
<attack type="1" damage="1d4"/>
</race>
<race name="dracoid" maxaura="1" regaura="1" weight="1000" capacity="540" speed="1" hp="24" damage="1d5" unarmedattack="-2" unarmeddefense="-2" walk="yes" teach="no" giveperson="yes" getitem="yes" equipment="yes">
<race name="dracoid" maxaura="1.000000" regaura="1.000000" weight="1000" capacity="540" speed="1.000000" hp="24" damage="1d5" unarmedattack="-2" unarmeddefense="-2" walk="yes" teach="no" giveperson="yes" getitem="yes" equipment="yes">
<ai splitsize="10000" moverandom="yes" learn="yes"/>
<attack type="4" damage="1d6"/>
<attack type="4" damage="1d6"/>
<attack type="1" damage="1d5"/>
</race>
<race name="catdragon" magres="90" maxaura="1" regaura="1" weight="20000" capacity="10000" speed="1" hp="20" damage="2d40" unarmedattack="0" unarmeddefense="0" defensemodifier="50" fly="yes" walk="yes" teach="no" shapeshift="yes" giveperson="yes" getitem="yes" dragon="yes">
<race name="catdragon" magres="90" maxaura="1.000000" regaura="1.000000" weight="20000" capacity="10000" speed="1.000000" hp="20" damage="2d40" unarmedattack="0" unarmeddefense="0" defensemodifier="50" fly="yes" walk="yes" teach="no" shapeshift="yes" giveperson="yes" getitem="yes" dragon="yes">
<ai splitsize="1"/>
<attack type="4" damage="2d40"/>
<attack type="4" damage="2d40"/>
<attack type="4" damage="2d40"/>
<attack type="4" damage="2d40"/>
</race>
<race name="ent" magres="25" maxaura="1" regaura="0.5" weight="5000" capacity="2500" speed="1" hp="50" ac="4" damage="2d4+12" unarmedattack="0" unarmeddefense="0" attackmodifier="9" defensemodifier="7" scarepeasants="yes" walk="yes" teach="no">
<race name="ent" magres="25" maxaura="1.000000" regaura="0.500000" weight="5000" capacity="2500" speed="1.000000" hp="50" ac="4" damage="2d4+12" unarmedattack="0" unarmeddefense="0" attackmodifier="9" defensemodifier="7" scarepeasants="yes" walk="yes" teach="no">
<ai splitsize="1000" moverandom="yes" learn="yes"/>
<attack type="4" damage="2d12"/>
<attack type="4" damage="2d12"/>
</race>
<race name="wyrm" magres="90" maxaura="1" regaura="3" weight="18000" capacity="1000000" speed="1" hp="2700" ac="8" damage="2d60" unarmedattack="0" unarmeddefense="0" attackmodifier="10" defensemodifier="10" scarepeasants="yes" fly="yes" walk="yes" teach="no" getitem="yes" resistbash="yes" dragon="yes" unarmedguard="yes">
<race name="wyrm" magres="90" maxaura="1.000000" regaura="3.000000" weight="18000" capacity="1000000" speed="1.000000" hp="2700" ac="8" damage="2d60" unarmedattack="0" unarmeddefense="0" attackmodifier="10" defensemodifier="10" scarepeasants="yes" fly="yes" walk="yes" teach="no" getitem="yes" resistbash="yes" dragon="yes" unarmedguard="yes">
<ai splitsize="1" killpeasants="yes" learn="yes"/>
<skill name="magic" modifier="12"/>
<skill name="tactics" modifier="12"/>
@ -712,7 +711,7 @@
<attack type="4" damage="5d30"/>
<attack type="6" spell="powerful_dragonbreath" level="12" />
</race>
<race name="dragon" magres="70" maxaura="1" regaura="2" weight="10000" capacity="1000000" speed="1.5" hp="900" ac="6" damage="2d30" unarmedattack="0" unarmeddefense="0" attackmodifier="7" defensemodifier="7" scarepeasants="yes" fly="yes" walk="yes" teach="no" getitem="yes" resistbash="yes" unarmedguard="yes" dragon="yes">
<race name="dragon" magres="70" maxaura="1.000000" regaura="2.000000" weight="10000" capacity="1000000" speed="1.500000" hp="900" ac="6" damage="2d30" unarmedattack="0" unarmeddefense="0" attackmodifier="7" defensemodifier="7" scarepeasants="yes" fly="yes" walk="yes" teach="no" getitem="yes" resistbash="yes" unarmedguard="yes" dragon="yes">
<ai splitsize="2" killpeasants="yes" learn="yes"/>
<skill name="magic" modifier="8"/>
<skill name="tactics" modifier="8"/>
@ -722,7 +721,7 @@
<attack type="4" damage="3d30"/>
<attack type="6" spell="icy_dragonbreath" level="6" />
</race>
<race name="youngdragon" magres="50" maxaura="1" regaura="1" weight="20000" capacity="10000" speed="1" hp="300" ac="4" damage="2d15" unarmedattack="0" unarmeddefense="0" attackmodifier="4" defensemodifier="4" scarepeasants="yes" fly="yes" walk="yes" teach="no" getitem="yes" resistbash="yes" unarmedguard="yes">
<race name="youngdragon" magres="50" maxaura="1.000000" regaura="1.000000" weight="20000" capacity="10000" speed="1.000000" hp="300" ac="4" damage="2d15" unarmedattack="0" unarmeddefense="0" attackmodifier="4" defensemodifier="4" scarepeasants="yes" fly="yes" walk="yes" teach="no" getitem="yes" resistbash="yes" unarmedguard="yes">
<ai splitsize="6" killpeasants="yes" learn="yes"/>
<skill name="magic" modifier="4"/>
<skill name="tactics" modifier="4"/>
@ -733,7 +732,7 @@
<attack type="4" damage="1d30"/>
<attack type="6" spell="fiery_dragonbreath" level="3" />
</race>
<race name="undead" maxaura="1" regaura="1" weight="1000" capacity="540" speed="1" hp="20" damage="1d7" unarmedattack="0" unarmeddefense="0" attackmodifier="1" defensemodifier="1" scarepeasants="yes" walk="yes" canlearn="no" teach="no" noheal="yes" undead="yes" equipment="yes" giveperson="yes">
<race name="undead" maxaura="1.000000" regaura="1.000000" weight="1000" capacity="540" speed="1.000000" hp="20" damage="1d7" unarmedattack="0" unarmeddefense="0" attackmodifier="1" defensemodifier="1" scarepeasants="yes" walk="yes" learn="no" teach="no" noheal="yes" undead="yes" equipment="yes" giveperson="yes">
<ai splitsize="20000" moverandom="yes"/>
<attack type="4" damage="1d7"/>
<attack type="5"/>
@ -783,7 +782,7 @@
</race>
<race name="halfling" magres="5" maxaura="1" regaura="1" recruitcost="80" maintenance="10" weight="1000" capacity="540" speed="1" hp="18" damage="1d5" unarmedattack="-2" unarmeddefense="-2" playerrace="yes" walk="yes" giveperson="yes" giveunit="yes" getitem="yes" equipment="yes">
<ai splitsize="10000" moverandom="yes" learn="yes"/>
<param name="hunger.damage" value="1d14+14"/>
<param name="hunger_damage" value="1d14+14"/>
<skill name="crossbow" modifier="1"/>
<skill name="mining" modifier="1"/>
<skill name="bow" modifier="-1"/>
@ -925,7 +924,7 @@
<familiar race="rat"/>
<familiar race="imp"/>
</race>
<race name="clone" magres="90" maxaura="0" regaura="0" weight="1000" capacity="540" speed="1" hp="40" damage="0d0" unarmedattack="-2" unarmeddefense="-2" playerrace="yes" walk="yes" canlearn="no" teach="no" noheal="yes">
<race name="clone" magres="90" maxaura="0.000000" regaura="0.000000" weight="1000" capacity="540" speed="1.000000" hp="40" damage="0d0" unarmedattack="-2" unarmeddefense="-2" playerrace="yes" walk="yes" learn="no" teach="no" noheal="yes">
<ai splitsize="10000"/>
<skill name="alchemy" modifier="-99"/>
<skill name="crossbow" modifier="-99"/>
@ -962,7 +961,7 @@
<ai splitsize="10000" moverandom="yes" learn="yes"/>
<attack type="1" damage="1d4"/>
</race>
<race name="gnome" magres="100" maxaura="0" regaura="0" weight="1000" capacity="540" speed="1" hp="50" damage="1d4" unarmedattack="10" unarmeddefense="10" attackmodifier="10" defensemodifier="10" walk="yes" teach="no">
<race name="gnome" magres="100" maxaura="0.000000" regaura="0.000000" weight="1000" capacity="540" speed="1.000000" hp="50" damage="1d4" unarmedattack="10" unarmeddefense="10" attackmodifier="10" defensemodifier="10" walk="yes" teach="no">
<ai splitsize="10000"/>
<skill name="tactics" modifier="1"/>
<skill name="perception" modifier="1"/>
@ -970,7 +969,7 @@
<skill name="unarmed" modifier="1"/>
<attack type="1" damage="1d4"/>
</race>
<race name="museumghost" magres="100" maxaura="0" regaura="0" weight="1000" capacity="540" speed="1" hp="50" damage="1d4" unarmedattack="10" unarmeddefense="10" attackmodifier="10" defensemodifier="10" walk="yes" teach="no">
<race name="museumghost" magres="100" maxaura="0.000000" regaura="0.000000" weight="1000" capacity="540" speed="1.000000" hp="50" damage="1d4" unarmedattack="10" unarmeddefense="10" attackmodifier="10" defensemodifier="10" walk="yes" teach="no">
<ai splitsize="10000"/>
<skill name="tactics" modifier="1"/>
<skill name="perception" modifier="1"/>
@ -984,7 +983,7 @@
<attack type="2" damage="5d600"/>
<attack type="1" damage="1d4"/>
</race>
<race name="ghast" magres="60" maxaura="1" regaura="1" weight="1000" capacity="540" speed="1" hp="60" ac="2" damage="1d7" unarmedattack="6" unarmeddefense="6" attackmodifier="6" defensemodifier="6" scarepeasants="yes" walk="yes" canlearn="no" teach="no" absorbpeasants="yes" noheal="yes" undead="yes" equipment="yes" giveperson="yes">
<race name="ghast" magres="60" maxaura="1.000000" regaura="1.000000" weight="1000" capacity="540" speed="1.000000" hp="60" ac="2" damage="1d7" unarmedattack="6" unarmeddefense="6" attackmodifier="6" defensemodifier="6" scarepeasants="yes" walk="yes" learn="no" teach="no" absorbpeasants="yes" noheal="yes" undead="yes" equipment="yes" giveperson="yes">
<ai splitsize="2000" killpeasants="yes" moverandom="yes"/>
<skill name="crossbow" modifier="1"/>
<skill name="bow" modifier="1"/>
@ -1001,7 +1000,7 @@
<attack type="2" damage="1d30"/>
<attack type="2" damage="1d30"/>
</race>
<race name="ghoul" magres="30" maxaura="1" regaura="1" weight="1000" capacity="540" speed="1" hp="30" ac="1" damage="1d7" unarmedattack="3" unarmeddefense="3" attackmodifier="3" defensemodifier="3" scarepeasants="yes" walk="yes" canlearn="no" teach="no" absorbpeasants="yes" noheal="yes" undead="yes" equipment="yes" giveperson="yes">
<race name="ghoul" magres="30" maxaura="1.000000" regaura="1.000000" weight="1000" capacity="540" speed="1.000000" hp="30" ac="1" damage="1d7" unarmedattack="3" unarmeddefense="3" attackmodifier="3" defensemodifier="3" scarepeasants="yes" walk="yes" learn="no" teach="no" absorbpeasants="yes" noheal="yes" undead="yes" equipment="yes" giveperson="yes">
<ai splitsize="10000" killpeasants="yes" moverandom="yes"/>
<skill name="crossbow" modifier="1"/>
<skill name="bow" modifier="1"/>
@ -1017,7 +1016,7 @@
<attack type="3" damage="1d2"/>
<attack type="2" damage="1d30"/>
</race>
<race name="juju" magres="50" maxaura="1" regaura="1" weight="1000" capacity="540" speed="1" hp="80" ac="2" damage="1d7" unarmedattack="6" unarmeddefense="6" attackmodifier="8" defensemodifier="8" scarepeasants="yes" walk="yes" canlearn="no" teach="no" absorbpeasants="yes" noheal="yes" undead="yes" equipment="yes" resistbash="yes" resistcut="yes" resistpierce="yes" giveperson="yes">
<race name="juju" magres="50" maxaura="1.000000" regaura="1.000000" weight="1000" capacity="540" speed="1.000000" hp="80" ac="2" damage="1d7" unarmedattack="6" unarmeddefense="6" attackmodifier="8" defensemodifier="8" scarepeasants="yes" walk="yes" learn="no" teach="no" absorbpeasants="yes" noheal="yes" undead="yes" equipment="yes" resistbash="yes" resistcut="yes" resistpierce="yes" giveperson="yes">
<ai splitsize="2000" killpeasants="yes" moverandom="yes"/>
<skill name="crossbow" modifier="1"/>
<skill name="bow" modifier="1"/>
@ -1032,7 +1031,7 @@
<attack type="3" damage="1d1"/>
<attack type="3" damage="1d1"/>
</race>
<race name="zombie" magres="20" maxaura="1" regaura="1" weight="1000" capacity="540" speed="1" hp="40" ac="1" damage="1d7" unarmedattack="2" unarmeddefense="2" attackmodifier="5" defensemodifier="5" scarepeasants="yes" walk="yes" canlearn="no" teach="no" noheal="yes" undead="yes" equipment="yes" resistcut="yes" resistpierce="yes" giveperson="yes">
<race name="zombie" magres="20" maxaura="1.000000" regaura="1.000000" weight="1000" capacity="540" speed="1.000000" hp="40" ac="1" damage="1d7" unarmedattack="2" unarmeddefense="2" attackmodifier="5" defensemodifier="5" scarepeasants="yes" walk="yes" learn="no" teach="no" noheal="yes" undead="yes" equipment="yes" resistcut="yes" resistpierce="yes" giveperson="yes">
<ai splitsize="10000" killpeasants="yes" moverandom="yes"/>
<skill name="crossbow" modifier="1"/>
<skill name="bow" modifier="1"/>
@ -1045,7 +1044,7 @@
<skill name="unarmed" modifier="1"/>
<attack type="1" damage="1d7"/>
</race>
<race name="skeletonlord" magres="30" maxaura="1" regaura="1" weight="1000" capacity="540" speed="1" hp="60" ac="4" damage="1d7" unarmedattack="6" unarmeddefense="6" attackmodifier="8" defensemodifier="8" scarepeasants="yes" walk="yes" canlearn="no" teach="no" absorbpeasants="yes" noheal="yes" undead="yes" equipment="yes" resistcut="yes" resistpierce="yes" giveperson="yes">
<race name="skeletonlord" magres="30" maxaura="1.000000" regaura="1.000000" weight="1000" capacity="540" speed="1.000000" hp="60" ac="4" damage="1d7" unarmedattack="6" unarmeddefense="6" attackmodifier="8" defensemodifier="8" scarepeasants="yes" walk="yes" learn="no" teach="no" absorbpeasants="yes" noheal="yes" undead="yes" equipment="yes" resistcut="yes" resistpierce="yes" giveperson="yes">
<ai splitsize="2000" killpeasants="yes" moverandom="yes"/>
<skill name="crossbow" modifier="1"/>
<skill name="bow" modifier="1"/>
@ -1059,7 +1058,7 @@
<attack type="1" damage="1d7"/>
<attack type="1" damage="1d7"/>
</race>
<race name="skeleton" magres="10" maxaura="1" regaura="1" weight="500" capacity="540" speed="1" hp="20" ac="1" damage="1d7" unarmedattack="1" unarmeddefense="1" attackmodifier="6" defensemodifier="6" scarepeasants="yes" walk="yes" canlearn="no" teach="no" noheal="yes" undead="yes" equipment="yes" resistcut="yes" resistpierce="yes" giveperson="yes">
<race name="skeleton" magres="10" maxaura="1.000000" regaura="1.000000" weight="500" capacity="540" speed="1.000000" hp="20" ac="1" damage="1d7" unarmedattack="1" unarmeddefense="1" attackmodifier="6" defensemodifier="6" scarepeasants="yes" walk="yes" learn="no" teach="no" noheal="yes" undead="yes" equipment="yes" resistcut="yes" resistpierce="yes" giveperson="yes">
<ai splitsize="10000" killpeasants="yes" moverandom="yes"/>
<skill name="crossbow" modifier="1"/>
<skill name="bow" modifier="1"/>
@ -1072,11 +1071,11 @@
<skill name="unarmed" modifier="1"/>
<attack type="1" damage="1d7"/>
</race>
<race name="shadowknight" maxaura="0" regaura="0" weight="0" capacity="540" speed="1" hp="1" damage="1d1" unarmedattack="0" unarmeddefense="0" attackmodifier="1" defensemodifier="1" scarepeasants="yes" walk="yes" canlearn="no" teach="no" noblock="yes">
<race name="shadowknight" maxaura="0.000000" regaura="0.000000" weight="0" capacity="540" speed="1.000000" hp="1" damage="1d1" unarmedattack="0" unarmeddefense="0" attackmodifier="1" defensemodifier="1" scarepeasants="yes" walk="yes" learn="no" teach="no" noblock="yes">
<ai splitsize="20000" moverandom="yes"/>
<attack type="1" damage="1d1"/>
</race>
<race name="seaserpent" magres="50" maxaura="1" regaura="1" weight="20000" capacity="5000" speed="1" hp="600" ac="3" damage="2d15" unarmedattack="0" unarmeddefense="0" attackmodifier="4" defensemodifier="4" scarepeasants="yes" swim="yes" teach="no" getitem="yes" resistbash="yes" unarmedguard="yes">
<race name="seaserpent" magres="50" maxaura="1.000000" regaura="1.000000" weight="20000" capacity="5000" speed="1.000000" hp="600" ac="3" damage="2d15" unarmedattack="0" unarmeddefense="0" attackmodifier="4" defensemodifier="4" scarepeasants="yes" swim="yes" teach="no" getitem="yes" resistbash="yes" unarmedguard="yes">
<ai splitsize="6" killpeasants="yes" moverandom="yes" learn="yes" moveattack="yes"/>
<skill name="tactics" modifier="4"/>
<attack type="4" damage="1d30"/>
@ -1203,7 +1202,7 @@
<familiar race="wolf"/>
<familiar race="demon"/>
</race>
<race name="shadowdragon" magres="95" maxaura="1" regaura="3" weight="100" capacity="100000" speed="1" hp="2700" ac="10" damage="2d60" unarmedattack="0" unarmeddefense="0" attackmodifier="10" defensemodifier="12" scarepeasants="yes" fly="yes" walk="yes" teach="no" getitem="yes" resistbash="yes">
<race name="shadowdragon" magres="95" maxaura="1.000000" regaura="3.000000" weight="100" capacity="100000" speed="1.000000" hp="2700" ac="10" damage="2d60" unarmedattack="0" unarmeddefense="0" attackmodifier="10" defensemodifier="12" scarepeasants="yes" fly="yes" walk="yes" teach="no" getitem="yes" resistbash="yes">
<ai splitsize="1" killpeasants="yes" learn="yes"/>
<skill name="tactics" modifier="20"/>
<skill name="perception" modifier="20"/>

View File

@ -6,7 +6,6 @@ attackmodifier="7" defensemodifier="7" scarepeasants="yes" fly="yes"
income="1000" walk="yes" teach="no" getitem="yes" resistbash="yes"
dragon="yes">
<ai splitsize="2" killpeasants="yes" learn="yes" scare="400"/>
<function name="name" value="namedragon"/>
<skill name="magic" modifier="8"/>
<skill name="tactics" modifier="8"/>
<attack type="4" damage="2d20"/>

View File

@ -7,7 +7,7 @@ speed="1.0" hp="16" damage="1d5" unarmedattack="-2" unarmeddefense="0"
playerrace="yes" walk="yes" giveperson="yes" giveunit="yes"
getitem="yes" equipment="yes" healing="2.0">
<ai splitsize="10000" moverandom="yes" learn="yes"/>
<param name="hunger.damage" value="1d8+7"/>
<param name="hunger_damage" value="1d8+7"/>
<param name="other_race" value="demon"/>
<param name="recruit_multi" value="0.5"/>
<skill name="cartmaking" modifier="-1"/>

View File

@ -1,7 +1,7 @@
<?xml version="1.0" ?>
<race name="halfling" magres="5" maxaura="1.000000" regaura="1.000000" recruitcost="80" maintenance="10" weight="1000" capacity="540" speed="1.000000" hp="18" damage="1d5" unarmedattack="-2" unarmeddefense="-2" playerrace="yes" walk="yes" giveperson="yes" giveunit="yes" getitem="yes" equipment="yes">
<ai splitsize="10000" moverandom="yes" learn="yes"/>
<param name="hunger.damage" value="1d14+14"/>
<param name="hunger_damage" value="1d14+14"/>
<skill name="crossbow" modifier="1"/>
<skill name="mining" modifier="1"/>
<skill name="bow" modifier="-1"/>

View File

@ -7,7 +7,6 @@ damage="2d60" unarmedattack="0" unarmeddefense="0" attackmodifier="10"
defensemodifier="10" scarepeasants="yes" fly="yes" walk="yes"
teach="no" getitem="yes" resistbash="yes" dragon="yes" income="5000">
<ai splitsize="1" killpeasants="yes" learn="yes" scare="1000"/>
<function name="name" value="namedragon"/>
<skill name="magic" modifier="12"/>
<skill name="tactics" modifier="12"/>
<attack type="4" damage="3d20"/>

View File

@ -6,7 +6,6 @@ damage="2d15" unarmedattack="0" unarmeddefense="0" attackmodifier="4"
defensemodifier="4" scarepeasants="yes" fly="yes" walk="yes"
teach="no" getitem="yes" resistbash="yes" dragon="yes" income="150">
<ai splitsize="6" killpeasants="yes" learn="yes" scare="160"/>
<function name="name" value="namedragon"/>
<skill name="magic" modifier="4"/>
<skill name="tactics" modifier="4"/>
<attack type="4" damage="1d30"/>

View File

@ -1,3 +1,16 @@
msgid ""
msgstr ""
"Project-Id-Version: \n"
"POT-Creation-Date: \n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: de\n"
"X-Generator: Poedit 2.0.7\n"
msgid "homestone_effect"
msgstr "\"Mit einem Ritual bindet $unit($mage) die magischen Kräfte der Erde in die Mauern von $building($building).\""

View File

@ -1,3 +1,16 @@
msgid ""
msgstr ""
"Project-Id-Version: \n"
"POT-Creation-Date: \n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: en\n"
"X-Generator: Poedit 2.0.7\n"
msgid "homestone_effect"
msgstr "\"A magic ritual by $unit($mage) binds magic energies to the walls of $building($building).\""

View File

@ -1,3 +1,16 @@
msgid ""
msgstr ""
"Project-Id-Version: \n"
"POT-Creation-Date: \n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: de\n"
"X-Generator: Poedit 2.0.7\n"
msgid "catamaran_a"
msgstr "ein Katamaran"

View File

@ -1,3 +1,16 @@
msgid ""
msgstr ""
"Project-Id-Version: \n"
"POT-Creation-Date: \n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: en\n"
"X-Generator: Poedit 2.0.7\n"
msgid "catamaran_a"
msgstr "a catamaran"

View File

@ -1,3 +1,16 @@
msgid ""
msgstr ""
"Project-Id-Version: \n"
"POT-Creation-Date: \n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: de\n"
"X-Generator: Poedit 2.0.7\n"
msgid "rustychainmail"
msgstr "Rostiges Kettenhemd"

View File

@ -1,3 +1,16 @@
msgid ""
msgstr ""
"Project-Id-Version: \n"
"POT-Creation-Date: \n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: \n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"Language: en\n"
"X-Generator: Poedit 2.0.7\n"
msgid "rustychainmail"
msgstr "rustychainmail"

View File

@ -154,7 +154,7 @@ end
function test_pure()
local r = region.create(0, 0, "plain")
assert_not_equal(nil, r)
assert_not_nil(r)
assert_equal(r, get_region(0, 0))
end
@ -169,21 +169,21 @@ function test_read_write()
assert_equal(r.terrain, "plain")
result = eressea.write_game("test.dat")
assert_equal(result, 0)
assert_not_equal(get_region(0, 0), nil)
assert_not_equal(get_faction(fno), nil)
assert_not_equal(get_unit(uno), nil)
assert_not_nil(get_region(0, 0))
assert_not_nil(get_faction(fno))
assert_not_nil(get_unit(uno))
r = nil
f = nil
u = nil
eressea.free_game()
assert_equal(get_region(0, 0), nil)
assert_equal(nil, get_faction(fno))
assert_equal(nil, get_unit(uno))
assert_nil(get_region(0, 0))
assert_nil(get_faction(fno))
assert_nil(get_unit(uno))
result = eressea.read_game("test.dat")
assert_equal(0, result)
assert_not_equal(nil, get_region(0, 0))
assert_not_equal(nil, get_faction(fno))
assert_not_equal(nil, get_unit(uno))
assert_not_nil(get_region(0, 0))
assert_not_nil(get_faction(fno))
assert_not_nil(get_unit(uno))
end
function test_descriptions()
@ -237,7 +237,7 @@ function test_gmtool()
selections=selections+1
end
assert_equal(2, selections)
assert_equal(nil, gmtool.get_cursor())
assert_nil(gmtool.get_cursor())
gmtool.close()
end
@ -567,7 +567,7 @@ function test_coordinate_translation()
local pe = plane.create(1, -8761, 3620, 23, 23) -- eternath
local r = region.create(1000, 1000, "plain")
local f = create_faction('human')
assert_not_equal(nil, r)
assert_not_nil(r)
assert_equal(r.x, 1000)
assert_equal(r.y, 1000)
local nx, ny = plane.normalize(pl, r.x, r.y)
@ -633,8 +633,8 @@ end
-- segfault above
function test_config()
assert_not_equal(nil, config.basepath)
assert_not_equal(nil, config.locales)
assert_not_nil(config.basepath)
assert_not_nil(config.locales)
end
local function _test_create_laen()
@ -826,9 +826,9 @@ function test_swim_and_die()
process_orders()
r.terrain = "ocean"
u = get_unit(uid)
assert_not_equal(get_unit(uid), nil)
assert_not_nil(get_unit(uid))
process_orders()
assert_equal(get_unit(uid), nil)
assert_nil(get_unit(uid))
end
function test_ride_with_horse()

View File

@ -13,6 +13,7 @@ function setup()
end
function test_water_of_life()
eressea.settings.set("rules.grow.formula", 0) -- no tree growth
local r = region.create(0, 0, "plain")
r:set_flag(1, false) -- no mallorn
local f = faction.create("human")

View File

@ -101,14 +101,14 @@ function test_build_boat_low_skill()
u:add_item("log", 10)
u:add_order("MACHE BOOT")
process_orders()
assert_not_equal(nil, u.ship)
assert_not_nil(u.ship)
assert_equal(4, u.ship.size)
assert_equal(6, u:get_item('log'))
end
function test_build_boat_high_skill()
local r = region.create(0, 0, "plain")
local f = faction.create("human", "build@example.com")
local f = faction.create("human", "skillz@example.com")
local u = unit.create(f, r, 1)
u:set_skill("shipcraft", 5) -- humans get +1
u:add_item("log", 10)

View File

@ -6,7 +6,7 @@ function setup()
eressea.free_game()
conf = [[{
"races": {
"human" : {}
"human" : { "flags" : [ "player" ] }
},
"terrains" : {
"plain": { "flags" : [ "land", "walk", "sail" ] }
@ -61,7 +61,7 @@ end
function test_make_temp()
local r = region.create(0, 0, "plain")
local f1 = faction.create("human", "owner@eressea.de", "de")
local f1 = faction.create("human", "temp@eressea.de", "de")
local u1 = unit.create(f1, r, 10)
local u, u2

View File

@ -111,6 +111,7 @@ set (ERESSEA_SRC
report.c
steal.c
economy.c
exparse.c
give.c
items.c
laws.c
@ -127,7 +128,6 @@ set (ERESSEA_SRC
travelthru.c
monsters.c
wormhole.c
xmlreader.c
${SPELLS_SRC}
${RACES_SRC}
${ITEMS_SRC}
@ -182,15 +182,6 @@ target_link_libraries(eressea
${INIPARSER_LIBRARIES}
)
add_executable(convert convert.c)
target_link_libraries(convert
game
${LUA_MATH_LIBRARY}
${STORAGE_LIBRARIES}
${CLIBS_LIBRARIES}
${INIPARSER_LIBRARIES}
)
set(TESTS_SRC
test_eressea.c
tests.c
@ -230,7 +221,6 @@ set(TESTS_SRC
volcano.test.c
vortex.test.c
wormhole.test.c
# xmlreader.test.c
spells/flyingship.test.c
spells/magicresistance.test.c
triggers/shock.test.c
@ -280,18 +270,15 @@ endif(HAVE_STRDUP)
if (HAVE_LIBBSD)
target_link_libraries(test_eressea bsd)
target_link_libraries(eressea bsd)
target_link_libraries(convert bsd)
endif (HAVE_LIBBSD)
if (SQLITE3_FOUND)
include_directories (${SQLITE3_INCLUDE_DIR})
target_link_libraries(eressea ${SQLITE3_LIBRARIES})
target_link_libraries(convert ${SQLITE3_LIBRARIES})
target_link_libraries(test_eressea ${SQLITE3_LIBRARIES})
add_definitions(-DUSE_SQLITE)
elseif (DB_FOUND)
include_directories (${DB_INCLUDE_DIR})
target_link_libraries(convert ${DB_LIBRARIES})
target_link_libraries(eressea ${DB_LIBRARIES})
target_link_libraries(test_eressea ${DB_LIBRARIES})
add_definitions(-DUSE_DB)
@ -309,9 +296,8 @@ target_link_libraries(eressea ${CURSES_LIBRARIES})
add_definitions(-DUSE_CURSES)
endif(CURSES_FOUND)
if (LIBXML2_FOUND)
include_directories (${LIBXML2_INCLUDE_DIR})
target_link_libraries(eressea ${LIBXML2_LIBRARIES})
target_link_libraries(convert ${LIBXML2_LIBRARIES})
target_link_libraries(test_eressea ${LIBXML2_LIBRARIES})
endif (LIBXML2_FOUND)
if (EXPAT_FOUND)
include_directories (${EXPAT_INCLUDE_DIRS})
target_link_libraries(eressea ${EXPAT_LIBRARIES})
target_link_libraries(test_eressea ${EXPAT_LIBRARIES})
endif (EXPAT_FOUND)

View File

@ -59,7 +59,6 @@
#include <util/nrmessage.h>
#include <util/rand.h>
#include <util/rng.h>
#include <util/xml.h>
#include <selist.h>
#include <storage.h>
@ -833,33 +832,12 @@ static int tolua_get_spells(lua_State * L)
return tolua_selist_push(L, "spell_list", "spell", spells);
}
static int init_data(const char *filename)
{
int l;
l = read_xml(filename);
reset_locales();
if (l) {
return l;
}
if (turn <= 0) {
turn = first_turn();
}
return 0;
}
static int tolua_equip_newunits(lua_State * L) {
unit *u = (unit *)tolua_tousertype(L, 1, 0);
equip_newunits(u);
return 0;
}
static int tolua_read_xml(lua_State * L)
{
const char *filename = tolua_tostring(L, 1, "config.xml");
lua_pushinteger(L, init_data(filename));
return 1;
}
static int tolua_report_unit(lua_State * L)
{
char buffer[512];
@ -1029,7 +1007,6 @@ int tolua_bindings_open(lua_State * L, const dictionary *inifile)
tolua_function(L, TOLUA_CAST "set_key", tolua_setkey);
tolua_function(L, TOLUA_CAST "translate", &tolua_translate);
tolua_function(L, TOLUA_CAST "spells", tolua_get_spells);
tolua_function(L, TOLUA_CAST "read_xml", tolua_read_xml);
tolua_function(L, TOLUA_CAST "equip_newunits", tolua_equip_newunits);
} tolua_endmodule(L);
return 1;

View File

@ -1,37 +0,0 @@
#include <platform.h>
#include "xmlreader.h"
#include <util/xml.h>
#include <kernel/race.h>
#include <kernel/rules.h>
#include <races/races.h>
#include <storage.h>
#include <string.h>
static int usage(void) {
return -1;
}
int main(int argc, char **argv) {
const char *mode;
register_races();
register_xmlreader();
if (argc < 2) return usage();
mode = argv[1];
if (strcmp(mode, "rules")==0) {
const char *xmlfile;
if (argc < 4) return usage();
xmlfile = argv[2];
read_xml(xmlfile);
write_rules("rules.dat");
return 0;
}
if (strcmp(mode, "po")==0) {
return 0;
}
return usage();
}

View File

@ -519,7 +519,7 @@ static void report_crtypes(FILE * F, const struct locale *lang)
fputc('\"', F);
fputs(str_escape(nrt_string(kmt->mtype, lang), buffer, sizeof(buffer)), F);
fputs("\";text\n", F);
fprintf(F, "\"%s\";section\n", nrt_section(kmt->mtype));
fprintf(F, "\"%s\";section\n", kmt->mtype->section);
}
while (mtypehash[i]) {
kmt = mtypehash[i];

View File

@ -13,7 +13,7 @@ static void test_add_donation(CuTest *tc) {
region *r;
test_setup();
mt_register(mt_new_va("donation", "from:faction", "to:faction", "amount:int", MT_NEW_END));
mt_create_va(mt_new("donation", NULL), "from:faction", "to:faction", "amount:int", MT_NEW_END);
r = test_create_region(0, 0, NULL);
f1 = test_create_faction(NULL);
f2 = test_create_faction(NULL);

View File

@ -143,10 +143,10 @@ static struct unit *create_recruiter(void) {
static void setup_production(void) {
init_resources();
mt_register(mt_new_va("produce", "unit:unit", "region:region", "amount:int", "wanted:int", "resource:resource", MT_NEW_END));
mt_register(mt_new_va("income", "unit:unit", "region:region", "amount:int", "wanted:int", "mode:int", MT_NEW_END));
mt_register(mt_new_va("buy", "unit:unit", "money:int", MT_NEW_END));
mt_register(mt_new_va("buyamount", "unit:unit", "amount:int", "resource:resource", MT_NEW_END));
mt_create_va(mt_new("produce", NULL), "unit:unit", "region:region", "amount:int", "wanted:int", "resource:resource", MT_NEW_END);
mt_create_va(mt_new("income", NULL), "unit:unit", "region:region", "amount:int", "wanted:int", "mode:int", MT_NEW_END);
mt_create_va(mt_new("buy", NULL), "unit:unit", "money:int", MT_NEW_END);
mt_create_va(mt_new("buyamount", NULL), "unit:unit", "amount:int", "resource:resource", MT_NEW_END);
}
static void test_heroes_dont_recruit(CuTest * tc) {
@ -378,11 +378,11 @@ static void test_tax_cmd(CuTest *tc) {
}
static void setup_economy(void) {
mt_register(mt_new_va("recruit", "unit:unit", "region:region", "amount:int", "want:int", MT_NEW_END));
mt_register(mt_new_va("maintenance", "unit:unit", "building:building", MT_NEW_END));
mt_register(mt_new_va("maintenancefail", "unit:unit", "building:building", MT_NEW_END));
mt_register(mt_new_va("maintenance_nowork", "building:building", MT_NEW_END));
mt_register(mt_new_va("maintenance_noowner", "building:building", MT_NEW_END));
mt_create_va(mt_new("recruit", NULL), "unit:unit", "region:region", "amount:int", "want:int", MT_NEW_END);
mt_create_va(mt_new("maintenance", NULL), "unit:unit", "building:building", MT_NEW_END);
mt_create_va(mt_new("maintenancefail", NULL), "unit:unit", "building:building", MT_NEW_END);
mt_create_va(mt_new("maintenance_nowork", NULL), "building:building", MT_NEW_END);
mt_create_va(mt_new("maintenance_noowner", NULL), "building:building", MT_NEW_END);
}
/**

View File

@ -33,7 +33,6 @@
#include "spells.h"
#include "vortex.h"
#include "wormhole.h"
#include "xmlreader.h"
#include <errno.h>
#include <stdlib.h>
@ -54,9 +53,9 @@ void game_done(void)
free_config();
free_special_directions();
free_locales();
#endif
kernel_done();
dblib_close();
#endif
}
void game_init(void)
@ -80,7 +79,6 @@ void game_init(void)
register_weapons();
register_xerewards();
register_xmlreader();
register_attributes();
register_gmcmd();

1552
src/exparse.c Normal file

File diff suppressed because it is too large Load Diff

3
src/exparse.h Normal file
View File

@ -0,0 +1,3 @@
#pragma once
int exparse_readfile(const char * filename);

View File

@ -54,24 +54,24 @@ static void setup_give(struct give *env) {
}
/* success messages: */
mt_register(mt_new_va("receive_person", "unit:unit", "target:unit", "amount:int", MT_NEW_END));
mt_register(mt_new_va("give_person", "unit:unit", "target:unit", "amount:int", MT_NEW_END));
mt_register(mt_new_va("give_person_peasants", "unit:unit", "amount:int", MT_NEW_END));
mt_register(mt_new_va("give_person_ocean", "unit:unit", "amount:int", MT_NEW_END));
mt_register(mt_new_va("receive", "unit:unit", "target:unit", "resource:resource", "amount:int", MT_NEW_END));
mt_register(mt_new_va("give", "unit:unit", "target:unit", "resource:resource", "amount:int", MT_NEW_END));
mt_register(mt_new_va("give_peasants", "unit:unit", "resource:resource", "amount:int", MT_NEW_END));
mt_create_va(mt_new("receive_person", NULL), "unit:unit", "target:unit", "amount:int", MT_NEW_END);
mt_create_va(mt_new("give_person", NULL), "unit:unit", "target:unit", "amount:int", MT_NEW_END);
mt_create_va(mt_new("give_person_peasants", NULL), "unit:unit", "amount:int", MT_NEW_END);
mt_create_va(mt_new("give_person_ocean", NULL), "unit:unit", "amount:int", MT_NEW_END);
mt_create_va(mt_new("receive", NULL), "unit:unit", "target:unit", "resource:resource", "amount:int", MT_NEW_END);
mt_create_va(mt_new("give", NULL), "unit:unit", "target:unit", "resource:resource", "amount:int", MT_NEW_END);
mt_create_va(mt_new("give_peasants", NULL), "unit:unit", "resource:resource", "amount:int", MT_NEW_END);
/* error messages: */
mt_register(mt_new_va("too_many_units_in_faction", "unit:unit", "region:region", "command:order", "allowed:int", MT_NEW_END));
mt_register(mt_new_va("too_many_units_in_alliance", "unit:unit", "region:region", "command:order", "allowed:int", MT_NEW_END));
mt_register(mt_new_va("feedback_no_contact", "unit:unit", "region:region", "command:order", "target:unit", MT_NEW_END));
mt_register(mt_new_va("feedback_give_forbidden", "unit:unit", "region:region", "command:order", MT_NEW_END));
mt_register(mt_new_va("peasants_give_invalid", "unit:unit", "region:region", "command:order", MT_NEW_END));
mt_register(mt_new_va("giverestriction", "unit:unit", "region:region", "command:order", "turns:int", MT_NEW_END));
mt_register(mt_new_va("error_unit_size", "unit:unit", "region:region", "command:order", "maxsize:int", MT_NEW_END));
mt_register(mt_new_va("nogive_reserved", "unit:unit", "region:region", "command:order", "resource:resource", "reservation:int", MT_NEW_END));
mt_register(mt_new_va("race_notake", "unit:unit", "region:region", "command:order", "race:race", MT_NEW_END));
mt_register(mt_new_va("race_noregroup", "unit:unit", "region:region", "command:order", "race:race", MT_NEW_END));
mt_create_va(mt_new("too_many_units_in_faction", NULL), "unit:unit", "region:region", "command:order", "allowed:int", MT_NEW_END);
mt_create_va(mt_new("too_many_units_in_alliance", NULL), "unit:unit", "region:region", "command:order", "allowed:int", MT_NEW_END);
mt_create_va(mt_new("feedback_no_contact", NULL), "unit:unit", "region:region", "command:order", "target:unit", MT_NEW_END);
mt_create_va(mt_new("feedback_give_forbidden", NULL), "unit:unit", "region:region", "command:order", MT_NEW_END);
mt_create_va(mt_new("peasants_give_invalid", NULL), "unit:unit", "region:region", "command:order", MT_NEW_END);
mt_create_va(mt_new("giverestriction", NULL), "unit:unit", "region:region", "command:order", "turns:int", MT_NEW_END);
mt_create_va(mt_new("error_unit_size", NULL), "unit:unit", "region:region", "command:order", "maxsize:int", MT_NEW_END);
mt_create_va(mt_new("nogive_reserved", NULL), "unit:unit", "region:region", "command:order", "resource:resource", "reservation:int", MT_NEW_END);
mt_create_va(mt_new("race_notake", NULL), "unit:unit", "region:region", "command:order", "race:race", MT_NEW_END);
mt_create_va(mt_new("race_noregroup", NULL), "unit:unit", "region:region", "command:order", "race:race", MT_NEW_END);
}
static void test_give_unit(CuTest * tc) {

View File

@ -55,7 +55,6 @@
#include "listbox.h"
#include "wormhole.h"
#include "teleport.h"
#include "xmlreader.h"
#include <storage.h>
#include <lua.h>

View File

@ -39,7 +39,6 @@ without prior permission by the authors of Eressea.
#include "util/path.h"
#include "util/pofile.h"
#include "util/strings.h"
#include "util/xml.h"
/* game modules */
#include "direction.h"
@ -47,6 +46,7 @@ without prior permission by the authors of Eressea.
#include "move.h"
#include "prefix.h"
#include "skill.h"
#include "exparse.h"
/* external libraries */
#include <cJSON.h>
@ -478,17 +478,16 @@ static void json_ship(cJSON *json, ship_type *st) {
static void json_race(cJSON *json, race *rc) {
cJSON *child;
const char *flags[] = {
"npc", "killpeasants", "scarepeasants",
"player", "killpeasants", "scarepeasants",
"nosteal", "moverandom", "cannotmove",
"learn", "fly", "swim", "walk", "nolearn",
"noteach", "horse", "desert",
"illusionary", "absorbpeasants", "noheal",
"noweapons", "shapeshift", "", "undead", "dragon",
"coastal", "", "cansail", 0
"coastal", "", "cansail", NULL
};
const char *ecflags[] = {
"", "keepitem", "giveperson",
"giveunit", "getitem", 0
"giveperson", "giveunit", "getitem", NULL
};
if (json->type != cJSON_Object) {
log_error("race %s is not a json object: %d", json->string, json->type);
@ -1014,8 +1013,9 @@ static int include_json(const char *uri) {
static int include_xml(const char *uri) {
char name[PATH_MAX];
const char *filename = uri_to_file(uri, name, sizeof(name));
int err = read_xml(filename);
if (err < 0) {
int err;
err = exparse_readfile(filename);
if (err != 0) {
log_error("could not parse XML from %s", uri);
}
return err;
@ -1048,7 +1048,7 @@ static int include_po(const char *uri) {
if (lang) {
int err = pofile_read(filename, add_po_string, lang);
if (err < 0) {
log_error("could not parse XML from %s", uri);
log_error("could not parse translations from %s", uri);
}
return err;
}

View File

@ -56,7 +56,7 @@ static void check_flag(CuTest *tc, const char *name, int flag) {
static void test_flags(CuTest *tc) {
test_setup();
check_flag(tc, "npc", RCF_NPC);
check_flag(tc, "player", RCF_PLAYABLE);
check_flag(tc, "scarepeasants", RCF_SCAREPEASANTS);
check_flag(tc, "nosteal", RCF_NOSTEAL);
check_flag(tc, "noheal", RCF_NOHEAL);
@ -181,7 +181,7 @@ static void test_races(CuTest * tc)
"\"income\" : 30,"
"\"hp\" : 5,"
"\"ac\" : 6,"
"\"flags\" : [ \"npc\", \"walk\", \"undead\" ]"
"\"flags\" : [ \"player\", \"walk\", \"undead\" ]"
"}}}";
cJSON *json = cJSON_Parse(data);
const struct race *rc;
@ -195,7 +195,7 @@ static void test_races(CuTest * tc)
CuAssertPtrNotNull(tc, races);
rc = rc_find("orc");
CuAssertPtrNotNull(tc, rc);
CuAssertIntEquals(tc, RCF_NPC | RCF_WALK | RCF_UNDEAD, rc->flags);
CuAssertIntEquals(tc, RCF_PLAYABLE | RCF_WALK | RCF_UNDEAD, rc->flags);
CuAssertStrEquals(tc, "1d4", rc->def_damage);
CuAssertTrue(tc, frac_equal(frac_one, rc->magres));
CuAssertIntEquals(tc, 200, rc->maxaura);

View File

@ -69,7 +69,6 @@ pool.c
race.c
region.c
resources.c
rules.c
save.c
ship.c
skills.c

View File

@ -60,7 +60,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <util/log.h>
#include <util/parser.h>
#include <util/resolve.h>
#include <util/xml.h>
/* from libc */
#include <assert.h>

View File

@ -253,7 +253,7 @@ static void test_build_destroy_road(CuTest *tc)
message *m;
test_setup();
mt_register(mt_new_va("destroy_road", "unit:unit", "from:region", "to:region", MT_NEW_END));
mt_create_va(mt_new("destroy_road", NULL), "unit:unit", "from:region", "to:region", MT_NEW_END);
r2 = test_create_region(1, 0, 0);
r = test_create_region(0, 0, NULL);
rsetroad(r, D_EAST, 100);

View File

@ -144,6 +144,7 @@ building_type *bt_get_or_create(const char *name)
if (btype == NULL) {
btype = calloc(sizeof(building_type), 1);
btype->_name = str_strdup(name);
btype->flags = BTF_DEFAULT;
btype->auraregen = 1.0;
btype->maxsize = -1;
btype->capacity = 1;

View File

@ -48,11 +48,13 @@ extern "C" {
#define BTF_NOBUILD 0x02 /* special, can't be built */
#define BTF_UNIQUE 0x04 /* only one per struct region (harbour) */
#define BTF_DECAY 0x08 /* decays when not occupied */
#define BTF_DYNAMIC 0x10 /* dynamic type, needs bt_write */
#define BTF_MAGIC 0x40 /* magical effect */
#define BTF_MAGIC 0x10 /* magical effect */
#define BTF_NAMECHANGE 0x20 /* name and description can be changed more than once */
#define BTF_FORTIFICATION 0x40 /* building_protection, safe from monsters */
#define BTF_ONEPERTURN 0x80 /* one one sizepoint can be added per turn */
#define BTF_NAMECHANGE 0x100 /* name and description can be changed more than once */
#define BTF_FORTIFICATION 0x200 /* building_protection, safe from monsters */
#define BTF_DYNAMIC 0x100 /* dynamic type, needs bt_write */
#define BTF_DEFAULT (BTF_NAMECHANGE)
typedef struct building_stage {
/* construction of this building stage: */

View File

@ -305,7 +305,7 @@ static void test_btype_defaults(CuTest *tc) {
CuAssertIntEquals(tc, 0, btype->magres.sa[0]);
CuAssertIntEquals(tc, 0, btype->magresbonus);
CuAssertIntEquals(tc, 0, btype->fumblebonus);
CuAssertIntEquals(tc, 0, btype->flags);
CuAssertIntEquals(tc, BTF_DEFAULT, btype->flags);
test_teardown();
}

View File

@ -66,16 +66,11 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <util/strings.h>
#include <util/translation.h>
#include <util/umlaut.h>
#include <util/xml.h>
#include "donations.h"
#include "guard.h"
#include "prefix.h"
/* libxml includes */
#include <libxml/tree.h>
#include <libxml/xpath.h>
/* external libraries */
#include <iniparser.h>
#include <critbit.h>
@ -559,7 +554,6 @@ void kernel_done(void)
/* calling this function releases memory assigned to static variables, etc.
* calling it is optional, e.g. a release server will most likely not do it.
*/
xml_done();
attrib_done();
item_done();
message_done();
@ -567,6 +561,7 @@ void kernel_done(void)
curses_done();
crmessage_done();
translation_done();
mt_clear();
}
bool rule_stealth_other(void)

View File

@ -243,17 +243,16 @@ item_type *it_find(const char *zname)
}
item_type *it_get_or_create(resource_type *rtype) {
item_type * itype;
assert(rtype);
itype = it_find(rtype->_name);
if (!itype) {
if (!rtype->itype) {
item_type * itype;
itype = (item_type *)calloc(sizeof(item_type), 1);
itype->rtype = rtype;
rtype->uchange = res_changeitem;
rtype->itype = itype;
rtype->flags |= RTF_ITEM;
}
itype->rtype = rtype;
rtype->uchange = res_changeitem;
rtype->itype = itype;
rtype->flags |= RTF_ITEM;
return itype;
return rtype->itype;
}
static void lt_register(luxury_type * ltype)
@ -291,7 +290,7 @@ weapon_type *new_weapontype(item_type * itype,
wtype->damage[1] = str_strdup(damage[1]);
}
wtype->defmod = defmod;
wtype->flags |= wflags;
wtype->flags = wflags;
wtype->itype = itype;
wtype->magres = magres;
wtype->offmod = offmod;
@ -892,7 +891,11 @@ static void free_itype(item_type *itype) {
free(itype);
}
static void free_wtype(weapon_type *wtype) {
void free_atype(armor_type *atype) {
free(atype);
}
void free_wtype(weapon_type *wtype) {
assert(wtype);
free(wtype->damage[0]);
free(wtype->damage[1]);
@ -907,7 +910,9 @@ void free_rtype(resource_type *rtype) {
if (rtype->itype) {
free_itype(rtype->itype);
}
free(rtype->atype);
if (rtype->atype) {
free_atype(rtype->atype);
}
free(rtype->modifiers);
free(rtype->raw);
free(rtype->_name);

View File

@ -40,6 +40,7 @@ extern "C" {
struct gamedata;
struct rawmaterial_type;
struct resource_mod;
struct weapon_type;
typedef struct item {
struct item *next;
@ -66,9 +67,12 @@ extern "C" {
void item_done(void);
typedef bool(*wtype_attack)(const struct troop *,
const struct weapon_type *, int *);
typedef int(*rtype_uchange) (struct unit * user,
const struct resource_type * rtype, int delta);
typedef char *(*rtype_name) (const struct resource_type * rtype, int flags);
typedef struct resource_type {
/* --- constants --- */
char *_name; /* wie es hei<65>t */
@ -159,9 +163,9 @@ extern "C" {
const item_type *itype;
unsigned int flags;
double penalty;
double projectile; /* chance, dass ein projektil abprallt */
variant magres;
int prot;
float projectile; /* chance, dass ein projektil abprallt */
} armor_type;
#define WTF_NONE 0x00
@ -224,9 +228,10 @@ extern "C" {
weapon_type *new_weapontype(item_type * itype, int wflags,
variant magres, const char *damage[], int offmod, int defmod, int reload,
skill_t sk);
void free_wtype(struct weapon_type *wtype);
armor_type *new_armortype(item_type * itype, double penalty,
variant magres, int prot, unsigned int flags);
void free_atype(struct armor_type *wtype);
/* these constants are used with get_resourcetype.
* The order of the enum is not important for stored data.
* The resourcenames array must be updated to match.

View File

@ -82,8 +82,8 @@ struct message *msg_feedback(const struct unit *u, struct order *ord,
if (!mtype) {
log_warning("trying to create message of unknown type \"%s\"\n", name);
if (!mt_find("missing_feedback")) {
mt_register(mt_new_va("missing_feedback", "unit:unit",
"region:region", "command:order", "name:string", MT_NEW_END));
mt_create_va(mt_new("missing_feedback", NULL), "unit:unit",
"region:region", "command:order", "name:string", MT_NEW_END);
}
return msg_message("missing_feedback", "name unit region command",
name, u, u->region, ord);
@ -153,7 +153,7 @@ static message *missing_message(const char *name) {
log_warning("trying to create undefined message of type \"%s\"\n", name);
if (strcmp(name, "missing_message") != 0) {
if (!mt_find("missing_message")) {
mt_register(mt_new_va("missing_message", "name:string", MT_NEW_END));
mt_create_va(mt_new("missing_message", NULL), "name:string", MT_NEW_END);
}
return msg_message("missing_message", "name", name);
}

View File

@ -22,10 +22,10 @@ void test_missing_message(CuTest *tc) {
void test_message(CuTest *tc) {
message *msg;
message_type *mtype = mt_new("custom", NULL);
message_type *mtype;
test_setup();
mt_register(mtype);
mtype = mt_create(mt_new("custom", NULL), NULL, 0);
CuAssertPtrEquals(tc, mtype, (void *)mt_find("custom"));
CuAssertIntEquals(tc, 0, mtype->nparameters);
CuAssertPtrEquals(tc, NULL, (void *)mtype->pnames);
@ -47,11 +47,11 @@ void test_message(CuTest *tc) {
static void test_merge_split(CuTest *tc) {
message_list *mlist = 0, *append = 0;
struct mlist **split; /* TODO: why is this a double asterisk? */
message_type *mtype = mt_new("custom", NULL);
message_type *mtype;
message *msg;
test_setup();
mt_register(mtype);
mtype = mt_create(mt_new("custom", NULL), NULL, 0);
add_message(&mlist, msg = msg_message(mtype->name, ""));
msg_release(msg);
add_message(&append, msg = msg_message(mtype->name, ""));

View File

@ -95,12 +95,12 @@ static void free_nodes(node * root)
}
}
struct selist *regions_in_range(struct region *start, int maxdist,
struct selist *regions_in_range(struct region *handle_start, int maxdist,
bool(*allowed) (const struct region *, const struct region *))
{
selist * rlist = NULL;
node *root = new_node(start, 0, NULL);
node **end = &root->next;
node *root = new_node(handle_start, 0, NULL);
node **handle_end = &root->next;
node *n = root;
while (n != NULL) {
@ -125,8 +125,8 @@ struct selist *regions_in_range(struct region *start, int maxdist,
/* make sure we don't go here again, and put the region into the set for
further BFS'ing */
fset(rn, RF_MARK);
*end = new_node(rn, depth, n);
end = &(*end)->next;
*handle_end = new_node(rn, depth, n);
handle_end = &(*handle_end)->next;
}
n = n->next;
}
@ -135,17 +135,17 @@ struct selist *regions_in_range(struct region *start, int maxdist,
return rlist;
}
static region **internal_path_find(region * start, const region * target,
static region **internal_path_find(region * handle_start, const region * target,
int maxlen, bool(*allowed) (const region *, const region *))
{
static region *path[MAXDEPTH + 2]; /* STATIC_RETURN: used for return, not across calls */
direction_t d;
node *root = new_node(start, 0, NULL);
node **end = &root->next;
node *root = new_node(handle_start, 0, NULL);
node **handle_end = &root->next;
node *n = root;
bool found = false;
assert(maxlen <= MAXDEPTH);
fset(start, RF_MARK);
fset(handle_start, RF_MARK);
while (n != NULL) {
region *r = n->r;
@ -173,8 +173,8 @@ static region **internal_path_find(region * start, const region * target,
}
else {
fset(rn, RF_MARK);
*end = new_node(rn, depth, n);
end = &(*end)->next;
*handle_end = new_node(rn, depth, n);
handle_end = &(*handle_end)->next;
}
}
if (found)
@ -188,22 +188,22 @@ static region **internal_path_find(region * start, const region * target,
}
bool
path_exists(region * start, const region * target, int maxlen,
path_exists(region * handle_start, const region * target, int maxlen,
bool(*allowed) (const region *, const region *))
{
assert((!fval(start, RF_MARK) && !fval(target, RF_MARK))
assert((!fval(handle_start, RF_MARK) && !fval(target, RF_MARK))
|| !"Some Algorithm did not clear its RF_MARKs!");
if (start == target)
if (handle_start == target)
return true;
if (internal_path_find(start, target, maxlen, allowed) != NULL)
if (internal_path_find(handle_start, target, maxlen, allowed) != NULL)
return true;
return false;
}
region **path_find(region * start, const region * target, int maxlen,
region **path_find(region * handle_start, const region * target, int maxlen,
bool(*allowed) (const region *, const region *))
{
assert((!fval(start, RF_MARK) && !fval(target, RF_MARK))
assert((!fval(handle_start, RF_MARK) && !fval(target, RF_MARK))
|| !"Did you call path_init()?");
return internal_path_find(start, target, maxlen, allowed);
return internal_path_find(handle_start, target, maxlen, allowed);
}

View File

@ -22,10 +22,10 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
extern "C" {
#endif
extern struct region **path_find(struct region *start,
extern struct region **path_find(struct region *handle_start,
const struct region *target, int maxlen,
bool(*allowed) (const struct region *, const struct region *));
extern bool path_exists(struct region *start, const struct region *target,
extern bool path_exists(struct region *handle_start, const struct region *target,
int maxlen, bool(*allowed) (const struct region *,
const struct region *));
extern bool allowed_swim(const struct region *src,

View File

@ -310,7 +310,7 @@ static race *rc_find_i(const char *name)
for (i = 0; rc_depr[i]; i += 2) {
if (strcmp(name, rc_depr[i]) == 0) {
rc = rc_find_i(rc_depr[i + 1]);
log_warning("a reference was made to the retired race '%s', returning '%s'.", name, rc->_name);
log_info("a reference was made to the retired race '%s', returning '%s'.", name, rc->_name);
break;
}
}
@ -356,6 +356,7 @@ race *rc_create(const char *zName)
rc->magres.sa[1] = 1;
rc->hitpoints = 1;
rc->flags = RCF_DEFAULT;
rc->weight = PERSON_WEIGHT;
rc->capacity = 540;
rc->income = 20;
@ -453,6 +454,12 @@ int rc_herb_trade(const struct race *rc)
return 500;
}
void set_study_speed(race *rc, skill_t sk, int modifier) {
if (!rc->study_speed)
rc->study_speed = calloc(1, MAXSKILLS);
rc->study_speed[sk] = (char)modifier;
}
const race *rc_otherrace(const race *rc)
{
variant *v = rc_getoption(rc, RCO_OTHER);
@ -468,18 +475,13 @@ void rc_set_param(struct race *rc, const char *key, const char *value) {
if (strcmp(key, "recruit_multi") == 0) {
rc->recruit_multi = atof(value);
}
else if (strcmp(key, "migrants.formula") == 0) {
if (value[0] == '1') {
rc->flags |= RCF_MIGRANTS;
}
}
else if (strcmp(key, "other_race")==0) {
rc_setoption(rc, RCO_OTHER, value);
}
else if (strcmp(key, "ai.scare")==0) {
else if (strcmp(key, "scare")==0) {
rc_setoption(rc, RCO_SCARE, value);
}
else if (strcmp(key, "hunger.damage")==0) {
else if (strcmp(key, "hunger_damage")==0) {
rc_setoption(rc, RCO_HUNGER, value);
}
else if (strcmp(key, "armor.stamina")==0) {

View File

@ -129,7 +129,7 @@ extern "C" {
int weight;
int capacity;
int income;
float speed;
double speed;
int hitpoints;
char *def_damage;
int armor;
@ -202,7 +202,7 @@ extern "C" {
int rc_get_mask(char *list);
/* Flags. Do not reorder these without changing json_race() in jsonconf.c */
#define RCF_NPC (1<<0) /* cannot be the race for a player faction (and other limits?) */
#define RCF_PLAYABLE (1<<0) /* cannot be the race for a player faction (and other limits?) */
#define RCF_KILLPEASANTS (1<<1) /* a monster that eats peasants */
#define RCF_SCAREPEASANTS (1<<2) /* a monster that scares peasants out of the hex */
#define RCF_NOSTEAL (1<<3) /* this race has high stealth, but is not allowed to steal */
@ -229,18 +229,20 @@ extern "C" {
#define RCF_CANSAIL (1<<24) /* Einheit darf Schiffe betreten */
#define RCF_INVISIBLE (1<<25) /* not visible in any report */
#define RCF_SHIPSPEED (1<<26) /* race gets +1 on shipspeed */
#define RCF_MIGRANTS (1<<27) /* may have migrant units (human bonus) */
#define RCF_FAMILIAR (1<<28) /* may be a familiar */
#define RCF_ATTACK_MOVED (1<<29) /* may attack if it has moved */
#define RCF_ATTACK_MOVED (1<<27) /* may attack if it has moved */
#define RCF_MIGRANTS (1<<28) /* may have migrant units (human bonus) */
#define RCF_FAMILIAR (1<<29) /* may be a familiar */
#define RCF_DEFAULT RCF_CANSAIL
/* Economic flags */
#define ECF_GIVEPERSON (1<<2) /* <20>bergibt Personen */
#define ECF_GIVEUNIT (1<<3) /* Einheiten an andere Partei <20>bergeben */
#define ECF_GETITEM (1<<4) /* nimmt Gegenst<73>nde an */
#define ECF_REC_ETHEREAL (1<<7) /* Rekrutiert aus dem Nichts */
#define ECF_REC_UNLIMITED (1<<8) /* Rekrutiert ohne Limit */
#define ECF_STONEGOLEM (1<<9) /* race gets stonegolem properties */
#define ECF_IRONGOLEM (1<<10) /* race gets irongolem properties */
#define ECF_GIVEPERSON (1<<0) /* <20>bergibt Personen */
#define ECF_GIVEUNIT (1<<1) /* Einheiten an andere Partei <20>bergeben */
#define ECF_GETITEM (1<<2) /* nimmt Gegenst<73>nde an */
#define ECF_REC_ETHEREAL (1<<3) /* Rekrutiert aus dem Nichts */
#define ECF_REC_UNLIMITED (1<<4) /* Rekrutiert ohne Limit */
#define ECF_STONEGOLEM (1<<5) /* race gets stonegolem properties */
#define ECF_IRONGOLEM (1<<6) /* race gets irongolem properties */
/* Battle-Flags */
#define BF_EQUIPMENT (1<<0) /* Kann Ausr<73>stung benutzen */
@ -254,7 +256,7 @@ extern "C" {
const char *racename(const struct locale *lang, const struct unit *u,
const race * rc);
#define playerrace(rc) (!((rc)->flags & RCF_NPC))
#define playerrace(rc) ((rc)->flags & RCF_PLAYABLE)
#define dragonrace(rc) ((rc)->flags & RCF_DRAGON)
#define humanoidrace(rc) (((rc)->flags & RCF_UNDEAD) || (rc)==get_race(RC_DRACOID) || playerrace(rc))
#define illusionaryrace(rc) ((rc)->flags & RCF_ILLUSIONARY)
@ -271,6 +273,7 @@ extern "C" {
const char *raceprefix(const struct unit *u);
void register_race_function(race_func, const char *);
void set_study_speed(struct race *rc, skill_t sk, int modifier);
#ifdef __cplusplus
}
#endif

View File

@ -50,7 +50,7 @@ static void test_rc_defaults(CuTest *tc) {
CuAssertDblEquals(tc, 1.0, rc->recruit_multi, 0.0);
CuAssertDblEquals(tc, 1.0, rc->regaura, 0.0);
CuAssertDblEquals(tc, 1.0, rc->speed, 0.0);
CuAssertIntEquals(tc, 0, rc->flags);
CuAssertIntEquals(tc, RCF_DEFAULT, rc->flags);
CuAssertIntEquals(tc, 0, rc->recruitcost);
CuAssertIntEquals(tc, 0, rc->maintenance);
CuAssertIntEquals(tc, 540, rc->capacity);
@ -112,12 +112,11 @@ static void test_rc_set_param(CuTest *tc) {
CuAssertPtrEquals(tc, NULL, rc->options);
rc_set_param(rc, "recruit_multi", "0.5");
CuAssertDblEquals(tc, 0.5, rc->recruit_multi, 0.0);
rc_set_param(rc, "migrants.formula", "1");
CuAssertIntEquals(tc, RCF_MIGRANTS, rc->flags&RCF_MIGRANTS);
rc->flags |= RCF_MIGRANTS;
CuAssertIntEquals(tc, MIGRANTS_LOG10, rc_migrants_formula(rc));
rc_set_param(rc, "ai.scare", "400");
rc_set_param(rc, "scare", "400");
CuAssertIntEquals(tc, 400, rc_scare(rc));
rc_set_param(rc, "hunger.damage", "1d10+12");
rc_set_param(rc, "hunger_damage", "1d10+12");
CuAssertStrEquals(tc, "1d10+12", rc_hungerdamage(rc));
test_teardown();
}

View File

@ -971,16 +971,16 @@ static char *makename(void)
size_t nk, ne, nv, ns;
static char name[16];
const char *kons = "bcdfghklmnprstvwz",
*start = "bcdgtskpvfr",
*end = "nlrdst",
*handle_start = "bcdgtskpvfr",
*handle_end = "nlrdst",
*vowels = "aaaaaaaaaaaeeeeeeeeeeeeiiiiiiiiiiioooooooooooouuuuuuuuuuyy";
/* const char * vowels_latin1 = "aaaaaaaaaàâeeeeeeeeeéèêiiiiiiiiiíîoooooooooóòôuuuuuuuuuúyy"; */
nk = strlen(kons);
ne = strlen(end);
ne = strlen(handle_end);
nv = strlen(vowels);
ns = strlen(start);
ns = strlen(handle_start);
for (s = rng_int() % 3 + 2; s > 0; s--) {
int v;
@ -991,7 +991,7 @@ static char *makename(void)
}
else {
k = rng_int() % (int)ns;
name[p] = start[k];
name[p] = handle_start[k];
p++;
}
v = rng_int() % (int)nv;
@ -999,7 +999,7 @@ static char *makename(void)
p++;
if (rng_int() % 3 == 2 || s == 1) {
e = rng_int() % (int)ne;
name[p] = end[e];
name[p] = handle_end[e];
p++;
x = 1;
}

View File

@ -180,15 +180,15 @@ struct rawmaterial_type *rmt_create(struct resource_type *rtype)
{
rawmaterial_type *rmtype;
assert(!rtype->raw);
assert(!rtype->itype || rtype->itype->construction);
rmtype = rtype->raw = malloc(sizeof(rawmaterial_type));
rmtype->rtype = rtype;
rmtype->terraform = terraform_default;
rmtype->update = NULL;
rmtype->use = use_default;
rmtype->visible = visible_default;
return rmtype;
if (!rtype->raw) {
rmtype = rtype->raw = malloc(sizeof(rawmaterial_type));
rmtype->rtype = rtype;
rmtype->terraform = terraform_default;
rmtype->update = NULL;
rmtype->use = use_default;
rmtype->visible = visible_default;
}
return rtype->raw;
}
int limit_resource(const struct region *r, const resource_type *rtype)

View File

@ -1,12 +0,0 @@
#include <platform.h>
#include "rules.h"
int write_rules(const char *filename) {
return -1;
}
int read_rules(const char *filename)
{
return -1;
}

View File

@ -1,5 +0,0 @@
#pragma once
int read_rules(const char *filename);
int write_rules(const char * filename);

View File

@ -42,7 +42,6 @@ OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
#include <util/log.h>
#include <util/strings.h>
#include <util/umlaut.h>
#include <util/xml.h>
#include <storage.h>
#include <selist.h>

View File

@ -4099,11 +4099,11 @@ static void reset_game(void)
void turn_begin(void)
{
int start = first_turn();
int handle_start = first_turn();
assert(turn >= 0);
if (turn < start) {
if (turn < handle_start) {
/* this should only happen during tests */
turn = start;
turn = handle_start;
}
++turn;
reset_game();

View File

@ -258,7 +258,7 @@ static void test_force_leave_buildings(CuTest *tc) {
building * b;
test_setup();
mt_register(mt_new_va("force_leave_building", "unit:unit", "owner:unit", "building:building", MT_NEW_END));
mt_create_va(mt_new("force_leave_building", NULL), "unit:unit", "owner:unit", "building:building", MT_NEW_END);
r = test_create_region(0, 0, test_create_terrain("plain", LAND_REGION));
u1 = test_create_unit(test_create_faction(NULL), r);
u2 = test_create_unit(u1->faction, r);
@ -288,7 +288,7 @@ static void test_force_leave_ships(CuTest *tc) {
ship *sh;
test_setup();
mt_register(mt_new_va("force_leave_ship", "unit:unit", "owner:unit", "ship:ship", MT_NEW_END));
mt_create_va(mt_new("force_leave_ship", NULL), "unit:unit", "owner:unit", "ship:ship", MT_NEW_END);
r = test_create_region(0, 0, test_create_terrain("plain", LAND_REGION));
u1 = test_create_unit(test_create_faction(NULL), r);
u2 = test_create_unit(test_create_faction(NULL), r);
@ -876,7 +876,7 @@ static void test_luck_message(CuTest *tc) {
attrib *a;
test_setup();
mt_register(mt_new_va("peasantluck_success", "births:int", MT_NEW_END));
mt_create_va(mt_new("peasantluck_success", NULL), "births:int", MT_NEW_END);
setup_terrains(tc);
r = test_create_region(0, 0, NULL);
rsetpeasants(r, 1);
@ -901,8 +901,8 @@ static unit * setup_name_cmd(void) {
faction *f;
test_setup();
mt_register(mt_new_va("renamed_building_seen", "renamer:unit", "region:region", "building:building", MT_NEW_END));
mt_register(mt_new_va("renamed_building_notseen", "region:region", "building:building", MT_NEW_END));
mt_create_va(mt_new("renamed_building_seen", NULL), "renamer:unit", "region:region", "building:building", MT_NEW_END);
mt_create_va(mt_new("renamed_building_notseen", NULL), "region:region", "building:building", MT_NEW_END);
f = test_create_faction(NULL);
return test_create_unit(f, test_create_region(0, 0, NULL));
}
@ -1301,9 +1301,9 @@ static void test_ally_cmd(CuTest *tc) {
static void test_nmr_warnings(CuTest *tc) {
faction *f1, *f2;
test_setup();
mt_register(mt_new_va("nmr_warning", MT_NEW_END));
mt_register(mt_new_va("nmr_warning_final", MT_NEW_END));
mt_register(mt_new_va("warn_dropout", "faction:faction", "turn:int", MT_NEW_END));
mt_create_va(mt_new("nmr_warning", NULL), MT_NEW_END);
mt_create_va(mt_new("nmr_warning_final", NULL), MT_NEW_END);
mt_create_va(mt_new("warn_dropout", NULL), "faction:faction", "turn:int", MT_NEW_END);
config_set("nmr.timeout", "3");
f1 = test_create_faction(NULL);
f2 = test_create_faction(NULL);
@ -1325,9 +1325,9 @@ static unit * setup_mail_cmd(void) {
faction *f;
test_setup();
mt_register(mt_new_va("regionmessage", "region:region", "sender:unit", "string:string", MT_NEW_END));
mt_register(mt_new_va("unitmessage", "region:region", "sender:unit", "string:string", "unit:unit", MT_NEW_END));
mt_register(mt_new_va("mail_result", "message:string", "unit:unit", MT_NEW_END));
mt_create_va(mt_new("regionmessage", NULL), "region:region", "sender:unit", "string:string", MT_NEW_END);
mt_create_va(mt_new("unitmessage", NULL), "region:region", "sender:unit", "string:string", "unit:unit", MT_NEW_END);
mt_create_va(mt_new("mail_result", NULL), "message:string", "unit:unit", MT_NEW_END);
f = test_create_faction(NULL);
return test_create_unit(f, test_create_region(0, 0, NULL));
}
@ -1444,7 +1444,7 @@ static void test_show_without_item(CuTest *tc)
struct locale *loc;
test_setup();
mt_register(mt_new_va("displayitem", "weight:int", "item:resource", "description:string", MT_NEW_END));
mt_create_va(mt_new("displayitem", NULL), "weight:int", "item:resource", "description:string", MT_NEW_END);
loc = get_or_create_locale("de");
locale_setstring(loc, parameters[P_ANY], "ALLE");
@ -1489,7 +1489,7 @@ static void test_show_race(CuTest *tc) {
test_setup();
mt_register(mt_new_va("msg_event", "string:string", MT_NEW_END));
mt_create_va(mt_new("msg_event", NULL), "string:string", MT_NEW_END);
test_create_race("human");
rc = test_create_race("elf");
@ -1529,8 +1529,8 @@ static void test_show_both(CuTest *tc) {
message * msg;
test_setup();
mt_register(mt_new_va("msg_event", "string:string", MT_NEW_END));
mt_register(mt_new_va("displayitem", "weight:int", "item:resource", "description:string", MT_NEW_END));
mt_create_va(mt_new("msg_event", NULL), "string:string", MT_NEW_END);
mt_create_va(mt_new("displayitem", NULL), "weight:int", "item:resource", "description:string", MT_NEW_END);
rc = test_create_race("elf");
test_create_itemtype("elvenhorse");

View File

@ -2068,11 +2068,11 @@ void free_castorder(struct castorder *co)
void add_castorder(spellrank * cll, castorder * co)
{
if (cll->begin == NULL) {
cll->end = &cll->begin;
cll->handle_end = &cll->begin;
}
*cll->end = co;
cll->end = &co->next;
*cll->handle_end = co;
cll->handle_end = &co->next;
return;
}

View File

@ -154,28 +154,28 @@ extern "C" {
#define FARCASTING (1<<0) /* ZAUBER [struct region x y] */
#define SPELLLEVEL (1<<1) /* ZAUBER [STUFE x] */
/* ID's können zu drei unterschiedlichen Entitäten gehören: Einheiten,
* Gebäuden und Schiffen. */
#define UNITSPELL (1<<2) /* ZAUBER .. <Einheit-Nr> [<Einheit-Nr> ..] */
#define SHIPSPELL (1<<3) /* ZAUBER .. <Schiff-Nr> [<Schiff-Nr> ..] */
#define BUILDINGSPELL (1<<4) /* ZAUBER .. <Gebaeude-Nr> [<Gebaeude-Nr> ..] */
#define REGIONSPELL (1<<5) /* wirkt auf struct region */
#define OCEANCASTABLE (1<<2) /* Können auch nicht-Meermenschen auf
hoher See zaubern */
#define ONSHIPCAST (1<<3) /* kann auch auf von Land ablegenden
Schiffen stehend gezaubert werden */
#define TESTCANSEE (1<<4) /* alle Zielunits auf cansee prüfen */
#define PRECOMBATSPELL (1<<7) /* PRÄKAMPFZAUBER .. */
#define COMBATSPELL (1<<8) /* KAMPFZAUBER .. */
#define POSTCOMBATSPELL (1<<9) /* POSTKAMPFZAUBER .. */
/* ID's können zu drei unterschiedlichen Entitäten gehören: Einheiten,
* Gebäuden und Schiffen. */
#define UNITSPELL (1<<5) /* ZAUBER .. <Einheit-Nr> [<Einheit-Nr> ..] */
#define SHIPSPELL (1<<6) /* ZAUBER .. <Schiff-Nr> [<Schiff-Nr> ..] */
#define BUILDINGSPELL (1<<7) /* ZAUBER .. <Gebaeude-Nr> [<Gebaeude-Nr> ..] */
#define REGIONSPELL (1<<8) /* wirkt auf struct region */
#define GLOBALTARGET (1<<9) /* Ziel kann ausserhalb der region sein */
#define PRECOMBATSPELL (1<<10) /* PRÄKAMPFZAUBER .. */
#define COMBATSPELL (1<<11) /* KAMPFZAUBER .. */
#define POSTCOMBATSPELL (1<<12) /* POSTKAMPFZAUBER .. */
#define ISCOMBATSPELL (PRECOMBATSPELL|COMBATSPELL|POSTCOMBATSPELL)
#define OCEANCASTABLE (1<<10) /* Können auch nicht-Meermenschen auf
hoher See zaubern */
#define ONSHIPCAST (1<<11) /* kann auch auf von Land ablegenden
Schiffen stehend gezaubert werden */
/* */
#define NOTFAMILIARCAST (1<<12)
#define TESTRESISTANCE (1<<13) /* alle Zielobjekte (u, s, b, r) auf
Magieresistenz prüfen */
#define GLOBALTARGET (1<<14) /* Ziel muss in der target_region sein */
#define TESTCANSEE (1<<15) /* alle Zielunits auf cansee prüfen */
#define TESTRESISTANCE (1<<13) /* Zielobjekte auf Magieresistenz prüfen. not used in XML? */
#define NOTFAMILIARCAST (1<<14) /* not used by XML? */
#define ANYTARGET (UNITSPELL|REGIONSPELL|BUILDINGSPELL|SHIPSPELL) /* wirkt auf alle objekttypen (unit, ship, building, region) */
/* Flag Spruchkostenberechnung: */
@ -272,7 +272,7 @@ extern "C" {
typedef struct spellrank {
struct castorder *begin;
struct castorder **end;
struct castorder **handle_end;
} spellrank;
struct castorder *create_castorder(struct castorder * co, struct unit *caster,

View File

@ -33,7 +33,7 @@ static void test_market_curse(CuTest * tc)
building_type *btype;
test_setup();
mt_register(mt_new_va("buyamount", "unit:unit", "amount:int", "resource:resource", MT_NEW_END));
mt_create_va(mt_new("buyamount", NULL), "unit:unit", "amount:int", "resource:resource", MT_NEW_END);
htype = test_create_itemtype("herb");
htype->flags |= ITF_HERB;

View File

@ -848,15 +848,15 @@ static double chaosfactor(region * r)
return fval(r, RF_CHAOTIC) ? ((double)(1 + get_chaoscount(r)) / 1000.0) : 0.0;
}
static int nrand(int start, int sub)
static int nrand(int handle_start, int sub)
{
int res = 0;
do {
if (rng_int() % 100 < start)
if (rng_int() % 100 < handle_start)
res++;
start -= sub;
} while (start > 0);
handle_start -= sub;
} while (handle_start > 0);
return res;
}

View File

@ -51,16 +51,21 @@ static void create_monsters(unit **up, unit **um) {
region *r;
faction *fp, *fm;
mt_register(mt_new_va("dragon_growl", "dragon:unit", "number:int", "target:region", "growl:string", MT_NEW_END));
mt_create_va(mt_new("dragon_growl", NULL),
"dragon:unit", "number:int", "target:region", "growl:string", MT_NEW_END);
test_create_horse();
default_locale = test_create_locale();
fp = test_create_faction(NULL);
fm = get_or_create_monsters();
fset(fm, FFL_NOIDLEOUT);
assert(fval(fm, FFL_NPC));
assert(fval(fm, FFL_NOIDLEOUT));
assert(rc_find(fm->race->_name));
rc = rc_get_or_create(fm->race->_name);
fset(rc, RCF_UNARMEDGUARD|RCF_NPC|RCF_DRAGON);
fset(fm, FFL_NOIDLEOUT);
assert(fval(fm, FFL_NPC) && fval(fm->race, RCF_UNARMEDGUARD) && fval(fm->race, RCF_NPC) && fval(fm, FFL_NOIDLEOUT));
fset(rc, RCF_UNARMEDGUARD|RCF_DRAGON);
assert(!fval(fm->race, RCF_PLAYABLE));
test_create_region(-1, 0, test_create_terrain("ocean", SEA_REGION | SWIM_INTO | FLY_INTO));
test_create_region(1, 0, 0);
@ -219,8 +224,6 @@ static void test_dragon_moves(CuTest * tc)
plan_monsters(m->faction);
CuAssertPtrNotNull(tc, find_order("move east", m));
mt_register(mt_new_va("dragon_growl", "dragon:unit", "number:int", "target:region", "growl:string", MT_NEW_END));
random_growl(m, findregion(1, 0), 3);
msg = test_get_last_message(r->msgs);
@ -261,12 +264,12 @@ static void test_spawn_seaserpent(CuTest *tc) {
race *rc;
test_setup();
rc = test_create_race("seaserpent");
rc->flags |= RCF_NPC;
rc->flags &= ~RCF_PLAYABLE;
r = test_create_region(0, 0, NULL);
f = test_create_faction(NULL);
u = spawn_seaserpent(r, f);
CuAssertPtrNotNull(tc, u);
CuAssertPtrEquals(tc, 0, u->_name);
CuAssertPtrEquals(tc, NULL, u->_name);
test_teardown();
}

View File

@ -28,8 +28,10 @@
#include <assert.h>
static void setup_move(void) {
mt_register(mt_new_va("travel", "unit:unit", "start:region", "end:region", "mode:int", "regions:regions", MT_NEW_END));
mt_register(mt_new_va("moveblocked", "unit:unit", "direction:int", MT_NEW_END));
mt_create_va(mt_new("travel", NULL),
"unit:unit", "start:region", "end:region", "mode:int", "regions:regions", MT_NEW_END);
mt_create_va(mt_new("moveblocked", NULL),
"unit:unit", "direction:int", MT_NEW_END);
}
static void test_ship_not_allowed_in_coast(CuTest * tc)
@ -285,9 +287,12 @@ void setup_drift (struct drift_fixture *fix) {
u_set_ship(fix->u, fix->sh = test_create_ship(fix->u->region, fix->st_boat));
assert(fix->sh);
mt_register(mt_new_va("ship_drift", "ship:ship", "dir:int", MT_NEW_END));
mt_register(mt_new_va("shipsink", "ship:ship", MT_NEW_END));
mt_register(mt_new_va("massive_overload", "ship:ship", MT_NEW_END));
mt_create_va(mt_new("ship_drift", NULL),
"ship:ship", "dir:int", MT_NEW_END);
mt_create_va(mt_new("shipsink", NULL),
"ship:ship", MT_NEW_END);
mt_create_va(mt_new("massive_overload", NULL),
"ship:ship", MT_NEW_END);
}
static void test_ship_no_overload(CuTest *tc) {
@ -482,7 +487,8 @@ static void test_follow_ship_msg(CuTest * tc) {
td->dir = D_NORTHWEST;
td->age = 2;
mt_register(mt_new_va("error18", "unit:unit", "region:region", "command:order", MT_NEW_END));
mt_create_va(mt_new("error18", NULL),
"unit:unit", "region:region", "command:order", MT_NEW_END);
init_order_depr(ord);
getstrtoken();

View File

@ -64,7 +64,7 @@ static void test_faction_password_bad(CuTest *tc) {
const char *orders[] = { "ERESSEA 1 password", NULL };
test_setup();
mt_register(mt_new_va("wrongpasswd", "password:string", MT_NEW_END));
mt_create_va(mt_new("wrongpasswd", NULL), "password:string", MT_NEW_END);
f = test_create_faction(NULL);
renumber_faction(f, 1);

View File

@ -30,12 +30,18 @@ static void setup_piracy(void) {
st_boat = test_create_shiptype("boat");
st_boat->cargo = 1000;
mt_register(mt_new_va("piratenovictim", "ship:ship", "unit:unit", "region:region", MT_NEW_END));
mt_register(mt_new_va("piratesawvictim", "ship:ship", "unit:unit", "region:region", "dir:int", MT_NEW_END));
mt_register(mt_new_va("shipsail", "ship:ship", "from:region", "to:region", MT_NEW_END));
mt_register(mt_new_va("shipfly", "ship:ship", "from:region", "to:region", MT_NEW_END));
mt_register(mt_new_va("shipnoshore", "ship:ship", "region:region", MT_NEW_END));
mt_register(mt_new_va("travel", "unit:unit", "start:region", "end:region", "mode:int", "regions:regions", MT_NEW_END));
mt_create_va(mt_new("piratenovictim", NULL),
"ship:ship", "unit:unit", "region:region", MT_NEW_END);
mt_create_va(mt_new("piratesawvictim", NULL),
"ship:ship", "unit:unit", "region:region", "dir:int", MT_NEW_END);
mt_create_va(mt_new("shipsail", NULL),
"ship:ship", "from:region", "to:region", MT_NEW_END);
mt_create_va(mt_new("shipfly", NULL),
"ship:ship", "from:region", "to:region", MT_NEW_END);
mt_create_va(mt_new("shipnoshore", NULL),
"ship:ship", "region:region", MT_NEW_END);
mt_create_va(mt_new("travel", NULL),
"unit:unit", "start:region", "end:region", "mode:int", "regions:regions", MT_NEW_END);
}
static void setup_pirate(unit **pirate, int p_r_flags, int p_rc_flags, const char *p_shiptype,

View File

@ -38,7 +38,7 @@ static void test_renumber_faction_duplicate(CuTest *tc) {
const struct locale *lang;
test_setup_ex(tc);
mt_register(mt_new_va("renumber_inuse", "id:int", MT_NEW_END));
mt_create_va(mt_new("renumber_inuse", NULL), "id:int", MT_NEW_END);
f2 = test_create_faction(NULL);
u = test_create_unit(f = test_create_faction(NULL), test_create_region(0, 0, NULL));
no = f->no;

View File

@ -169,7 +169,7 @@ paragraph(struct stream *out, const char *str, ptrdiff_t indent, int hanging_ind
char marker)
{
size_t length = REPORTWIDTH;
const char *end, *begin, *mark = 0;
const char *handle_end, *begin, *mark = 0;
if (!str) return;
/* find out if there's a mark + indent already encoded in the string. */
@ -188,7 +188,7 @@ paragraph(struct stream *out, const char *str, ptrdiff_t indent, int hanging_ind
else {
mark = &marker;
}
begin = end = str;
begin = handle_end = str;
do {
const char *last_space = begin;
@ -205,25 +205,25 @@ paragraph(struct stream *out, const char *str, ptrdiff_t indent, int hanging_ind
else {
write_spaces(out, indent + hanging_indent);
}
while (*end && end <= begin + length - indent) {
if (*end == ' ') {
last_space = end;
while (*handle_end && handle_end <= begin + length - indent) {
if (*handle_end == ' ') {
last_space = handle_end;
}
++end;
++handle_end;
}
if (*end == 0)
last_space = end;
if (*handle_end == 0)
last_space = handle_end;
if (last_space == begin) {
/* there was no space in this line. clip it */
last_space = end;
last_space = handle_end;
}
swrite(begin, sizeof(char), last_space - begin, out);
begin = last_space;
while (*begin == ' ') {
++begin;
}
if (begin > end)
begin = end;
if (begin > handle_end)
begin = handle_end;
sputs("", out);
} while (*begin);
}
@ -714,16 +714,17 @@ static void
rp_messages(struct stream *out, message_list * msgs, faction * viewer, int indent,
bool categorized)
{
nrsection *section;
if (!msgs)
int i;
if (!msgs) {
return;
for (section = sections; section; section = section->next) {
}
for (i = 0; i != MAXSECTIONS && sections[i]; ++i) {
const char * section = sections[i];
int k = 0;
struct mlist *m = msgs->begin;
while (m) {
/* messagetype * mt = m->type; */
if (!categorized || strcmp(nrt_section(m->msg->type), section->name) == 0) {
if (!categorized || strcmp(m->msg->type->section, section) == 0) {
char lbuf[8192];
if (!k && categorized) {
@ -731,14 +732,14 @@ rp_messages(struct stream *out, message_list * msgs, faction * viewer, int inden
char cat_identifier[24];
newline(out);
sprintf(cat_identifier, "section_%s", section->name);
sprintf(cat_identifier, "section_%s", section);
section_title = LOC(viewer->locale, cat_identifier);
if (section_title) {
centre(out, section_title, true);
newline(out);
}
else {
log_error("no title defined for section %s in locale %s", section->name, locale_name(viewer->locale));
log_error("no title defined for section %s in locale %s", section, locale_name(viewer->locale));
}
k = 1;
}
@ -1930,7 +1931,7 @@ static void nr_paragraph(struct stream *out, message * m, faction * f)
typedef struct cb_data {
struct stream *out;
char *start, *writep;
char *handle_start, *writep;
size_t size;
const faction *f;
int maxtravel, counter;
@ -1939,7 +1940,7 @@ typedef struct cb_data {
static void init_cb(cb_data *data, struct stream *out, char *buffer, size_t size, const faction *f) {
data->out = out;
data->writep = buffer;
data->start = buffer;
data->handle_start = buffer;
data->size = size;
data->f = f;
data->maxtravel = 0;
@ -1956,7 +1957,7 @@ static void cb_write_travelthru(region *r, unit *u, void *cbdata) {
if (travelthru_cansee(r, f, u)) {
++data->counter;
do {
size_t len, size = data->size - (data->writep - data->start);
size_t len, size = data->size - (data->writep - data->handle_start);
const char *str;
char *writep = data->writep;
@ -1991,13 +1992,13 @@ static void cb_write_travelthru(region *r, unit *u, void *cbdata) {
if (len >= size || data->counter == data->maxtravel) {
/* buffer is full */
*writep = 0;
paragraph(data->out, data->start, 0, 0, 0);
data->writep = data->start;
paragraph(data->out, data->handle_start, 0, 0, 0);
data->writep = data->handle_start;
if (data->counter == data->maxtravel) {
break;
}
}
} while (data->writep == data->start);
} while (data->writep == data->handle_start);
}
}

View File

@ -2243,7 +2243,7 @@ static void eval_regions(struct opstack **stack, const void *userdata)
{ /* order -> string */
const faction *report = (const faction *)userdata;
int i = opop(stack).i;
int end, begin = opop(stack).i;
int handle_end, begin = opop(stack).i;
const arg_regions *aregs = (const arg_regions *)opop(stack).v;
char buf[256];
size_t size = sizeof(buf) - 1;
@ -2251,19 +2251,19 @@ static void eval_regions(struct opstack **stack, const void *userdata)
char *bufp = buf;
if (aregs == NULL) {
end = begin;
handle_end = begin;
}
else {
if (i >= 0)
end = begin + i;
handle_end = begin + i;
else
end = aregs->nregions + i;
handle_end = aregs->nregions + i;
}
for (i = begin; i < end; ++i) {
for (i = begin; i < handle_end; ++i) {
const char *rname = (const char *)regionname(aregs->regions[i], report);
bufp = STRLCPY(bufp, rname, size);
if (i + 1 < end && size > 2) {
if (i + 1 < handle_end && size > 2) {
strcat(bufp, ", ");
bufp += 2;
size -= 2;
@ -2296,9 +2296,9 @@ static void eval_trail(struct opstack **stack, const void *userdata)
#endif
if (aregs != NULL) {
int i, end = 0, begin = 0;
end = aregs->nregions;
for (i = begin; i < end; ++i) {
int i, handle_end = 0, begin = 0;
handle_end = aregs->nregions;
for (i = begin; i < handle_end; ++i) {
region *r = aregs->regions[i];
const char *trail = trailinto(r, lang);
const char *rn = f_regionid_s(r, report);
@ -2306,10 +2306,10 @@ static void eval_trail(struct opstack **stack, const void *userdata)
if (wrptr(&bufp, &size, snprintf(bufp, size, trail, rn)) != 0)
WARN_STATIC_BUFFER();
if (i + 2 < end) {
if (i + 2 < handle_end) {
bufp = STRLCPY(bufp, ", ", size);
}
else if (i + 1 < end) {
else if (i + 1 < handle_end) {
bufp = STRLCPY(bufp, LOC(lang, "list_and"), size);
}
}

View File

@ -26,7 +26,6 @@
#include "randenc.h"
#include "monsters.h"
#include "teleport.h"
#include "xmlreader.h"
/* triggers includes */
#include <triggers/changefaction.h>

View File

@ -130,8 +130,10 @@ static void test_view_reality(CuTest *tc) {
test_setup();
setup_spells();
mt_register(mt_new_va("spell_astral_only", "unit:unit", "region:region", "command:order", MT_NEW_END));
mt_register(mt_new_va("viewreality_effect", "unit:unit", MT_NEW_END));
mt_create_va(mt_new("spell_astral_only", NULL),
"unit:unit", "region:region", "command:order", MT_NEW_END);
mt_create_va(mt_new("viewreality_effect", NULL),
"unit:unit", MT_NEW_END);
r = test_create_region(0, 0, NULL);
ra = test_create_region(real2tp(r->x), real2tp(r->y), NULL);
ra->_plane = get_astralplane();

View File

@ -29,7 +29,8 @@ static void test_flyingship(CuTest * tc)
ship *sh1, *sh2;
test_setup();
mt_register(mt_new_va("flying_ship_result", "mage:unit", "ship:ship", MT_NEW_END));
mt_create_va(mt_new("flying_ship_result", NULL),
"mage:unit", "ship:ship", MT_NEW_END);
par.param = &par_data_ptr;
par_data.typ = SPP_SHIP;

View File

@ -29,7 +29,8 @@ static void test_magicresistance_unit(CuTest *tc) {
curse *c;
test_setup();
mt_register(mt_new_va("magicresistance_unit", "unit:unit", "id:int", MT_NEW_END));
mt_create_va(mt_new("magicresistance_unit", NULL),
"unit:unit", "id:int", MT_NEW_END);
r = test_create_plain(0, 0);
f1 = test_create_faction(NULL);
u1 = test_create_unit(f1, r);
@ -57,7 +58,8 @@ static void test_magicresistance_building(CuTest *tc) {
curse *c;
test_setup();
mt_register(mt_new_va("magicresistance_building", "building:building", "id:int", MT_NEW_END));
mt_create_va(mt_new("magicresistance_building", NULL),
"building:building", "id:int", MT_NEW_END);
r = test_create_plain(0, 0);
f1 = test_create_faction(NULL);
u1 = test_create_unit(f1, r);

View File

@ -232,7 +232,7 @@ static message *cinfo_sparkle(const void *obj, objtype_t typ, const curse * c,
"sparkle_18",
NULL, /* end draig */
};
int m, begin = 0, end = 0;
int m, begin = 0, handle_end = 0;
unit *u;
UNUSED_ARG(typ);
@ -243,18 +243,18 @@ static message *cinfo_sparkle(const void *obj, objtype_t typ, const curse * c,
return NULL;
for (m = 0; m != c->magician->faction->magiegebiet; ++m) {
while (effects[end] != NULL)
++end;
begin = end + 1;
end = begin;
while (effects[handle_end] != NULL)
++handle_end;
begin = handle_end + 1;
handle_end = begin;
}
while (effects[end] != NULL)
++end;
if (end == begin)
while (effects[handle_end] != NULL)
++handle_end;
if (handle_end == begin)
return NULL;
else {
int index = begin + curse_geteffect_int(c) % (end - begin);
int index = begin + curse_geteffect_int(c) % (handle_end - begin);
return msg_message(mkname("curseinfo", effects[index]), "unit id", u,
c->no);
}

View File

@ -33,19 +33,32 @@ typedef struct {
} spy_fixture;
static void setup_spy(spy_fixture *fix) {
mt_register(mt_new_va("spyreport", "spy:unit", "target:unit", "status:int", MT_NEW_END));
mt_register(mt_new_va("spyreport_mage", "spy:unit", "target:unit", "type:int", MT_NEW_END));
mt_register(mt_new_va("spyreport_faction", "spy:unit", "target:unit", "faction:faction", MT_NEW_END));
mt_register(mt_new_va("spyreport_skills", "spy:unit", "target:unit", "skills:string", MT_NEW_END));
mt_register(mt_new_va("spyreport_items", "spy:unit", "target:unit", "items:items", MT_NEW_END));
mt_register(mt_new_va("destroy_ship_0", "unit:unit", "ship:ship", MT_NEW_END));
mt_register(mt_new_va("destroy_ship_1", "unit:unit", "ship:ship", MT_NEW_END));
mt_register(mt_new_va("destroy_ship_2", "unit:unit", "ship:ship", MT_NEW_END));
mt_register(mt_new_va("destroy_ship_3", "ship:ship", MT_NEW_END));
mt_register(mt_new_va("destroy_ship_4", "ship:ship", MT_NEW_END));
mt_register(mt_new_va("sink_msg", "ship:ship", "region:region", MT_NEW_END));
mt_register(mt_new_va("sink_lost_msg", "unit:unit", "region:region", "dead:int", MT_NEW_END));
mt_register(mt_new_va("sink_saved_msg", "unit:unit", "region:region", MT_NEW_END));
mt_create_va(mt_new("spyreport", NULL),
"spy:unit", "target:unit", "status:int", MT_NEW_END);
mt_create_va(mt_new("spyreport_mage", NULL),
"spy:unit", "target:unit", "type:int", MT_NEW_END);
mt_create_va(mt_new("spyreport_faction", NULL),
"spy:unit", "target:unit", "faction:faction", MT_NEW_END);
mt_create_va(mt_new("spyreport_skills", NULL),
"spy:unit", "target:unit", "skills:string", MT_NEW_END);
mt_create_va(mt_new("spyreport_items", NULL),
"spy:unit", "target:unit", "items:items", MT_NEW_END);
mt_create_va(mt_new("destroy_ship_0", NULL),
"unit:unit", "ship:ship", MT_NEW_END);
mt_create_va(mt_new("destroy_ship_1", NULL),
"unit:unit", "ship:ship", MT_NEW_END);
mt_create_va(mt_new("destroy_ship_2", NULL),
"unit:unit", "ship:ship", MT_NEW_END);
mt_create_va(mt_new("destroy_ship_3", NULL),
"ship:ship", MT_NEW_END);
mt_create_va(mt_new("destroy_ship_4", NULL),
"ship:ship", MT_NEW_END);
mt_create_va(mt_new("sink_msg", NULL),
"ship:ship", "region:region", MT_NEW_END);
mt_create_va(mt_new("sink_lost_msg", NULL),
"unit:unit", "region:region", "dead:int", MT_NEW_END);
mt_create_va(mt_new("sink_saved_msg", NULL),
"unit:unit", "region:region", MT_NEW_END);
if (fix) {
fix->r = test_create_region(0, 0, NULL);
@ -196,7 +209,10 @@ static void test_setstealth_demon_bad(CuTest *tc) {
lang = test_create_locale();
rc = test_create_race("demon");
u = test_create_unit(test_create_faction(rc), test_create_region(0, 0, NULL));
rc = test_create_race("smurf");
rc->flags &= ~RCF_PLAYABLE;
init_races(lang);
u->thisorder = create_order(K_SETSTEALTH, lang, racename(lang, u, rc));
setstealth_cmd(u, u->thisorder);

View File

@ -58,9 +58,12 @@ typedef struct {
} study_fixture;
static void setup_study(void) {
mt_register(mt_new_va("studycost", "unit:unit", "region:region", "cost:int", "skill:int", MT_NEW_END));
mt_register(mt_new_va("teach_teacher", "teacher:unit", "student:unit", "skill:int", "level:int", MT_NEW_END));
mt_register(mt_new_va("teach_student", "teacher:unit", "student:unit", "skill:int", MT_NEW_END));
mt_create_va(mt_new("studycost", NULL),
"unit:unit", "region:region", "cost:int", "skill:int", MT_NEW_END);
mt_create_va(mt_new("teach_teacher", NULL),
"teacher:unit", "student:unit", "skill:int", "level:int", MT_NEW_END);
mt_create_va(mt_new("teach_student", NULL),
"teacher:unit", "student:unit", "skill:int", MT_NEW_END);
}
static void setup_locale(struct locale *lang) {
@ -218,7 +221,8 @@ static void test_academy_building(CuTest *tc) {
message * msg;
test_setup();
mt_register(mt_new_va("teach_asgood", "unit:unit", "region:region", "command:order", "student:unit", MT_NEW_END));
mt_create_va(mt_new("teach_asgood", NULL),
"unit:unit", "region:region", "command:order", "student:unit", MT_NEW_END);
random_source_inject_constant(0.0);
init_resources();
@ -636,8 +640,10 @@ static void test_teach_message(CuTest *tc) {
teaching_info *teach;
test_setup();
mt_register(mt_new_va("teach_teacher", "teacher:unit", "student:unit", "skill:int", "level:int", MT_NEW_END));
mt_register(mt_new_va("teach_student", "teacher:unit", "student:unit", "skill:int", MT_NEW_END));
mt_create_va(mt_new("teach_teacher", NULL),
"teacher:unit", "student:unit", "skill:int", "level:int", MT_NEW_END);
mt_create_va(mt_new("teach_student", NULL),
"teacher:unit", "student:unit", "skill:int", MT_NEW_END);
init_resources();
u = test_create_unit(test_create_faction(NULL), test_create_region(0, 0, NULL));
scale_number(u, 20);

View File

@ -59,7 +59,7 @@ struct race *test_create_race(const char *name)
rc->maintenance = 10;
rc->hitpoints = 20;
rc->maxaura = 100;
rc->flags |= RCF_WALK;
rc->flags |= (RCF_WALK|RCF_PLAYABLE);
rc->ec_flags |= ECF_GETITEM;
rc->battle_flags = BF_EQUIPMENT;
return rc;
@ -246,9 +246,12 @@ static void test_reset(void) {
}
random_source_reset();
mt_register(mt_new_va("changepasswd", "value:string", MT_NEW_END));
mt_register(mt_new_va("starvation", "unit:unit", "region:region", "dead:int", "live:int", MT_NEW_END));
mt_register(mt_new_va("malnourish", "unit:unit", "region:region", MT_NEW_END));
mt_create_va(mt_new("changepasswd", NULL),
"value:string", MT_NEW_END);
mt_create_va(mt_new("starvation", NULL),
"unit:unit", "region:region", "dead:int", "live:int", MT_NEW_END);
mt_create_va(mt_new("malnourish", NULL),
"unit:unit", "region:region", MT_NEW_END);
if (errno) {
int error = errno;
@ -354,7 +357,6 @@ building_type * test_create_buildingtype(const char * name)
{
construction *con;
building_type *btype = bt_get_or_create(name);
btype->flags = BTF_NAMECHANGE;
if (btype->stages) {
con = btype->stages->construction;
} else {

View File

@ -12,7 +12,8 @@
#include <CuTest.h>
static void shock_setup(void) {
mt_register(mt_new_va("shock", "mage:unit", "reason:string", MT_NEW_END));
mt_create_va(mt_new("shock", NULL),
"mage:unit", "reason:string", MT_NEW_END);
}
static void test_shock(CuTest *tc) {

View File

@ -28,7 +28,6 @@ log.test.c
umlaut.test.c
unicode.test.c
variant.test.c
# xml.test.c
)
SET(_FILES
@ -59,7 +58,6 @@ translation.c
umlaut.c
unicode.c
variant.c
xml.c
)
FOREACH(_FILE ${_FILES})

View File

@ -136,11 +136,11 @@ static const char *getbuf_latin1(FILE * F)
continue;
}
else if (c == CONTINUE_CHAR) {
const char *end = ++bp;
while (*end && isspace(*(unsigned char *)end))
++end; /* eatwhite */
if (*end == '\0') {
bp = end;
const char *handle_end = ++bp;
while (*handle_end && isspace(*(unsigned char *)handle_end))
++handle_end; /* eatwhite */
if (*handle_end == '\0') {
bp = handle_end;
cont = true;
continue;
}
@ -303,11 +303,11 @@ static const char *getbuf_utf8(FILE * F)
}
else {
if (*bp == CONTINUE_CHAR) {
const char *end;
const char *handle_end;
eatwhite(bp + 1, &white);
end = bp + 1 + white;
if (*end == '\0') {
bp = end;
handle_end = bp + 1 + white;
if (*handle_end == '\0') {
bp = handle_end;
cont = true;
continue;
}

View File

@ -60,35 +60,43 @@ arg_type *find_argtype(const char *name)
return NULL;
}
message_type *mt_new(const char *name, const char *args[])
static unsigned int mt_id(const message_type * mtype)
{
int nparameters = 0;
message_type *mtype;
unsigned int key = 0;
size_t i = strlen(mtype->name);
assert(name != NULL);
if (name == NULL) {
log_error("Trying to create message_type with name=0x0\n");
return NULL;
while (i > 0) {
/* TODO: why not use str_hash? */
key = (mtype->name[--i] + key * 37);
}
if (args != NULL) {
return key % 0x7FFFFFFF;
}
#define MT_MAXHASH 1021
static selist *messagetypes[MT_MAXHASH];
static void mt_register(message_type * mtype) {
unsigned int hash = str_hash(mtype->name) % MT_MAXHASH;
selist **qlp = messagetypes + hash;
if (selist_set_insert(qlp, mtype, NULL)) {
mtype->key = mt_id(mtype);
}
}
message_type *mt_create(message_type * mtype, const char *args[], int nparameters)
{
if (args != NULL && args[nparameters]) {
/* count the number of parameters */
while (args[nparameters]) ++nparameters;
do {
++nparameters;
} while (args[nparameters]);
}
mtype = (message_type *)malloc(sizeof(message_type));
mtype->key = 0;
mtype->name = str_strdup(name);
mtype->nparameters = nparameters;
if (nparameters > 0) {
int i;
mtype->nparameters = nparameters;
mtype->pnames = (char **)malloc(sizeof(char *) * nparameters);
mtype->types = (arg_type **)malloc(sizeof(arg_type *) * nparameters);
}
else {
mtype->pnames = NULL;
mtype->types = NULL;
}
if (args != NULL) {
int i;
for (i = 0; args[i]; ++i) {
const char *x = args[i];
const char *spos = strchr(x, ':');
@ -110,16 +118,75 @@ message_type *mt_new(const char *name, const char *args[])
}
}
}
mt_register(mtype);
return mtype;
}
message_type *mt_new_va(const char *name, ...)
char *sections[MAXSECTIONS];
const char *section_find(const char *name)
{
int i;
if (name == NULL) {
return NULL;
}
for (i = 0; i != MAXSECTIONS && sections[i]; ++i) {
if (strcmp(sections[i], name) == 0) {
return sections[i];
}
}
return NULL;
}
const char *section_add(const char *name) {
int i;
if (name == NULL) {
return NULL;
}
for (i = 0; i != MAXSECTIONS && sections[i]; ++i) {
if (strcmp(sections[i], name) == 0) {
return sections[i];
}
}
assert(i < MAXSECTIONS);
assert(sections[i] == NULL);
if (i + 1 < MAXSECTIONS) {
sections[i + 1] = NULL;
}
return sections[i] = str_strdup(name);
}
message_type *mt_new(const char *name, const char *section)
{
message_type *mtype;
assert(name != NULL);
if (name == NULL) {
log_error("Trying to create message_type with name=0x0\n");
return NULL;
}
mtype = (message_type *)malloc(sizeof(message_type));
mtype->key = 0;
mtype->name = str_strdup(name);
mtype->section = section_find(section);
if (!mtype->section) {
mtype->section = section_add(section);
}
mtype->nparameters = 0;
mtype->pnames = NULL;
mtype->types = NULL;
return mtype;
}
message_type *mt_create_va(message_type *mtype, ...)
{
const char *args[16];
int i = 0;
va_list marker;
va_start(marker, name);
va_start(marker, mtype);
for (;;) {
const char *c = va_arg(marker, const char *);
args[i++] = c;
@ -127,8 +194,8 @@ message_type *mt_new_va(const char *name, ...)
break;
}
va_end(marker);
args[i] = 0;
return mt_new(name, args);
args[i] = NULL;
return mt_create(mtype, args, i - 1);
}
static variant copy_arg(const arg_type * atype, variant data)
@ -168,9 +235,6 @@ message *msg_create(const struct message_type *mtype, variant args[])
return msg;
}
#define MT_MAXHASH 1021
static selist *messagetypes[MT_MAXHASH];
static void mt_free(void *val) {
message_type *mtype = (message_type *)val;
int i;
@ -191,6 +255,10 @@ void mt_clear(void) {
selist_free(ql);
messagetypes[i] = 0;
}
for (i = 0; i != MAXSECTIONS && sections[i]; ++i) {
free(sections[i]);
sections[i] = NULL;
}
}
const message_type *mt_find(const char *name)
@ -208,29 +276,6 @@ const message_type *mt_find(const char *name)
return 0;
}
static unsigned int mt_id(const message_type * mtype)
{
unsigned int key = 0;
size_t i = strlen(mtype->name);
while (i > 0) {
/* TODO: why not use str_hash? */
key = (mtype->name[--i] + key * 37);
}
return key % 0x7FFFFFFF;
}
const message_type *mt_register(message_type * type)
{
unsigned int hash = str_hash(type->name) % MT_MAXHASH;
selist **qlp = messagetypes + hash;
if (selist_set_insert(qlp, type, NULL)) {
type->key = mt_id(type);
}
return type;
}
void msg_free(message * msg)
{
int i;
@ -265,3 +310,4 @@ void message_done(void) {
free(at);
}
}

View File

@ -18,6 +18,12 @@
extern "C" {
#endif
#define MSG_MAXARGS 8
#define MT_NEW_END ((const char *)0)
#define MAXSECTIONS 16
extern char *sections[MAXSECTIONS];
typedef struct arg_type {
struct arg_type *next;
variant_type vtype;
@ -29,6 +35,7 @@ extern "C" {
typedef struct message_type {
unsigned int key;
char *name;
const char *section;
int nparameters;
char **pnames;
struct arg_type ** types;
@ -43,11 +50,6 @@ extern "C" {
void message_done(void);
void mt_clear(void);
struct message_type *mt_new(const char *name, const char *args[]);
struct message_type *mt_new_va(const char *name, ...);
#define MT_NEW_END ((const char *)0)
/* mt_new("simple_sentence", "subject:string", "predicate:string",
* "object:string", "lang:locale", MT_NEW_END); */
struct message *msg_create(const struct message_type *type,
variant args[]);
@ -59,8 +61,10 @@ extern "C" {
const char *mt_name(const struct message_type *mtype);
struct message_type *mt_new(const char *name, const char *section);
/** message_type registry (optional): **/
const struct message_type *mt_register(struct message_type *);
struct message_type *mt_create(struct message_type *, const char *args[], int nargs);
struct message_type *mt_create_va(struct message_type *, ...);
const struct message_type *mt_find(const char *);
void register_argtype(const char *name, void(*free_arg) (variant),

View File

@ -8,8 +8,7 @@ static void test_mt_new(CuTest *tc)
{
message_type *mt;
test_setup();
mt = mt_new_va("test", "name:string", "number:int", MT_NEW_END);
mt_register(mt);
mt = mt_create_va(mt_new("test", NULL), "name:string", "number:int", MT_NEW_END);
CuAssertPtrNotNull(tc, mt);
CuAssertStrEquals(tc, "test", mt->name);
CuAssertIntEquals(tc, 2, mt->nparameters);

View File

@ -27,10 +27,9 @@
#include <stdlib.h>
typedef struct nrmessage_type {
const struct message_type *mtype;
char *vars;
struct nrmessage_type *next;
const char *section;
const struct message_type *mtype;
char *vars;
struct nrmessage_type *next;
} nrmessage_type;
#define NRT_MAXHASH 1021
@ -66,41 +65,8 @@ static nrmessage_type *nrt_find(const struct message_type * mtype)
return found;
}
nrsection *sections;
const nrsection *section_find(const char *name)
{
nrsection **mcp = &sections;
if (name == NULL)
return NULL;
for (; *mcp; mcp = &(*mcp)->next) {
nrsection *mc = *mcp;
if (!strcmp(mc->name, name))
break;
}
return *mcp;
}
const nrsection *section_add(const char *name)
{
nrsection **mcp = &sections;
if (name == NULL)
return NULL;
for (; *mcp; mcp = &(*mcp)->next) {
nrsection *mc = *mcp;
if (!strcmp(mc->name, name))
break;
}
if (!*mcp) {
nrsection *mc = calloc(sizeof(nrsection), 1);
mc->name = str_strdup(name);
*mcp = mc;
}
return *mcp;
}
void
nrt_register(const struct message_type *mtype, const char *section)
nrt_register(const struct message_type *mtype)
{
unsigned int hash = mtype->key % NRT_MAXHASH;
nrmessage_type *nrt = nrtypes[hash];
@ -118,15 +84,6 @@ nrt_register(const struct message_type *mtype, const char *section)
nrt = malloc(sizeof(nrmessage_type));
nrt->mtype = mtype;
nrt->next = nrtypes[hash];
if (section) {
const nrsection *s = section_find(section);
if (s == NULL) {
s = section_add(section);
}
nrt->section = s->name;
}
else
nrt->section = NULL;
nrtypes[hash] = nrt;
*c = '\0';
for (i = 0; i != mtype->nparameters; ++i) {
@ -159,12 +116,6 @@ size_t size, const void *userdata)
return 0;
}
const char *nrt_section(const struct message_type * mtype)
{
nrmessage_type *nrt = nrt_find(mtype);
return nrt ? nrt->section : NULL;
}
void free_nrmesssages(void) {
int i;
for (i = 0; i != NRT_MAXHASH; ++i) {

View File

@ -25,19 +25,11 @@ extern "C" {
struct message_type;
struct nrmessage_type;
typedef struct nrsection {
char *name;
struct nrsection *next;
} nrsection;
extern nrsection *sections;
void free_nrmesssages(void);
void nrt_register(const struct message_type *mtype, const char *section);
void nrt_register(const struct message_type *mtype);
const char *nrt_string(const struct message_type *mtype,
const struct locale *lang);
const char *nrt_section(const struct message_type *mtype);
size_t nr_render(const struct message *msg, const struct locale *lang,
char *buffer, size_t size, const void *userdata);

View File

@ -157,13 +157,13 @@ int str_hash(const char *s)
const char *str_escape(const char *str, char *buffer,
size_t len)
{
const char *start = strchr(str, '\"');
if (!start) start = strchr(str, '\\');
const char *handle_start = strchr(str, '\"');
if (!handle_start) handle_start = strchr(str, '\\');
assert(buffer);
if (start) {
if (handle_start) {
const char *p;
char *o;
size_t skip = start - str;
size_t skip = handle_start - str;
if (skip > len) {
skip = len;
@ -218,6 +218,7 @@ unsigned int wang_hash(unsigned int a)
}
char *str_strdup(const char *s) {
if (s == NULL) return NULL;
#ifdef HAVE_STRDUP
return strdup(s);
#elif defined(_MSC_VER)

View File

@ -77,7 +77,7 @@ void opstack_push(opstack ** stackp, variant data)
#define BBUFSIZE 0x10000
static struct {
char *begin;
char *end;
char *handle_end;
char *last;
char *current;
} buffer;
@ -88,9 +88,9 @@ char *balloc(size_t size)
if (!init) {
init = 1;
buffer.current = buffer.begin = malloc(BBUFSIZE * sizeof(char));
buffer.end = buffer.begin + BBUFSIZE;
buffer.handle_end = buffer.begin + BBUFSIZE;
}
assert(buffer.current + size <= buffer.end || !"balloc is out of memory");
assert(buffer.current + size <= buffer.handle_end || !"balloc is out of memory");
buffer.last = buffer.current;
buffer.current += size;
return buffer.last;

View File

@ -1,131 +0,0 @@
/*
+-------------------+ Christian Schlittchen <corwin@amber.kn-bremen.de>
| | Enno Rehling <enno@eressea.de>
| Eressea PBEM host | Katja Zedel <katze@felidae.kn-bremen.de>
| (c) 1998 - 2003 | Henning Peters <faroul@beyond.kn-bremen.de>
| | Ingo Wilken <Ingo.Wilken@informatik.uni-oldenburg.de>
+-------------------+ Stefan Reich <reich@halbling.de>
This program may not be used, modified or distributed
without prior permission by the authors of Eressea.
*/
#include <platform.h>
#include "xml.h"
/* util includes */
#include "log.h"
#include "assert.h"
#include <libxml/catalog.h>
#include <libxml/xmlstring.h>
/* libc includes */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
int xml_ivalue(xmlNodePtr node, const char *name, int dflt)
{
int i = dflt;
xmlChar *propValue = xmlGetProp(node, BAD_CAST name);
if (propValue != NULL) {
i = atoi((const char *)propValue);
xmlFree(propValue);
}
return i;
}
bool xml_bvalue(xmlNodePtr node, const char *name, bool dflt)
{
bool result = dflt;
xmlChar *propValue = xmlGetProp(node, BAD_CAST name);
if (propValue != NULL) {
if (strcmp((const char *)propValue, "no") == 0)
result = false;
else if (strcmp((const char *)propValue, "yes") == 0)
result = true;
else if (strcmp((const char *)propValue, "false") == 0)
result = false;
else if (strcmp((const char *)propValue, "true") == 0)
result = true;
else if (strcmp((const char *)propValue, "1") == 0) {
log_warning("bool value is '1': %s::%s\n", node->name, name);
result = true;
}
else if (strcmp((const char *)propValue, "0") == 0) {
log_warning("bool value is '0': %s::%s\n", node->name, name);
result = false;
}
xmlFree(propValue);
}
return result;
}
double xml_fvalue(xmlNodePtr node, const char *name, double dflt)
{
double result = dflt;
xmlChar *propValue = xmlGetProp(node, BAD_CAST name);
if (propValue != NULL) {
result = atof((const char *)propValue);
xmlFree(propValue);
}
return result;
}
/* new xml functions */
/* libxml includes */
#include <libxml/tree.h>
#include <libxml/parser.h>
typedef struct xml_reader {
struct xml_reader *next;
xml_callback callback;
} xml_reader;
static xml_reader *xmlReaders;
void xml_done(void) {
xml_reader ** xrp = &xmlReaders;
while (*xrp) {
xml_reader *xr = *xrp;
*xrp = xr->next;
free(xr);
}
}
void xml_register_callback(xml_callback callback)
{
xml_reader *reader = (xml_reader *)malloc(sizeof(xml_reader));
xml_reader **insert = &xmlReaders;
assert_alloc(reader);
reader->callback = callback;
reader->next = NULL;
while (*insert)
insert = &(*insert)->next;
*insert = reader;
}
int read_xml(const char *filename)
{
xml_reader *reader = xmlReaders;
xmlDocPtr doc;
int results = 0;
doc = xmlReadFile(filename, NULL, XML_PARSE_NONET | XML_PARSE_PEDANTIC | XML_PARSE_COMPACT);
if (doc == NULL) {
log_error("could not open '%s'\n", filename);
return -1;
}
while (reader != NULL) {
int i = reader->callback(doc);
if (i < 0) {
return i;
}
results += i;
reader = reader->next;
}
xmlFreeDoc(doc);
return (results > 0) ? 0 : -1;
}

View File

@ -1,39 +0,0 @@
/*
+-------------------+ Christian Schlittchen <corwin@amber.kn-bremen.de>
| | Enno Rehling <enno@eressea.de>
| Eressea PBEM host | Katja Zedel <katze@felidae.kn-bremen.de>
| (c) 1998 - 2003 | Henning Peters <faroul@beyond.kn-bremen.de>
| | Ingo Wilken <Ingo.Wilken@informatik.uni-oldenburg.de>
+-------------------+ Stefan Reich <reich@halbling.de>
This program may not be used, modified or distributed
without prior permission by the authors of Eressea.
*/
#ifndef H_UTIL_XML
#define H_UTIL_XML
#include <stdbool.h>
#ifdef __cplusplus
extern "C" {
#endif
/* new xml functions: */
#include <libxml/tree.h>
typedef int (*xml_callback) (xmlDocPtr);
void xml_register_callback(xml_callback callback);
double xml_fvalue(xmlNodePtr node, const char *name, double dflt);
int xml_ivalue(xmlNodePtr node, const char *name, int dflt);
bool xml_bvalue(xmlNodePtr node, const char *name, bool dflt);
void xml_done(void);
int read_xml(const char *filename);
#ifdef __cplusplus
}
#endif
#endif

View File

@ -20,7 +20,8 @@ static void test_volcano_update(CuTest *tc) {
const struct terrain_type *t_volcano, *t_active;
test_setup();
mt_register(mt_new_va("volcanostopsmoke", "region:region", MT_NEW_END));
mt_create_va(mt_new("volcanostopsmoke", NULL),
"region:region", MT_NEW_END);
t_volcano = test_create_terrain("volcano", LAND_REGION);
t_active = test_create_terrain("activevolcano", LAND_REGION);
r = test_create_region(0, 0, t_active);
@ -42,9 +43,12 @@ static void test_volcano_outbreak(CuTest *tc) {
const struct terrain_type *t_volcano, *t_active;
test_setup();
mt_register(mt_new_va("volcanooutbreak", "regionv:region", "regionn:region", MT_NEW_END));
mt_register(mt_new_va("volcanooutbreaknn", "region:region", MT_NEW_END));
mt_register(mt_new_va("volcano_dead", "unit:unit", "region:region", "dead:int", MT_NEW_END));
mt_create_va(mt_new("volcanooutbreak", NULL),
"regionv:region", "regionn:region", MT_NEW_END);
mt_create_va(mt_new("volcanooutbreaknn", NULL),
"region:region", MT_NEW_END);
mt_create_va(mt_new("volcano_dead", NULL),
"unit:unit", "region:region", "dead:int", MT_NEW_END);
t_volcano = test_create_terrain("volcano", LAND_REGION);
t_active = test_create_terrain("activevolcano", LAND_REGION);
r = test_create_region(0, 0, t_active);

View File

@ -19,10 +19,14 @@ void sort_wormhole_regions(selist *rlist, region **match, int count);
void make_wormholes(region **match, int count, const building_type *bt_wormhole);
static void setup_wormholes(void) {
mt_register(mt_new_va("wormhole_appear", "region:region", MT_NEW_END));
mt_register(mt_new_va("wormhole_dissolve", "region:region", MT_NEW_END));
mt_register(mt_new_va("wormhole_exit", "unit:unit", "region:region", MT_NEW_END));
mt_register(mt_new_va("wormhole_requirements", "unit:unit", "region:region", MT_NEW_END));
mt_create_va(mt_new("wormhole_appear", NULL),
"region:region", MT_NEW_END);
mt_create_va(mt_new("wormhole_dissolve", NULL),
"region:region", MT_NEW_END);
mt_create_va(mt_new("wormhole_exit", NULL),
"unit:unit", "region:region", MT_NEW_END);
mt_create_va(mt_new("wormhole_requirements", NULL),
"unit:unit", "region:region", MT_NEW_END);
}
static void test_make_wormholes(CuTest *tc) {

File diff suppressed because it is too large Load Diff

View File

@ -1,28 +0,0 @@
/*
+-------------------+
| | Enno Rehling <enno@eressea.de>
| Eressea PBEM host | Christian Schlittchen <corwin@amber.kn-bremen.de>
| (c) 1998 - 2007 | Katja Zedel <katze@felidae.kn-bremen.de>
| | Henning Peters <faroul@beyond.kn-bremen.de>
+-------------------+
This program may not be used, modified or distributed
without prior permission by the authors of Eressea.
*/
#ifndef H_KRNL_XMLREADER_H
#define H_KRNL_XMLREADER_H
struct spell;
#ifdef __cplusplus
extern "C" {
#endif
extern void register_xmlreader(void);
/* game-specific callbacks */
extern void(*set_spelldata_cb) (struct spell * sp);
#ifdef __cplusplus
}
#endif
#endif