undo more CRLF screwups.

This commit is contained in:
Enno Rehling 2010-08-08 01:06:34 -07:00
parent 14b3ed309f
commit a5e712580f
413 changed files with 105706 additions and 105752 deletions

View file

@ -1,9 +1,9 @@
<?xml version="1.0"?>
<resource name="chainmail">
<item weight="200" score="90">
<construction skill="armorer" minskill="3" reqsize="1">
<requirement type="iron" quantity="3"/>
</construction>
<armor ac="3" penalty="0.15" magres="0.0"/>
</item>
</resource>
<?xml version="1.0"?>
<resource name="chainmail">
<item weight="200" score="90">
<construction skill="armorer" minskill="3" reqsize="1">
<requirement type="iron" quantity="3"/>
</construction>
<armor ac="3" penalty="0.15" magres="0.0"/>
</item>
</resource>

View file

@ -1,9 +1,9 @@
<?xml version="1.0"?>
<resource name="laenmail">
<item weight="100" score="1000">
<construction skill="armorer" minskill="9" reqsize="1">
<requirement type="laen" quantity="3"/>
</construction>
<armor ac="6" penalty="0.0" magres="0.3" laen="yes" />
</item>
</resource>
<?xml version="1.0"?>
<resource name="laenmail">
<item weight="100" score="1000">
<construction skill="armorer" minskill="9" reqsize="1">
<requirement type="laen" quantity="3"/>
</construction>
<armor ac="6" penalty="0.0" magres="0.3" laen="yes" />
</item>
</resource>

View file

@ -1,9 +1,9 @@
<?xml version="1.0"?>
<resource name="laenshield">
<item weight="0" score="1000">
<construction skill="armorer" minskill="7" reqsize="1">
<requirement type="laen" quantity="1"/>
</construction>
<armor ac="2" penalty="-0.25" magres="0.3" laen="yes" shield="yes" />
</item>
</resource>
<?xml version="1.0"?>
<resource name="laenshield">
<item weight="0" score="1000">
<construction skill="armorer" minskill="7" reqsize="1">
<requirement type="laen" quantity="1"/>
</construction>
<armor ac="2" penalty="-0.25" magres="0.3" laen="yes" shield="yes" />
</item>
</resource>

View file

@ -1,10 +1,10 @@
<?xml version="1.0"?>
<resource name="plate">
<item weight="400" score="150">
<function name="canuse" value="lua_canuse_item"/>
<construction skill="armorer" minskill="4" reqsize="1">
<requirement type="iron" quantity="5"/>
</construction>
<armor ac="5" penalty="0.30" magres="0.0"/>
</item>
</resource>
<?xml version="1.0"?>
<resource name="plate">
<item weight="400" score="150">
<function name="canuse" value="lua_canuse_item"/>
<construction skill="armorer" minskill="4" reqsize="1">
<requirement type="iron" quantity="5"/>
</construction>
<armor ac="5" penalty="0.30" magres="0.0"/>
</item>
</resource>

View file

@ -1,10 +1,10 @@
<?xml version="1.0"?>
<resource name="rustychainmail">
<item weight="200" score="30">
<construction skill="armorer" minskill="3" reqsize="1">
<requirement type="iron" quantity="3"/>
</construction>
<armor ac="2" penalty="0.30" magres="0.0"/>
</item>
</resource>
<?xml version="1.0"?>
<resource name="rustychainmail">
<item weight="200" score="30">
<construction skill="armorer" minskill="3" reqsize="1">
<requirement type="iron" quantity="3"/>
</construction>
<armor ac="2" penalty="0.30" magres="0.0"/>
</item>
</resource>

View file

@ -1,9 +1,9 @@
<?xml version="1.0"?>
<resource name="rustyshield">
<item weight="100" score="10">
<construction skill="armorer" minskill="2" reqsize="1">
<requirement type="iron" quantity="1"/>
</construction>
<armor ac="1" penalty="0.0" magres="0.0" shield="yes"/>
</item>
</resource>
<?xml version="1.0"?>
<resource name="rustyshield">
<item weight="100" score="10">
<construction skill="armorer" minskill="2" reqsize="1">
<requirement type="iron" quantity="1"/>
</construction>
<armor ac="1" penalty="0.0" magres="0.0" shield="yes"/>
</item>
</resource>

View file

@ -1,9 +1,9 @@
<?xml version="1.0"?>
<resource name="shield">
<item weight="100" score="30">
<construction skill="armorer" minskill="2" reqsize="1">
<requirement type="iron" quantity="1"/>
</construction>
<armor ac="1" penalty="-0.15" magres="0.0" shield="yes"/>
</item>
</resource>
<?xml version="1.0"?>
<resource name="shield">
<item weight="100" score="30">
<construction skill="armorer" minskill="2" reqsize="1">
<requirement type="iron" quantity="1"/>
</construction>
<armor ac="1" penalty="-0.15" magres="0.0" shield="yes"/>
</item>
</resource>

View file

@ -1,23 +1,23 @@
<?xml version="1.0"?>
<calendar name="secondage" newyear="month_1" start="0">
<season name="winter">
<month name="month_4" storm="50" />
<month name="month_5" storm="30" />
<month name="month_6" storm="60" />
</season>
<season name="spring">
<month name="month_7" storm="60" />
<month name="month_8" storm="10" />
</season>
<season name="summer">
<month name="month_9" storm="60" />
<month name="month_1" storm="10" />
</season>
<season name="fall">
<month name="month_2" storm="60" />
<month name="month_3" storm="80" />
</season>
<week name="firstweek" />
<week name="secondweek" />
<week name="thirdweek" />
</calendar>
<?xml version="1.0"?>
<calendar name="secondage" newyear="month_1" start="0">
<season name="winter">
<month name="month_4" storm="50" />
<month name="month_5" storm="30" />
<month name="month_6" storm="60" />
</season>
<season name="spring">
<month name="month_7" storm="60" />
<month name="month_8" storm="10" />
</season>
<season name="summer">
<month name="month_9" storm="60" />
<month name="month_1" storm="10" />
</season>
<season name="fall">
<month name="month_2" storm="60" />
<month name="month_3" storm="80" />
</season>
<week name="firstweek" />
<week name="secondweek" />
<week name="thirdweek" />
</calendar>

View file

@ -1,10 +1,10 @@
<?xml version="1.0"?>
<resources xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="../armor/chainmail.xml"/>
<xi:include href="../armor/laenmail.xml"/>
<xi:include href="../armor/laenshield.xml"/>
<xi:include href="../armor/plate.xml"/>
<xi:include href="../armor/rustychainmail.xml"/>
<xi:include href="../armor/rustyshield.xml"/>
<xi:include href="../armor/shield.xml"/>
</resources>
<?xml version="1.0"?>
<resources xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="../armor/chainmail.xml"/>
<xi:include href="../armor/laenmail.xml"/>
<xi:include href="../armor/laenshield.xml"/>
<xi:include href="../armor/plate.xml"/>
<xi:include href="../armor/rustychainmail.xml"/>
<xi:include href="../armor/rustyshield.xml"/>
<xi:include href="../armor/shield.xml"/>
</resources>

View file

@ -1,171 +1,171 @@
<?xml version="1.0"?>
<buildings>
<building name="wormhole" maxsize="4" capacity="1" maxcapacity="4" nobuild="yes" nodestroy="yes" unique="yes" />
<building name="illusioncastle" capacity="0" maxcapacity="0" maxsize="0" nobuild="yes"/>
<building name="xmas_exit" maxsize="10" maxcapacity="2" nobuild="yes" nodestroy="yes" unique="yes"/>
<building name="caldera" capacity="1" nodestroy="yes" nobuild="yes"/>
<building name="genericbuilding" namechange="no" maxsize="1" nobuild="yes"/>
<building name="artacademy" maxsize="100" nobuild="yes" nodestroy="yes" unique="yes"/>
<building name="artsculpture" namechange="no" maxsize="100" nobuild="yes" nodestroy="yes" unique="yes"/>
<building name="blessedstonecircle" maxcapacity="3" maxsize="100" nobuild="yes" magic="yes" magres="60" magresbonus="30" auraregen="1.50">
<construction skill="building" minskill="2" reqsize="100" maxsize="100">
<requirement type="log" quantity="500"/>
<requirement type="stone" quantity="500"/>
</construction>
</building>
<building name="stonecircle" maxsize="100">
<construction skill="building" minskill="2" reqsize="100" maxsize="100">
<requirement type="log" quantity="500"/>
<requirement type="stone" quantity="500"/>
</construction>
</building>
<building name="inn" capacity="1">
<maintenance type="money" amount="5" variable="yes" vital="yes"/>
<construction skill="building" minskill="2" reqsize="10">
<requirement type="iron" quantity="10"/>
<requirement type="log" quantity="30"/>
<requirement type="stone" quantity="40"/>
<requirement type="money" quantity="2000"/>
</construction>
</building>
<building name="tunnel" capacity="1" maxsize="100">
<maintenance type="stone" amount="2"/>
<maintenance type="money" amount="100" vital="yes"/>
<construction skill="building" minskill="6" reqsize="100" maxsize="100">
<requirement type="iron" quantity="100"/>
<requirement type="log" quantity="500"/>
<requirement type="stone" quantity="1000"/>
<requirement type="money" quantity="30000"/>
</construction>
</building>
<building name="caravan" capacity="1" maxsize="10">
<maintenance type="horse" amount="2"/>
<maintenance type="money" amount="3000" vital="yes"/>
<construction skill="building" minskill="2" reqsize="10" maxsize="10">
<requirement type="iron" quantity="10"/>
<requirement type="log" quantity="50"/>
<requirement type="stone" quantity="10"/>
<requirement type="money" quantity="5000"/>
</construction>
</building>
<building name="dam" capacity="1" maxsize="50">
<maintenance type="log" amount="3"/>
<maintenance type="money" amount="1000" vital="yes"/>
<construction skill="building" minskill="4" reqsize="50" maxsize="50">
<requirement type="iron" quantity="50"/>
<requirement type="log" quantity="500"/>
<requirement type="stone" quantity="250"/>
<requirement type="money" quantity="25000"/>
</construction>
</building>
<building name="monument" namechange="no" capacity="1">
<construction skill="building" minskill="4" reqsize="1">
<requirement type="log" quantity="1"/>
<requirement type="stone" quantity="1"/>
<requirement type="iron" quantity="1"/>
<requirement type="money" quantity="400"/>
</construction>
</building>
<building name="stables" capacity="1">
<maintenance type="money" amount="150" vital="yes"/>
<construction skill="building" minskill="2" reqsize="1">
<requirement type="log" quantity="4"/>
<requirement type="stone" quantity="2"/>
<requirement type="iron" quantity="1"/>
<requirement type="money" quantity="100"/>
</construction>
</building>
<building name="sawmill" capacity="1">
<maintenance type="money" amount="250" vital="yes"/>
<construction skill="building" minskill="3" reqsize="1">
<requirement type="log" quantity="5"/>
<requirement type="stone" quantity="5"/>
<requirement type="iron" quantity="3"/>
<requirement type="money" quantity="200"/>
</construction>
</building>
<building name="smithy" capacity="1">
<function name="init" value="init_smithy"/>
<maintenance type="money" amount="300" vital="yes"/>
<maintenance type="log" amount="1"/>
<construction skill="building" minskill="3" reqsize="1">
<requirement type="log" quantity="5"/>
<requirement type="stone" quantity="5"/>
<requirement type="iron" quantity="2"/>
<requirement type="money" quantity="200"/>
</construction>
</building>
<building name="magictower" maxcapacity="2" maxsize="50" magic="yes" magres="40" fumblebonus="10" auraregen="1.75">
<maintenance type="money" amount="1000" vital="yes"/>
<construction skill="building" minskill="5" reqsize="50" maxsize="50">
<requirement type="log" quantity="150"/>
<requirement type="stone" quantity="250"/>
<requirement type="mallorn" quantity="100"/>
<requirement type="iron" quantity="150"/>
<requirement type="laen" quantity="100"/>
<requirement type="money" quantity="25000"/>
</construction>
</building>
<building name="academy" maxcapacity="25" maxsize="25">
<maintenance type="money" amount="1000" vital="yes"/>
<construction skill="building" minskill="3" reqsize="25" maxsize="25">
<requirement type="log" quantity="125"/>
<requirement type="stone" quantity="125"/>
<requirement type="iron" quantity="25"/>
<requirement type="money" quantity="12500"/>
</construction>
</building>
<building name="harbour" capacity="1" maxcapacity="25" maxsize="25">
<maintenance type="money" amount="250" vital="yes"/>
<construction skill="building" minskill="3" reqsize="25" maxsize="25">
<requirement type="log" quantity="125"/>
<requirement type="stone" quantity="125"/>
<requirement type="money" quantity="6250"/>
</construction>
</building>
<building name="quarry" capacity="1">
<maintenance type="money" amount="250" vital="yes"/>
<construction skill="building" minskill="2" reqsize="1">
<requirement type="iron" quantity="1"/>
<requirement type="log" quantity="5"/>
<requirement type="stone" quantity="1"/>
<requirement type="money" quantity="250"/>
</construction>
</building>
<building name="mine" capacity="1">
<maintenance type="money" amount="500" vital="yes"/>
<construction skill="building" minskill="4" reqsize="1">
<requirement type="iron" quantity="1"/>
<requirement type="log" quantity="10"/>
<requirement type="stone" quantity="5"/>
<requirement type="money" quantity="250"/>
</construction>
</building>
<building name="lighthouse" capacity="1" maxcapacity="4">
<maintenance type="money" amount="100" vital="yes"/>
<construction skill="building" minskill="3" reqsize="1">
<requirement type="iron" quantity="1"/>
<requirement type="log" quantity="1"/>
<requirement type="stone" quantity="2"/>
<requirement type="money" quantity="100"/>
</construction>
</building>
</buildings>
<?xml version="1.0"?>
<buildings>
<building name="wormhole" maxsize="4" capacity="1" maxcapacity="4" nobuild="yes" nodestroy="yes" unique="yes" />
<building name="illusioncastle" capacity="0" maxcapacity="0" maxsize="0" nobuild="yes"/>
<building name="xmas_exit" maxsize="10" maxcapacity="2" nobuild="yes" nodestroy="yes" unique="yes"/>
<building name="caldera" capacity="1" nodestroy="yes" nobuild="yes"/>
<building name="genericbuilding" namechange="no" maxsize="1" nobuild="yes"/>
<building name="artacademy" maxsize="100" nobuild="yes" nodestroy="yes" unique="yes"/>
<building name="artsculpture" namechange="no" maxsize="100" nobuild="yes" nodestroy="yes" unique="yes"/>
<building name="blessedstonecircle" maxcapacity="3" maxsize="100" nobuild="yes" magic="yes" magres="60" magresbonus="30" auraregen="1.50">
<construction skill="building" minskill="2" reqsize="100" maxsize="100">
<requirement type="log" quantity="500"/>
<requirement type="stone" quantity="500"/>
</construction>
</building>
<building name="stonecircle" maxsize="100">
<construction skill="building" minskill="2" reqsize="100" maxsize="100">
<requirement type="log" quantity="500"/>
<requirement type="stone" quantity="500"/>
</construction>
</building>
<building name="inn" capacity="1">
<maintenance type="money" amount="5" variable="yes" vital="yes"/>
<construction skill="building" minskill="2" reqsize="10">
<requirement type="iron" quantity="10"/>
<requirement type="log" quantity="30"/>
<requirement type="stone" quantity="40"/>
<requirement type="money" quantity="2000"/>
</construction>
</building>
<building name="tunnel" capacity="1" maxsize="100">
<maintenance type="stone" amount="2"/>
<maintenance type="money" amount="100" vital="yes"/>
<construction skill="building" minskill="6" reqsize="100" maxsize="100">
<requirement type="iron" quantity="100"/>
<requirement type="log" quantity="500"/>
<requirement type="stone" quantity="1000"/>
<requirement type="money" quantity="30000"/>
</construction>
</building>
<building name="caravan" capacity="1" maxsize="10">
<maintenance type="horse" amount="2"/>
<maintenance type="money" amount="3000" vital="yes"/>
<construction skill="building" minskill="2" reqsize="10" maxsize="10">
<requirement type="iron" quantity="10"/>
<requirement type="log" quantity="50"/>
<requirement type="stone" quantity="10"/>
<requirement type="money" quantity="5000"/>
</construction>
</building>
<building name="dam" capacity="1" maxsize="50">
<maintenance type="log" amount="3"/>
<maintenance type="money" amount="1000" vital="yes"/>
<construction skill="building" minskill="4" reqsize="50" maxsize="50">
<requirement type="iron" quantity="50"/>
<requirement type="log" quantity="500"/>
<requirement type="stone" quantity="250"/>
<requirement type="money" quantity="25000"/>
</construction>
</building>
<building name="monument" namechange="no" capacity="1">
<construction skill="building" minskill="4" reqsize="1">
<requirement type="log" quantity="1"/>
<requirement type="stone" quantity="1"/>
<requirement type="iron" quantity="1"/>
<requirement type="money" quantity="400"/>
</construction>
</building>
<building name="stables" capacity="1">
<maintenance type="money" amount="150" vital="yes"/>
<construction skill="building" minskill="2" reqsize="1">
<requirement type="log" quantity="4"/>
<requirement type="stone" quantity="2"/>
<requirement type="iron" quantity="1"/>
<requirement type="money" quantity="100"/>
</construction>
</building>
<building name="sawmill" capacity="1">
<maintenance type="money" amount="250" vital="yes"/>
<construction skill="building" minskill="3" reqsize="1">
<requirement type="log" quantity="5"/>
<requirement type="stone" quantity="5"/>
<requirement type="iron" quantity="3"/>
<requirement type="money" quantity="200"/>
</construction>
</building>
<building name="smithy" capacity="1">
<function name="init" value="init_smithy"/>
<maintenance type="money" amount="300" vital="yes"/>
<maintenance type="log" amount="1"/>
<construction skill="building" minskill="3" reqsize="1">
<requirement type="log" quantity="5"/>
<requirement type="stone" quantity="5"/>
<requirement type="iron" quantity="2"/>
<requirement type="money" quantity="200"/>
</construction>
</building>
<building name="magictower" maxcapacity="2" maxsize="50" magic="yes" magres="40" fumblebonus="10" auraregen="1.75">
<maintenance type="money" amount="1000" vital="yes"/>
<construction skill="building" minskill="5" reqsize="50" maxsize="50">
<requirement type="log" quantity="150"/>
<requirement type="stone" quantity="250"/>
<requirement type="mallorn" quantity="100"/>
<requirement type="iron" quantity="150"/>
<requirement type="laen" quantity="100"/>
<requirement type="money" quantity="25000"/>
</construction>
</building>
<building name="academy" maxcapacity="25" maxsize="25">
<maintenance type="money" amount="1000" vital="yes"/>
<construction skill="building" minskill="3" reqsize="25" maxsize="25">
<requirement type="log" quantity="125"/>
<requirement type="stone" quantity="125"/>
<requirement type="iron" quantity="25"/>
<requirement type="money" quantity="12500"/>
</construction>
</building>
<building name="harbour" capacity="1" maxcapacity="25" maxsize="25">
<maintenance type="money" amount="250" vital="yes"/>
<construction skill="building" minskill="3" reqsize="25" maxsize="25">
<requirement type="log" quantity="125"/>
<requirement type="stone" quantity="125"/>
<requirement type="money" quantity="6250"/>
</construction>
</building>
<building name="quarry" capacity="1">
<maintenance type="money" amount="250" vital="yes"/>
<construction skill="building" minskill="2" reqsize="1">
<requirement type="iron" quantity="1"/>
<requirement type="log" quantity="5"/>
<requirement type="stone" quantity="1"/>
<requirement type="money" quantity="250"/>
</construction>
</building>
<building name="mine" capacity="1">
<maintenance type="money" amount="500" vital="yes"/>
<construction skill="building" minskill="4" reqsize="1">
<requirement type="iron" quantity="1"/>
<requirement type="log" quantity="10"/>
<requirement type="stone" quantity="5"/>
<requirement type="money" quantity="250"/>
</construction>
</building>
<building name="lighthouse" capacity="1" maxcapacity="4">
<maintenance type="money" amount="100" vital="yes"/>
<construction skill="building" minskill="3" reqsize="1">
<requirement type="iron" quantity="1"/>
<requirement type="log" quantity="1"/>
<requirement type="stone" quantity="2"/>
<requirement type="money" quantity="100"/>
</construction>
</building>
</buildings>

View file

@ -1,10 +1,10 @@
<?xml version="1.0"?>
<!-- TODO: this does not work yet -->
<production>
<construction resource="laenshield" skill="armorer" minskill="7" reqsize="1">
<requirement type="laen" quantity="1"/>
</construction>
<construction resource="laenmail" skill="armorer" minskill="9" reqsize="1">
<requirement type="laen" quantity="3"/>
</construction>
</production>
<?xml version="1.0"?>
<!-- TODO: this does not work yet -->
<production>
<construction resource="laenshield" skill="armorer" minskill="7" reqsize="1">
<requirement type="laen" quantity="1"/>
</construction>
<construction resource="laenmail" skill="armorer" minskill="9" reqsize="1">
<requirement type="laen" quantity="3"/>
</construction>
</production>

View file

@ -1,89 +1,89 @@
<?xml version="1.0"?>
<resources>
<!-- this file contains herbs that are part of the alchemy system -->
<resource name="h0" appearance="herbbag"><!-- Flachwurz -->
<item weight="0" score="10" herb="yes"/>
</resource>
<resource name="h1" appearance="herbbag"><!-- Würziger Wagemut -->
<item weight="0" score="10" herb="yes"/>
</resource>
<resource name="h2" appearance="herbbag"><!-- Eulenauge -->
<item weight="0" score="10" herb="yes"/>
</resource>
<resource name="h3" appearance="herbbag"><!-- Grüner Spinnerich -->
<item weight="0" score="10" herb="yes"/>
</resource>
<resource name="h4" appearance="herbbag"><!-- Blauer Baumringel -->
<item weight="0" score="10" herb="yes"/>
</resource>
<resource name="h5" appearance="herbbag"><!-- Elfenlieb -->
<item weight="0" score="10" herb="yes"/>
</resource>
<resource name="h6" appearance="herbbag"><!-- Gurgelkraut -->
<item weight="0" score="10" herb="yes"/>
</resource>
<resource name="h7" appearance="herbbag"><!-- Knotiger Saugwurz -->
<item weight="0" score="10" herb="yes"/>
</resource>
<resource name="h8" appearance="herbbag"><!-- Blasenmorchel -->
<item weight="0" score="10" herb="yes"/>
</resource>
<resource name="h9" appearance="herbbag"><!-- Wasserfinder -->
<item weight="0" score="10" herb="yes"/>
</resource>
<resource name="h10" appearance="herbbag">
<item weight="0" score="10" herb="yes"/>
</resource>
<resource name="h11" appearance="herbbag">
<item weight="0" score="10" herb="yes"/>
</resource>
<resource name="h12" appearance="herbbag"><!-- Windbeutel -->
<item weight="0" score="10" herb="yes"/>
</resource>
<resource name="h13" appearance="herbbag">
<item weight="0" score="10" herb="yes"/>
</resource>
<resource name="h14" appearance="herbbag"><!-- Alraune -->
<item weight="0" score="10" herb="yes"/>
</resource>
<resource name="h15" appearance="herbbag">
<item weight="0" score="10" herb="yes"/>
</resource>
<resource name="h16" appearance="herbbag">
<item weight="0" score="10" herb="yes"/>
</resource>
<resource name="h17" appearance="herbbag">
<item weight="0" score="10" herb="yes"/>
</resource>
<resource name="h18" appearance="herbbag">
<item weight="0" score="10" herb="yes"/>
</resource>
<resource name="h19" appearance="herbbag">
<item weight="0" score="10" herb="yes"/>
</resource>
<resource name="h20" appearance="herbbag">
<item weight="0" score="10" herb="yes"/>
</resource>
</resources>
<?xml version="1.0"?>
<resources>
<!-- this file contains herbs that are part of the alchemy system -->
<resource name="h0" appearance="herbbag"><!-- Flachwurz -->
<item weight="0" score="10" herb="yes"/>
</resource>
<resource name="h1" appearance="herbbag"><!-- Würziger Wagemut -->
<item weight="0" score="10" herb="yes"/>
</resource>
<resource name="h2" appearance="herbbag"><!-- Eulenauge -->
<item weight="0" score="10" herb="yes"/>
</resource>
<resource name="h3" appearance="herbbag"><!-- Grüner Spinnerich -->
<item weight="0" score="10" herb="yes"/>
</resource>
<resource name="h4" appearance="herbbag"><!-- Blauer Baumringel -->
<item weight="0" score="10" herb="yes"/>
</resource>
<resource name="h5" appearance="herbbag"><!-- Elfenlieb -->
<item weight="0" score="10" herb="yes"/>
</resource>
<resource name="h6" appearance="herbbag"><!-- Gurgelkraut -->
<item weight="0" score="10" herb="yes"/>
</resource>
<resource name="h7" appearance="herbbag"><!-- Knotiger Saugwurz -->
<item weight="0" score="10" herb="yes"/>
</resource>
<resource name="h8" appearance="herbbag"><!-- Blasenmorchel -->
<item weight="0" score="10" herb="yes"/>
</resource>
<resource name="h9" appearance="herbbag"><!-- Wasserfinder -->
<item weight="0" score="10" herb="yes"/>
</resource>
<resource name="h10" appearance="herbbag">
<item weight="0" score="10" herb="yes"/>
</resource>
<resource name="h11" appearance="herbbag">
<item weight="0" score="10" herb="yes"/>
</resource>
<resource name="h12" appearance="herbbag"><!-- Windbeutel -->
<item weight="0" score="10" herb="yes"/>
</resource>
<resource name="h13" appearance="herbbag">
<item weight="0" score="10" herb="yes"/>
</resource>
<resource name="h14" appearance="herbbag"><!-- Alraune -->
<item weight="0" score="10" herb="yes"/>
</resource>
<resource name="h15" appearance="herbbag">
<item weight="0" score="10" herb="yes"/>
</resource>
<resource name="h16" appearance="herbbag">
<item weight="0" score="10" herb="yes"/>
</resource>
<resource name="h17" appearance="herbbag">
<item weight="0" score="10" herb="yes"/>
</resource>
<resource name="h18" appearance="herbbag">
<item weight="0" score="10" herb="yes"/>
</resource>
<resource name="h19" appearance="herbbag">
<item weight="0" score="10" herb="yes"/>
</resource>
<resource name="h20" appearance="herbbag">
<item weight="0" score="10" herb="yes"/>
</resource>
</resources>

View file

@ -1,156 +1,156 @@
<?xml version="1.0"?>
<resources>
<resource name="ao_healing" appearance="amulet">
<item weight="0" score="6000"/>
</resource>
<resource name="aots" appearance="amulet">
<item weight="0" score="6000"/>
</resource>
<resource name="roi" appearance="">
<item weight="0" score="6000"/>
</resource>
<resource name="rop" appearance="">
<item weight="0" score="6000"/>
</resource>
<resource name="roqf" appearance="">
<item weight="0" score="6000"/>
</resource>
<resource name="trollbelt">
<item weight="0" score="6000"/>
</resource>
<resource name="presspass" cursed="yes">
<item weight="0" score="6000"/>
</resource>
<resource name="aurafocus">
<item weight="100" score="6000"/>
</resource>
<resource name="sphereofinv" appearance="">
<item weight="100" score="6000"/>
</resource>
<resource name="magicbag">
<item big="yes" notlost="yes" weight="100" score="6000"/>
</resource>
<resource name="magicherbbag" appearance="">
<item weight="100" score="6000"/>
</resource>
<resource name="ao_chastity" appearance="amulet">
<item weight="0" score="6000"/>
</resource>
<resource name="fairyboot">
<item weight="0" score="6000"/>
</resource>
<resource name="aoc" appearance="amulet">
<item weight="100">
<function name="use" value="use_birthdayamulet"/>
</item>
</resource>
<resource name="dreameye">
<item weight="100">
<function name="use" value="use_tacticcrystal"/>
</item>
</resource>
<resource name="pegasus">
<item weight="5000" notlost="yes" big="yes" score="6000" capacity="7000" animal="yes"/>
</resource>
<resource name="elvenhorse">
<item weight="5000" notlost="yes" big="yes" score="6000" capacity="7000" animal="yes">
<function name="give" value="givehorses"/>
</item>
</resource>
<resource name="dolphin">
<item weight="5000" notlost="yes" big="yes" score="6000" capacity="7000" animal="yes"/>
</resource>
<resource name="seaserpenthead">
<item weight="500" score="400"/>
</resource>
<resource name="dragonblood">
<item weight="100" score="100"/>
</resource>
<resource name="dragonhead">
<item weight="500" score="300"/>
</resource>
<!-- XE items -->
<resource name="skillpotion">
<!-- gives user one free learning attempt -->
<item weight="0">
<function name="use" value="use_skillpotion"/>
</item>
</resource>
<resource name="manacrystal">
<!-- gives user free aura -->
<item weight="0">
<function name="use" value="use_manacrystal"/>
</item>
</resource>
<!-- xmas items -->
<resource name="mistletoe">
<!-- Sets the chance of escape in a fight to 100 percent -->
<item notlost="yes" weight="0">
<function name="use" value="usemistletoe"/>
</item>
</resource>
<resource name="speedsail">
<item weight="0">
<function name="use" value="use_speedsail"/>
</item>
</resource>
<!-- items -->
<resource name="cart" big="true">
<item capacity="14000" weight="4000" score="60" vehicle="yes">
<construction skill="cartmaking" minskill="1" reqsize="1">
<requirement type="log" quantity="5"/>
</construction>
</item>
</resource>
<resource name="antimagic" appearance="amulet">
<item weight="0" score="2000">
<function name="use" value="use_antimagiccrystal"/>
</item>
</resource>
<resource name="wand_of_tears">
<item notlost="yes" weight="0">
<function name="use" value="use_wand_of_tears"/>
</item>
</resource>
<resource name="catapultammo">
<item weight="1000">
<construction skill="quarrying" minskill="3" reqsize="1">
<requirement type="stone" quantity="1"/>
</construction>
</item>
</resource>
<resource name="toadslime" appearance="vial">
<item weight="100" score="0"/>
</resource>
</resources>
<?xml version="1.0"?>
<resources>
<resource name="ao_healing" appearance="amulet">
<item weight="0" score="6000"/>
</resource>
<resource name="aots" appearance="amulet">
<item weight="0" score="6000"/>
</resource>
<resource name="roi" appearance="">
<item weight="0" score="6000"/>
</resource>
<resource name="rop" appearance="">
<item weight="0" score="6000"/>
</resource>
<resource name="roqf" appearance="">
<item weight="0" score="6000"/>
</resource>
<resource name="trollbelt">
<item weight="0" score="6000"/>
</resource>
<resource name="presspass" cursed="yes">
<item weight="0" score="6000"/>
</resource>
<resource name="aurafocus">
<item weight="100" score="6000"/>
</resource>
<resource name="sphereofinv" appearance="">
<item weight="100" score="6000"/>
</resource>
<resource name="magicbag">
<item big="yes" notlost="yes" weight="100" score="6000"/>
</resource>
<resource name="magicherbbag" appearance="">
<item weight="100" score="6000"/>
</resource>
<resource name="ao_chastity" appearance="amulet">
<item weight="0" score="6000"/>
</resource>
<resource name="fairyboot">
<item weight="0" score="6000"/>
</resource>
<resource name="aoc" appearance="amulet">
<item weight="100">
<function name="use" value="use_birthdayamulet"/>
</item>
</resource>
<resource name="dreameye">
<item weight="100">
<function name="use" value="use_tacticcrystal"/>
</item>
</resource>
<resource name="pegasus">
<item weight="5000" notlost="yes" big="yes" score="6000" capacity="7000" animal="yes"/>
</resource>
<resource name="elvenhorse">
<item weight="5000" notlost="yes" big="yes" score="6000" capacity="7000" animal="yes">
<function name="give" value="givehorses"/>
</item>
</resource>
<resource name="dolphin">
<item weight="5000" notlost="yes" big="yes" score="6000" capacity="7000" animal="yes"/>
</resource>
<resource name="seaserpenthead">
<item weight="500" score="400"/>
</resource>
<resource name="dragonblood">
<item weight="100" score="100"/>
</resource>
<resource name="dragonhead">
<item weight="500" score="300"/>
</resource>
<!-- XE items -->
<resource name="skillpotion">
<!-- gives user one free learning attempt -->
<item weight="0">
<function name="use" value="use_skillpotion"/>
</item>
</resource>
<resource name="manacrystal">
<!-- gives user free aura -->
<item weight="0">
<function name="use" value="use_manacrystal"/>
</item>
</resource>
<!-- xmas items -->
<resource name="mistletoe">
<!-- Sets the chance of escape in a fight to 100 percent -->
<item notlost="yes" weight="0">
<function name="use" value="usemistletoe"/>
</item>
</resource>
<resource name="speedsail">
<item weight="0">
<function name="use" value="use_speedsail"/>
</item>
</resource>
<!-- items -->
<resource name="cart" big="true">
<item capacity="14000" weight="4000" score="60" vehicle="yes">
<construction skill="cartmaking" minskill="1" reqsize="1">
<requirement type="log" quantity="5"/>
</construction>
</item>
</resource>
<resource name="antimagic" appearance="amulet">
<item weight="0" score="2000">
<function name="use" value="use_antimagiccrystal"/>
</item>
</resource>
<resource name="wand_of_tears">
<item notlost="yes" weight="0">
<function name="use" value="use_wand_of_tears"/>
</item>
</resource>
<resource name="catapultammo">
<item weight="1000">
<construction skill="quarrying" minskill="3" reqsize="1">
<requirement type="stone" quantity="1"/>
</construction>
</item>
</resource>
<resource name="toadslime" appearance="vial">
<item weight="100" score="0"/>
</resource>
</resources>

View file

@ -1,26 +1,26 @@
<?xml version="1.0"?>
<resources>
<!-- this file contains luxury items that are part of the trade system -->
<resource name="balm">
<item weight="200"><luxury price="4"/></item>
</resource>
<resource name="spice">
<item weight="200"><luxury price="5"/></item>
</resource>
<resource name="jewel">
<item weight="100"><luxury price="7"/></item>
</resource>
<resource name="myrrh">
<item weight="200"><luxury price="5"/></item>
</resource>
<resource name="oil">
<item weight="300"><luxury price="3"/></item>
</resource>
<resource name="silk">
<item weight="300"><luxury price="6"/></item>
</resource>
<resource name="incense">
<item weight="200"><luxury price="4"/></item>
</resource>
</resources>
<?xml version="1.0"?>
<resources>
<!-- this file contains luxury items that are part of the trade system -->
<resource name="balm">
<item weight="200"><luxury price="4"/></item>
</resource>
<resource name="spice">
<item weight="200"><luxury price="5"/></item>
</resource>
<resource name="jewel">
<item weight="100"><luxury price="7"/></item>
</resource>
<resource name="myrrh">
<item weight="200"><luxury price="5"/></item>
</resource>
<resource name="oil">
<item weight="300"><luxury price="3"/></item>
</resource>
<resource name="silk">
<item weight="300"><luxury price="6"/></item>
</resource>
<resource name="incense">
<item weight="200"><luxury price="4"/></item>
</resource>
</resources>

View file

@ -1,197 +1,197 @@
<?xml version="1.0"?>
<resources>
<!-- this file contains potions that are part of the alchemy system -->
<!-- potions -->
<resource name="p0" appearance="vial">
<item weight="0" score="30">
<function name="use" value="usepotion"/>
<potion level="1"/>
<construction skill="alchemy" minskill="2" reqsize="1">
<requirement type="h4"/>
<requirement type="h12"/>
</construction>
</item>
</resource>
<resource name="goliathwater" appearance="vial">
<item weight="0" score="30">
<function name="use" value="usepotion"/>
<potion level="1"/>
<construction skill="alchemy" minskill="2" reqsize="1">
<requirement type="h6"/>
<requirement type="h13"/>
</construction>
</item>
</resource>
<resource name="truthpotion" appearance="vial">
<item weight="0" score="30">
<function name="use" value="usepotion"/>
<potion level="1"/>
<construction skill="alchemy" minskill="2" reqsize="1">
<requirement type="h0"/>
<requirement type="h13"/>
</construction>
</item>
</resource>
<resource name="p2" appearance="vial">
<item weight="0" score="30">
<function name="use" value="usepotion"/>
<potion level="1"/>
<construction skill="alchemy" minskill="2" reqsize="1">
<requirement type="h5"/>
<requirement type="h7"/>
</construction>
</item>
</resource>
<resource name="p3" appearance="vial">
<item weight="0" score="60">
<function name="use" value="usepotion"/>
<potion level="2"/>
<construction skill="alchemy" minskill="4" reqsize="1">
<requirement type="h14"/>
<requirement type="h16"/>
<requirement type="h1"/>
</construction>
</item>
</resource>
<resource name="ointment" appearance="vial">
<!-- Wundsalbe -->
<item weight="0" score="60">
<function name="use" value="usehealingpotion"/>
<potion level="2"/>
<construction skill="alchemy" minskill="4" reqsize="1">
<requirement type="h19"/>
<requirement type="h4"/>
<requirement type="h1"/>
</construction>
</item>
</resource>
<resource name="peasantblood" appearance="vial">
<!-- Bauernblut -->
<item weight="0" score="60">
<function name="use" value="usebloodpotion"/>
<potion level="2"/>
<construction skill="alchemy" minskill="4" reqsize="1">
<requirement type="h17"/>
<requirement type="h13"/>
<requirement type="h4"/>
<requirement type="peasant"/>
</construction>
</item>
</resource>
<resource name="p6" appearance="vial">
<item weight="0" score="90">
<function name="use" value="usepotion"/>
<potion level="3"/>
<construction skill="alchemy" minskill="6" reqsize="1">
<requirement type="h9"/>
<requirement type="h15"/>
<requirement type="h12"/>
<requirement type="h6"/>
</construction>
</item>
</resource>
<resource name="p7" appearance="vial">
<item weight="0" score="90">
<function name="useonother" value="usefoolpotion"/>
<potion level="3"/>
<construction skill="alchemy" minskill="6" reqsize="1">
<requirement type="h2"/>
<requirement type="h3"/>
<requirement type="h17"/>
<requirement type="h13"/>
</construction>
</item>
</resource>
<resource name="nestwarmth" appearance="vial">
<item weight="0" score="90">
<function name="use" value="usewarmthpotion"/>
<potion level="3"/>
<construction skill="alchemy" minskill="6" reqsize="1">
<requirement type="h18"/>
<requirement type="h3"/>
<requirement type="h16"/>
<requirement type="h10"/>
</construction>
</item>
</resource>
<resource name="p9" appearance="vial">
<item weight="0" score="90">
<function name="use" value="usepotion"/>
<potion level="3"/>
<construction skill="alchemy" minskill="6" reqsize="1">
<requirement type="h4"/>
<requirement type="h11"/>
<requirement type="h10"/>
<requirement type="h7"/>
</construction>
</item>
</resource>
<resource name="p10" appearance="vial">
<item weight="0" score="90">
<function name="use" value="usepotion"/>
<potion level="3"/>
<construction skill="alchemy" minskill="6" reqsize="1">
<requirement type="h19"/>
<requirement type="h14"/>
<requirement type="h0"/>
<requirement type="h11"/>
</construction>
</item>
</resource>
<resource name="p11" appearance="vial">
<item weight="0" score="120">
<function name="use" value="usepotion"/>
<potion level="4"/>
<construction skill="alchemy" minskill="8" reqsize="1">
<requirement type="h14"/>
<requirement type="h20"/>
<requirement type="h15"/>
<requirement type="h8"/>
<requirement type="h5"/>
</construction>
</item>
</resource>
<resource name="p13" appearance="vial">
<item weight="0" score="120">
<function name="use" value="usepotion"/>
<potion level="4"/>
<construction skill="alchemy" minskill="8" reqsize="1">
<requirement type="h5"/>
<requirement type="h9"/>
<requirement type="h12"/>
<requirement type="h3"/>
<requirement type="h8"/>
<requirement type="dragonblood"/>
</construction>
</item>
</resource>
<resource name="p14" appearance="vial">
<item weight="0" score="120">
<function name="use" value="usepotion"/>
<potion level="4"/>
<construction skill="alchemy" minskill="8" reqsize="1">
<requirement type="h6"/>
<requirement type="h12"/>
<requirement type="h18"/>
<requirement type="h5"/>
<requirement type="h16"/>
</construction>
</item>
</resource>
</resources>
<?xml version="1.0"?>
<resources>
<!-- this file contains potions that are part of the alchemy system -->
<!-- potions -->
<resource name="p0" appearance="vial">
<item weight="0" score="30">
<function name="use" value="usepotion"/>
<potion level="1"/>
<construction skill="alchemy" minskill="2" reqsize="1">
<requirement type="h4"/>
<requirement type="h12"/>
</construction>
</item>
</resource>
<resource name="goliathwater" appearance="vial">
<item weight="0" score="30">
<function name="use" value="usepotion"/>
<potion level="1"/>
<construction skill="alchemy" minskill="2" reqsize="1">
<requirement type="h6"/>
<requirement type="h13"/>
</construction>
</item>
</resource>
<resource name="truthpotion" appearance="vial">
<item weight="0" score="30">
<function name="use" value="usepotion"/>
<potion level="1"/>
<construction skill="alchemy" minskill="2" reqsize="1">
<requirement type="h0"/>
<requirement type="h13"/>
</construction>
</item>
</resource>
<resource name="p2" appearance="vial">
<item weight="0" score="30">
<function name="use" value="usepotion"/>
<potion level="1"/>
<construction skill="alchemy" minskill="2" reqsize="1">
<requirement type="h5"/>
<requirement type="h7"/>
</construction>
</item>
</resource>
<resource name="p3" appearance="vial">
<item weight="0" score="60">
<function name="use" value="usepotion"/>
<potion level="2"/>
<construction skill="alchemy" minskill="4" reqsize="1">
<requirement type="h14"/>
<requirement type="h16"/>
<requirement type="h1"/>
</construction>
</item>
</resource>
<resource name="ointment" appearance="vial">
<!-- Wundsalbe -->
<item weight="0" score="60">
<function name="use" value="usehealingpotion"/>
<potion level="2"/>
<construction skill="alchemy" minskill="4" reqsize="1">
<requirement type="h19"/>
<requirement type="h4"/>
<requirement type="h1"/>
</construction>
</item>
</resource>
<resource name="peasantblood" appearance="vial">
<!-- Bauernblut -->
<item weight="0" score="60">
<function name="use" value="usebloodpotion"/>
<potion level="2"/>
<construction skill="alchemy" minskill="4" reqsize="1">
<requirement type="h17"/>
<requirement type="h13"/>
<requirement type="h4"/>
<requirement type="peasant"/>
</construction>
</item>
</resource>
<resource name="p6" appearance="vial">
<item weight="0" score="90">
<function name="use" value="usepotion"/>
<potion level="3"/>
<construction skill="alchemy" minskill="6" reqsize="1">
<requirement type="h9"/>
<requirement type="h15"/>
<requirement type="h12"/>
<requirement type="h6"/>
</construction>
</item>
</resource>
<resource name="p7" appearance="vial">
<item weight="0" score="90">
<function name="useonother" value="usefoolpotion"/>
<potion level="3"/>
<construction skill="alchemy" minskill="6" reqsize="1">
<requirement type="h2"/>
<requirement type="h3"/>
<requirement type="h17"/>
<requirement type="h13"/>
</construction>
</item>
</resource>
<resource name="nestwarmth" appearance="vial">
<item weight="0" score="90">
<function name="use" value="usewarmthpotion"/>
<potion level="3"/>
<construction skill="alchemy" minskill="6" reqsize="1">
<requirement type="h18"/>
<requirement type="h3"/>
<requirement type="h16"/>
<requirement type="h10"/>
</construction>
</item>
</resource>
<resource name="p9" appearance="vial">
<item weight="0" score="90">
<function name="use" value="usepotion"/>
<potion level="3"/>
<construction skill="alchemy" minskill="6" reqsize="1">
<requirement type="h4"/>
<requirement type="h11"/>
<requirement type="h10"/>
<requirement type="h7"/>
</construction>
</item>
</resource>
<resource name="p10" appearance="vial">
<item weight="0" score="90">
<function name="use" value="usepotion"/>
<potion level="3"/>
<construction skill="alchemy" minskill="6" reqsize="1">
<requirement type="h19"/>
<requirement type="h14"/>
<requirement type="h0"/>
<requirement type="h11"/>
</construction>
</item>
</resource>
<resource name="p11" appearance="vial">
<item weight="0" score="120">
<function name="use" value="usepotion"/>
<potion level="4"/>
<construction skill="alchemy" minskill="8" reqsize="1">
<requirement type="h14"/>
<requirement type="h20"/>
<requirement type="h15"/>
<requirement type="h8"/>
<requirement type="h5"/>
</construction>
</item>
</resource>
<resource name="p13" appearance="vial">
<item weight="0" score="120">
<function name="use" value="usepotion"/>
<potion level="4"/>
<construction skill="alchemy" minskill="8" reqsize="1">
<requirement type="h5"/>
<requirement type="h9"/>
<requirement type="h12"/>
<requirement type="h3"/>
<requirement type="h8"/>
<requirement type="dragonblood"/>
</construction>
</item>
</resource>
<resource name="p14" appearance="vial">
<item weight="0" score="120">
<function name="use" value="usepotion"/>
<potion level="4"/>
<construction skill="alchemy" minskill="8" reqsize="1">
<requirement type="h6"/>
<requirement type="h12"/>
<requirement type="h18"/>
<requirement type="h5"/>
<requirement type="h16"/>
</construction>
</item>
</resource>
</resources>

View file

@ -1,15 +1,15 @@
<?xml version="1.0"?>
<resources xmlns:xi="http://www.w3.org/2001/XInclude">
<!-- this file contains resources that can be mined in some way (anything with a resourcelimit) -->
<xi:include href="../resources/horse.xml"/>
<xi:include href="../resources/hp.xml"/>
<xi:include href="../resources/iron.xml"/>
<xi:include href="../resources/laen.xml"/>
<xi:include href="../resources/log.xml"/>
<xi:include href="../resources/mallorn.xml"/>
<xi:include href="../resources/mallornseed.xml"/>
<xi:include href="../resources/seed.xml"/>
<xi:include href="../resources/peasant.xml"/>
<xi:include href="../resources/stone.xml"/>
</resources>
<?xml version="1.0"?>
<resources xmlns:xi="http://www.w3.org/2001/XInclude">
<!-- this file contains resources that can be mined in some way (anything with a resourcelimit) -->
<xi:include href="../resources/horse.xml"/>
<xi:include href="../resources/hp.xml"/>
<xi:include href="../resources/iron.xml"/>
<xi:include href="../resources/laen.xml"/>
<xi:include href="../resources/log.xml"/>
<xi:include href="../resources/mallorn.xml"/>
<xi:include href="../resources/mallornseed.xml"/>
<xi:include href="../resources/seed.xml"/>
<xi:include href="../resources/peasant.xml"/>
<xi:include href="../resources/stone.xml"/>
</resources>

View file

@ -1,24 +1,24 @@
<?xml version="1.0"?>
<resources xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="../weapons/axe.xml"/>
<xi:include href="../weapons/bow.xml"/>
<xi:include href="../weapons/catapult.xml"/>
<xi:include href="../weapons/crossbow.xml"/>
<xi:include href="../weapons/firesword.xml"/>
<xi:include href="../weapons/greatbow.xml"/>
<xi:include href="../weapons/greatsword.xml"/>
<xi:include href="../weapons/halberd.xml"/>
<xi:include href="../weapons/laensword.xml"/>
<xi:include href="../weapons/lance.xml"/>
<xi:include href="../weapons/mallornbow.xml"/>
<xi:include href="../weapons/mallorncrossbow.xml"/>
<xi:include href="../weapons/mallornlance.xml"/>
<xi:include href="../weapons/mallornspear.xml"/>
<xi:include href="../weapons/runesword.xml"/>
<xi:include href="../weapons/rustyaxe.xml"/>
<xi:include href="../weapons/rustygreatsword.xml"/>
<xi:include href="../weapons/rustyhalberd.xml"/>
<xi:include href="../weapons/rustysword.xml"/>
<xi:include href="../weapons/spear.xml"/>
<xi:include href="../weapons/sword.xml"/>
</resources>
<?xml version="1.0"?>
<resources xmlns:xi="http://www.w3.org/2001/XInclude">
<xi:include href="../weapons/axe.xml"/>
<xi:include href="../weapons/bow.xml"/>
<xi:include href="../weapons/catapult.xml"/>
<xi:include href="../weapons/crossbow.xml"/>
<xi:include href="../weapons/firesword.xml"/>
<xi:include href="../weapons/greatbow.xml"/>
<xi:include href="../weapons/greatsword.xml"/>
<xi:include href="../weapons/halberd.xml"/>
<xi:include href="../weapons/laensword.xml"/>
<xi:include href="../weapons/lance.xml"/>
<xi:include href="../weapons/mallornbow.xml"/>
<xi:include href="../weapons/mallorncrossbow.xml"/>
<xi:include href="../weapons/mallornlance.xml"/>
<xi:include href="../weapons/mallornspear.xml"/>
<xi:include href="../weapons/runesword.xml"/>
<xi:include href="../weapons/rustyaxe.xml"/>
<xi:include href="../weapons/rustygreatsword.xml"/>
<xi:include href="../weapons/rustyhalberd.xml"/>
<xi:include href="../weapons/rustysword.xml"/>
<xi:include href="../weapons/spear.xml"/>
<xi:include href="../weapons/sword.xml"/>
</resources>

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,399 +1,399 @@
<?xml version="1.0"?>
<equipment>
<!-- equipment given to familiars -->
<set name="lynx_familiar">
<skill name="espionage" level="1"/>
<skill name="magic" level="1"/>
<skill name="stealth" level="1"/>
<skill name="perception" level="1"/>
</set>
<set name="tunnelworm_familiar">
<skill name="magic" level="1"/>
<skill name="mining" level="1"/>
<skill name="forestry" level="1"/>
<skill name="stamina" level="1"/>
</set>
<set name="eagle_familiar">
<skill name="magic" level="1"/>
<skill name="perception" level="1"/>
</set>
<set name="rat_familiar">
<skill name="magic" level="1"/>
<skill name="espionage" level="1"/>
<skill name="stealth" level="1"/>
<skill name="perception" level="1"/>
<skill name="stamina" level="6"/>
</set>
<set name="songdragon_familiar">
<skill name="magic" level="1"/>
<!-- spells -->
<spell name="flee" school="gray"/>
<spell name="sleep" school="gray"/>
<spell name="frighten" school="gray"/>
</set>
<set name="nymph_familiar">
<skill name="magic" level="1"/>
<skill name="bow" level="1"/>
<skill name="herbalism" level="1"/>
<skill name="training" level="1"/>
<skill name="riding" level="1"/>
<skill name="espionage" level="1"/>
<skill name="stealth" level="1"/>
<skill name="entertainment" level="1"/>
<skill name="perception" level="1"/>
<!-- spells -->
<spell name="seduction" school="gray"/>
<spell name="calm_monster" school="gray"/>
<spell name="song_of_confusion" school="gray"/>
<spell name="appeasement" school="gray"/>
</set>
<set name="unicorn_familiar">
<skill name="magic" level="1"/>
<skill name="stealth" level="1"/>
<skill name="perception" level="1"/>
<!-- spells -->
<spell name="resist_magic" school="gray"/>
<spell name="song_of_peace" school="gray"/>
<spell name="calm_monster" school="gray"/>
<spell name="heroic_song" school="gray"/>
<spell name="song_of_healing" school="gray"/>
<spell name="appeasement" school="gray"/>
</set>
<set name="direwolf_familiar">
<skill name="magic" level="1"/>
<skill name="perception" level="1"/>
</set>
<set name="ghost_familiar">
<skill name="magic" level="1"/>
<!-- spells -->
<spell name="steal_aura" school="gray"/>
<spell name="frighten" school="gray"/>
<spell name="summonundead" school="gray"/>
</set>
<set name="imp_familiar">
<skill name="magic" level="1"/>
<skill name="espionage" level="1"/>
<skill name="stealth" level="1"/>
<skill name="perception" level="1"/>
<skill name="taxation" level="1"/>
<!-- spells -->
<spell name="steal_aura" school="gray"/>
<spell name="shapeshift" school="gray"/>
<spell name="seduction" school="gray"/>
</set>
<set name="dreamcat_familiar">
<skill name="magic" level="1"/>
<skill name="espionage" level="1"/>
<skill name="stealth" level="1"/>
<skill name="perception" level="1"/>
<skill name="taxation" level="1"/>
<!-- spells -->
<spell name="shapeshift" school="gray"/>
<spell name="transferauratraum" school="gray"/>
</set>
<set name="fairy_familiar">
<skill name="magic" level="1"/>
<!-- spells -->
<spell name="appeasement" school="gray"/>
<spell name="calm_monster" school="gray"/>
<spell name="seduction" school="gray"/>
</set>
<set name="owl_familiar">
<skill name="magic" level="1"/>
<skill name="espionage" level="1"/>
<skill name="stealth" level="1"/>
<skill name="perception" level="1"/>
</set>
<set name="hellcat_familiar">
<skill name="magic" level="1"/>
<skill name="perception" level="1"/>
</set>
<set name="tiger_familiar">
<skill name="magic" level="1"/>
<skill name="perception" level="1"/>
</set>
<!-- one equipment-set per player-race for the first unit in a faction -->
<set name="first_dwarf">
<item name="axe" amount="1"/>
<item name="chainmail" amount="1"/>
<skill name="melee" level="1"/>
</set>
<set name="first_elf">
<item name="fairyboot" amount="1"/>
<callback name="equip_newunits"/>
</set>
<set name="first_orc">
<skill name="polearm" level="4"/>
<skill name="melee" level="4"/>
<skill name="crossbow" level="4"/>
<skill name="catapult" level="4"/>
<skill name="bow" level="4"/>
</set>
<set name="first_goblin">
<item name="roi" amount="1"/>
<callback name="equip_newunits"/>
</set>
<set name="first_human">
<callback name="equip_newunits"/>
</set>
<set name="first_troll">
<skill name="building" level="1"/>
<skill name="perception" level="3"/>
<item name="stone" amount="50"/>
</set>
<set name="first_demon">
<skill name="stamina" level="15"/>
</set>
<set name="first_insect">
<item name="nestwarmth" amount="9"/>
</set>
<set name="first_halfling">
<skill name="trade" level="1"/>
<skill name="riding" level="2"/>
<item name="horse" amount="2"/>
<item name="cart" amount="1"/>
<item name="balm" amount="5"/>
<item name="spice" amount="5"/>
<item name="myrrh" amount="5"/>
<item name="jewel" amount="5"/>
<item name="oil" amount="5"/>
<item name="silk" amount="5"/>
<item name="incense" amount="5"/>
</set>
<set name="first_cat">
<item name="roi" amount="1"/>
<callback name="equip_newunits"/>
</set>
<set name="first_aquarian">
<skill name="sailing" level="1"/>
<callback name="equip_newunits"/>
</set>
<set name="first_centaur">
<callback name="equip_newunits"/>
</set>
<!-- equipment-sets for random encounters -->
<set name="random_desert">
<skill name="melee" level="d2"/>
<skill name="trade" level="d3"/>
<skill name="riding" level="d2+1"/>
<skill name="training" level="d2+1"/>
<item name="horse" amount="1"/>
<item name="sword" amount="1"/>
<item name="money" amount="d30+19"/>
</set>
<set name="random_swamp">
<skill name="stealth" level="d3+1"/>
<skill name="polearm" level="d3+1"/>
<item name="spear" amount="1"/>
<item name="money" amount="d20+9"/>
</set>
<set name="random_glacier">
<skill name="armorer" level="d2+1"/>
<skill name="melee" level="d2+1"/>
<item name="sword" amount="1"/>
<item name="money" amount="d20+19"/>
</set>
<set name="random_mountain">
<skill name="armorer" level="d2+1"/>
<skill name="melee" level="d2+1"/>
<skill name="trade" level="d3"/>
<item name="sword" amount="1"/>
<item name="money" amount="d40+59"/>
<subset chance="0.6">
<set name="item_plate"/>
</subset>
</set>
<set name="random_highland">
<skill name="melee" level="d2"/>
<item name="sword" amount="1"/>
<item name="money" amount="d10+19"/>
</set>
<set name="random_forest">
<skill name="stealth" level="d2"/>
<skill name="perception" level="d2+1"/>
<skill name="bow" level="d3+1"/>
<item name="bow" amount="1"/>
<item name="money" amount="d20+9"/>
<subset chance="0.2">
<set name="random_herbalist"/>
</subset>
</set>
<set name="random_herbalist">
<skill name="herbalism" level="d2"/>
</set>
<set name="random_villagers">
<item name="money" amount="d80+19"/>
<skill name="cartmaking" level="d2-1"/>
<skill name="mining" level="d2-1"/>
<skill name="quarrying" level="d2-1"/>
<skill name="forestry" level="d2-1"/>
<item name="horse" amount="2"/>
<item name="wagon" amount="d2-1"/>
<item name="money" amount="d30+10"/>
</set>
<set name="random_plain">
<item name="money" amount="d80+19"/>
<subset>
<set name="random_sword" chance="0.25"/>
<set name="random_spear" chance="0.25"/>
<set name="random_crossbow" chance="0.25"/>
<set name="random_bow" chance="0.25"/>
</subset>
<subset chance="0.4">
<set name="item_chain"/>
</subset>
<subset chance="0.3">
<set name="random_rider"/>
</subset>
</set>
<set name="random_spear">
<skill name="polearm" level="d3"/>
<item name="spear" amount="1"/>
</set>
<set name="random_sword">
<skill name="sword" level="d3"/>
<item name="sword" amount="1"/>
</set>
<set name="random_crossbow">
<skill name="crossbow" level="d3"/>
<item name="crossbow" amount="1"/>
</set>
<set name="random_bow">
<skill name="bow" level="d3"/>
<item name="bow" amount="1"/>
</set>
<set name="random_rider">
<item name="horse" amount="1"/>
<skill name="riding" level="d3"/>
</set>
<set name="recruited_dracoid">
<!-- dracoiden, von drachen rekrutiert -->
<skill name="polearm" level="d4+2"/>
<skill name="melee" level="d4+2"/>
<skill name="bow" level="d3+1"/>
<subset>
<!-- dracoiden haben immer eine von drei waffen -->
<set name="item_sword" chance="0.33"/>
<set name="item_spear" chance="0.33"/>
<set name="item_bow" chance="0.34"/>
</subset>
</set>
<set name="rising_undead">
<!-- untote, von den graebern auferstanden -->
<item name="rustysword" amount="1"/>
<item name="rustychainmail" amount="d2-1"/>
<subset chance="0.3">
<set name="item_rustyshield"/>
</subset>
</set>
<!-- single-item sets (that can be given a percentage-chance in a subset) -->
<set name="item_plate">
<item name="plate" amount="1"/>
</set>
<set name="item_spear">
<item name="spear" amount="1"/>
</set>
<set name="item_bow">
<item name="bow" amount="1"/>
</set>
<set name="item_sword">
<item name="sword" amount="1"/>
</set>
<set name="item_chain">
<item name="chainmail" amount="1"/>
</set>
<set name="item_log">
<item name="log" amount="1"/>
</set>
<set name="item_rustychain">
<item name="rustychainmail" amount="1"/>
</set>
<set name="dragon_spoils">
<item name="dragonblood" amount="4"/>
<item name="dragonhead" amount="1"/>
</set>
<set name="youngdragon_spoils">
<item name="dragonblood" amount="1"/>
</set>
<set name="wyrm_spoils">
<item name="dragonblood" amount="10"/>
<item name="dragonhead" amount="1"/>
</set>
<!-- sets that are used by the monster-spawning code -->
<set name="monster_dragon">
<skill name="magic" level="4"/>
<skill name="stealth" level="1"/>
<skill name="stamina" level="1"/>
<skill name="perception" level="d3"/>
<item name="money" amount="d500+99"/>
</set>
<set name="monster_braineater">
<skill name="stealth" level="1"/>
<skill name="perception" level="1"/>
</set>
<set name="monster_seaserpent">
<skill name="magic" level="4"/>
<skill name="stealth" level="2"/>
<skill name="stamina" level="1"/>
<skill name="perception" level="3"/>
</set>
</equipment>
<?xml version="1.0"?>
<equipment>
<!-- equipment given to familiars -->
<set name="lynx_familiar">
<skill name="espionage" level="1"/>
<skill name="magic" level="1"/>
<skill name="stealth" level="1"/>
<skill name="perception" level="1"/>
</set>
<set name="tunnelworm_familiar">
<skill name="magic" level="1"/>
<skill name="mining" level="1"/>
<skill name="forestry" level="1"/>
<skill name="stamina" level="1"/>
</set>
<set name="eagle_familiar">
<skill name="magic" level="1"/>
<skill name="perception" level="1"/>
</set>
<set name="rat_familiar">
<skill name="magic" level="1"/>
<skill name="espionage" level="1"/>
<skill name="stealth" level="1"/>
<skill name="perception" level="1"/>
<skill name="stamina" level="6"/>
</set>
<set name="songdragon_familiar">
<skill name="magic" level="1"/>
<!-- spells -->
<spell name="flee" school="gray"/>
<spell name="sleep" school="gray"/>
<spell name="frighten" school="gray"/>
</set>
<set name="nymph_familiar">
<skill name="magic" level="1"/>
<skill name="bow" level="1"/>
<skill name="herbalism" level="1"/>
<skill name="training" level="1"/>
<skill name="riding" level="1"/>
<skill name="espionage" level="1"/>
<skill name="stealth" level="1"/>
<skill name="entertainment" level="1"/>
<skill name="perception" level="1"/>
<!-- spells -->
<spell name="seduction" school="gray"/>
<spell name="calm_monster" school="gray"/>
<spell name="song_of_confusion" school="gray"/>
<spell name="appeasement" school="gray"/>
</set>
<set name="unicorn_familiar">
<skill name="magic" level="1"/>
<skill name="stealth" level="1"/>
<skill name="perception" level="1"/>
<!-- spells -->
<spell name="resist_magic" school="gray"/>
<spell name="song_of_peace" school="gray"/>
<spell name="calm_monster" school="gray"/>
<spell name="heroic_song" school="gray"/>
<spell name="song_of_healing" school="gray"/>
<spell name="appeasement" school="gray"/>
</set>
<set name="direwolf_familiar">
<skill name="magic" level="1"/>
<skill name="perception" level="1"/>
</set>
<set name="ghost_familiar">
<skill name="magic" level="1"/>
<!-- spells -->
<spell name="steal_aura" school="gray"/>
<spell name="frighten" school="gray"/>
<spell name="summonundead" school="gray"/>
</set>
<set name="imp_familiar">
<skill name="magic" level="1"/>
<skill name="espionage" level="1"/>
<skill name="stealth" level="1"/>
<skill name="perception" level="1"/>
<skill name="taxation" level="1"/>
<!-- spells -->
<spell name="steal_aura" school="gray"/>
<spell name="shapeshift" school="gray"/>
<spell name="seduction" school="gray"/>
</set>
<set name="dreamcat_familiar">
<skill name="magic" level="1"/>
<skill name="espionage" level="1"/>
<skill name="stealth" level="1"/>
<skill name="perception" level="1"/>
<skill name="taxation" level="1"/>
<!-- spells -->
<spell name="shapeshift" school="gray"/>
<spell name="transferauratraum" school="gray"/>
</set>
<set name="fairy_familiar">
<skill name="magic" level="1"/>
<!-- spells -->
<spell name="appeasement" school="gray"/>
<spell name="calm_monster" school="gray"/>
<spell name="seduction" school="gray"/>
</set>
<set name="owl_familiar">
<skill name="magic" level="1"/>
<skill name="espionage" level="1"/>
<skill name="stealth" level="1"/>
<skill name="perception" level="1"/>
</set>
<set name="hellcat_familiar">
<skill name="magic" level="1"/>
<skill name="perception" level="1"/>
</set>
<set name="tiger_familiar">
<skill name="magic" level="1"/>
<skill name="perception" level="1"/>
</set>
<!-- one equipment-set per player-race for the first unit in a faction -->
<set name="first_dwarf">
<item name="axe" amount="1"/>
<item name="chainmail" amount="1"/>
<skill name="melee" level="1"/>
</set>
<set name="first_elf">
<item name="fairyboot" amount="1"/>
<callback name="equip_newunits"/>
</set>
<set name="first_orc">
<skill name="polearm" level="4"/>
<skill name="melee" level="4"/>
<skill name="crossbow" level="4"/>
<skill name="catapult" level="4"/>
<skill name="bow" level="4"/>
</set>
<set name="first_goblin">
<item name="roi" amount="1"/>
<callback name="equip_newunits"/>
</set>
<set name="first_human">
<callback name="equip_newunits"/>
</set>
<set name="first_troll">
<skill name="building" level="1"/>
<skill name="perception" level="3"/>
<item name="stone" amount="50"/>
</set>
<set name="first_demon">
<skill name="stamina" level="15"/>
</set>
<set name="first_insect">
<item name="nestwarmth" amount="9"/>
</set>
<set name="first_halfling">
<skill name="trade" level="1"/>
<skill name="riding" level="2"/>
<item name="horse" amount="2"/>
<item name="cart" amount="1"/>
<item name="balm" amount="5"/>
<item name="spice" amount="5"/>
<item name="myrrh" amount="5"/>
<item name="jewel" amount="5"/>
<item name="oil" amount="5"/>
<item name="silk" amount="5"/>
<item name="incense" amount="5"/>
</set>
<set name="first_cat">
<item name="roi" amount="1"/>
<callback name="equip_newunits"/>
</set>
<set name="first_aquarian">
<skill name="sailing" level="1"/>
<callback name="equip_newunits"/>
</set>
<set name="first_centaur">
<callback name="equip_newunits"/>
</set>
<!-- equipment-sets for random encounters -->
<set name="random_desert">
<skill name="melee" level="d2"/>
<skill name="trade" level="d3"/>
<skill name="riding" level="d2+1"/>
<skill name="training" level="d2+1"/>
<item name="horse" amount="1"/>
<item name="sword" amount="1"/>
<item name="money" amount="d30+19"/>
</set>
<set name="random_swamp">
<skill name="stealth" level="d3+1"/>
<skill name="polearm" level="d3+1"/>
<item name="spear" amount="1"/>
<item name="money" amount="d20+9"/>
</set>
<set name="random_glacier">
<skill name="armorer" level="d2+1"/>
<skill name="melee" level="d2+1"/>
<item name="sword" amount="1"/>
<item name="money" amount="d20+19"/>
</set>
<set name="random_mountain">
<skill name="armorer" level="d2+1"/>
<skill name="melee" level="d2+1"/>
<skill name="trade" level="d3"/>
<item name="sword" amount="1"/>
<item name="money" amount="d40+59"/>
<subset chance="0.6">
<set name="item_plate"/>
</subset>
</set>
<set name="random_highland">
<skill name="melee" level="d2"/>
<item name="sword" amount="1"/>
<item name="money" amount="d10+19"/>
</set>
<set name="random_forest">
<skill name="stealth" level="d2"/>
<skill name="perception" level="d2+1"/>
<skill name="bow" level="d3+1"/>
<item name="bow" amount="1"/>
<item name="money" amount="d20+9"/>
<subset chance="0.2">
<set name="random_herbalist"/>
</subset>
</set>
<set name="random_herbalist">
<skill name="herbalism" level="d2"/>
</set>
<set name="random_villagers">
<item name="money" amount="d80+19"/>
<skill name="cartmaking" level="d2-1"/>
<skill name="mining" level="d2-1"/>
<skill name="quarrying" level="d2-1"/>
<skill name="forestry" level="d2-1"/>
<item name="horse" amount="2"/>
<item name="wagon" amount="d2-1"/>
<item name="money" amount="d30+10"/>
</set>
<set name="random_plain">
<item name="money" amount="d80+19"/>
<subset>
<set name="random_sword" chance="0.25"/>
<set name="random_spear" chance="0.25"/>
<set name="random_crossbow" chance="0.25"/>
<set name="random_bow" chance="0.25"/>
</subset>
<subset chance="0.4">
<set name="item_chain"/>
</subset>
<subset chance="0.3">
<set name="random_rider"/>
</subset>
</set>
<set name="random_spear">
<skill name="polearm" level="d3"/>
<item name="spear" amount="1"/>
</set>
<set name="random_sword">
<skill name="sword" level="d3"/>
<item name="sword" amount="1"/>
</set>
<set name="random_crossbow">
<skill name="crossbow" level="d3"/>
<item name="crossbow" amount="1"/>
</set>
<set name="random_bow">
<skill name="bow" level="d3"/>
<item name="bow" amount="1"/>
</set>
<set name="random_rider">
<item name="horse" amount="1"/>
<skill name="riding" level="d3"/>
</set>
<set name="recruited_dracoid">
<!-- dracoiden, von drachen rekrutiert -->
<skill name="polearm" level="d4+2"/>
<skill name="melee" level="d4+2"/>
<skill name="bow" level="d3+1"/>
<subset>
<!-- dracoiden haben immer eine von drei waffen -->
<set name="item_sword" chance="0.33"/>
<set name="item_spear" chance="0.33"/>
<set name="item_bow" chance="0.34"/>
</subset>
</set>
<set name="rising_undead">
<!-- untote, von den graebern auferstanden -->
<item name="rustysword" amount="1"/>
<item name="rustychainmail" amount="d2-1"/>
<subset chance="0.3">
<set name="item_rustyshield"/>
</subset>
</set>
<!-- single-item sets (that can be given a percentage-chance in a subset) -->
<set name="item_plate">
<item name="plate" amount="1"/>
</set>
<set name="item_spear">
<item name="spear" amount="1"/>
</set>
<set name="item_bow">
<item name="bow" amount="1"/>
</set>
<set name="item_sword">
<item name="sword" amount="1"/>
</set>
<set name="item_chain">
<item name="chainmail" amount="1"/>
</set>
<set name="item_log">
<item name="log" amount="1"/>
</set>
<set name="item_rustychain">
<item name="rustychainmail" amount="1"/>
</set>
<set name="dragon_spoils">
<item name="dragonblood" amount="4"/>
<item name="dragonhead" amount="1"/>
</set>
<set name="youngdragon_spoils">
<item name="dragonblood" amount="1"/>
</set>
<set name="wyrm_spoils">
<item name="dragonblood" amount="10"/>
<item name="dragonhead" amount="1"/>
</set>
<!-- sets that are used by the monster-spawning code -->
<set name="monster_dragon">
<skill name="magic" level="4"/>
<skill name="stealth" level="1"/>
<skill name="stamina" level="1"/>
<skill name="perception" level="d3"/>
<item name="money" amount="d500+99"/>
</set>
<set name="monster_braineater">
<skill name="stealth" level="1"/>
<skill name="perception" level="1"/>
</set>
<set name="monster_seaserpent">
<skill name="magic" level="4"/>
<skill name="stealth" level="2"/>
<skill name="stamina" level="1"/>
<skill name="perception" level="3"/>
</set>
</equipment>

File diff suppressed because it is too large Load diff

File diff suppressed because it is too large Load diff

View file

@ -1,31 +1,31 @@
<?xml version="1.0"?>
<prefixes>
<prefix>Dunkel</prefix>
<prefix>Licht</prefix>
<prefix>Klein</prefix>
<prefix>Hoch</prefix>
<prefix>Huegel</prefix>
<prefix>Berg</prefix>
<prefix>Wald</prefix>
<prefix>Sumpf</prefix>
<prefix>Schnee</prefix>
<prefix>Sonnen</prefix>
<prefix>Mond</prefix>
<prefix>See</prefix>
<prefix>Tal</prefix>
<prefix>Schatten</prefix>
<prefix>Hoehlen</prefix>
<prefix>Blut</prefix>
<prefix>Wild</prefix>
<prefix>Chaos</prefix>
<prefix>Nacht</prefix>
<prefix>Nebel</prefix>
<prefix>Grau</prefix>
<prefix>Frost</prefix>
<prefix>Finster</prefix>
<prefix>Duester</prefix>
<prefix>flame</prefix>
<prefix>ice</prefix>
<prefix>star</prefix>
<prefix>black</prefix>
</prefixes>
<?xml version="1.0"?>
<prefixes>
<prefix>Dunkel</prefix>
<prefix>Licht</prefix>
<prefix>Klein</prefix>
<prefix>Hoch</prefix>
<prefix>Huegel</prefix>
<prefix>Berg</prefix>
<prefix>Wald</prefix>
<prefix>Sumpf</prefix>
<prefix>Schnee</prefix>
<prefix>Sonnen</prefix>
<prefix>Mond</prefix>
<prefix>See</prefix>
<prefix>Tal</prefix>
<prefix>Schatten</prefix>
<prefix>Hoehlen</prefix>
<prefix>Blut</prefix>
<prefix>Wild</prefix>
<prefix>Chaos</prefix>
<prefix>Nacht</prefix>
<prefix>Nebel</prefix>
<prefix>Grau</prefix>
<prefix>Frost</prefix>
<prefix>Finster</prefix>
<prefix>Duester</prefix>
<prefix>flame</prefix>
<prefix>ice</prefix>
<prefix>star</prefix>
<prefix>black</prefix>
</prefixes>

View file

@ -1,11 +1,11 @@
<?xml version="1.0"?>
<resource name="horse" limited="yes" material="rm_horse">
<item big="yes" weight="5000" score="10" capacity="7000" animal="yes">
<construction skill="training" minskill="1" reqsize="1"/>
<function name="give" value="givehorses"/>
</item>
<resourcelimit>
<function name="produce" value="lua_produceresource"/>
<function name="limit" value="lua_limitresource"/>
</resourcelimit>
</resource>
<?xml version="1.0"?>
<resource name="horse" limited="yes" material="rm_horse">
<item big="yes" weight="5000" score="10" capacity="7000" animal="yes">
<construction skill="training" minskill="1" reqsize="1"/>
<function name="give" value="givehorses"/>
</item>
<resourcelimit>
<function name="produce" value="lua_produceresource"/>
<function name="limit" value="lua_limitresource"/>
</resourcelimit>
</resource>

View file

@ -1,5 +1,5 @@
<?xml version="1.0"?>
<resource name="hp" pooled="false">
<function name="change" value="lua_changeresource"/>
<function name="get" value="lua_getresource"/>
</resource>
<?xml version="1.0"?>
<resource name="hp" pooled="false">
<function name="change" value="lua_changeresource"/>
<function name="get" value="lua_getresource"/>
</resource>

View file

@ -1,12 +1,12 @@
<?xml version="1.0"?>
<resource name="iron" limited="yes" material="rm_iron">
<item weight="500" score="10">
<construction skill="mining" minskill="1" reqsize="1"/>
</item>
<resourcelimit>
<modifier building="mine" type="skill" value="1"/>
<modifier building="mine" type="material" value="0.5"/>
<modifier race="dwarf" type="material" value="0.60"/>
<guard flag="mining"/>
</resourcelimit>
</resource>
<?xml version="1.0"?>
<resource name="iron" limited="yes" material="rm_iron">
<item weight="500" score="10">
<construction skill="mining" minskill="1" reqsize="1"/>
</item>
<resourcelimit>
<modifier building="mine" type="skill" value="1"/>
<modifier building="mine" type="material" value="0.5"/>
<modifier race="dwarf" type="material" value="0.60"/>
<guard flag="mining"/>
</resourcelimit>
</resource>

View file

@ -1,10 +1,10 @@
<?xml version="1.0"?>
<resource name="laen" limited="yes" material="rm_laen">
<item weight="200" score="100">
<construction skill="mining" minskill="7" reqsize="1"/>
</item>
<resourcelimit>
<modifier type="require" building="mine"/>
<guard flag="mining"/>
</resourcelimit>
</resource>
<?xml version="1.0"?>
<resource name="laen" limited="yes" material="rm_laen">
<item weight="200" score="100">
<construction skill="mining" minskill="7" reqsize="1"/>
</item>
<resourcelimit>
<modifier type="require" building="mine"/>
<guard flag="mining"/>
</resourcelimit>
</resource>

View file

@ -1,13 +1,13 @@
<?xml version="1.0"?>
<resource name="log" material="rm_tree">
<item weight="500" score="10">
<construction skill="forestry" minskill="1" reqsize="1"/>
</item>
<resourcelimit>
<modifier building="sawmill" type="skill" value="1"/>
<modifier building="sawmill" type="material" value="0.5"/>
<guard flag="logging"/>
<function name="produce" value="lua_produceresource"/>
<function name="limit" value="lua_limitresource"/>
</resourcelimit>
</resource>
<?xml version="1.0"?>
<resource name="log" material="rm_tree">
<item weight="500" score="10">
<construction skill="forestry" minskill="1" reqsize="1"/>
</item>
<resourcelimit>
<modifier building="sawmill" type="skill" value="1"/>
<modifier building="sawmill" type="material" value="0.5"/>
<guard flag="logging"/>
<function name="produce" value="lua_produceresource"/>
<function name="limit" value="lua_limitresource"/>
</resourcelimit>
</resource>

View file

@ -1,13 +1,13 @@
<?xml version="1.0"?>
<resource name="mallorn" material="rm_mallorn">
<item weight="500" score="30">
<construction skill="forestry" minskill="2" reqsize="1"/>
</item>
<resourcelimit>
<modifier building="sawmill" type="skill" value="1"/>
<modifier building="sawmill" type="material" value="0.5"/>
<guard flag="logging"/>
<function name="produce" value="lua_produceresource"/>
<function name="limit" value="lua_limitresource"/>
</resourcelimit>
</resource>
<?xml version="1.0"?>
<resource name="mallorn" material="rm_mallorn">
<item weight="500" score="30">
<construction skill="forestry" minskill="2" reqsize="1"/>
</item>
<resourcelimit>
<modifier building="sawmill" type="skill" value="1"/>
<modifier building="sawmill" type="material" value="0.5"/>
<guard flag="logging"/>
<function name="produce" value="lua_produceresource"/>
<function name="limit" value="lua_limitresource"/>
</resourcelimit>
</resource>

View file

@ -1,6 +1,6 @@
<?xml version="1.0"?>
<resource name="mallornseed" limited="yes">
<item weight="10" score="100">
<construction skill="herbalism" minskill="4" reqsize="1"/>
</item>
</resource>
<?xml version="1.0"?>
<resource name="mallornseed" limited="yes">
<item weight="10" score="100">
<construction skill="herbalism" minskill="4" reqsize="1"/>
</item>
</resource>

View file

@ -1,5 +1,5 @@
<?xml version="1.0"?>
<resource name="peasant" pooled="false">
<function name="change" value="lua_changeresource"/>
<function name="get" value="lua_getresource"/>
</resource>
<?xml version="1.0"?>
<resource name="peasant" pooled="false">
<function name="change" value="lua_changeresource"/>
<function name="get" value="lua_getresource"/>
</resource>

View file

@ -1,6 +1,6 @@
<?xml version="1.0"?>
<resource name="seed" limited="yes">
<item weight="10" score="50">
<construction skill="herbalism" minskill="3" reqsize="1"/>
</item>
</resource>
<?xml version="1.0"?>
<resource name="seed" limited="yes">
<item weight="10" score="50">
<construction skill="herbalism" minskill="3" reqsize="1"/>
</item>
</resource>

View file

@ -1,11 +1,11 @@
<?xml version="1.0"?>
<resource name="stone" limited="yes" material="rm_stone">
<item weight="6000" score="10" big="yes">
<construction skill="quarrying" minskill="1" reqsize="1"/>
</item>
<resourcelimit>
<modifier building="quarry" type="skill" value="1"/>
<modifier building="quarry" type="material" value="0.5"/>
<modifier race="troll" type="material" value="0.75"/>
</resourcelimit>
</resource>
<?xml version="1.0"?>
<resource name="stone" limited="yes" material="rm_stone">
<item weight="6000" score="10" big="yes">
<construction skill="quarrying" minskill="1" reqsize="1"/>
</item>
<resourcelimit>
<modifier building="quarry" type="skill" value="1"/>
<modifier building="quarry" type="material" value="0.5"/>
<modifier race="troll" type="material" value="0.75"/>
</resourcelimit>
</resource>

View file

@ -1,83 +1,83 @@
<?xml version="1.0"?>
<ships>
<ship name="trireme" range="7" storm="1.00" damage="1.00" cargo="200000" cptskill="4" minskill="1" sumskill="120" opensea="yes">
<coast terrain="ocean"/>
<coast terrain="plain"/>
<construction skill="shipcraft" minskill="4" maxsize="200" reqsize="1">
<requirement type="log" quantity="1"/>
</construction>
</ship>
<ship name="caravel" range="5" storm="1.00" damage="1.00" cargo="300000" cptskill="3" minskill="1" sumskill="30" opensea="yes">
<coast terrain="ocean"/>
<coast terrain="plain"/>
<construction skill="shipcraft" minskill="3" maxsize="250" reqsize="1">
<requirement type="log" quantity="1"/>
</construction>
</ship>
<ship name="dragonship" range="5" storm="1.00" damage="1.00" cargo="100000" cptskill="2" minskill="1" sumskill="50" opensea="yes">
<coast terrain="ocean"/>
<coast terrain="plain"/>
<construction skill="shipcraft" minskill="2" maxsize="100" reqsize="1">
<requirement type="log" quantity="1"/>
</construction>
</ship>
<ship name="longboat" range="3" storm="1.00" damage="1.00" cargo="50000" cptskill="1" minskill="1" sumskill="10" opensea="yes">
<coast terrain="ocean"/>
<coast terrain="plain"/>
<construction skill="shipcraft" minskill="1" maxsize="50" reqsize="1">
<requirement type="log" quantity="1"/>
</construction>
</ship>
<ship name="balloon" range="2" storm="1.00" damage="1.00" cargo="5000" cptskill="6" minskill="6" sumskill="6" opensea="yes" fly="yes">
<coast terrain="ocean"/>
<coast terrain="plain"/>
<coast terrain="swamp"/>
<coast terrain="desert"/>
<coast terrain="highland"/>
<coast terrain="mountain"/>
<coast terrain="glacier"/>
<coast terrain="volcano"/>
<coast terrain="activevolcano"/>
<coast terrain="iceberg_sleep"/>
<coast terrain="iceberg"/>
<construction skill="shipcraft" minskill="100" maxsize="5" reqsize="1"/>
</ship>
<ship name="boat" range="2" storm="1.00" damage="1.00" cargo="5000" cptskill="1" minskill="1" sumskill="2" opensea="yes">
<coast terrain="ocean"/>
<coast terrain="plain"/>
<coast terrain="swamp"/>
<coast terrain="desert"/>
<coast terrain="highland"/>
<coast terrain="mountain"/>
<coast terrain="glacier"/>
<coast terrain="volcano"/>
<coast terrain="activevolcano"/>
<coast terrain="iceberg_sleep"/>
<coast terrain="iceberg"/>
<construction skill="shipcraft" minskill="1" maxsize="5" reqsize="1">
<requirement type="log" quantity="1"/>
</construction>
</ship>
<ship name="flyingcarpet" range="3" storm="1.00" damage="1.00" cargo="50000" cptskill="6" minskill="6" sumskill="10" opensea="yes" fly="yes">
<coast terrain="ocean"/>
<coast terrain="plain"/>
<coast terrain="swamp"/>
<coast terrain="desert"/>
<coast terrain="highland"/>
<coast terrain="mountain"/>
<coast terrain="glacier"/>
<coast terrain="volcano"/>
<coast terrain="activevolcano"/>
<coast terrain="iceberg_sleep"/>
<coast terrain="iceberg"/>
<construction skill="shipcraft" minskill="100" maxsize="50" reqsize="1"/>
</ship>
</ships>
<?xml version="1.0"?>
<ships>
<ship name="trireme" range="7" storm="1.00" damage="1.00" cargo="200000" cptskill="4" minskill="1" sumskill="120" opensea="yes">
<coast terrain="ocean"/>
<coast terrain="plain"/>
<construction skill="shipcraft" minskill="4" maxsize="200" reqsize="1">
<requirement type="log" quantity="1"/>
</construction>
</ship>
<ship name="caravel" range="5" storm="1.00" damage="1.00" cargo="300000" cptskill="3" minskill="1" sumskill="30" opensea="yes">
<coast terrain="ocean"/>
<coast terrain="plain"/>
<construction skill="shipcraft" minskill="3" maxsize="250" reqsize="1">
<requirement type="log" quantity="1"/>
</construction>
</ship>
<ship name="dragonship" range="5" storm="1.00" damage="1.00" cargo="100000" cptskill="2" minskill="1" sumskill="50" opensea="yes">
<coast terrain="ocean"/>
<coast terrain="plain"/>
<construction skill="shipcraft" minskill="2" maxsize="100" reqsize="1">
<requirement type="log" quantity="1"/>
</construction>
</ship>
<ship name="longboat" range="3" storm="1.00" damage="1.00" cargo="50000" cptskill="1" minskill="1" sumskill="10" opensea="yes">
<coast terrain="ocean"/>
<coast terrain="plain"/>
<construction skill="shipcraft" minskill="1" maxsize="50" reqsize="1">
<requirement type="log" quantity="1"/>
</construction>
</ship>
<ship name="balloon" range="2" storm="1.00" damage="1.00" cargo="5000" cptskill="6" minskill="6" sumskill="6" opensea="yes" fly="yes">
<coast terrain="ocean"/>
<coast terrain="plain"/>
<coast terrain="swamp"/>
<coast terrain="desert"/>
<coast terrain="highland"/>
<coast terrain="mountain"/>
<coast terrain="glacier"/>
<coast terrain="volcano"/>
<coast terrain="activevolcano"/>
<coast terrain="iceberg_sleep"/>
<coast terrain="iceberg"/>
<construction skill="shipcraft" minskill="100" maxsize="5" reqsize="1"/>
</ship>
<ship name="boat" range="2" storm="1.00" damage="1.00" cargo="5000" cptskill="1" minskill="1" sumskill="2" opensea="yes">
<coast terrain="ocean"/>
<coast terrain="plain"/>
<coast terrain="swamp"/>
<coast terrain="desert"/>
<coast terrain="highland"/>
<coast terrain="mountain"/>
<coast terrain="glacier"/>
<coast terrain="volcano"/>
<coast terrain="activevolcano"/>
<coast terrain="iceberg_sleep"/>
<coast terrain="iceberg"/>
<construction skill="shipcraft" minskill="1" maxsize="5" reqsize="1">
<requirement type="log" quantity="1"/>
</construction>
</ship>
<ship name="flyingcarpet" range="3" storm="1.00" damage="1.00" cargo="50000" cptskill="6" minskill="6" sumskill="10" opensea="yes" fly="yes">
<coast terrain="ocean"/>
<coast terrain="plain"/>
<coast terrain="swamp"/>
<coast terrain="desert"/>
<coast terrain="highland"/>
<coast terrain="mountain"/>
<coast terrain="glacier"/>
<coast terrain="volcano"/>
<coast terrain="activevolcano"/>
<coast terrain="iceberg_sleep"/>
<coast terrain="iceberg"/>
<construction skill="shipcraft" minskill="100" maxsize="50" reqsize="1"/>
</ship>
</ships>

View file

@ -1,204 +1,204 @@
<?xml version="1.0"?>
<spells>
<!-- draig spells -->
<spell name="create_roi" type="draig" ship="true" rank="5" level="6" index="130">
<function name="cast" value="lua_castspell"/>
<resource name="aura" amount="50" cost="fixed"/>
<resource name="money" amount="3000" cost="fixed"/>
<resource name="permaura" amount="1" cost="fixed"/>
</spell>
<spell name="earn_silver#draig" type="draig" ship="true" variable="true" rank="5" level="1" index="159">
<function name="cast" value="lua_castspell"/>
<resource name="aura" amount="1" cost="level"/>
</spell>
<spell name="create_aots" type="draig" ship="true" rank="5" level="6" index="125">
<function name="cast" value="lua_castspell"/>
<resource name="aura" amount="50" cost="fixed"/>
<resource name="money" amount="3000" cost="fixed"/>
<resource name="permaura" amount="1" cost="fixed"/>
</spell>
<spell name="create_firesword" type="draig" ship="true" rank="5" level="12" index="148">
<function name="cast" value="lua_castspell"/>
<resource name="aura" amount="100" cost="fixed"/>
<resource name="p10" amount="1" cost="fixed"/>
<resource name="sword" amount="1" cost="fixed"/>
<resource name="permaura" amount="1" cost="fixed"/>
</spell>
<spell name="create_trollbelt" type="draig" ship="true" rank="5" level="9" index="48">
<function name="cast" value="lua_castspell"/>
<resource name="aura" amount="20" cost="fixed"/>
<resource name="permaura" amount="1" cost="fixed"/>
</spell>
<!-- gwyrrd spells -->
<spell name="create_roi" type="gwyrrd" ship="true" rank="5" level="6" index="129">
<function name="cast" value="lua_castspell"/>
<resource name="aura" amount="50" cost="fixed"/>
<resource name="money" amount="3000" cost="fixed"/>
<resource name="permaura" amount="1" cost="fixed"/>
</spell>
<spell name="earn_silver#gwyrrd" type="gwyrrd" ship="true" variable="true" rank="5" level="1" index="159">
<function name="cast" value="lua_castspell"/>
<resource name="aura" amount="1" cost="level"/>
</spell>
<spell name="create_aots" type="gwyrrd" ship="true" rank="5" level="6" index="124">
<function name="cast" value="lua_castspell"/>
<resource name="aura" amount="50" cost="fixed"/>
<resource name="money" amount="3000" cost="fixed"/>
<resource name="permaura" amount="1" cost="fixed"/>
</spell>
<spell name="create_magicherbbag" type="gwyrrd" ship="true" rank="5" level="5" index="165">
<function name="cast" value="lua_castspell"/>
<resource name="aura" amount="30" cost="fixed"/>
<resource name="permaura" amount="1" cost="fixed"/>
<resource name="p2" amount="1" cost="fixed"/>
</spell>
<!-- illaun spells -->
<spell name="create_roi" type="illaun" ship="true" rank="5" level="6" index="131">
<function name="cast" value="lua_castspell"/>
<resource name="aura" amount="50" cost="fixed"/>
<resource name="money" amount="3000" cost="fixed"/>
<resource name="permaura" amount="1" cost="fixed"/>
</spell>
<spell name="earn_silver#illaun" type="illaun" ship="true" variable="true" rank="5" level="1" index="159">
<function name="cast" value="lua_castspell"/>
<resource name="aura" amount="1" cost="level"/>
</spell>
<spell name="create_aots" type="illaun" ship="true" rank="5" level="6" index="126">
<function name="cast" value="lua_castspell"/>
<resource name="aura" amount="50" cost="fixed"/>
<resource name="money" amount="3000" cost="fixed"/>
<resource name="permaura" amount="1" cost="fixed"/>
</spell>
<spell name="create_dreameye" type="illaun" ship="true" rank="5" level="14" index="149">
<function name="cast" value="lua_castspell"/>
<resource name="dragonhead" amount="1" cost="fixed"/>
<resource name="permaura" amount="5" cost="fixed"/>
</spell>
<spell name="create_invisibility_sphere" type="illaun" ship="true" rank="5" level="13" index="178">
<function name="cast" value="lua_castspell"/>
<resource name="aura" amount="150" cost="fixed"/>
<resource name="money" amount="30000" cost="fixed"/>
<resource name="permaura" amount="3" cost="fixed"/>
</spell>
<!-- cerddor spells -->
<spell name="create_roi" type="cerddor" ship="true" rank="5" level="6" index="132">
<function name="cast" value="lua_castspell"/>
<resource name="aura" amount="50" cost="fixed"/>
<resource name="money" amount="3000" cost="fixed"/>
<resource name="permaura" amount="1" cost="fixed"/>
</spell>
<spell name="earn_silver#cerddor" type="cerddor" ship="true" variable="true" rank="5" level="1" index="159">
<function name="cast" value="lua_castspell"/>
<resource name="aura" amount="1" cost="level"/>
</spell>
<spell name="create_aots" type="cerddor" ship="true" rank="5" level="6" index="127">
<function name="cast" value="lua_castspell"/>
<resource name="aura" amount="50" cost="fixed"/>
<resource name="money" amount="3000" cost="fixed"/>
<resource name="permaura" amount="1" cost="fixed"/>
</spell>
<spell name="create_roqf" type="cerddor" ship="true" rank="5" level="11" index="63">
<function name="cast" value="lua_castspell"/>
<resource name="aura" amount="20" cost="fixed"/>
<resource name="money" amount="1000" cost="fixed"/>
<resource name="permaura" amount="1" cost="fixed"/>
</spell>
<spell name="blabbermouth" parameters="u" type="cerddor" ship="false" los="true" rank="5" level="4" index="115">
<function name="cast" value="cast_babbler"/>
<resource name="aura" amount="10" cost="fixed"/>
<!-- missing syntactical info: ONETARGET | UNITSPELL -->
</spell>
<spell name="readmind" parameters="u" type="illaun" ship="false" rank="5" level="7" index="114">
<function name="cast" value="cast_readmind"/>
<resource name="aura" amount="20" cost="fixed"/>
<!-- missing syntactical info: ONETARGET | UNITSPELL -->
</spell>
<!-- tybied spells -->
<spell name="create_roi" type="tybied" ship="true" rank="5" level="6" index="133">
<function name="cast" value="lua_castspell"/>
<resource name="aura" amount="50" cost="fixed"/>
<resource name="money" amount="3000" cost="fixed"/>
<resource name="permaura" amount="1" cost="fixed"/>
</spell>
<spell name="earn_silver#tybied" type="tybied" ship="true" variable="true" rank="5" level="1" index="159">
<function name="cast" value="lua_castspell"/>
<resource name="aura" amount="1" cost="level"/>
</spell>
<spell name="create_aots" type="tybied" ship="true" rank="5" level="6" index="128">
<function name="cast" value="lua_castspell"/>
<resource name="aura" amount="50" cost="fixed"/>
<resource name="money" amount="3000" cost="fixed"/>
<resource name="permaura" amount="1" cost="fixed"/>
</spell>
<spell name="create_antimagic" type="tybied" ship="true" rank="5" level="7" index="38">
<function name="cast" value="lua_castspell"/>
<resource name="aura" amount="50" cost="fixed"/>
<resource name="money" amount="3000" cost="fixed"/>
</spell>
<spell name="create_rop" type="tybied" ship="true" rank="5" level="9" index="1">
<function name="cast" value="lua_castspell"/>
<resource name="aura" amount="100" cost="fixed"/>
<resource name="permaura" amount="1" cost="fixed"/>
<resource name="money" amount="4000" cost="fixed"/>
</spell>
<spell name="create_bagofholding" type="tybied" ship="true" rank="5" level="10" index="155">
<function name="cast" value="lua_castspell"/>
<resource name="aura" amount="30" cost="fixed"/>
<resource name="permaura" amount="1" cost="fixed"/>
<resource name="money" amount="5000" cost="fixed"/>
</spell>
<!-- gray magic -->
<spell name="create_runesword" type="gray" ship="true" rank="5" level="6" index="135">
<function name="cast" value="lua_castspell"/>
<resource name="aura" amount="100" cost="fixed"/>
<resource name="permaura" amount="1" cost="fixed"/>
<resource name="money" amount="1000" cost="fixed"/>
<resource name="laensword" amount="1" cost="fixed"/>
</spell>
<spell name="create_chastitybelt" type="gray" ship="true" rank="5" level="7" index="134">
<function name="cast" value="lua_castspell"/>
<resource name="aura" amount="50" cost="fixed"/>
<resource name="permaura" amount="1" cost="fixed"/>
<resource name="money" amount="3000" cost="fixed"/>
</spell>
<spell name="create_focus" type="gray" ship="true" rank="5" level="9" index="2">
<function name="cast" value="lua_castspell"/>
<resource name="aura" amount="100" cost="fixed"/>
<resource name="permaura" amount="1" cost="fixed"/>
</spell>
<spell name="create_ror" type="gray" ship="true" rank="5" level="9" index="3">
<function name="cast" value="lua_castspell"/>
<resource name="aura" amount="100" cost="fixed"/>
<resource name="permaura" amount="1" cost="fixed"/>
</spell>
</spells>
<?xml version="1.0"?>
<spells>
<!-- draig spells -->
<spell name="create_roi" type="draig" ship="true" rank="5" level="6" index="130">
<function name="cast" value="lua_castspell"/>
<resource name="aura" amount="50" cost="fixed"/>
<resource name="money" amount="3000" cost="fixed"/>
<resource name="permaura" amount="1" cost="fixed"/>
</spell>
<spell name="earn_silver#draig" type="draig" ship="true" variable="true" rank="5" level="1" index="159">
<function name="cast" value="lua_castspell"/>
<resource name="aura" amount="1" cost="level"/>
</spell>
<spell name="create_aots" type="draig" ship="true" rank="5" level="6" index="125">
<function name="cast" value="lua_castspell"/>
<resource name="aura" amount="50" cost="fixed"/>
<resource name="money" amount="3000" cost="fixed"/>
<resource name="permaura" amount="1" cost="fixed"/>
</spell>
<spell name="create_firesword" type="draig" ship="true" rank="5" level="12" index="148">
<function name="cast" value="lua_castspell"/>
<resource name="aura" amount="100" cost="fixed"/>
<resource name="p10" amount="1" cost="fixed"/>
<resource name="sword" amount="1" cost="fixed"/>
<resource name="permaura" amount="1" cost="fixed"/>
</spell>
<spell name="create_trollbelt" type="draig" ship="true" rank="5" level="9" index="48">
<function name="cast" value="lua_castspell"/>
<resource name="aura" amount="20" cost="fixed"/>
<resource name="permaura" amount="1" cost="fixed"/>
</spell>
<!-- gwyrrd spells -->
<spell name="create_roi" type="gwyrrd" ship="true" rank="5" level="6" index="129">
<function name="cast" value="lua_castspell"/>
<resource name="aura" amount="50" cost="fixed"/>
<resource name="money" amount="3000" cost="fixed"/>
<resource name="permaura" amount="1" cost="fixed"/>
</spell>
<spell name="earn_silver#gwyrrd" type="gwyrrd" ship="true" variable="true" rank="5" level="1" index="159">
<function name="cast" value="lua_castspell"/>
<resource name="aura" amount="1" cost="level"/>
</spell>
<spell name="create_aots" type="gwyrrd" ship="true" rank="5" level="6" index="124">
<function name="cast" value="lua_castspell"/>
<resource name="aura" amount="50" cost="fixed"/>
<resource name="money" amount="3000" cost="fixed"/>
<resource name="permaura" amount="1" cost="fixed"/>
</spell>
<spell name="create_magicherbbag" type="gwyrrd" ship="true" rank="5" level="5" index="165">
<function name="cast" value="lua_castspell"/>
<resource name="aura" amount="30" cost="fixed"/>
<resource name="permaura" amount="1" cost="fixed"/>
<resource name="p2" amount="1" cost="fixed"/>
</spell>
<!-- illaun spells -->
<spell name="create_roi" type="illaun" ship="true" rank="5" level="6" index="131">
<function name="cast" value="lua_castspell"/>
<resource name="aura" amount="50" cost="fixed"/>
<resource name="money" amount="3000" cost="fixed"/>
<resource name="permaura" amount="1" cost="fixed"/>
</spell>
<spell name="earn_silver#illaun" type="illaun" ship="true" variable="true" rank="5" level="1" index="159">
<function name="cast" value="lua_castspell"/>
<resource name="aura" amount="1" cost="level"/>
</spell>
<spell name="create_aots" type="illaun" ship="true" rank="5" level="6" index="126">
<function name="cast" value="lua_castspell"/>
<resource name="aura" amount="50" cost="fixed"/>
<resource name="money" amount="3000" cost="fixed"/>
<resource name="permaura" amount="1" cost="fixed"/>
</spell>
<spell name="create_dreameye" type="illaun" ship="true" rank="5" level="14" index="149">
<function name="cast" value="lua_castspell"/>
<resource name="dragonhead" amount="1" cost="fixed"/>
<resource name="permaura" amount="5" cost="fixed"/>
</spell>
<spell name="create_invisibility_sphere" type="illaun" ship="true" rank="5" level="13" index="178">
<function name="cast" value="lua_castspell"/>
<resource name="aura" amount="150" cost="fixed"/>
<resource name="money" amount="30000" cost="fixed"/>
<resource name="permaura" amount="3" cost="fixed"/>
</spell>
<!-- cerddor spells -->
<spell name="create_roi" type="cerddor" ship="true" rank="5" level="6" index="132">
<function name="cast" value="lua_castspell"/>
<resource name="aura" amount="50" cost="fixed"/>
<resource name="money" amount="3000" cost="fixed"/>
<resource name="permaura" amount="1" cost="fixed"/>
</spell>
<spell name="earn_silver#cerddor" type="cerddor" ship="true" variable="true" rank="5" level="1" index="159">
<function name="cast" value="lua_castspell"/>
<resource name="aura" amount="1" cost="level"/>
</spell>
<spell name="create_aots" type="cerddor" ship="true" rank="5" level="6" index="127">
<function name="cast" value="lua_castspell"/>
<resource name="aura" amount="50" cost="fixed"/>
<resource name="money" amount="3000" cost="fixed"/>
<resource name="permaura" amount="1" cost="fixed"/>
</spell>
<spell name="create_roqf" type="cerddor" ship="true" rank="5" level="11" index="63">
<function name="cast" value="lua_castspell"/>
<resource name="aura" amount="20" cost="fixed"/>
<resource name="money" amount="1000" cost="fixed"/>
<resource name="permaura" amount="1" cost="fixed"/>
</spell>
<spell name="blabbermouth" parameters="u" type="cerddor" ship="false" los="true" rank="5" level="4" index="115">
<function name="cast" value="cast_babbler"/>
<resource name="aura" amount="10" cost="fixed"/>
<!-- missing syntactical info: ONETARGET | UNITSPELL -->
</spell>
<spell name="readmind" parameters="u" type="illaun" ship="false" rank="5" level="7" index="114">
<function name="cast" value="cast_readmind"/>
<resource name="aura" amount="20" cost="fixed"/>
<!-- missing syntactical info: ONETARGET | UNITSPELL -->
</spell>
<!-- tybied spells -->
<spell name="create_roi" type="tybied" ship="true" rank="5" level="6" index="133">
<function name="cast" value="lua_castspell"/>
<resource name="aura" amount="50" cost="fixed"/>
<resource name="money" amount="3000" cost="fixed"/>
<resource name="permaura" amount="1" cost="fixed"/>
</spell>
<spell name="earn_silver#tybied" type="tybied" ship="true" variable="true" rank="5" level="1" index="159">
<function name="cast" value="lua_castspell"/>
<resource name="aura" amount="1" cost="level"/>
</spell>
<spell name="create_aots" type="tybied" ship="true" rank="5" level="6" index="128">
<function name="cast" value="lua_castspell"/>
<resource name="aura" amount="50" cost="fixed"/>
<resource name="money" amount="3000" cost="fixed"/>
<resource name="permaura" amount="1" cost="fixed"/>
</spell>
<spell name="create_antimagic" type="tybied" ship="true" rank="5" level="7" index="38">
<function name="cast" value="lua_castspell"/>
<resource name="aura" amount="50" cost="fixed"/>
<resource name="money" amount="3000" cost="fixed"/>
</spell>
<spell name="create_rop" type="tybied" ship="true" rank="5" level="9" index="1">
<function name="cast" value="lua_castspell"/>
<resource name="aura" amount="100" cost="fixed"/>
<resource name="permaura" amount="1" cost="fixed"/>
<resource name="money" amount="4000" cost="fixed"/>
</spell>
<spell name="create_bagofholding" type="tybied" ship="true" rank="5" level="10" index="155">
<function name="cast" value="lua_castspell"/>
<resource name="aura" amount="30" cost="fixed"/>
<resource name="permaura" amount="1" cost="fixed"/>
<resource name="money" amount="5000" cost="fixed"/>
</spell>
<!-- gray magic -->
<spell name="create_runesword" type="gray" ship="true" rank="5" level="6" index="135">
<function name="cast" value="lua_castspell"/>
<resource name="aura" amount="100" cost="fixed"/>
<resource name="permaura" amount="1" cost="fixed"/>
<resource name="money" amount="1000" cost="fixed"/>
<resource name="laensword" amount="1" cost="fixed"/>
</spell>
<spell name="create_chastitybelt" type="gray" ship="true" rank="5" level="7" index="134">
<function name="cast" value="lua_castspell"/>
<resource name="aura" amount="50" cost="fixed"/>
<resource name="permaura" amount="1" cost="fixed"/>
<resource name="money" amount="3000" cost="fixed"/>
</spell>
<spell name="create_focus" type="gray" ship="true" rank="5" level="9" index="2">
<function name="cast" value="lua_castspell"/>
<resource name="aura" amount="100" cost="fixed"/>
<resource name="permaura" amount="1" cost="fixed"/>
</spell>
<spell name="create_ror" type="gray" ship="true" rank="5" level="9" index="3">
<function name="cast" value="lua_castspell"/>
<resource name="aura" amount="100" cost="fixed"/>
<resource name="permaura" amount="1" cost="fixed"/>
</spell>
</spells>

View file

@ -1,59 +1,59 @@
<?xml version="1.0"?>
<resources>
<resource name="elfspoil">
<function name="change" value="changeitem"/>
<item weight="1"/>
</resource>
<resource name="demonspoil">
<function name="change" value="changeitem"/>
<item weight="1"/>
</resource>
<resource name="goblinspoil">
<function name="change" value="changeitem"/>
<item weight="1"/>
</resource>
<resource name="dwarfspoil">
<function name="change" value="changeitem"/>
<item weight="1"/>
</resource>
<resource name="halflingspoil">
<function name="change" value="changeitem"/>
<item weight="1"/>
</resource>
<resource name="humanspoil">
<function name="change" value="changeitem"/>
<item weight="1"/>
</resource>
<resource name="aquarianspoil">
<function name="change" value="changeitem"/>
<item weight="1"/>
</resource>
<resource name="insectspoil">
<function name="change" value="changeitem"/>
<item weight="1"/>
</resource>
<resource name="catspoil">
<function name="change" value="changeitem"/>
<item weight="1"/>
</resource>
<resource name="orcspoil">
<function name="change" value="changeitem"/>
<item weight="1"/>
</resource>
<resource name="trollspoil">
<function name="change" value="changeitem"/>
<item weight="1"/>
</resource>
</resources>
<?xml version="1.0"?>
<resources>
<resource name="elfspoil">
<function name="change" value="changeitem"/>
<item weight="1"/>
</resource>
<resource name="demonspoil">
<function name="change" value="changeitem"/>
<item weight="1"/>
</resource>
<resource name="goblinspoil">
<function name="change" value="changeitem"/>
<item weight="1"/>
</resource>
<resource name="dwarfspoil">
<function name="change" value="changeitem"/>
<item weight="1"/>
</resource>
<resource name="halflingspoil">
<function name="change" value="changeitem"/>
<item weight="1"/>
</resource>
<resource name="humanspoil">
<function name="change" value="changeitem"/>
<item weight="1"/>
</resource>
<resource name="aquarianspoil">
<function name="change" value="changeitem"/>
<item weight="1"/>
</resource>
<resource name="insectspoil">
<function name="change" value="changeitem"/>
<item weight="1"/>
</resource>
<resource name="catspoil">
<function name="change" value="changeitem"/>
<item weight="1"/>
</resource>
<resource name="orcspoil">
<function name="change" value="changeitem"/>
<item weight="1"/>
</resource>
<resource name="trollspoil">
<function name="change" value="changeitem"/>
<item weight="1"/>
</resource>
</resources>

View file

@ -1,84 +1,84 @@
<?xml version="1.0" encoding="ISO-8859-1"?>
<terrains>
<!-- defaults: walk="yes" sail="yes" fly="yes" shallow="yes" swim="no" forest="no" sea="no" land="yes" forbidden="no" arctic="no" cavalry="no" -->
<terrain name="ocean" size="100" shallow="no" walk="no" swim="yes" land="no" sea="yes" />
<terrain name="plain" size="10000" road="50" shallow="no" forest="yes" cavalry="yes" seed="3">
<herb name="h0" />
<herb name="h1" />
<herb name="h2" />
<herb name="h3" />
<herb name="h4" />
<herb name="h5" />
<resource name="iron" chance="0.1" level="2d4-1" base="5d8" div="2d20+10" />
<resource name="stone" chance="0.15" level="1d4" base="5d8" div="2d30+20" />
<resource name="laen" chance="0.01" level="1d4" base="1d4" div="2d20+50" />
</terrain>
<terrain name="swamp" size="2000" road="75" seed="2">
<herb name="h6" />
<herb name="h7" />
<herb name="h8" />
<resource name="iron" chance="0.02" level="2d4-1" base="5d8" div="2d20+10" />
<resource name="stone" chance="0.02" level="1d4" base="5d8" div="2d30+20" />
<resource name="laen" chance="0.02" level="1d4" base="1d4" div="2d20+50" />
</terrain>
<terrain name="desert" size="500" road="100" cavalry="yes" seed="2">
<herb name="h9" />
<herb name="h10" />
<herb name="h11" />
<resource name="iron" chance="0.15" level="2d4-1" base="5d8" div="2d20+10" />
<resource name="stone" chance="0.25" level="1d4" base="5d8" div="2d30+20" />
<resource name="laen" chance="0.025" level="1d4" base="1d4" div="2d20+50" />
</terrain>
<terrain name="highland" size="4000" road="100" cavalry="yes" seed="2">
<herb name="h12" />
<herb name="h13" />
<herb name="h14" />
<resource name="iron" chance="0.15" level="2d4-1" base="5d8" div="2d20+10" />
<resource name="stone" chance="0.25" level="1d4" base="5d8" div="2d30+20" />
<resource name="laen" chance="0.025" level="1d4" base="1d4" div="2d20+50" />
</terrain>
<terrain name="mountain" size="1000" road="250" seed="2">
<herb name="h15" />
<herb name="h16" />
<herb name="h17" />
<resource name="iron" chance="1.0" level="1" base="50" div="50" />
<resource name="stone" chance="1.0" level="1" base="100" div="100" />
<resource name="laen" chance="0.05" level="1" base="4" div="100" />
</terrain>
<terrain name="glacier" size="100" road="250" arctic="yes" seed="2">
<herb name="h18" />
<herb name="h19" />
<herb name="h20" />
<resource name="iron" chance="1.0" level="1" base="3" div="50" />
<resource name="stone" chance="1.0" level="1" base="2" div="100" />
<resource name="laen" chance="0.05" level="1" base="4" div="100" />
</terrain>
<terrain name="iceberg_sleep" size="100" road="250" arctic="yes">
<herb name="h18" />
<herb name="h19" />
<herb name="h20" />
<resource name="iron" chance="0.9" level="1" base="3" div="50" />
<resource name="stone" chance="0.9" level="1" base="2" div="100" />
<resource name="laen" chance="0.05" level="1" base="4" div="100" />
</terrain>
<terrain name="iceberg" size="100" arctic="yes">
<herb name="h18" />
<herb name="h19" />
<herb name="h20" />
<resource name="iron" chance="0.9" level="1" base="3" div="50" />
<resource name="stone" chance="0.9" level="1" base="2" div="100" />
</terrain>
<terrain name="firewall" size="100" road="250" land="no" walk="no" sail="no" fly="no" forbidden="yes" />
<terrain name="fog" sail="no" land="no" size="0" />
<terrain name="thickfog" forbidden="yes" sail="no" walk="no" fly="no" land="no" size="0" />
<terrain name="volcano" size="500" road="250" seed="1">
<resource name="iron" chance="0.5" level="1" base="50" div="50" />
<resource name="stone" chance="0.5" level="1" base="100" div="100" />
<resource name="laen" chance="0.075" level="1" base="4" div="100" />
</terrain>
<terrain name="activevolcano" size="500" road="250">
<resource name="iron" chance="0.5" level="1" base="50" div="50" />
<resource name="stone" chance="0.5" level="1" base="100" div="100" />
<resource name="laen" chance="0.075" level="1" base="4" div="100" />
</terrain>
</terrains>
<?xml version="1.0" encoding="ISO-8859-1"?>
<terrains>
<!-- defaults: walk="yes" sail="yes" fly="yes" shallow="yes" swim="no" forest="no" sea="no" land="yes" forbidden="no" arctic="no" cavalry="no" -->
<terrain name="ocean" size="100" shallow="no" walk="no" swim="yes" land="no" sea="yes" />
<terrain name="plain" size="10000" road="50" shallow="no" forest="yes" cavalry="yes" seed="3">
<herb name="h0" />
<herb name="h1" />
<herb name="h2" />
<herb name="h3" />
<herb name="h4" />
<herb name="h5" />
<resource name="iron" chance="0.1" level="2d4-1" base="5d8" div="2d20+10" />
<resource name="stone" chance="0.15" level="1d4" base="5d8" div="2d30+20" />
<resource name="laen" chance="0.01" level="1d4" base="1d4" div="2d20+50" />
</terrain>
<terrain name="swamp" size="2000" road="75" seed="2">
<herb name="h6" />
<herb name="h7" />
<herb name="h8" />
<resource name="iron" chance="0.02" level="2d4-1" base="5d8" div="2d20+10" />
<resource name="stone" chance="0.02" level="1d4" base="5d8" div="2d30+20" />
<resource name="laen" chance="0.02" level="1d4" base="1d4" div="2d20+50" />
</terrain>
<terrain name="desert" size="500" road="100" cavalry="yes" seed="2">
<herb name="h9" />
<herb name="h10" />
<herb name="h11" />
<resource name="iron" chance="0.15" level="2d4-1" base="5d8" div="2d20+10" />
<resource name="stone" chance="0.25" level="1d4" base="5d8" div="2d30+20" />
<resource name="laen" chance="0.025" level="1d4" base="1d4" div="2d20+50" />
</terrain>
<terrain name="highland" size="4000" road="100" cavalry="yes" seed="2">
<herb name="h12" />
<herb name="h13" />
<herb name="h14" />
<resource name="iron" chance="0.15" level="2d4-1" base="5d8" div="2d20+10" />
<resource name="stone" chance="0.25" level="1d4" base="5d8" div="2d30+20" />
<resource name="laen" chance="0.025" level="1d4" base="1d4" div="2d20+50" />
</terrain>
<terrain name="mountain" size="1000" road="250" seed="2">
<herb name="h15" />
<herb name="h16" />
<herb name="h17" />
<resource name="iron" chance="1.0" level="1" base="50" div="50" />
<resource name="stone" chance="1.0" level="1" base="100" div="100" />
<resource name="laen" chance="0.05" level="1" base="4" div="100" />
</terrain>
<terrain name="glacier" size="100" road="250" arctic="yes" seed="2">
<herb name="h18" />
<herb name="h19" />
<herb name="h20" />
<resource name="iron" chance="1.0" level="1" base="3" div="50" />
<resource name="stone" chance="1.0" level="1" base="2" div="100" />
<resource name="laen" chance="0.05" level="1" base="4" div="100" />
</terrain>
<terrain name="iceberg_sleep" size="100" road="250" arctic="yes">
<herb name="h18" />
<herb name="h19" />
<herb name="h20" />
<resource name="iron" chance="0.9" level="1" base="3" div="50" />
<resource name="stone" chance="0.9" level="1" base="2" div="100" />
<resource name="laen" chance="0.05" level="1" base="4" div="100" />
</terrain>
<terrain name="iceberg" size="100" arctic="yes">
<herb name="h18" />
<herb name="h19" />
<herb name="h20" />
<resource name="iron" chance="0.9" level="1" base="3" div="50" />
<resource name="stone" chance="0.9" level="1" base="2" div="100" />
</terrain>
<terrain name="firewall" size="100" road="250" land="no" walk="no" sail="no" fly="no" forbidden="yes" />
<terrain name="fog" sail="no" land="no" size="0" />
<terrain name="thickfog" forbidden="yes" sail="no" walk="no" fly="no" land="no" size="0" />
<terrain name="volcano" size="500" road="250" seed="1">
<resource name="iron" chance="0.5" level="1" base="50" div="50" />
<resource name="stone" chance="0.5" level="1" base="100" div="100" />
<resource name="laen" chance="0.075" level="1" base="4" div="100" />
</terrain>
<terrain name="activevolcano" size="500" road="250">
<resource name="iron" chance="0.5" level="1" base="50" div="50" />
<resource name="stone" chance="0.5" level="1" base="100" div="100" />
<resource name="laen" chance="0.075" level="1" base="4" div="100" />
</terrain>
</terrains>

View file

@ -1,14 +1,14 @@
<?xml version="1.0"?>
<resource name="axe">
<item weight="200">
<function name="canuse" value="lua_canuse_item"/>
<construction skill="weaponsmithing" minskill="3" reqsize="1">
<requirement type="log" quantity="1"/>
<requirement type="iron" quantity="1"/>
</construction>
<weapon cut="true" skill="melee" offmod="1" defmod="-2">
<damage type="rider" value="2d6+4"/>
<damage type="footman" value="2d6+4"/>
</weapon>
</item>
</resource>
<?xml version="1.0"?>
<resource name="axe">
<item weight="200">
<function name="canuse" value="lua_canuse_item"/>
<construction skill="weaponsmithing" minskill="3" reqsize="1">
<requirement type="log" quantity="1"/>
<requirement type="iron" quantity="1"/>
</construction>
<weapon cut="true" skill="melee" offmod="1" defmod="-2">
<damage type="rider" value="2d6+4"/>
<damage type="footman" value="2d6+4"/>
</weapon>
</item>
</resource>

View file

@ -1,13 +1,13 @@
<?xml version="1.0"?>
<resource name="bow">
<item weight="100">
<construction skill="weaponsmithing" minskill="2" reqsize="1">
<requirement type="log" quantity="1"/>
</construction>
<weapon pierce="true" missile="true" skill="bow" offmod="0" defmod="0" reload="0">
<damage type="rider" value="1d11+1"/>
<damage type="footman" value="1d11+1"/>
<modifier type="missile_target" value="2"/>
</weapon>
</item>
</resource>
<?xml version="1.0"?>
<resource name="bow">
<item weight="100">
<construction skill="weaponsmithing" minskill="2" reqsize="1">
<requirement type="log" quantity="1"/>
</construction>
<weapon pierce="true" missile="true" skill="bow" offmod="0" defmod="0" reload="0">
<damage type="rider" value="1d11+1"/>
<damage type="footman" value="1d11+1"/>
<modifier type="missile_target" value="2"/>
</weapon>
</item>
</resource>

View file

@ -1,14 +1,14 @@
<?xml version="1.0"?>
<resource name="catapult">
<item weight="10000">
<construction skill="cartmaking" minskill="5" reqsize="1">
<requirement type="log" quantity="10"/>
</construction>
<weapon siege="true" bash="true" missile="true" skill="catapult" offmod="0" defmod="0" reload="5">
<damage type="rider" value="3d10+5"/>
<damage type="footman" value="3d10+5"/>
<modifier type="missile_target" value="4"/>
<function name="attack" value="attack_catapult"/>
</weapon>
</item>
</resource>
<?xml version="1.0"?>
<resource name="catapult">
<item weight="10000">
<construction skill="cartmaking" minskill="5" reqsize="1">
<requirement type="log" quantity="10"/>
</construction>
<weapon siege="true" bash="true" missile="true" skill="catapult" offmod="0" defmod="0" reload="5">
<damage type="rider" value="3d10+5"/>
<damage type="footman" value="3d10+5"/>
<modifier type="missile_target" value="4"/>
<function name="attack" value="attack_catapult"/>
</weapon>
</item>
</resource>

View file

@ -1,13 +1,13 @@
<?xml version="1.0"?>
<resource name="crossbow">
<item weight="100">
<construction skill="weaponsmithing" minskill="3" reqsize="1">
<requirement type="log" quantity="1"/>
</construction>
<weapon armorpiercing="true" pierce="true" missile="true" skill="crossbow" offmod="0" defmod="0" reload="2">
<damage type="rider" value="3d3+5"/>
<damage type="footman" value="3d3+5"/>
<modifier type="missile_target" value="0"/>
</weapon>
</item>
</resource>
<?xml version="1.0"?>
<resource name="crossbow">
<item weight="100">
<construction skill="weaponsmithing" minskill="3" reqsize="1">
<requirement type="log" quantity="1"/>
</construction>
<weapon armorpiercing="true" pierce="true" missile="true" skill="crossbow" offmod="0" defmod="0" reload="2">
<damage type="rider" value="3d3+5"/>
<damage type="footman" value="3d3+5"/>
<modifier type="missile_target" value="0"/>
</weapon>
</item>
</resource>

View file

@ -1,10 +1,10 @@
<?xml version="1.0"?>
<resource name="firesword">
<item weight="100">
<weapon minskill="7" magres="0.3" cut="true" skill="melee" offmod="1" defmod="1">
<function name="attack" value="attack_firesword"/>
<damage type="rider" value="3d6+10"/>
<damage type="footman" value="3d6+10"/>
</weapon>
</item>
</resource>
<?xml version="1.0"?>
<resource name="firesword">
<item weight="100">
<weapon minskill="7" magres="0.3" cut="true" skill="melee" offmod="1" defmod="1">
<function name="attack" value="attack_firesword"/>
<damage type="rider" value="3d6+10"/>
<damage type="footman" value="3d6+10"/>
</weapon>
</item>
</resource>

View file

@ -1,18 +1,18 @@
<?xml version="1.0"?>
<resource name="greatbow">
<item weight="100">
<function name="canuse" value="lua_canuse_item"/>
<construction skill="weaponsmithing" minskill="5" reqsize="1">
<modifier function="mod_elves_only"/>
<requirement type="mallorn" quantity="2"/>
</construction>
<weapon pierce="true" missile="true" skill="bow" offmod="0" defmod="0" reload="0" magres="0.0">
<damage type="rider" value="2d6+4"/>
<damage type="footman" value="2d6+4"/>
<modifier type="missile_target" value="2"/>
<modifier type="damage" value="1">
<race name="elf"/>
</modifier>
</weapon>
</item>
</resource>
<?xml version="1.0"?>
<resource name="greatbow">
<item weight="100">
<function name="canuse" value="lua_canuse_item"/>
<construction skill="weaponsmithing" minskill="5" reqsize="1">
<modifier function="mod_elves_only"/>
<requirement type="mallorn" quantity="2"/>
</construction>
<weapon pierce="true" missile="true" skill="bow" offmod="0" defmod="0" reload="0" magres="0.0">
<damage type="rider" value="2d6+4"/>
<damage type="footman" value="2d6+4"/>
<modifier type="missile_target" value="2"/>
<modifier type="damage" value="1">
<race name="elf"/>
</modifier>
</weapon>
</item>
</resource>

View file

@ -1,13 +1,13 @@
<?xml version="1.0"?>
<resource name="greatsword">
<item weight="200" score="30">
<function name="canuse" value="lua_canuse_item"/>
<construction skill="weaponsmithing" minskill="4" reqsize="1">
<requirement type="iron" quantity="2"/>
</construction>
<weapon cut="true" skill="melee" offmod="-1" defmod="-2">
<damage type="rider" value="2d8+3"/>
<damage type="footman" value="2d8+3"/>
</weapon>
</item>
</resource>
<?xml version="1.0"?>
<resource name="greatsword">
<item weight="200" score="30">
<function name="canuse" value="lua_canuse_item"/>
<construction skill="weaponsmithing" minskill="4" reqsize="1">
<requirement type="iron" quantity="2"/>
</construction>
<weapon cut="true" skill="melee" offmod="-1" defmod="-2">
<damage type="rider" value="2d8+3"/>
<damage type="footman" value="2d8+3"/>
</weapon>
</item>
</resource>

View file

@ -1,15 +1,15 @@
<?xml version="1.0"?>
<resource name="halberd">
<item weight="200">
<function name="canuse" value="lua_canuse_item"/>
<construction skill="weaponsmithing" minskill="3" reqsize="1">
<requirement type="log" quantity="2"/>
<requirement type="iron" quantity="1"/>
</construction>
<weapon cut="true" skill="polearm" offmod="-1" defmod="2" magres="0.0">
<damage type="rider" value="2d6+3"/>
<damage type="footman" value="2d6+3"/>
<modifier type="skill" value="1" walking="true" against_riding="true" defensive="true"/>
</weapon>
</item>
</resource>
<?xml version="1.0"?>
<resource name="halberd">
<item weight="200">
<function name="canuse" value="lua_canuse_item"/>
<construction skill="weaponsmithing" minskill="3" reqsize="1">
<requirement type="log" quantity="2"/>
<requirement type="iron" quantity="1"/>
</construction>
<weapon cut="true" skill="polearm" offmod="-1" defmod="2" magres="0.0">
<damage type="rider" value="2d6+3"/>
<damage type="footman" value="2d6+3"/>
<modifier type="skill" value="1" walking="true" against_riding="true" defensive="true"/>
</weapon>
</item>
</resource>

View file

@ -1,12 +1,12 @@
<?xml version="1.0"?>
<resource name="laensword">
<item weight="100" score="400">
<construction skill="weaponsmithing" minskill="8" reqsize="1">
<requirement type="laen" quantity="1"/>
</construction>
<weapon cut="true" skill="melee" offmod="1" defmod="1" magres="0.30">
<damage type="rider" value="3d6+10"/>
<damage type="footman" value="3d6+10"/>
</weapon>
</item>
</resource>
<?xml version="1.0"?>
<resource name="laensword">
<item weight="100" score="400">
<construction skill="weaponsmithing" minskill="8" reqsize="1">
<requirement type="laen" quantity="1"/>
</construction>
<weapon cut="true" skill="melee" offmod="1" defmod="1" magres="0.30">
<damage type="rider" value="3d6+10"/>
<damage type="footman" value="3d6+10"/>
</weapon>
</item>
</resource>

View file

@ -1,13 +1,13 @@
<?xml version="1.0"?>
<resource name="lance">
<item weight="200">
<function name="canuse" value="lua_canuse_item"/>
<construction skill="weaponsmithing" minskill="2" reqsize="1">
<requirement type="log" quantity="2"/>
</construction>
<weapon pierce="true" skill="polearm" offmod="0" defmod="-2">
<damage type="footman" value="1d5"/>
<damage type="rider" value="2d6+5"/>
</weapon>
</item>
</resource>
<?xml version="1.0"?>
<resource name="lance">
<item weight="200">
<function name="canuse" value="lua_canuse_item"/>
<construction skill="weaponsmithing" minskill="2" reqsize="1">
<requirement type="log" quantity="2"/>
</construction>
<weapon pierce="true" skill="polearm" offmod="0" defmod="-2">
<damage type="footman" value="1d5"/>
<damage type="rider" value="2d6+5"/>
</weapon>
</item>
</resource>

View file

@ -1,16 +1,16 @@
<?xml version="1.0"?>
<resource name="mallornbow">
<item weight="100">
<construction skill="weaponsmithing" minskill="5" reqsize="1">
<requirement type="mallorn" quantity="1"/>
</construction>
<weapon pierce="true" missile="true" skill="bow" offmod="0" defmod="0" reload="0" magres="0.15">
<damage type="rider" value="1d11+2"/>
<damage type="footman" value="1d11+2"/>
<modifier type="missile_target" value="2"/>
<modifier type="damage" value="1">
<race name="elf"/>
</modifier>
</weapon>
</item>
</resource>
<?xml version="1.0"?>
<resource name="mallornbow">
<item weight="100">
<construction skill="weaponsmithing" minskill="5" reqsize="1">
<requirement type="mallorn" quantity="1"/>
</construction>
<weapon pierce="true" missile="true" skill="bow" offmod="0" defmod="0" reload="0" magres="0.15">
<damage type="rider" value="1d11+2"/>
<damage type="footman" value="1d11+2"/>
<modifier type="missile_target" value="2"/>
<modifier type="damage" value="1">
<race name="elf"/>
</modifier>
</weapon>
</item>
</resource>

View file

@ -1,13 +1,13 @@
<?xml version="1.0"?>
<resource name="mallorncrossbow">
<item weight="100">
<construction skill="weaponsmithing" minskill="5" reqsize="1">
<requirement type="mallorn" quantity="1"/>
</construction>
<weapon armorpiercing="true" pierce="true" missile="true" skill="crossbow" offmod="0" defmod="0" reload="2" magres="0.15">
<damage type="rider" value="3d3+5"/>
<damage type="footman" value="3d3+5"/>
<modifier type="missile_target" value="0"/>
</weapon>
</item>
</resource>
<?xml version="1.0"?>
<resource name="mallorncrossbow">
<item weight="100">
<construction skill="weaponsmithing" minskill="5" reqsize="1">
<requirement type="mallorn" quantity="1"/>
</construction>
<weapon armorpiercing="true" pierce="true" missile="true" skill="crossbow" offmod="0" defmod="0" reload="2" magres="0.15">
<damage type="rider" value="3d3+5"/>
<damage type="footman" value="3d3+5"/>
<modifier type="missile_target" value="0"/>
</weapon>
</item>
</resource>

View file

@ -1,13 +1,13 @@
<?xml version="1.0"?>
<resource name="mallornlance">
<item weight="100">
<function name="canuse" value="lua_canuse_item"/>
<construction skill="weaponsmithing" minskill="5" reqsize="1">
<requirement type="mallorn" quantity="2"/>
</construction>
<weapon pierce="true" skill="polearm" minskill="5" offmod="0" defmod="0" magres="0.15">
<damage type="footman" value="1d5+1"/>
<damage type="rider" value="2d6+6"/>
</weapon>
</item>
</resource>
<?xml version="1.0"?>
<resource name="mallornlance">
<item weight="100">
<function name="canuse" value="lua_canuse_item"/>
<construction skill="weaponsmithing" minskill="5" reqsize="1">
<requirement type="mallorn" quantity="2"/>
</construction>
<weapon pierce="true" skill="polearm" minskill="5" offmod="0" defmod="0" magres="0.15">
<damage type="footman" value="1d5+1"/>
<damage type="rider" value="2d6+6"/>
</weapon>
</item>
</resource>

View file

@ -1,14 +1,14 @@
<?xml version="1.0"?>
<resource name="mallornspear">
<item weight="100">
<construction skill="weaponsmithing" minskill="5" reqsize="1">
<requirement type="mallorn" quantity="1"/>
</construction>
<weapon pierce="true" skill="polearm" minskill="5" offmod="0" defmod="0" magres="0.15">
<damage type="footman" value="1d10+1"/>
<damage type="rider" value="1d12+3"/>
<modifier type="skill" value="1" riding="true" against_riding="true" against_walking="true" offensive="true"/>
<modifier type="skill" value="1" walking="true" against_riding="true" against_walking="true" defensive="true"/>
</weapon>
</item>
</resource>
<?xml version="1.0"?>
<resource name="mallornspear">
<item weight="100">
<construction skill="weaponsmithing" minskill="5" reqsize="1">
<requirement type="mallorn" quantity="1"/>
</construction>
<weapon pierce="true" skill="polearm" minskill="5" offmod="0" defmod="0" magres="0.15">
<damage type="footman" value="1d10+1"/>
<damage type="rider" value="1d12+3"/>
<modifier type="skill" value="1" riding="true" against_riding="true" against_walking="true" offensive="true"/>
<modifier type="skill" value="1" walking="true" against_riding="true" against_walking="true" defensive="true"/>
</weapon>
</item>
</resource>

View file

@ -1,16 +1,16 @@
<?xml version="1.0"?>
<resource name="rep_crossbow">
<item weight="100">
<function name="canuse" value="lua_canuse_item"/>
<construction skill="weaponsmithing" minskill="5" reqsize="1">
<modifier function="mod_dwarves_only"/>
<requirement type="log" quantity="1"/>
<requirement type="iron" quantity="1"/>
</construction>
<weapon armorpiercing="true" pierce="true" missile="true" skill="crossbow" offmod="0" defmod="0" reload="1">
<damage type="rider" value="3d4+5"/>
<damage type="footman" value="3d4+5"/>
<modifier type="missile_target" value="0"/>
</weapon>
</item>
</resource>
<?xml version="1.0"?>
<resource name="rep_crossbow">
<item weight="100">
<function name="canuse" value="lua_canuse_item"/>
<construction skill="weaponsmithing" minskill="5" reqsize="1">
<modifier function="mod_dwarves_only"/>
<requirement type="log" quantity="1"/>
<requirement type="iron" quantity="1"/>
</construction>
<weapon armorpiercing="true" pierce="true" missile="true" skill="crossbow" offmod="0" defmod="0" reload="1">
<damage type="rider" value="3d4+5"/>
<damage type="footman" value="3d4+5"/>
<modifier type="missile_target" value="0"/>
</weapon>
</item>
</resource>

View file

@ -1,10 +1,10 @@
<?xml version="1.0"?>
<resource name="runesword">
<item weight="100" score="2000">
<weapon minskill="7" cut="true" magical="yes" skill="melee" offmod="2" defmod="2">
<function name="attack" value="attack_firesword"/>
<damage type="rider" value="3d10+10"/>
<damage type="footman" value="3d10+10"/>
</weapon>
</item>
</resource>
<?xml version="1.0"?>
<resource name="runesword">
<item weight="100" score="2000">
<weapon minskill="7" cut="true" magical="yes" skill="melee" offmod="2" defmod="2">
<function name="attack" value="attack_firesword"/>
<damage type="rider" value="3d10+10"/>
<damage type="footman" value="3d10+10"/>
</weapon>
</item>
</resource>

View file

@ -1,14 +1,14 @@
<?xml version="1.0"?>
<resource name="rustyaxe">
<item weight="200">
<function name="canuse" value="lua_canuse_item"/>
<construction skill="weaponsmithing" minskill="3" reqsize="1">
<requirement type="log" quantity="1"/>
<requirement type="iron" quantity="1"/>
</construction>
<weapon cut="true" skill="melee" offmod="0" defmod="-3">
<damage type="rider" value="2d6"/>
<damage type="footman" value="2d6"/>
</weapon>
</item>
</resource>
<?xml version="1.0"?>
<resource name="rustyaxe">
<item weight="200">
<function name="canuse" value="lua_canuse_item"/>
<construction skill="weaponsmithing" minskill="3" reqsize="1">
<requirement type="log" quantity="1"/>
<requirement type="iron" quantity="1"/>
</construction>
<weapon cut="true" skill="melee" offmod="0" defmod="-3">
<damage type="rider" value="2d6"/>
<damage type="footman" value="2d6"/>
</weapon>
</item>
</resource>

View file

@ -1,12 +1,12 @@
<?xml version="1.0"?>
<resource name="rustygreatsword">
<item weight="200" score="20">
<construction skill="weaponsmithing" minskill="4" reqsize="1">
<requirement type="iron" quantity="2"/>
</construction>
<weapon cut="true" skill="melee" offmod="-2" defmod="-3">
<damage type="rider" value="2d8"/>
<damage type="footman" value="2d8"/>
</weapon>
</item>
</resource>
<?xml version="1.0"?>
<resource name="rustygreatsword">
<item weight="200" score="20">
<construction skill="weaponsmithing" minskill="4" reqsize="1">
<requirement type="iron" quantity="2"/>
</construction>
<weapon cut="true" skill="melee" offmod="-2" defmod="-3">
<damage type="rider" value="2d8"/>
<damage type="footman" value="2d8"/>
</weapon>
</item>
</resource>

View file

@ -1,15 +1,15 @@
<?xml version="1.0"?>
<resource name="rustyhalberd">
<item weight="200" score="20">
<function name="canuse" value="lua_canuse_item"/>
<construction skill="weaponsmithing" minskill="3" reqsize="1">
<requirement type="iron" quantity="1"/>
<requirement type="log" quantity="1"/>
</construction>
<weapon cut="true" skill="polearm" offmod="-2" defmod="-1">
<damage type="rider" value="2d6"/>
<damage type="footman" value="2d6"/>
</weapon>
</item>
</resource>
<?xml version="1.0"?>
<resource name="rustyhalberd">
<item weight="200" score="20">
<function name="canuse" value="lua_canuse_item"/>
<construction skill="weaponsmithing" minskill="3" reqsize="1">
<requirement type="iron" quantity="1"/>
<requirement type="log" quantity="1"/>
</construction>
<weapon cut="true" skill="polearm" offmod="-2" defmod="-1">
<damage type="rider" value="2d6"/>
<damage type="footman" value="2d6"/>
</weapon>
</item>
</resource>

View file

@ -1,12 +1,12 @@
<?xml version="1.0"?>
<resource name="rustysword">
<item weight="100" score="10">
<construction skill="weaponsmithing" minskill="3" reqsize="1">
<requirement type="iron" quantity="1"/>
</construction>
<weapon cut="true" skill="melee" offmod="-1" defmod="-1">
<damage type="rider" value="1d9"/>
<damage type="footman" value="1d9"/>
</weapon>
</item>
</resource>
<?xml version="1.0"?>
<resource name="rustysword">
<item weight="100" score="10">
<construction skill="weaponsmithing" minskill="3" reqsize="1">
<requirement type="iron" quantity="1"/>
</construction>
<weapon cut="true" skill="melee" offmod="-1" defmod="-1">
<damage type="rider" value="1d9"/>
<damage type="footman" value="1d9"/>
</weapon>
</item>
</resource>

View file

@ -1,14 +1,14 @@
<?xml version="1.0"?>
<resource name="spear">
<item weight="100">
<construction skill="weaponsmithing" minskill="2" reqsize="1">
<requirement type="log" quantity="1"/>
</construction>
<weapon pierce="true" skill="polearm" offmod="0" defmod="0">
<damage type="footman" value="1d10"/>
<damage type="rider" value="1d12+2"/>
<modifier type="skill" value="1" riding="true" against_riding="true" against_walking="true" offensive="true"/>
<modifier type="skill" value="1" walking="true" against_riding="true" against_walking="true" defensive="true"/>
</weapon>
</item>
</resource>
<?xml version="1.0"?>
<resource name="spear">
<item weight="100">
<construction skill="weaponsmithing" minskill="2" reqsize="1">
<requirement type="log" quantity="1"/>
</construction>
<weapon pierce="true" skill="polearm" offmod="0" defmod="0">
<damage type="footman" value="1d10"/>
<damage type="rider" value="1d12+2"/>
<modifier type="skill" value="1" riding="true" against_riding="true" against_walking="true" offensive="true"/>
<modifier type="skill" value="1" walking="true" against_riding="true" against_walking="true" defensive="true"/>
</weapon>
</item>
</resource>

View file

@ -1,12 +1,12 @@
<?xml version="1.0"?>
<resource name="sword">
<item weight="100" score="30">
<construction skill="weaponsmithing" minskill="3" reqsize="1">
<requirement type="iron" quantity="1"/>
</construction>
<weapon cut="true" skill="melee">
<damage type="rider" value="1d9+2"/>
<damage type="footman" value="1d9+2"/>
</weapon>
</item>
</resource>
<?xml version="1.0"?>
<resource name="sword">
<item weight="100" score="30">
<construction skill="weaponsmithing" minskill="3" reqsize="1">
<requirement type="iron" quantity="1"/>
</construction>
<weapon cut="true" skill="melee">
<damage type="rider" value="1d9+2"/>
<damage type="footman" value="1d9+2"/>
</weapon>
</item>
</resource>

View file

@ -1,11 +1,11 @@
callbacks = {}
callbacks["attrib_init"] = function(attr)
if attr.name ~= nil then
local init = callbacks["init_" .. attr.name]
if init ~=nil then
init(attr)
end
end
end
callbacks = {}
callbacks["attrib_init"] = function(attr)
if attr.name ~= nil then
local init = callbacks["init_" .. attr.name]
if init ~=nil then
init(attr)
end
end
end

View file

@ -1,121 +1,121 @@
function change_locales(localechange)
for loc, flist in pairs(localechange) do
for index, name in pairs(flist) do
f = get_faction(atoi36(name))
if f ~= nil then
f.locale = loc
print("LOCALECHANGE ", f, loc)
end
end
end
end
function dbupdate()
update_scores()
edb = db.open(config.basepath.."/eressea.db")
if edb~=nil then
edb:update_factions()
edb:update_scores()
else
print("could no open "..config.basepath.."/eressea.db")
end
end
function nmr_check(maxnmrs)
local nmrs = get_nmrs(1)
if nmrs >= maxnmrs then
print("Shit. More than " .. maxnmrs .. " factions with 1 NMR (" .. nmrs .. ")")
write_summary()
write_game("aborted.dat")
return -1
end
print (nmrs .. " Factions with 1 NMR")
return 0
end
function open_game(turn)
file = "" .. get_turn()
if read_game(file .. ".dat", "binary")~=0 then
return read_game(file, "text")
end
return 0
end
function write_emails(locales)
local files = {}
local key
local locale
local file
for key, locale in pairs(locales) do
files[locale] = io.open(config.basepath .. "/emails." .. locale, "w")
end
local faction
for faction in factions() do
if faction.email~="" then
files[faction.locale]:write(faction.email .. "\n")
end
end
for key, file in pairs(files) do
file:close()
end
end
function write_addresses()
local file
local faction
file = io.open(config.basepath .. "/adressen", "w")
for faction in factions() do
-- print(faction.id .. " - " .. faction.locale)
file:write(tostring(faction) .. ":" .. faction.email .. ":" .. faction.info .. "\n")
end
file:close()
end
function write_aliases()
local file
local faction
file = io.open(config.basepath .. "/aliases", "w")
for faction in factions() do
local unit
if faction.email ~= "" then
file:write("partei-" .. itoa36(faction.id) .. ": " .. faction.email .. "\n")
for unit in faction.units do
file:write("einheit-" .. itoa36(unit.id) .. ": " .. faction.email .. "\n")
end
end
end
file:close()
end
function write_files(locales)
write_passwords()
write_reports()
write_summary()
-- write_emails(locales)
-- write_aliases()
-- write_addresses()
end
function write_scores()
scores = {}
for r in regions() do
f = r.owner
if f~=nil then
value = scores[f.id]
if value==nil then value=0 end
value = value + r:get_resource("money")/100
scores[f.id] = value
end
end
for f in factions() do
score=scores[f.id]
if score==nil then score=0 end
print(math.floor(score)..":"..f.name..":"..itoa36(f.id))
end
end
function change_locales(localechange)
for loc, flist in pairs(localechange) do
for index, name in pairs(flist) do
f = get_faction(atoi36(name))
if f ~= nil then
f.locale = loc
print("LOCALECHANGE ", f, loc)
end
end
end
end
function dbupdate()
update_scores()
edb = db.open(config.basepath.."/eressea.db")
if edb~=nil then
edb:update_factions()
edb:update_scores()
else
print("could no open "..config.basepath.."/eressea.db")
end
end
function nmr_check(maxnmrs)
local nmrs = get_nmrs(1)
if nmrs >= maxnmrs then
print("Shit. More than " .. maxnmrs .. " factions with 1 NMR (" .. nmrs .. ")")
write_summary()
write_game("aborted.dat")
return -1
end
print (nmrs .. " Factions with 1 NMR")
return 0
end
function open_game(turn)
file = "" .. get_turn()
if read_game(file .. ".dat", "binary")~=0 then
return read_game(file, "text")
end
return 0
end
function write_emails(locales)
local files = {}
local key
local locale
local file
for key, locale in pairs(locales) do
files[locale] = io.open(config.basepath .. "/emails." .. locale, "w")
end
local faction
for faction in factions() do
if faction.email~="" then
files[faction.locale]:write(faction.email .. "\n")
end
end
for key, file in pairs(files) do
file:close()
end
end
function write_addresses()
local file
local faction
file = io.open(config.basepath .. "/adressen", "w")
for faction in factions() do
-- print(faction.id .. " - " .. faction.locale)
file:write(tostring(faction) .. ":" .. faction.email .. ":" .. faction.info .. "\n")
end
file:close()
end
function write_aliases()
local file
local faction
file = io.open(config.basepath .. "/aliases", "w")
for faction in factions() do
local unit
if faction.email ~= "" then
file:write("partei-" .. itoa36(faction.id) .. ": " .. faction.email .. "\n")
for unit in faction.units do
file:write("einheit-" .. itoa36(unit.id) .. ": " .. faction.email .. "\n")
end
end
end
file:close()
end
function write_files(locales)
write_passwords()
write_reports()
write_summary()
-- write_emails(locales)
-- write_aliases()
-- write_addresses()
end
function write_scores()
scores = {}
for r in regions() do
f = r.owner
if f~=nil then
value = scores[f.id]
if value==nil then value=0 end
value = value + r:get_resource("money")/100
scores[f.id] = value
end
end
for f in factions() do
score=scores[f.id]
if score==nil then score=0 end
print(math.floor(score)..":"..f.name..":"..itoa36(f.id))
end
end

View file

@ -1,95 +1,95 @@
---------------------------------------------
-- Return indentation string for passed level
---------------------------------------------
local function tabs(i)
return string.rep(".",i).." " -- Dots followed by a space
end
-----------------------------------------------------------
-- Return string representation of parameter's value & type
-----------------------------------------------------------
local function toStrType(t)
local function fttu2hex(t) -- Grab hex value from tostring() output
local str = tostring(t);
if str == nil then
return "tostring() failure! \n"
else
local str2 = string.match(str,"[ :][ (](%x+)")
if str2 == nil then
return "string.match() failure: "..str.."\n"
else
return "0x"..str2
end
end
end
-- Stringify a value of a given type using a table of functions keyed
-- by the name of the type (Lua's version of C's switch() statement).
local stringify = {
-- Keys are all possible strings that type() may return,
-- per http://www.lua.org/manual/5.1/manual.html#pdf-type.
["nil"] = function(v) return "nil (nil)" end,
["string"] = function(v) return '"'..v..'" (string)' end,
["number"] = function(v) return v.." (number)" end,
["boolean"] = function(v) return tostring(v).." (boolean)" end,
["function"] = function(v) return fttu2hex(v).." (function)" end,
["table"] = function(v) return fttu2hex(v).." (table)" end,
["thread"] = function(v) return fttu2hex(v).." (thread)" end,
["userdata"] = function(v) return fttu2hex(v).." (userdata)" end
}
return stringify[type(t)](t)
end
-------------------------------------
-- Count elements in the passed table
-------------------------------------
local function lenTable(t) -- What Lua builtin does this simple thing?
local n=0 -- '#' doesn't work with mixed key types
if ("table" == type(t)) then
for key in pairs(t) do -- Just count 'em
n = n + 1
end
return n
else
return nil
end
end
--------------------------------
-- Pretty-print the passed table
--------------------------------
local function do_dumptable(t, indent, seen)
-- "seen" is an initially empty table used to track all tables
-- that have been dumped so far. No table is dumped twice.
-- This also keeps the code from following self-referential loops,
-- the need for which was found when first dumping "_G".
if ("table" == type(t)) then -- Dump passed table
seen[t] = 1
if (indent == 0) then
print ("The passed table has "..lenTable(t).." entries:")
indent = 1
end
for f,v in pairsByKeys(t) do
if ("table" == type(v)) and (seen[v] == nil) then -- Recurse
print( tabs(indent)..toStrType(f).." has "..lenTable(v).." entries: {")
do_dumptable(v, indent+1, seen)
print( tabs(indent).."}" )
else
print( tabs(indent)..toStrType(f).." = "..toStrType(v))
end
end
else
print (tabs(indent).."Not a table!")
end
end
--------------------------------
-- Wrapper to handle persistence
--------------------------------
function dumptable(t) -- Only global declaration in the package
-- This wrapper exists only to set the environment for the first run:
-- The second param is the indentation level.
-- The third param is the list of tables dumped during this call.
-- Getting this list allocated and freed was a pain, and this
-- wrapper was the best solution I came up with...
return do_dumptable(t, 0, {})
end
---------------------------------------------
-- Return indentation string for passed level
---------------------------------------------
local function tabs(i)
return string.rep(".",i).." " -- Dots followed by a space
end
-----------------------------------------------------------
-- Return string representation of parameter's value & type
-----------------------------------------------------------
local function toStrType(t)
local function fttu2hex(t) -- Grab hex value from tostring() output
local str = tostring(t);
if str == nil then
return "tostring() failure! \n"
else
local str2 = string.match(str,"[ :][ (](%x+)")
if str2 == nil then
return "string.match() failure: "..str.."\n"
else
return "0x"..str2
end
end
end
-- Stringify a value of a given type using a table of functions keyed
-- by the name of the type (Lua's version of C's switch() statement).
local stringify = {
-- Keys are all possible strings that type() may return,
-- per http://www.lua.org/manual/5.1/manual.html#pdf-type.
["nil"] = function(v) return "nil (nil)" end,
["string"] = function(v) return '"'..v..'" (string)' end,
["number"] = function(v) return v.." (number)" end,
["boolean"] = function(v) return tostring(v).." (boolean)" end,
["function"] = function(v) return fttu2hex(v).." (function)" end,
["table"] = function(v) return fttu2hex(v).." (table)" end,
["thread"] = function(v) return fttu2hex(v).." (thread)" end,
["userdata"] = function(v) return fttu2hex(v).." (userdata)" end
}
return stringify[type(t)](t)
end
-------------------------------------
-- Count elements in the passed table
-------------------------------------
local function lenTable(t) -- What Lua builtin does this simple thing?
local n=0 -- '#' doesn't work with mixed key types
if ("table" == type(t)) then
for key in pairs(t) do -- Just count 'em
n = n + 1
end
return n
else
return nil
end
end
--------------------------------
-- Pretty-print the passed table
--------------------------------
local function do_dumptable(t, indent, seen)
-- "seen" is an initially empty table used to track all tables
-- that have been dumped so far. No table is dumped twice.
-- This also keeps the code from following self-referential loops,
-- the need for which was found when first dumping "_G".
if ("table" == type(t)) then -- Dump passed table
seen[t] = 1
if (indent == 0) then
print ("The passed table has "..lenTable(t).." entries:")
indent = 1
end
for f,v in pairsByKeys(t) do
if ("table" == type(v)) and (seen[v] == nil) then -- Recurse
print( tabs(indent)..toStrType(f).." has "..lenTable(v).." entries: {")
do_dumptable(v, indent+1, seen)
print( tabs(indent).."}" )
else
print( tabs(indent)..toStrType(f).." = "..toStrType(v))
end
end
else
print (tabs(indent).."Not a table!")
end
end
--------------------------------
-- Wrapper to handle persistence
--------------------------------
function dumptable(t) -- Only global declaration in the package
-- This wrapper exists only to set the environment for the first run:
-- The second param is the indentation level.
-- The third param is the list of tables dumped during this call.
-- Getting this list allocated and freed was a pain, and this
-- wrapper was the best solution I came up with...
return do_dumptable(t, 0, {})
end

View file

@ -1,25 +1,25 @@
-- implements gates and travel between them
-- used in HSE and Eressea
function gate_travel(b, units)
-- we've found which units we want to exchange, now swap them:
local u
for key, u in pairs(units) do
u.region = b.region
u.building = b
end
end
function gate_units(b, maxsize)
local size = maxsize
local units = {}
local u
for u in b.units do
if u.number<=size and u.weight<=u.capacity then
units[u] = u
size = size - u.number
end
end
return units
end
-- implements gates and travel between them
-- used in HSE and Eressea
function gate_travel(b, units)
-- we've found which units we want to exchange, now swap them:
local u
for key, u in pairs(units) do
u.region = b.region
u.building = b
end
end
function gate_units(b, maxsize)
local size = maxsize
local units = {}
local u
for u in b.units do
if u.number<=size and u.weight<=u.capacity then
units[u] = u
size = size - u.number
end
end
return units
end

View file

@ -1,43 +1,43 @@
require(config.game .. ".modules")
require "default"
require "resources"
function run_editor()
local turn = get_turn()
if turn==0 then
turn = read_turn()
set_turn(turn)
end
read_game(turn .. ".dat")
gmtool.editor()
end
function run_tests()
print("running tests")
require "lunit"
lunit.clearstats()
local argv = tests or {}
local stats = lunit.main(argv)
if stats.errors > 0 or stats.failed > 0 then
return 1
end
return 0
end
function run_turn()
require(config.game .. ".main")
local turn = get_turn()
if turn==0 then
turn = read_turn()
set_turn(turn)
end
orderfile = orderfile or config.basepath .. '/orders.' .. turn
print("executing turn " .. get_turn() .. " with " .. orderfile)
local result = process(orderfile)
if result==0 then
dbupdate()
end
return result
end
require(config.game .. ".modules")
require "default"
require "resources"
function run_editor()
local turn = get_turn()
if turn==0 then
turn = read_turn()
set_turn(turn)
end
read_game(turn .. ".dat")
gmtool.editor()
end
function run_tests()
print("running tests")
require "lunit"
lunit.clearstats()
local argv = tests or {}
local stats = lunit.main(argv)
if stats.errors > 0 or stats.failed > 0 then
return 1
end
return 0
end
function run_turn()
require(config.game .. ".main")
local turn = get_turn()
if turn==0 then
turn = read_turn()
set_turn(turn)
end
orderfile = orderfile or config.basepath .. '/orders.' .. turn
print("executing turn " .. get_turn() .. " with " .. orderfile)
local result = process(orderfile)
if result==0 then
dbupdate()
end
return result
end

View file

@ -1,101 +1,101 @@
function kill_nonstarters()
for f in factions() do
if f.lastturn==1 then
kill_faction(f, true)
end
end
end
function kill_multis(multis, destructive)
for idx, fno in ipairs(multis) do
local f = get_faction(fno)
if f~=nil and f.email=="doppelspieler@eressea.de" then
kill_faction(f, destructive)
end
end
end
function mark_multis(multis, block)
if multis~=nil then
for idx, fno in ipairs(multis) do
local f = get_faction(fno)
if f~=nil and f.email~="doppelspieler@eressea.de" then
print("* multi-player " .. tostring(f))
mark_multi(f, block)
end
end
end
end
-- destroy a faction
-- destructive: kill all of its buildings and the home region, too.
function kill_faction(f, destructive)
for u in f.units do
local r = u.region
local b = u.building
unit.destroy(u)
if destructive and b~=nil then
building.destroy(b)
local nuke = true
for v in r.units do
if v.faction.id~=f.id then
-- print("cannot nuke: " .. tostring(v.faction))
nuke = false
break
end
end
r.terrain_name = nil
if nuke and num_oceans(r)<=1 then
-- print("nuke!")
r.terrain = "ocean"
else
-- print("cannot nuke: > 1 oceans")
r.terrain = "glacier"
r.peasants = 10
r:set_resource("money", 100)
b = building.create(r, "monument")
b.size = 1
b.name = "Memento Mori"
b.info = "Eine kleine " .. translate("race::" .. f.race .."_x") .. "-Statue erinnert hier an ein verschwundenes Volk"
end
end
end
faction.destroy(f)
end
local function mark_multi(f, block)
f.password = "doppelspieler"
f.email = "doppelspieler@eressea.de"
f.banner = "Diese Partei steht wegen vermuteten Doppelspiels unter Beobachtung."
for u in f.units do
u.race_name = "toad"
if block and u.building~=nil then
local found = false
for u2 in u.region.units do
if u2.faction.id~=u.faction.id then
found = true
break
end
end
if not found then
u.region.terrain_name = "firewall"
u.region:set_flag(2) -- RF_BLOCKED
end
end
end
end
local function num_oceans(r)
local oceans = 0
local p = r:next(5)
for d = 0,5 do
local n = r:next(d)
if p.terrain~="ocean" and n.terrain=="ocean" then
oceans = oceans +1
end
p = n
end
return oceans
end
function kill_nonstarters()
for f in factions() do
if f.lastturn==1 then
kill_faction(f, true)
end
end
end
function kill_multis(multis, destructive)
for idx, fno in ipairs(multis) do
local f = get_faction(fno)
if f~=nil and f.email=="doppelspieler@eressea.de" then
kill_faction(f, destructive)
end
end
end
function mark_multis(multis, block)
if multis~=nil then
for idx, fno in ipairs(multis) do
local f = get_faction(fno)
if f~=nil and f.email~="doppelspieler@eressea.de" then
print("* multi-player " .. tostring(f))
mark_multi(f, block)
end
end
end
end
-- destroy a faction
-- destructive: kill all of its buildings and the home region, too.
function kill_faction(f, destructive)
for u in f.units do
local r = u.region
local b = u.building
unit.destroy(u)
if destructive and b~=nil then
building.destroy(b)
local nuke = true
for v in r.units do
if v.faction.id~=f.id then
-- print("cannot nuke: " .. tostring(v.faction))
nuke = false
break
end
end
r.terrain_name = nil
if nuke and num_oceans(r)<=1 then
-- print("nuke!")
r.terrain = "ocean"
else
-- print("cannot nuke: > 1 oceans")
r.terrain = "glacier"
r.peasants = 10
r:set_resource("money", 100)
b = building.create(r, "monument")
b.size = 1
b.name = "Memento Mori"
b.info = "Eine kleine " .. translate("race::" .. f.race .."_x") .. "-Statue erinnert hier an ein verschwundenes Volk"
end
end
end
faction.destroy(f)
end
local function mark_multi(f, block)
f.password = "doppelspieler"
f.email = "doppelspieler@eressea.de"
f.banner = "Diese Partei steht wegen vermuteten Doppelspiels unter Beobachtung."
for u in f.units do
u.race_name = "toad"
if block and u.building~=nil then
local found = false
for u2 in u.region.units do
if u2.faction.id~=u.faction.id then
found = true
break
end
end
if not found then
u.region.terrain_name = "firewall"
u.region:set_flag(2) -- RF_BLOCKED
end
end
end
end
local function num_oceans(r)
local oceans = 0
local p = r:next(5)
for d = 0,5 do
local n = r:next(d)
if p.terrain~="ocean" and n.terrain=="ocean" then
oceans = oceans +1
end
p = n
end
return oceans
end

View file

@ -1,89 +1,89 @@
function peasant_getresource(u)
return u.region:get_resource("peasant")
end
function peasant_changeresource(u, delta)
local p = u.region:get_resource("peasant")
p = p + delta
if p < 0 then
p = 0
end
u.region:set_resource("peasant", p)
return p
end
function hp_getresource(u)
return u.hp
end
function hp_changeresource(u, delta)
local hp = u.hp + delta
if hp < u.number then
if hp < 0 then
hp = 0
end
u.number = hp
end
u.hp = hp
return hp
end
function horse_limit(r)
return r:get_resource("horse")
end
function horse_produce(r, n)
local horses = r:get_resource("horse")
if horses>=n then
r:set_resource("horse", horses-n)
else
r:set_resource("horse", 0)
end
end
function log_limit(r)
-- if r:get_flag(1) then -- RF_MALLORN
-- return 0
-- end
return r:get_resource("tree") + r:get_resource("sapling")
end
function log_produce(r, n)
local trees = r:get_resource("tree")
if trees>=n then
r:set_resource("tree", trees-n)
else
r:set_resource("tree", 0)
n = n - trees
trees = r:get_resource("sapling")
if trees>=n then
r:set_resource("sapling", trees-n)
else
r:set_resource("sapling", 0)
end
end
end
function mallorn_limit(r)
if not r:get_flag(1) then -- RF_MALLORN
return 0
end
return r:get_resource("tree") + r:get_resource("sapling")
end
function mallorn_produce(r, n)
local trees = r:get_resource("tree")
if trees>=n then
r:set_resource("tree", trees-n)
else
r:set_resource("tree", 0)
n = n - trees
trees = r:get_resource("sapling")
if trees>=n then
r:set_resource("sapling", trees-n)
else
r:set_resource("sapling", 0)
end
end
end
function peasant_getresource(u)
return u.region:get_resource("peasant")
end
function peasant_changeresource(u, delta)
local p = u.region:get_resource("peasant")
p = p + delta
if p < 0 then
p = 0
end
u.region:set_resource("peasant", p)
return p
end
function hp_getresource(u)
return u.hp
end
function hp_changeresource(u, delta)
local hp = u.hp + delta
if hp < u.number then
if hp < 0 then
hp = 0
end
u.number = hp
end
u.hp = hp
return hp
end
function horse_limit(r)
return r:get_resource("horse")
end
function horse_produce(r, n)
local horses = r:get_resource("horse")
if horses>=n then
r:set_resource("horse", horses-n)
else
r:set_resource("horse", 0)
end
end
function log_limit(r)
-- if r:get_flag(1) then -- RF_MALLORN
-- return 0
-- end
return r:get_resource("tree") + r:get_resource("sapling")
end
function log_produce(r, n)
local trees = r:get_resource("tree")
if trees>=n then
r:set_resource("tree", trees-n)
else
r:set_resource("tree", 0)
n = n - trees
trees = r:get_resource("sapling")
if trees>=n then
r:set_resource("sapling", trees-n)
else
r:set_resource("sapling", 0)
end
end
end
function mallorn_limit(r)
if not r:get_flag(1) then -- RF_MALLORN
return 0
end
return r:get_resource("tree") + r:get_resource("sapling")
end
function mallorn_produce(r, n)
local trees = r:get_resource("tree")
if trees>=n then
r:set_resource("tree", trees-n)
else
r:set_resource("tree", 0)
n = n - trees
trees = r:get_resource("sapling")
if trees>=n then
r:set_resource("sapling", trees-n)
else
r:set_resource("sapling", 0)
end
end
end

View file

@ -1,6 +1,6 @@
CREATE TABLE email(id INTEGER PRIMARY KEY, md5 VARCHAR(32) UNIQUE NOT NULL, email VARCHAR(32), bounces INT DEFAULT 0, confirmed TIMESTAMP DEFAULT NULL);
CREATE TABLE faction (id INTEGER PRIMARY KEY, user_id INTEGER REFERENCES user(id), no INTEGER, name VARCHAR(64), game_id INTEGER REFERENCES game(id), race VARCHAR(10), lang CHAR(2));
CREATE TABLE faction_email (faction_id INTEGER REFERENCES faction(id), email_id INTEGER REFERENCES email(id));
CREATE TABLE game (id INTEGER PRIMARY KEY, name VARCHAR(20), last_turn INTEGER);
CREATE TABLE score (turn INTEGER, faction_id INTEGER REFERENCES faction(id), value INTEGER, UNIQUE(turn, faction_id));
CREATE TABLE user(id INTEGER PRIMARY KEY, email_id INTEGER REFERENCES email(id), creation TIMESTAMP DEFAULT CURRENT_TIMESTAMP);
CREATE TABLE email(id INTEGER PRIMARY KEY, md5 VARCHAR(32) UNIQUE NOT NULL, email VARCHAR(32), bounces INT DEFAULT 0, confirmed TIMESTAMP DEFAULT NULL);
CREATE TABLE faction (id INTEGER PRIMARY KEY, user_id INTEGER REFERENCES user(id), no INTEGER, name VARCHAR(64), game_id INTEGER REFERENCES game(id), race VARCHAR(10), lang CHAR(2));
CREATE TABLE faction_email (faction_id INTEGER REFERENCES faction(id), email_id INTEGER REFERENCES email(id));
CREATE TABLE game (id INTEGER PRIMARY KEY, name VARCHAR(20), last_turn INTEGER);
CREATE TABLE score (turn INTEGER, faction_id INTEGER REFERENCES faction(id), value INTEGER, UNIQUE(turn, faction_id));
CREATE TABLE user(id INTEGER PRIMARY KEY, email_id INTEGER REFERENCES email(id), creation TIMESTAMP DEFAULT CURRENT_TIMESTAMP);

View file

@ -1,16 +1,16 @@
local srcpath = config.source_dir
local respath = srcpath .. '/' .. config.game .. '/res/'
local paths = { config.game..'/scripts/?.lua';'lunit/?.lua','external/lunit/?.lua','scripts/?.lua';'scripts/?' }
tests = {'common'}
for idx, test in pairs(tests) do
tests[idx] = srcpath .. '/scripts/tests/' .. test .. '.lua'
end
for idx, path in pairs(paths) do
package.path = srcpath .. '/' .. path .. ';' .. package.path
end
read_xml(respath..'config-'..config.game..'.xml', respath..'catalog-'..config.game..'.xml')
require "init"
local srcpath = config.source_dir
local respath = srcpath .. '/' .. config.game .. '/res/'
local paths = { config.game..'/scripts/?.lua';'lunit/?.lua','external/lunit/?.lua','scripts/?.lua';'scripts/?' }
tests = {'common'}
for idx, test in pairs(tests) do
tests[idx] = srcpath .. '/scripts/tests/' .. test .. '.lua'
end
for idx, path in pairs(paths) do
package.path = srcpath .. '/' .. path .. ';' .. package.path
end
read_xml(respath..'config-'..config.game..'.xml', respath..'catalog-'..config.game..'.xml')
require "init"

View file

@ -1,151 +1,151 @@
function creation_message(mage, type, number)
local msg = message.create("item_create_spell")
msg:set_unit("mage", mage)
msg:set_int("number", number)
msg:set_resource("item", type)
return msg
end
local function create_item(mage, level, name, number)
local count = number or 1
mage:add_item(name, count);
local msg = creation_message(mage, name, count)
msg:send_faction(mage.faction)
return level
end
-- Wasser des Lebens
function create_potion_p2(r, mage, level, force)
return create_item(mage, level, "p2", level)
end
-- Siebenmeilentee
function create_potion_p0(r, mage, level, force)
return create_item(mage, level, "p0", level)
end
-- Wundsalbe
function create_potion_ointment(r, mage, level, force)
return create_item(mage, level, "ointment", level)
end
-- Bauernblut
function create_potion_peasantblood(r, mage, level, force)
return create_item(mage, level, "peasantblood", level)
end
-- Pferdeglück
function create_potion_p9(r, mage, level, force)
return create_item(mage, level, "p9", level)
end
-- Schaffenstrunk
function create_potion_p3(r, mage, level, force)
return create_item(mage, level, "p3", level)
end
-- Heiltrank
function create_potion_p14(r, mage, level, force)
return create_item(mage, level, "p14", level)
end
-- Elixier der Macht
function create_potion_p13(r, mage, level, force)
return create_item(mage, level, "p13", level)
end
-- Erschaffe ein Flammenschwert
function create_firesword(r, mage, level, force)
return create_item(mage, level, "firesword")
end
-- Erschaffe einen Gürtel der Trollstärke
function create_trollbelt(r, mage, level, force)
return create_item(mage, level, "trollbelt")
end
-- Erschaffe einen Ring der Unsichtbarkeit
function create_roi(r, mage, level, force)
return create_item(mage, level, "roi")
end
-- Erschaffe einen Ring der flinken Finger
function create_roqf(r, mage, level, force)
return create_item(mage, level, "roqf")
end
-- Erschaffe ein Amulett des wahren Sehens
function create_aots(r, mage, level, force)
return create_item(mage, level, "aots")
end
-- Erschaffe einen magischen Kräuterbeutel
function create_magicherbbag(r, mage, level, force)
return create_item(mage, level, "magicherbbag")
end
-- Erschaffe einen Taktikkristal
function create_dreameye(r, mage, level, force)
return create_item(mage, level, "dreameye")
end
-- Erschaffe einen Antimagiekristall
function create_antimagic(r, mage, level, force)
return create_item(mage, level, "antimagic")
end
-- Erschaffe eine Sphäre der Unsichtbarkeit
function create_invisibility_sphere(r, mage, level, force)
return create_item(mage, level, "sphereofinv")
end
-- Erschaffe einen Gürtel der Keuschheit
function create_chastitybelt(r, mage, level, force)
return create_item(mage, level, "ao_chastity")
end
-- Erschaffe ein Runenschwert
function create_runesword(r, mage, level, force)
return create_item(mage, level, "runesword")
end
-- Erschaffe ein Aurafokus
function create_focus(r, mage, level, force)
return create_item(mage, level, "aurafocus")
end
-- Erschaffe einen Ring der Macht
function create_rop(r, mage, level, force)
return create_item(mage, level, "rop")
end
-- Erschaffe einen Ring der Regeneration
function create_ror(r, mage, level, force)
return create_item(mage, level, "ror")
end
-- Erschaffe einen Zauberbeutel
function create_bagofholding(r, mage, level, force)
return create_item(mage, level, "magicbag")
end
-- TODO:
function earn_silver(r, mage, level, force)
local money = r:get_resource("money")
local wanted = 50 * force
local amount = wanted
if wanted > money then
amount = money
end
r:set_resource("money", money - amount)
mage:add_item("money", amount)
local msg = message.create("income")
msg:set_unit("unit", mage)
msg:set_region("region", r)
msg:set_int("mode", 6)
msg:set_int("wanted", wanted)
msg:set_int("amount", amount)
msg:send_faction(mage.faction)
return level
end
function creation_message(mage, type, number)
local msg = message.create("item_create_spell")
msg:set_unit("mage", mage)
msg:set_int("number", number)
msg:set_resource("item", type)
return msg
end
local function create_item(mage, level, name, number)
local count = number or 1
mage:add_item(name, count);
local msg = creation_message(mage, name, count)
msg:send_faction(mage.faction)
return level
end
-- Wasser des Lebens
function create_potion_p2(r, mage, level, force)
return create_item(mage, level, "p2", level)
end
-- Siebenmeilentee
function create_potion_p0(r, mage, level, force)
return create_item(mage, level, "p0", level)
end
-- Wundsalbe
function create_potion_ointment(r, mage, level, force)
return create_item(mage, level, "ointment", level)
end
-- Bauernblut
function create_potion_peasantblood(r, mage, level, force)
return create_item(mage, level, "peasantblood", level)
end
-- Pferdeglück
function create_potion_p9(r, mage, level, force)
return create_item(mage, level, "p9", level)
end
-- Schaffenstrunk
function create_potion_p3(r, mage, level, force)
return create_item(mage, level, "p3", level)
end
-- Heiltrank
function create_potion_p14(r, mage, level, force)
return create_item(mage, level, "p14", level)
end
-- Elixier der Macht
function create_potion_p13(r, mage, level, force)
return create_item(mage, level, "p13", level)
end
-- Erschaffe ein Flammenschwert
function create_firesword(r, mage, level, force)
return create_item(mage, level, "firesword")
end
-- Erschaffe einen Gürtel der Trollstärke
function create_trollbelt(r, mage, level, force)
return create_item(mage, level, "trollbelt")
end
-- Erschaffe einen Ring der Unsichtbarkeit
function create_roi(r, mage, level, force)
return create_item(mage, level, "roi")
end
-- Erschaffe einen Ring der flinken Finger
function create_roqf(r, mage, level, force)
return create_item(mage, level, "roqf")
end
-- Erschaffe ein Amulett des wahren Sehens
function create_aots(r, mage, level, force)
return create_item(mage, level, "aots")
end
-- Erschaffe einen magischen Kräuterbeutel
function create_magicherbbag(r, mage, level, force)
return create_item(mage, level, "magicherbbag")
end
-- Erschaffe einen Taktikkristal
function create_dreameye(r, mage, level, force)
return create_item(mage, level, "dreameye")
end
-- Erschaffe einen Antimagiekristall
function create_antimagic(r, mage, level, force)
return create_item(mage, level, "antimagic")
end
-- Erschaffe eine Sphäre der Unsichtbarkeit
function create_invisibility_sphere(r, mage, level, force)
return create_item(mage, level, "sphereofinv")
end
-- Erschaffe einen Gürtel der Keuschheit
function create_chastitybelt(r, mage, level, force)
return create_item(mage, level, "ao_chastity")
end
-- Erschaffe ein Runenschwert
function create_runesword(r, mage, level, force)
return create_item(mage, level, "runesword")
end
-- Erschaffe ein Aurafokus
function create_focus(r, mage, level, force)
return create_item(mage, level, "aurafocus")
end
-- Erschaffe einen Ring der Macht
function create_rop(r, mage, level, force)
return create_item(mage, level, "rop")
end
-- Erschaffe einen Ring der Regeneration
function create_ror(r, mage, level, force)
return create_item(mage, level, "ror")
end
-- Erschaffe einen Zauberbeutel
function create_bagofholding(r, mage, level, force)
return create_item(mage, level, "magicbag")
end
-- TODO:
function earn_silver(r, mage, level, force)
local money = r:get_resource("money")
local wanted = 50 * force
local amount = wanted
if wanted > money then
amount = money
end
r:set_resource("money", money - amount)
mage:add_item("money", amount)
local msg = message.create("income")
msg:set_unit("unit", mage)
msg:set_region("region", r)
msg:set_int("mode", 6)
msg:set_int("wanted", wanted)
msg:set_int("amount", amount)
msg:send_faction(mage.faction)
return level
end

File diff suppressed because it is too large Load diff

View file

@ -1,64 +1,64 @@
require "lunit"
module( "spells", package.seeall, lunit.testcase )
function setup()
free_game()
end
function test_roi()
local r = region.create(0,0, "plain")
local f = faction.create("noreply@eressea.de", "human", "de")
local u = unit.create(f, r, 1)
u.race = "elf"
u:set_skill("magic", 10)
u:add_item("money", 3010)
u.magic = "tybied"
u.aura = 200
u.ship = s1
u:add_spell("create_roi")
u:clear_orders()
u:add_order("ZAUBERE 'Erschaffe einen Ring der Unsichtbarkeit' ")
process_orders()
write_reports()
assert_equal(1, u:get_item("roi"))
end
function test_blessedharvest_lasts_n_turn()
free_game()
local r = region.create(0, 0, "plain")
local f = faction.create("noreply@eressea.de", "halfling", "de")
local u = unit.create(f, r)
r:set_resource("peasant", 100)
r:set_resource("money", 0)
u:add_item("money", 1000)
u.magic = "gwyrrd"
u.race = "dwarf"
u:set_skill("magic", 20)
u.aura = 200
u:add_spell("raindance")
u:add_spell("blessedharvest")
u:clear_orders()
local level = 5
u:add_order("ZAUBERE STUFE " .. level .. " Regentanz")
assert_equal(0, r:get_resource("money"), 0)
local m = 0
local p = 100
for i=1,level+2 do
process_orders()
local income = p * 12
p = r:get_resource("peasant")
income = income - p * 10
m = m + income
-- print(i, m, p, r:get_resource("money"))
if (i>level+1) then
assert_not_equal(m, r:get_resource("money"))
else
assert_equal(m, r:get_resource("money"))
end
u:clear_orders()
u:add_order("ARBEITEN")
-- u:add_spell("raindance")
end
end
require "lunit"
module( "spells", package.seeall, lunit.testcase )
function setup()
free_game()
end
function test_roi()
local r = region.create(0,0, "plain")
local f = faction.create("noreply@eressea.de", "human", "de")
local u = unit.create(f, r, 1)
u.race = "elf"
u:set_skill("magic", 10)
u:add_item("money", 3010)
u.magic = "tybied"
u.aura = 200
u.ship = s1
u:add_spell("create_roi")
u:clear_orders()
u:add_order("ZAUBERE 'Erschaffe einen Ring der Unsichtbarkeit' ")
process_orders()
write_reports()
assert_equal(1, u:get_item("roi"))
end
function test_blessedharvest_lasts_n_turn()
free_game()
local r = region.create(0, 0, "plain")
local f = faction.create("noreply@eressea.de", "halfling", "de")
local u = unit.create(f, r)
r:set_resource("peasant", 100)
r:set_resource("money", 0)
u:add_item("money", 1000)
u.magic = "gwyrrd"
u.race = "dwarf"
u:set_skill("magic", 20)
u.aura = 200
u:add_spell("raindance")
u:add_spell("blessedharvest")
u:clear_orders()
local level = 5
u:add_order("ZAUBERE STUFE " .. level .. " Regentanz")
assert_equal(0, r:get_resource("money"), 0)
local m = 0
local p = 100
for i=1,level+2 do
process_orders()
local income = p * 12
p = r:get_resource("peasant")
income = income - p * 10
m = m + income
-- print(i, m, p, r:get_resource("money"))
if (i>level+1) then
assert_not_equal(m, r:get_resource("money"))
else
assert_equal(m, r:get_resource("money"))
end
u:clear_orders()
u:add_order("ARBEITEN")
-- u:add_spell("raindance")
end
end

View file

@ -1,33 +1,33 @@
/*
Copyright (c) 1998-2010, Enno Rehling <enno@eressea.de>
Katja Zedel <katze@felidae.kn-bremen.de
Christian Schlittchen <corwin@amber.kn-bremen.de>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
**/
#ifndef H_ATTRIBUTE_AGGRESSIVE
#define H_ATTRIBUTE_AGGRESSIVE
#ifdef __cplusplus
extern "C" {
#endif
extern struct attrib_type at_aggressive;
extern struct attrib * make_aggressive(double probability);
extern void init_aggressive(void);
#ifdef __cplusplus
}
#endif
#endif
/*
Copyright (c) 1998-2010, Enno Rehling <enno@eressea.de>
Katja Zedel <katze@felidae.kn-bremen.de
Christian Schlittchen <corwin@amber.kn-bremen.de>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
**/
#ifndef H_ATTRIBUTE_AGGRESSIVE
#define H_ATTRIBUTE_AGGRESSIVE
#ifdef __cplusplus
extern "C" {
#endif
extern struct attrib_type at_aggressive;
extern struct attrib * make_aggressive(double probability);
extern void init_aggressive(void);
#ifdef __cplusplus
}
#endif
#endif

View file

@ -1,34 +1,34 @@
/*
Copyright (c) 1998-2010, Enno Rehling <enno@eressea.de>
Katja Zedel <katze@felidae.kn-bremen.de
Christian Schlittchen <corwin@amber.kn-bremen.de>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
**/
#include <platform.h>
#include <kernel/types.h>
#include "alliance.h"
#include <kernel/save.h>
#include <util/attrib.h>
attrib_type at_alliance = {
"alliance",
NULL,
NULL,
NULL,
a_writeint,
a_readint,
ATF_UNIQUE
};
/*
Copyright (c) 1998-2010, Enno Rehling <enno@eressea.de>
Katja Zedel <katze@felidae.kn-bremen.de
Christian Schlittchen <corwin@amber.kn-bremen.de>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
**/
#include <platform.h>
#include <kernel/types.h>
#include "alliance.h"
#include <kernel/save.h>
#include <util/attrib.h>
attrib_type at_alliance = {
"alliance",
NULL,
NULL,
NULL,
a_writeint,
a_readint,
ATF_UNIQUE
};

View file

@ -1,31 +1,31 @@
/*
Copyright (c) 1998-2010, Enno Rehling <enno@eressea.de>
Katja Zedel <katze@felidae.kn-bremen.de
Christian Schlittchen <corwin@amber.kn-bremen.de>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
**/
#ifndef H_ATTRIBUTE_ALLIANCE
#define H_ATTRIBUTE_ALLIANCE
#ifdef __cplusplus
extern "C" {
#endif
extern struct attrib_type at_alliance;
#ifdef __cplusplus
}
#endif
#endif
/*
Copyright (c) 1998-2010, Enno Rehling <enno@eressea.de>
Katja Zedel <katze@felidae.kn-bremen.de
Christian Schlittchen <corwin@amber.kn-bremen.de>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
**/
#ifndef H_ATTRIBUTE_ALLIANCE
#define H_ATTRIBUTE_ALLIANCE
#ifdef __cplusplus
extern "C" {
#endif
extern struct attrib_type at_alliance;
#ifdef __cplusplus
}
#endif
#endif

View file

@ -1,81 +1,81 @@
/*
Copyright (c) 1998-2010, Enno Rehling <enno@eressea.de>
Katja Zedel <katze@felidae.kn-bremen.de
Christian Schlittchen <corwin@amber.kn-bremen.de>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
**/
#include <platform.h>
#include <kernel/config.h>
#include "attributes.h"
/* attributes includes */
#include "follow.h"
#include "gm.h"
#include "hate.h"
#include "iceberg.h"
#include "key.h"
#include "moved.h"
#include "movement.h"
#include "object.h"
#include "orcification.h"
#include "otherfaction.h"
#include "overrideroads.h"
#include "racename.h"
#include "raceprefix.h"
#include "reduceproduction.h"
#include "targetregion.h"
#ifdef WDW_PYRAMID
# include "alliance.h"
#endif
/* kernel includes */
#include <kernel/unit.h>
#include <kernel/faction.h>
#include <kernel/region.h>
#include <kernel/save.h>
#include <kernel/ship.h>
#include <kernel/building.h>
/* util includes */
#include <util/attrib.h>
attrib_type at_unitdissolve = {
"unitdissolve", NULL, NULL, NULL, a_writechars, a_readchars
};
void
register_attributes(void)
{
at_register(&at_object);
at_register(&at_unitdissolve);
at_register(&at_overrideroads);
at_register(&at_raceprefix);
at_register(&at_iceberg);
at_register(&at_key);
at_register(&at_gm);
at_register(&at_follow);
at_register(&at_targetregion);
at_register(&at_orcification);
at_register(&at_hate);
at_register(&at_reduceproduction);
at_register(&at_otherfaction);
at_register(&at_racename);
at_register(&at_movement);
at_register(&at_moved);
#ifdef WDW_PYRAMID
at_register(&at_alliance);
#endif /* WDW_PYRAMID */
}
/*
Copyright (c) 1998-2010, Enno Rehling <enno@eressea.de>
Katja Zedel <katze@felidae.kn-bremen.de
Christian Schlittchen <corwin@amber.kn-bremen.de>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
**/
#include <platform.h>
#include <kernel/config.h>
#include "attributes.h"
/* attributes includes */
#include "follow.h"
#include "gm.h"
#include "hate.h"
#include "iceberg.h"
#include "key.h"
#include "moved.h"
#include "movement.h"
#include "object.h"
#include "orcification.h"
#include "otherfaction.h"
#include "overrideroads.h"
#include "racename.h"
#include "raceprefix.h"
#include "reduceproduction.h"
#include "targetregion.h"
#ifdef WDW_PYRAMID
# include "alliance.h"
#endif
/* kernel includes */
#include <kernel/unit.h>
#include <kernel/faction.h>
#include <kernel/region.h>
#include <kernel/save.h>
#include <kernel/ship.h>
#include <kernel/building.h>
/* util includes */
#include <util/attrib.h>
attrib_type at_unitdissolve = {
"unitdissolve", NULL, NULL, NULL, a_writechars, a_readchars
};
void
register_attributes(void)
{
at_register(&at_object);
at_register(&at_unitdissolve);
at_register(&at_overrideroads);
at_register(&at_raceprefix);
at_register(&at_iceberg);
at_register(&at_key);
at_register(&at_gm);
at_register(&at_follow);
at_register(&at_targetregion);
at_register(&at_orcification);
at_register(&at_hate);
at_register(&at_reduceproduction);
at_register(&at_otherfaction);
at_register(&at_racename);
at_register(&at_movement);
at_register(&at_moved);
#ifdef WDW_PYRAMID
at_register(&at_alliance);
#endif /* WDW_PYRAMID */
}

View file

@ -1,31 +1,31 @@
/*
Copyright (c) 1998-2010, Enno Rehling <enno@eressea.de>
Katja Zedel <katze@felidae.kn-bremen.de
Christian Schlittchen <corwin@amber.kn-bremen.de>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
**/
#ifndef H_ATTRIBUTE_ATTRIBUTES
#define H_ATTRIBUTE_ATTRIBUTES
#ifdef __cplusplus
extern "C" {
#endif
extern void register_attributes(void);
#ifdef __cplusplus
}
#endif
#endif
/*
Copyright (c) 1998-2010, Enno Rehling <enno@eressea.de>
Katja Zedel <katze@felidae.kn-bremen.de
Christian Schlittchen <corwin@amber.kn-bremen.de>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
**/
#ifndef H_ATTRIBUTE_ATTRIBUTES
#define H_ATTRIBUTE_ATTRIBUTES
#ifdef __cplusplus
extern "C" {
#endif
extern void register_attributes(void);
#ifdef __cplusplus
}
#endif
#endif

View file

@ -1,45 +1,45 @@
/*
Copyright (c) 1998-2010, Enno Rehling <enno@eressea.de>
Katja Zedel <katze@felidae.kn-bremen.de
Christian Schlittchen <corwin@amber.kn-bremen.de>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
**/
#include <platform.h>
#include "fleechance.h"
#include <util/attrib.h>
attrib_type at_fleechance = {
"fleechance",
NULL,
NULL,
NULL,
NULL,
NULL,
};
attrib *
make_fleechance(float fleechance)
{
attrib * a = a_new(&at_fleechance);
a->data.flt = fleechance;
return a;
}
void
init_fleechance(void)
{
at_register(&at_fleechance);
}
/*
Copyright (c) 1998-2010, Enno Rehling <enno@eressea.de>
Katja Zedel <katze@felidae.kn-bremen.de
Christian Schlittchen <corwin@amber.kn-bremen.de>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
**/
#include <platform.h>
#include "fleechance.h"
#include <util/attrib.h>
attrib_type at_fleechance = {
"fleechance",
NULL,
NULL,
NULL,
NULL,
NULL,
};
attrib *
make_fleechance(float fleechance)
{
attrib * a = a_new(&at_fleechance);
a->data.flt = fleechance;
return a;
}
void
init_fleechance(void)
{
at_register(&at_fleechance);
}

View file

@ -1,33 +1,33 @@
/*
Copyright (c) 1998-2010, Enno Rehling <enno@eressea.de>
Katja Zedel <katze@felidae.kn-bremen.de
Christian Schlittchen <corwin@amber.kn-bremen.de>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
**/
#ifndef H_ATTRIBUTE_FLEECHANCE
#define H_ATTRIBUTE_FLEECHANCE
#ifdef __cplusplus
extern "C" {
#endif
extern struct attrib_type at_fleechance;
extern struct attrib * make_fleechance(float fleechance);
extern void init_fleechance(void);
#ifdef __cplusplus
}
#endif
#endif
/*
Copyright (c) 1998-2010, Enno Rehling <enno@eressea.de>
Katja Zedel <katze@felidae.kn-bremen.de
Christian Schlittchen <corwin@amber.kn-bremen.de>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
**/
#ifndef H_ATTRIBUTE_FLEECHANCE
#define H_ATTRIBUTE_FLEECHANCE
#ifdef __cplusplus
extern "C" {
#endif
extern struct attrib_type at_fleechance;
extern struct attrib * make_fleechance(float fleechance);
extern void init_fleechance(void);
#ifdef __cplusplus
}
#endif
#endif

View file

@ -1,46 +1,46 @@
/*
Copyright (c) 1998-2010, Enno Rehling <enno@eressea.de>
Katja Zedel <katze@felidae.kn-bremen.de
Christian Schlittchen <corwin@amber.kn-bremen.de>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
**/
#include <platform.h>
#include "follow.h"
#include <kernel/config.h>
#include <kernel/unit.h>
#include <util/attrib.h>
#include <util/storage.h>
#include <util/variant.h>
static int
read_follow(attrib * a, void * owner, struct storage * store)
{
read_unit_reference(store); /* skip it */
return AT_READ_FAIL;
}
attrib_type at_follow = {
"follow", NULL, NULL, NULL, NULL, read_follow
};
attrib *
make_follow(struct unit * u)
{
attrib * a = a_new(&at_follow);
a->data.v = u;
return a;
}
/*
Copyright (c) 1998-2010, Enno Rehling <enno@eressea.de>
Katja Zedel <katze@felidae.kn-bremen.de
Christian Schlittchen <corwin@amber.kn-bremen.de>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
**/
#include <platform.h>
#include "follow.h"
#include <kernel/config.h>
#include <kernel/unit.h>
#include <util/attrib.h>
#include <util/storage.h>
#include <util/variant.h>
static int
read_follow(attrib * a, void * owner, struct storage * store)
{
read_unit_reference(store); /* skip it */
return AT_READ_FAIL;
}
attrib_type at_follow = {
"follow", NULL, NULL, NULL, NULL, read_follow
};
attrib *
make_follow(struct unit * u)
{
attrib * a = a_new(&at_follow);
a->data.v = u;
return a;
}

View file

@ -1,35 +1,35 @@
/*
Copyright (c) 1998-2010, Enno Rehling <enno@eressea.de>
Katja Zedel <katze@felidae.kn-bremen.de
Christian Schlittchen <corwin@amber.kn-bremen.de>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
**/
#ifndef H_ATTRIBUTE_FOLLOW
#define H_ATTRIBUTE_FOLLOW
#ifdef __cplusplus
extern "C" {
#endif
extern struct attrib_type at_follow;
struct unit;
extern struct attrib * make_follow(struct unit * u);
#ifdef __cplusplus
}
#endif
#endif
/*
Copyright (c) 1998-2010, Enno Rehling <enno@eressea.de>
Katja Zedel <katze@felidae.kn-bremen.de
Christian Schlittchen <corwin@amber.kn-bremen.de>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
**/
#ifndef H_ATTRIBUTE_FOLLOW
#define H_ATTRIBUTE_FOLLOW
#ifdef __cplusplus
extern "C" {
#endif
extern struct attrib_type at_follow;
struct unit;
extern struct attrib * make_follow(struct unit * u);
#ifdef __cplusplus
}
#endif
#endif

View file

@ -1,135 +1,135 @@
/*
Copyright (c) 1998-2010, Enno Rehling <enno@eressea.de>
Katja Zedel <katze@felidae.kn-bremen.de
Christian Schlittchen <corwin@amber.kn-bremen.de>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
**/
#include <platform.h>
#include "giveitem.h"
#include <kernel/config.h>
/* kernel includes */
#include <kernel/building.h>
#include <kernel/region.h>
#include <kernel/unit.h>
#include <kernel/item.h>
/* util includes */
#include <util/attrib.h>
#include <util/base36.h>
#include <util/resolve.h>
#include <util/storage.h>
#include <util/goodies.h>
/* libc includes */
#include <stdlib.h>
#include <string.h>
typedef struct give_data {
struct building * building;
struct item * items;
} give_data;
static void
a_writegive(const attrib * a, const void * owner, struct storage * store)
{
give_data * gdata = (give_data*)a->data.v;
item * itm;
write_building_reference(gdata->building, store);
for (itm=gdata->items;itm;itm=itm->next) {
store->w_tok(store, resourcename(itm->type->rtype, 0));
store->w_int(store, itm->number);
}
store->w_tok(store, "end");
}
static int
a_readgive(attrib * a, void * owner, struct storage * store)
{
give_data * gdata = (give_data*)a->data.v;
variant var;
char zText[32];
var.i = store->r_id(store);
if (var.i>0) {
gdata->building = findbuilding(var.i);
if (gdata->building==NULL) {
ur_add(var, &gdata->building, resolve_building);
}
} else {
gdata->building=NULL;
}
for (;;) {
int i;
store->r_tok_buf(store, zText, sizeof(zText));
if (!strcmp("end", zText)) break;
i = store->r_int(store);
if (i==0) i_add(&gdata->items, i_new(it_find(zText), i));
}
return AT_READ_OK;
}
static void
a_initgive(struct attrib * a)
{
a->data.v = calloc(sizeof(give_data), 1);
}
static void
a_finalizegive(struct attrib * a)
{
free(a->data.v);
}
static int
a_giveitem(attrib * a)
{
give_data * gdata = (give_data*)a->data.v;
region * r;
unit * u;
if (gdata->building==NULL || gdata->items==NULL) return 0;
r = gdata->building->region;
u = building_owner(gdata->building);
if (u==NULL) return 1;
while (gdata->items) {
item * itm = gdata->items;
i_change(&u->items, itm->type, itm->number);
i_free(i_remove(&gdata->items, itm));
}
return 0;
}
attrib_type at_giveitem = {
"giveitem",
a_initgive, a_finalizegive,
a_giveitem,
a_writegive, a_readgive
};
attrib *
make_giveitem(struct building * b, struct item * ip)
{
attrib * a = a_new(&at_giveitem);
give_data * gd = (give_data*)a->data.v;
gd->building = b;
gd->items = ip;
return a;
}
void
init_giveitem(void)
{
at_register(&at_giveitem);
}
/*
Copyright (c) 1998-2010, Enno Rehling <enno@eressea.de>
Katja Zedel <katze@felidae.kn-bremen.de
Christian Schlittchen <corwin@amber.kn-bremen.de>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
**/
#include <platform.h>
#include "giveitem.h"
#include <kernel/config.h>
/* kernel includes */
#include <kernel/building.h>
#include <kernel/region.h>
#include <kernel/unit.h>
#include <kernel/item.h>
/* util includes */
#include <util/attrib.h>
#include <util/base36.h>
#include <util/resolve.h>
#include <util/storage.h>
#include <util/goodies.h>
/* libc includes */
#include <stdlib.h>
#include <string.h>
typedef struct give_data {
struct building * building;
struct item * items;
} give_data;
static void
a_writegive(const attrib * a, const void * owner, struct storage * store)
{
give_data * gdata = (give_data*)a->data.v;
item * itm;
write_building_reference(gdata->building, store);
for (itm=gdata->items;itm;itm=itm->next) {
store->w_tok(store, resourcename(itm->type->rtype, 0));
store->w_int(store, itm->number);
}
store->w_tok(store, "end");
}
static int
a_readgive(attrib * a, void * owner, struct storage * store)
{
give_data * gdata = (give_data*)a->data.v;
variant var;
char zText[32];
var.i = store->r_id(store);
if (var.i>0) {
gdata->building = findbuilding(var.i);
if (gdata->building==NULL) {
ur_add(var, &gdata->building, resolve_building);
}
} else {
gdata->building=NULL;
}
for (;;) {
int i;
store->r_tok_buf(store, zText, sizeof(zText));
if (!strcmp("end", zText)) break;
i = store->r_int(store);
if (i==0) i_add(&gdata->items, i_new(it_find(zText), i));
}
return AT_READ_OK;
}
static void
a_initgive(struct attrib * a)
{
a->data.v = calloc(sizeof(give_data), 1);
}
static void
a_finalizegive(struct attrib * a)
{
free(a->data.v);
}
static int
a_giveitem(attrib * a)
{
give_data * gdata = (give_data*)a->data.v;
region * r;
unit * u;
if (gdata->building==NULL || gdata->items==NULL) return 0;
r = gdata->building->region;
u = building_owner(gdata->building);
if (u==NULL) return 1;
while (gdata->items) {
item * itm = gdata->items;
i_change(&u->items, itm->type, itm->number);
i_free(i_remove(&gdata->items, itm));
}
return 0;
}
attrib_type at_giveitem = {
"giveitem",
a_initgive, a_finalizegive,
a_giveitem,
a_writegive, a_readgive
};
attrib *
make_giveitem(struct building * b, struct item * ip)
{
attrib * a = a_new(&at_giveitem);
give_data * gd = (give_data*)a->data.v;
gd->building = b;
gd->items = ip;
return a;
}
void
init_giveitem(void)
{
at_register(&at_giveitem);
}

View file

@ -1,36 +1,36 @@
/*
Copyright (c) 1998-2010, Enno Rehling <enno@eressea.de>
Katja Zedel <katze@felidae.kn-bremen.de
Christian Schlittchen <corwin@amber.kn-bremen.de>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
**/
#ifndef H_ATTRIBUTE_GIVEITEM
#define H_ATTRIBUTE_GIVEITEM
#ifdef __cplusplus
extern "C" {
#endif
struct building;
struct item;
extern struct attrib_type at_giveitem;
extern struct attrib * make_giveitem(struct building * b, struct item * items);
extern void init_giveitem(void);
#ifdef __cplusplus
}
#endif
#endif
/*
Copyright (c) 1998-2010, Enno Rehling <enno@eressea.de>
Katja Zedel <katze@felidae.kn-bremen.de
Christian Schlittchen <corwin@amber.kn-bremen.de>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
**/
#ifndef H_ATTRIBUTE_GIVEITEM
#define H_ATTRIBUTE_GIVEITEM
#ifdef __cplusplus
extern "C" {
#endif
struct building;
struct item;
extern struct attrib_type at_giveitem;
extern struct attrib * make_giveitem(struct building * b, struct item * items);
extern void init_giveitem(void);
#ifdef __cplusplus
}
#endif
#endif

View file

@ -1,61 +1,61 @@
/*
Copyright (c) 1998-2010, Enno Rehling <enno@eressea.de>
Katja Zedel <katze@felidae.kn-bremen.de
Christian Schlittchen <corwin@amber.kn-bremen.de>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
**/
#include <platform.h>
#include <kernel/config.h>
#include "gm.h"
/* kernel includes */
#include <kernel/plane.h>
/* util includes */
#include <util/attrib.h>
#include <util/storage.h>
static void
write_gm(const attrib * a, const void * owner, struct storage * store)
{
write_plane_reference((plane*)a->data.v, store);
}
static int
read_gm(attrib * a, void * owner, struct storage * store)
{
plane * pl;
int result = read_plane_reference(&pl, store);
a->data.v = pl;
return result;
}
attrib_type at_gm = {
"gm",
NULL,
NULL,
NULL,
write_gm,
read_gm,
};
attrib *
make_gm(const struct plane * pl)
{
attrib * a = a_new(&at_gm);
a->data.v = (void*)pl;
return a;
}
/*
Copyright (c) 1998-2010, Enno Rehling <enno@eressea.de>
Katja Zedel <katze@felidae.kn-bremen.de
Christian Schlittchen <corwin@amber.kn-bremen.de>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
**/
#include <platform.h>
#include <kernel/config.h>
#include "gm.h"
/* kernel includes */
#include <kernel/plane.h>
/* util includes */
#include <util/attrib.h>
#include <util/storage.h>
static void
write_gm(const attrib * a, const void * owner, struct storage * store)
{
write_plane_reference((plane*)a->data.v, store);
}
static int
read_gm(attrib * a, void * owner, struct storage * store)
{
plane * pl;
int result = read_plane_reference(&pl, store);
a->data.v = pl;
return result;
}
attrib_type at_gm = {
"gm",
NULL,
NULL,
NULL,
write_gm,
read_gm,
};
attrib *
make_gm(const struct plane * pl)
{
attrib * a = a_new(&at_gm);
a->data.v = (void*)pl;
return a;
}

View file

@ -1,36 +1,36 @@
/*
Copyright (c) 1998-2010, Enno Rehling <enno@eressea.de>
Katja Zedel <katze@felidae.kn-bremen.de
Christian Schlittchen <corwin@amber.kn-bremen.de>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
**/
#ifndef H_ATTRIBUTE_GM
#define H_ATTRIBUTE_GM
#ifdef __cplusplus
extern "C" {
#endif
/* this is an attribute used by the kernel (isallied) */
struct plane;
extern struct attrib_type at_gm;
extern struct attrib * make_gm(const struct plane *pl);
#ifdef __cplusplus
}
#endif
#endif
/*
Copyright (c) 1998-2010, Enno Rehling <enno@eressea.de>
Katja Zedel <katze@felidae.kn-bremen.de
Christian Schlittchen <corwin@amber.kn-bremen.de>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
**/
#ifndef H_ATTRIBUTE_GM
#define H_ATTRIBUTE_GM
#ifdef __cplusplus
extern "C" {
#endif
/* this is an attribute used by the kernel (isallied) */
struct plane;
extern struct attrib_type at_gm;
extern struct attrib * make_gm(const struct plane *pl);
#ifdef __cplusplus
}
#endif
#endif

View file

@ -1,70 +1,70 @@
/*
Copyright (c) 1998-2010, Enno Rehling <enno@eressea.de>
Katja Zedel <katze@felidae.kn-bremen.de
Christian Schlittchen <corwin@amber.kn-bremen.de>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
**/
#include <platform.h>
#include <kernel/config.h>
#include "hate.h"
#include <kernel/unit.h>
#include <kernel/version.h>
#include <util/attrib.h>
#include <util/resolve.h>
#include <util/storage.h>
static int
verify_hate(attrib * a)
{
if (a->data.v==NULL) {
return 0;
}
return 1;
}
static void
write_hate(const attrib * a, const void * owner, struct storage * store)
{
write_unit_reference((unit*)a->data.v, store);
}
static int
read_hate(attrib * a, void * owner, struct storage * store)
{
int result = read_reference(&a->data.v, store, read_unit_reference, resolve_unit);
if (result==0 && !a->data.v) {
return AT_READ_FAIL;
}
return AT_READ_OK;
}
attrib_type at_hate = {
"hates",
NULL,
NULL,
verify_hate,
write_hate,
read_hate,
};
attrib *
make_hate(struct unit * u)
{
attrib * a = a_new(&at_hate);
a->data.v = u;
return a;
}
/*
Copyright (c) 1998-2010, Enno Rehling <enno@eressea.de>
Katja Zedel <katze@felidae.kn-bremen.de
Christian Schlittchen <corwin@amber.kn-bremen.de>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
**/
#include <platform.h>
#include <kernel/config.h>
#include "hate.h"
#include <kernel/unit.h>
#include <kernel/version.h>
#include <util/attrib.h>
#include <util/resolve.h>
#include <util/storage.h>
static int
verify_hate(attrib * a)
{
if (a->data.v==NULL) {
return 0;
}
return 1;
}
static void
write_hate(const attrib * a, const void * owner, struct storage * store)
{
write_unit_reference((unit*)a->data.v, store);
}
static int
read_hate(attrib * a, void * owner, struct storage * store)
{
int result = read_reference(&a->data.v, store, read_unit_reference, resolve_unit);
if (result==0 && !a->data.v) {
return AT_READ_FAIL;
}
return AT_READ_OK;
}
attrib_type at_hate = {
"hates",
NULL,
NULL,
verify_hate,
write_hate,
read_hate,
};
attrib *
make_hate(struct unit * u)
{
attrib * a = a_new(&at_hate);
a->data.v = u;
return a;
}

View file

@ -1,35 +1,35 @@
/*
Copyright (c) 1998-2010, Enno Rehling <enno@eressea.de>
Katja Zedel <katze@felidae.kn-bremen.de
Christian Schlittchen <corwin@amber.kn-bremen.de>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
**/
#ifndef H_ATTRIBUTE_HATE
#define H_ATTRIBUTE_HATE
#ifdef __cplusplus
extern "C" {
#endif
extern struct attrib_type at_hate;
struct unit;
extern struct attrib * make_hate(struct unit * u);
#ifdef __cplusplus
}
#endif
#endif
/*
Copyright (c) 1998-2010, Enno Rehling <enno@eressea.de>
Katja Zedel <katze@felidae.kn-bremen.de
Christian Schlittchen <corwin@amber.kn-bremen.de>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
**/
#ifndef H_ATTRIBUTE_HATE
#define H_ATTRIBUTE_HATE
#ifdef __cplusplus
extern "C" {
#endif
extern struct attrib_type at_hate;
struct unit;
extern struct attrib * make_hate(struct unit * u);
#ifdef __cplusplus
}
#endif
#endif

View file

@ -1,42 +1,42 @@
/*
Copyright (c) 1998-2010, Enno Rehling <enno@eressea.de>
Katja Zedel <katze@felidae.kn-bremen.de
Christian Schlittchen <corwin@amber.kn-bremen.de>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
**/
#include <platform.h>
#include <kernel/config.h>
#include "iceberg.h"
#include <kernel/save.h>
#include <util/attrib.h>
attrib_type at_iceberg = {
"iceberg_drift",
NULL,
NULL,
NULL,
a_writeint,
a_readint,
ATF_UNIQUE
};
attrib *
make_iceberg(direction_t dir)
{
attrib * a = a_new(&at_iceberg);
a->data.i = (int)dir;
return a;
}
/*
Copyright (c) 1998-2010, Enno Rehling <enno@eressea.de>
Katja Zedel <katze@felidae.kn-bremen.de
Christian Schlittchen <corwin@amber.kn-bremen.de>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
**/
#include <platform.h>
#include <kernel/config.h>
#include "iceberg.h"
#include <kernel/save.h>
#include <util/attrib.h>
attrib_type at_iceberg = {
"iceberg_drift",
NULL,
NULL,
NULL,
a_writeint,
a_readint,
ATF_UNIQUE
};
attrib *
make_iceberg(direction_t dir)
{
attrib * a = a_new(&at_iceberg);
a->data.i = (int)dir;
return a;
}

View file

@ -1,33 +1,33 @@
/*
Copyright (c) 1998-2010, Enno Rehling <enno@eressea.de>
Katja Zedel <katze@felidae.kn-bremen.de
Christian Schlittchen <corwin@amber.kn-bremen.de>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
**/
#ifndef H_ATTRIBUTE_ICEBERG
#define H_ATTRIBUTE_ICEBERG
#ifdef __cplusplus
extern "C" {
#endif
extern struct attrib_type at_iceberg;
extern struct attrib * make_iceberg(direction_t dir);
#ifdef __cplusplus
}
#endif
#endif
/*
Copyright (c) 1998-2010, Enno Rehling <enno@eressea.de>
Katja Zedel <katze@felidae.kn-bremen.de
Christian Schlittchen <corwin@amber.kn-bremen.de>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
**/
#ifndef H_ATTRIBUTE_ICEBERG
#define H_ATTRIBUTE_ICEBERG
#ifdef __cplusplus
extern "C" {
#endif
extern struct attrib_type at_iceberg;
extern struct attrib * make_iceberg(direction_t dir);
#ifdef __cplusplus
}
#endif
#endif

View file

@ -1,59 +1,59 @@
/*
Copyright (c) 1998-2010, Enno Rehling <enno@eressea.de>
Katja Zedel <katze@felidae.kn-bremen.de
Christian Schlittchen <corwin@amber.kn-bremen.de>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
**/
#include <platform.h>
#include <kernel/config.h>
#include "key.h"
#include <kernel/save.h>
#include <util/attrib.h>
attrib_type at_key = {
"key",
NULL,
NULL,
NULL,
a_writeint,
a_readint,
};
attrib *
add_key(attrib ** alist, int key)
{
attrib * a = find_key(*alist, key);
if (a==NULL) a = a_add(alist, make_key(key));
return a;
}
attrib *
make_key(int key)
{
attrib * a = a_new(&at_key);
a->data.i = key;
return a;
}
attrib *
find_key(attrib * alist, int key)
{
attrib * a = a_find(alist, &at_key);
while (a && a->type==&at_key && a->data.i != key) {
a = a->next;
}
return (a && a->type==&at_key)?a:NULL;
}
/*
Copyright (c) 1998-2010, Enno Rehling <enno@eressea.de>
Katja Zedel <katze@felidae.kn-bremen.de
Christian Schlittchen <corwin@amber.kn-bremen.de>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
**/
#include <platform.h>
#include <kernel/config.h>
#include "key.h"
#include <kernel/save.h>
#include <util/attrib.h>
attrib_type at_key = {
"key",
NULL,
NULL,
NULL,
a_writeint,
a_readint,
};
attrib *
add_key(attrib ** alist, int key)
{
attrib * a = find_key(*alist, key);
if (a==NULL) a = a_add(alist, make_key(key));
return a;
}
attrib *
make_key(int key)
{
attrib * a = a_new(&at_key);
a->data.i = key;
return a;
}
attrib *
find_key(attrib * alist, int key)
{
attrib * a = a_find(alist, &at_key);
while (a && a->type==&at_key && a->data.i != key) {
a = a->next;
}
return (a && a->type==&at_key)?a:NULL;
}

View file

@ -1,35 +1,35 @@
/*
Copyright (c) 1998-2010, Enno Rehling <enno@eressea.de>
Katja Zedel <katze@felidae.kn-bremen.de
Christian Schlittchen <corwin@amber.kn-bremen.de>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
**/
#ifndef H_ATTRIBUTE_KEY
#define H_ATTRIBUTE_KEY
#ifdef __cplusplus
extern "C" {
#endif
extern struct attrib_type at_key;
extern struct attrib * make_key(int key);
extern struct attrib * find_key(struct attrib * alist, int key);
extern struct attrib * add_key(struct attrib ** alist, int key);
#ifdef __cplusplus
}
#endif
#endif
/*
Copyright (c) 1998-2010, Enno Rehling <enno@eressea.de>
Katja Zedel <katze@felidae.kn-bremen.de
Christian Schlittchen <corwin@amber.kn-bremen.de>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
**/
#ifndef H_ATTRIBUTE_KEY
#define H_ATTRIBUTE_KEY
#ifdef __cplusplus
extern "C" {
#endif
extern struct attrib_type at_key;
extern struct attrib * make_key(int key);
extern struct attrib * find_key(struct attrib * alist, int key);
extern struct attrib * add_key(struct attrib ** alist, int key);
#ifdef __cplusplus
}
#endif
#endif

View file

@ -1,40 +1,40 @@
/*
Copyright (c) 1998-2010, Enno Rehling <enno@eressea.de>
Katja Zedel <katze@felidae.kn-bremen.de
Christian Schlittchen <corwin@amber.kn-bremen.de>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
**/
#include <platform.h>
#include "matmod.h"
#include <util/attrib.h>
attrib_type at_matmod = {
"matmod",
NULL,
NULL,
NULL,
NULL,
NULL,
ATF_PRESERVE
};
attrib *
make_matmod(mm_fun function)
{
attrib * a = a_new(&at_matmod);
a->data.f = (void(*)(void))function;
return a;
}
/*
Copyright (c) 1998-2010, Enno Rehling <enno@eressea.de>
Katja Zedel <katze@felidae.kn-bremen.de
Christian Schlittchen <corwin@amber.kn-bremen.de>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
**/
#include <platform.h>
#include "matmod.h"
#include <util/attrib.h>
attrib_type at_matmod = {
"matmod",
NULL,
NULL,
NULL,
NULL,
NULL,
ATF_PRESERVE
};
attrib *
make_matmod(mm_fun function)
{
attrib * a = a_new(&at_matmod);
a->data.f = (void(*)(void))function;
return a;
}

View file

@ -1,37 +1,37 @@
/*
Copyright (c) 1998-2010, Enno Rehling <enno@eressea.de>
Katja Zedel <katze@felidae.kn-bremen.de
Christian Schlittchen <corwin@amber.kn-bremen.de>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
**/
#ifndef H_ATTRIBUTE_MATMOD
#define H_ATTRIBUTE_MATMOD
#ifdef __cplusplus
extern "C" {
#endif
struct resource_type;
struct unit;
typedef int (*mm_fun)(const struct unit * u, const struct resource_type * rtype, int value);
extern struct attrib_type at_matmod;
extern struct attrib * make_matmod(mm_fun function);
#ifdef __cplusplus
}
#endif
#endif
/*
Copyright (c) 1998-2010, Enno Rehling <enno@eressea.de>
Katja Zedel <katze@felidae.kn-bremen.de
Christian Schlittchen <corwin@amber.kn-bremen.de>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
**/
#ifndef H_ATTRIBUTE_MATMOD
#define H_ATTRIBUTE_MATMOD
#ifdef __cplusplus
extern "C" {
#endif
struct resource_type;
struct unit;
typedef int (*mm_fun)(const struct unit * u, const struct resource_type * rtype, int value);
extern struct attrib_type at_matmod;
extern struct attrib * make_matmod(mm_fun function);
#ifdef __cplusplus
}
#endif
#endif

View file

@ -1,63 +1,63 @@
/*
Copyright (c) 1998-2010, Enno Rehling <enno@eressea.de>
Katja Zedel <katze@felidae.kn-bremen.de
Christian Schlittchen <corwin@amber.kn-bremen.de>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
**/
#include <platform.h>
#include <kernel/config.h>
#include "moved.h"
#include <util/attrib.h>
#include <util/storage.h>
static int
age_moved(attrib * a)
{
--a->data.i;
return a->data.i > 0;
}
static void
write_moved(const attrib * a, const void * owner, struct storage * store)
{
store->w_int(store, a->data.i);
}
static int
read_moved(attrib * a, void * owner, struct storage * store)
{
a->data.i = store->r_int(store);
if (a->data.i !=0 ) return AT_READ_OK;
else return AT_READ_FAIL;
}
attrib_type at_moved = {
"moved", NULL, NULL, age_moved, write_moved, read_moved
};
boolean
get_moved(attrib ** alist)
{
return a_find(*alist, &at_moved) ? true : false;
}
void
set_moved(attrib ** alist)
{
attrib * a = a_find(*alist, &at_moved);
if (a==NULL) a = a_add(alist, a_new(&at_moved));
a->data.i = 2;
}
/*
Copyright (c) 1998-2010, Enno Rehling <enno@eressea.de>
Katja Zedel <katze@felidae.kn-bremen.de
Christian Schlittchen <corwin@amber.kn-bremen.de>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
**/
#include <platform.h>
#include <kernel/config.h>
#include "moved.h"
#include <util/attrib.h>
#include <util/storage.h>
static int
age_moved(attrib * a)
{
--a->data.i;
return a->data.i > 0;
}
static void
write_moved(const attrib * a, const void * owner, struct storage * store)
{
store->w_int(store, a->data.i);
}
static int
read_moved(attrib * a, void * owner, struct storage * store)
{
a->data.i = store->r_int(store);
if (a->data.i !=0 ) return AT_READ_OK;
else return AT_READ_FAIL;
}
attrib_type at_moved = {
"moved", NULL, NULL, age_moved, write_moved, read_moved
};
boolean
get_moved(attrib ** alist)
{
return a_find(*alist, &at_moved) ? true : false;
}
void
set_moved(attrib ** alist)
{
attrib * a = a_find(*alist, &at_moved);
if (a==NULL) a = a_add(alist, a_new(&at_moved));
a->data.i = 2;
}

View file

@ -1,37 +1,37 @@
/*
Copyright (c) 1998-2010, Enno Rehling <enno@eressea.de>
Katja Zedel <katze@felidae.kn-bremen.de
Christian Schlittchen <corwin@amber.kn-bremen.de>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
**/
#ifndef H_ATTRIBUTE_MOVED
#define H_ATTRIBUTE_MOVED
#ifdef __cplusplus
extern "C" {
#endif
struct attrib;
struct attrib_type;
extern boolean get_moved(struct attrib ** alist);
extern void set_moved(struct attrib ** alist);
extern struct attrib_type at_moved;
#ifdef __cplusplus
}
#endif
#endif
/*
Copyright (c) 1998-2010, Enno Rehling <enno@eressea.de>
Katja Zedel <katze@felidae.kn-bremen.de
Christian Schlittchen <corwin@amber.kn-bremen.de>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
**/
#ifndef H_ATTRIBUTE_MOVED
#define H_ATTRIBUTE_MOVED
#ifdef __cplusplus
extern "C" {
#endif
struct attrib;
struct attrib_type;
extern boolean get_moved(struct attrib ** alist);
extern void set_moved(struct attrib ** alist);
extern struct attrib_type at_moved;
#ifdef __cplusplus
}
#endif
#endif

View file

@ -1,59 +1,59 @@
/*
Copyright (c) 1998-2010, Enno Rehling <enno@eressea.de>
Katja Zedel <katze@felidae.kn-bremen.de
Christian Schlittchen <corwin@amber.kn-bremen.de>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
**/
#include <platform.h>
#include <kernel/config.h>
#include "movement.h"
#include <util/attrib.h>
#include <util/storage.h>
static void
write_movement(const attrib * a, const void * owner, struct storage * store)
{
store->w_int(store, a->data.i);
}
static int
read_movement(attrib * a, void * owner, struct storage * store)
{
a->data.i = store->r_int(store);
if (a->data.i !=0 ) return AT_READ_OK;
else return AT_READ_FAIL;
}
attrib_type at_movement = {
"movement", NULL, NULL, NULL, write_movement, read_movement
};
boolean
get_movement(attrib * const * alist, int type)
{
const attrib * a = a_findc(*alist, &at_movement);
if (a==NULL) return false;
if (a->data.i & type) return true;
return false;
}
void
set_movement(attrib ** alist, int type)
{
attrib * a = a_find(*alist, &at_movement);
if (a==NULL) a = a_add(alist, a_new(&at_movement));
a->data.i |= type;
}
/*
Copyright (c) 1998-2010, Enno Rehling <enno@eressea.de>
Katja Zedel <katze@felidae.kn-bremen.de
Christian Schlittchen <corwin@amber.kn-bremen.de>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
**/
#include <platform.h>
#include <kernel/config.h>
#include "movement.h"
#include <util/attrib.h>
#include <util/storage.h>
static void
write_movement(const attrib * a, const void * owner, struct storage * store)
{
store->w_int(store, a->data.i);
}
static int
read_movement(attrib * a, void * owner, struct storage * store)
{
a->data.i = store->r_int(store);
if (a->data.i !=0 ) return AT_READ_OK;
else return AT_READ_FAIL;
}
attrib_type at_movement = {
"movement", NULL, NULL, NULL, write_movement, read_movement
};
boolean
get_movement(attrib * const * alist, int type)
{
const attrib * a = a_findc(*alist, &at_movement);
if (a==NULL) return false;
if (a->data.i & type) return true;
return false;
}
void
set_movement(attrib ** alist, int type)
{
attrib * a = a_find(*alist, &at_movement);
if (a==NULL) a = a_add(alist, a_new(&at_movement));
a->data.i |= type;
}

View file

@ -1,33 +1,33 @@
/*
Copyright (c) 1998-2010, Enno Rehling <enno@eressea.de>
Katja Zedel <katze@felidae.kn-bremen.de
Christian Schlittchen <corwin@amber.kn-bremen.de>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
**/
#ifndef H_ATTRIBUTE_MOVEMENT
#define H_ATTRIBUTE_MOVEMENT
#ifdef __cplusplus
extern "C" {
#endif
extern boolean get_movement(struct attrib * const * alist, int type);
extern void set_movement(struct attrib ** alist, int type);
extern struct attrib_type at_movement;
#ifdef __cplusplus
}
#endif
#endif
/*
Copyright (c) 1998-2010, Enno Rehling <enno@eressea.de>
Katja Zedel <katze@felidae.kn-bremen.de
Christian Schlittchen <corwin@amber.kn-bremen.de>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
**/
#ifndef H_ATTRIBUTE_MOVEMENT
#define H_ATTRIBUTE_MOVEMENT
#ifdef __cplusplus
extern "C" {
#endif
extern boolean get_movement(struct attrib * const * alist, int type);
extern void set_movement(struct attrib ** alist, int type);
extern struct attrib_type at_movement;
#ifdef __cplusplus
}
#endif
#endif

View file

@ -1,267 +1,267 @@
/*
Copyright (c) 1998-2010, Enno Rehling <enno@eressea.de>
Katja Zedel <katze@felidae.kn-bremen.de
Christian Schlittchen <corwin@amber.kn-bremen.de>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
**/
#include <platform.h>
#include <kernel/config.h>
#include "object.h"
/* kernel includes */
#include <kernel/building.h>
#include <kernel/faction.h>
#include <kernel/region.h>
#include <kernel/save.h>
#include <kernel/ship.h>
#include <kernel/unit.h>
#include <kernel/version.h>
/* util includes */
#include <util/attrib.h>
#include <util/resolve.h>
#include <util/storage.h>
/* stdc includes */
#include <string.h>
#include <assert.h>
typedef struct object_data {
object_type type;
char * name;
union {
int i;
char * str;
double real;
struct unit * u;
struct region * r;
struct building * b;
struct ship * sh;
struct faction * f;
} data;
} object_data;
static void
object_write(const attrib * a, const void * owner, struct storage * store)
{
const object_data * data = (object_data *)a->data.v;
int type = (int)data->type;
store->w_tok(store, data->name);
store->w_int(store, type);
switch (data->type) {
case TINTEGER:
store->w_int(store, data->data.i);
break;
case TREAL:
store->w_flt(store, (float)data->data.real);
break;
case TSTRING:
store->w_str(store, data->data.str);
break;
case TUNIT:
write_unit_reference(data->data.u, store );
break;
case TFACTION:
write_faction_reference(data->data.f, store);
break;
case TBUILDING:
write_building_reference(data->data.b, store);
break;
case TSHIP:
/* write_ship_reference(data->data.sh, store); */
assert(!"not implemented");
break;
case TREGION:
write_region_reference(data->data.r, store);
break;
case TNONE:
break;
default:
assert(!"illegal type in object-attribute");
}
}
static int
object_read(attrib *a, void * owner, struct storage * store)
{
object_data * data = (object_data *)a->data.v;
int result;
data->name = store->r_str(store);
data->type = (object_type)store->r_int(store);
switch (data->type) {
case TINTEGER:
data->data.i = store->r_int(store);
break;
case TREAL:
data->data.real = store->r_flt(store);
break;
case TSTRING:
data->data.str = store->r_str(store);
break;
case TBUILDING:
result = read_reference(&data->data.b, store, read_building_reference, resolve_building);
if (result==0 && !data->data.b) {
return AT_READ_FAIL;
}
break;
case TUNIT:
result = read_reference(&data->data.u, store, read_unit_reference, resolve_unit);
if (result==0 && !data->data.u) {
return AT_READ_FAIL;
}
break;
case TFACTION:
result = read_reference(&data->data.f, store, read_faction_reference, resolve_faction);
if (result==0 && !data->data.f) {
return AT_READ_FAIL;
}
break;
case TREGION:
result = read_reference(&data->data.r, store, read_region_reference, RESOLVE_REGION(store->version));
if (result==0 && !data->data.r) {
return AT_READ_FAIL;
}
break;
case TSHIP:
/* return read_ship_reference(&data->data.sh, store); */
assert(!"not implemented");
break;
case TNONE:
break;
default:
return AT_READ_FAIL;
}
return AT_READ_OK;
}
static void
object_init(attrib * a)
{
object_data * data;
a->data.v = malloc(sizeof(object_data));
data = (object_data *)a->data.v;
data->type = TNONE;
}
static void
object_done(attrib * a)
{
object_data * data = (object_data *)a->data.v;
if (data->type == TSTRING) free(data->data.str);
free(data->name);
free(a->data.v);
}
attrib_type at_object = {
"object", object_init, object_done, NULL,
object_write, object_read
};
const char *
object_name(const attrib * a)
{
object_data * data = (object_data *)a->data.v;
return data->name;
}
struct attrib *
object_create(const char * name, object_type type, variant value)
{
attrib * a = a_new(&at_object);
object_data * data = (object_data *)a->data.v;
data->name = strdup(name);
object_set(a, type, value);
return a;
}
void
object_set(attrib * a, object_type type, variant value)
{
object_data * data = (object_data *)a->data.v;
if (data->type==TSTRING) free(data->data.str);
data->type = type;
switch (type) {
case TSTRING:
data->data.str = value.v?strdup(value.v):NULL;
break;
case TINTEGER:
data->data.i = value.i;
break;
case TREAL:
data->data.real = value.f;
break;
case TREGION:
data->data.r = (region*)value.v;
break;
case TBUILDING:
data->data.b = (building*)value.v;
break;
case TFACTION:
data->data.f = (faction*)value.v;
break;
case TUNIT:
data->data.u = (unit*)value.v;
break;
case TSHIP:
data->data.sh = (ship*)value.v;
break;
case TNONE:
break;
default:
assert(!"invalid object-type");
break;
}
}
void
object_get(const struct attrib * a, object_type * type, variant * value)
{
object_data * data = (object_data *)a->data.v;
*type = data->type;
switch (data->type) {
case TSTRING:
value->v = data->data.str;
break;
case TINTEGER:
value->i = data->data.i;
break;
case TREAL:
value->f = (float)data->data.real;
break;
case TREGION:
value->v = data->data.r;
break;
case TBUILDING:
value->v = data->data.b;
break;
case TFACTION:
value->v = data->data.f;
break;
case TUNIT:
value->v = data->data.u;
break;
case TSHIP:
value->v = data->data.sh;
break;
case TNONE:
break;
default:
assert(!"invalid object-type");
break;
}
}
/*
Copyright (c) 1998-2010, Enno Rehling <enno@eressea.de>
Katja Zedel <katze@felidae.kn-bremen.de
Christian Schlittchen <corwin@amber.kn-bremen.de>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
**/
#include <platform.h>
#include <kernel/config.h>
#include "object.h"
/* kernel includes */
#include <kernel/building.h>
#include <kernel/faction.h>
#include <kernel/region.h>
#include <kernel/save.h>
#include <kernel/ship.h>
#include <kernel/unit.h>
#include <kernel/version.h>
/* util includes */
#include <util/attrib.h>
#include <util/resolve.h>
#include <util/storage.h>
/* stdc includes */
#include <string.h>
#include <assert.h>
typedef struct object_data {
object_type type;
char * name;
union {
int i;
char * str;
double real;
struct unit * u;
struct region * r;
struct building * b;
struct ship * sh;
struct faction * f;
} data;
} object_data;
static void
object_write(const attrib * a, const void * owner, struct storage * store)
{
const object_data * data = (object_data *)a->data.v;
int type = (int)data->type;
store->w_tok(store, data->name);
store->w_int(store, type);
switch (data->type) {
case TINTEGER:
store->w_int(store, data->data.i);
break;
case TREAL:
store->w_flt(store, (float)data->data.real);
break;
case TSTRING:
store->w_str(store, data->data.str);
break;
case TUNIT:
write_unit_reference(data->data.u, store );
break;
case TFACTION:
write_faction_reference(data->data.f, store);
break;
case TBUILDING:
write_building_reference(data->data.b, store);
break;
case TSHIP:
/* write_ship_reference(data->data.sh, store); */
assert(!"not implemented");
break;
case TREGION:
write_region_reference(data->data.r, store);
break;
case TNONE:
break;
default:
assert(!"illegal type in object-attribute");
}
}
static int
object_read(attrib *a, void * owner, struct storage * store)
{
object_data * data = (object_data *)a->data.v;
int result;
data->name = store->r_str(store);
data->type = (object_type)store->r_int(store);
switch (data->type) {
case TINTEGER:
data->data.i = store->r_int(store);
break;
case TREAL:
data->data.real = store->r_flt(store);
break;
case TSTRING:
data->data.str = store->r_str(store);
break;
case TBUILDING:
result = read_reference(&data->data.b, store, read_building_reference, resolve_building);
if (result==0 && !data->data.b) {
return AT_READ_FAIL;
}
break;
case TUNIT:
result = read_reference(&data->data.u, store, read_unit_reference, resolve_unit);
if (result==0 && !data->data.u) {
return AT_READ_FAIL;
}
break;
case TFACTION:
result = read_reference(&data->data.f, store, read_faction_reference, resolve_faction);
if (result==0 && !data->data.f) {
return AT_READ_FAIL;
}
break;
case TREGION:
result = read_reference(&data->data.r, store, read_region_reference, RESOLVE_REGION(store->version));
if (result==0 && !data->data.r) {
return AT_READ_FAIL;
}
break;
case TSHIP:
/* return read_ship_reference(&data->data.sh, store); */
assert(!"not implemented");
break;
case TNONE:
break;
default:
return AT_READ_FAIL;
}
return AT_READ_OK;
}
static void
object_init(attrib * a)
{
object_data * data;
a->data.v = malloc(sizeof(object_data));
data = (object_data *)a->data.v;
data->type = TNONE;
}
static void
object_done(attrib * a)
{
object_data * data = (object_data *)a->data.v;
if (data->type == TSTRING) free(data->data.str);
free(data->name);
free(a->data.v);
}
attrib_type at_object = {
"object", object_init, object_done, NULL,
object_write, object_read
};
const char *
object_name(const attrib * a)
{
object_data * data = (object_data *)a->data.v;
return data->name;
}
struct attrib *
object_create(const char * name, object_type type, variant value)
{
attrib * a = a_new(&at_object);
object_data * data = (object_data *)a->data.v;
data->name = strdup(name);
object_set(a, type, value);
return a;
}
void
object_set(attrib * a, object_type type, variant value)
{
object_data * data = (object_data *)a->data.v;
if (data->type==TSTRING) free(data->data.str);
data->type = type;
switch (type) {
case TSTRING:
data->data.str = value.v?strdup(value.v):NULL;
break;
case TINTEGER:
data->data.i = value.i;
break;
case TREAL:
data->data.real = value.f;
break;
case TREGION:
data->data.r = (region*)value.v;
break;
case TBUILDING:
data->data.b = (building*)value.v;
break;
case TFACTION:
data->data.f = (faction*)value.v;
break;
case TUNIT:
data->data.u = (unit*)value.v;
break;
case TSHIP:
data->data.sh = (ship*)value.v;
break;
case TNONE:
break;
default:
assert(!"invalid object-type");
break;
}
}
void
object_get(const struct attrib * a, object_type * type, variant * value)
{
object_data * data = (object_data *)a->data.v;
*type = data->type;
switch (data->type) {
case TSTRING:
value->v = data->data.str;
break;
case TINTEGER:
value->i = data->data.i;
break;
case TREAL:
value->f = (float)data->data.real;
break;
case TREGION:
value->v = data->data.r;
break;
case TBUILDING:
value->v = data->data.b;
break;
case TFACTION:
value->v = data->data.f;
break;
case TUNIT:
value->v = data->data.u;
break;
case TSHIP:
value->v = data->data.sh;
break;
case TNONE:
break;
default:
assert(!"invalid object-type");
break;
}
}

View file

@ -1,38 +1,38 @@
/* vi: set ts=2:
+-------------------+ 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_ATTRIBUTE_OBJECT
#define H_ATTRIBUTE_OBJECT
#include <util/variant.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef enum {
TNONE = 0, TINTEGER = 1, TREAL = 2, TSTRING = 3,
TUNIT = 10, TFACTION = 11, TREGION = 12, TBUILDING = 13, TSHIP = 14,
} object_type;
extern struct attrib_type at_object;
extern struct attrib * object_create(const char * name, object_type type, variant value);
extern void object_get(const struct attrib * a, object_type * type, variant * value);
extern void object_set(struct attrib * a, object_type type, variant value);
extern const char * object_name(const struct attrib * a);
#ifdef __cplusplus
}
#endif
#endif
/* vi: set ts=2:
+-------------------+ 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_ATTRIBUTE_OBJECT
#define H_ATTRIBUTE_OBJECT
#include <util/variant.h>
#ifdef __cplusplus
extern "C" {
#endif
typedef enum {
TNONE = 0, TINTEGER = 1, TREAL = 2, TSTRING = 3,
TUNIT = 10, TFACTION = 11, TREGION = 12, TBUILDING = 13, TSHIP = 14,
} object_type;
extern struct attrib_type at_object;
extern struct attrib * object_create(const char * name, object_type type, variant value);
extern void object_get(const struct attrib * a, object_type * type, variant * value);
extern void object_set(struct attrib * a, object_type type, variant value);
extern const char * object_name(const struct attrib * a);
#ifdef __cplusplus
}
#endif
#endif

View file

@ -1,40 +1,40 @@
/*
Copyright (c) 1998-2010, Enno Rehling <enno@eressea.de>
Katja Zedel <katze@felidae.kn-bremen.de
Christian Schlittchen <corwin@amber.kn-bremen.de>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
**/
#include <platform.h>
#include <kernel/config.h>
#include "orcification.h"
#include <kernel/save.h>
#include <util/attrib.h>
/*
* simple attributes that do not yet have their own file
*/
attrib_type at_orcification = {
"orcification", NULL, NULL, NULL, a_writeint, a_readint, ATF_UNIQUE
};
attrib *
make_orcification(int orcification)
{
attrib * a = a_new(&at_orcification);
a->data.i = orcification;
return a;
}
/*
Copyright (c) 1998-2010, Enno Rehling <enno@eressea.de>
Katja Zedel <katze@felidae.kn-bremen.de
Christian Schlittchen <corwin@amber.kn-bremen.de>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
**/
#include <platform.h>
#include <kernel/config.h>
#include "orcification.h"
#include <kernel/save.h>
#include <util/attrib.h>
/*
* simple attributes that do not yet have their own file
*/
attrib_type at_orcification = {
"orcification", NULL, NULL, NULL, a_writeint, a_readint, ATF_UNIQUE
};
attrib *
make_orcification(int orcification)
{
attrib * a = a_new(&at_orcification);
a->data.i = orcification;
return a;
}

View file

@ -1,28 +1,28 @@
/*
Copyright (c) 1998-2010, Enno Rehling <enno@eressea.de>
Katja Zedel <katze@felidae.kn-bremen.de
Christian Schlittchen <corwin@amber.kn-bremen.de>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
**/
#ifdef __cplusplus
extern "C" {
#endif
extern struct attrib_type at_orcification;
extern struct attrib * make_orcification(int orcification);
#ifdef __cplusplus
}
#endif
/*
Copyright (c) 1998-2010, Enno Rehling <enno@eressea.de>
Katja Zedel <katze@felidae.kn-bremen.de
Christian Schlittchen <corwin@amber.kn-bremen.de>
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
**/
#ifdef __cplusplus
extern "C" {
#endif
extern struct attrib_type at_orcification;
extern struct attrib * make_orcification(int orcification);
#ifdef __cplusplus
}
#endif

Some files were not shown because too many files have changed in this diff Show more