<!-- Savegame DTD : version 1.05 -->
<!-- History of file format versioning :
...
1.05 : New versions to reflect changes in level.dtd 1.05
--> 

<!ENTITY % object "cat|extensible|sergeant|flamer|bolter|genestealer|blip
                   |extensible|entry|door|zone|bulkhead|exit|flame
                   |emptysquare">

<!-- The savegame includes :
      - the gamemanager object
      - a bit of the level object
      - the board object
-->
<!ELEMENT savegame (gamemanager,level,board)>


<!ELEMENT gamemanager (cardlist,waitingentrylist,replaylist?)>
<!ATTLIST gamemanager
       turn CDATA #REQUIRED
       nbturns CDATA #REQUIRED
       maxcreaid CDATA #REQUIRED
       cmdpts CDATA #REQUIRED
       random_seed CDATA #REQUIRED
       heurisrev CDATA #REQUIRED
       heuristurn CDATA #REQUIRED
       cheat CDATA "1"
       hascheated CDATA "no"
       gametype CDATA #REQUIRED
       email CDATA>

<!ELEMENT cardlist (card*)>
<!ELEMENT card EMPTY>
<!ATTLIST card 
       nbgen CDATA #REQUIRED>

<!ELEMENT waitingentrylist (waitingentry*)>
<!ELEMENT waitingentry EMPTY>
<!ATTLIST waitingentry 
       position CDATA #REQUIRED>

<!ELEMENT replaylist (replay*)>
<!ELEMENT replay EMPTY>
<!ATTLIST replay
       command CDATA #REQUIRED>

<!-- The level is taken from the level.dtd It just miss the map
element, already written by the board element. -->

<!ELEMENT level (global,marine_cfg,gen_cfg,killlist)>
<!ELEMENT killlist (kill*)>
<!ELEMENT kill EMPTY>
<!ATTLIST kill
       unit CDATA #REQUIRED
       nb CDATA #REQUIRED>



<!ELEMENT board ((%object;)*|dead_tiles)>
<!ATTLIST board
       xmax CDATA #REQUIRED
       ymax CDATA #REQUIRED>

<!ELEMENT dead_tiles ((dead_marine|dead_genestealer)*)>
<!ELEMENT dead_marine EMPTY>
<!ATTLIST dead_marine position CDATA #REQUIRED>
<!ELEMENT dead_genestealer EMPTY>
<!ATTLIST dead_genestealer position CDATA #REQUIRED>


<!ELEMENT door EMPTY>
<!ATTLIST door
       position CDATA #REQUIRED
       vertical (yes|no) #REQUIRED
       state (open|close) #REQUIRED>

<!ELEMENT bulkhead EMPTY>
<!ATTLIST bulkhead
       position CDATA #REQUIRED
       vertical (yes|no) #REQUIRED
       state (open|close) #REQUIRED
       can_open (yes|no) #REQUIRED
       can_close (yes|no) #REQUIRED>

<!ELEMENT extensible EMPTY>
<!ATTLIST extensible
        position CDATA #REQUIRED
        desc CDATA #REQUIRED
        graphic (toxinduct|archives|machinery) #REQUIRED
        empty (yes|no) "no"
        attackable (yes|no) "no"
        shootable CDATA "0"
        fireable (yes|no) "no"
        takeable CDATA "0"
        removeable CDATA "0"
        transferable CDATA "0"
        shootwith (yes|no) "yes"
        usedoorwith (yes|no) "yes"
        istaken (yes|no) "no">

<!ELEMENT entry EMPTY>
<!ATTLIST entry
        position CDATA #REQUIRED
        direction (north|south|east|west) #REQUIRED
        maxblip CDATA "3">

<!ELEMENT exit (exitedunit)*>
<!ATTLIST exit
        position CDATA #REQUIRED
        direction (north|south|east|west) #REQUIRED
        turn CDATA #REQUIRED>

<!ELEMENT exitedunit EMPTY>
<!ATTLIST exitedunit
           type (sergeant|bolter|flamer|blip|genestealer|cat) #REQUIRED
           id CDATA #REQUIRED>

<!ELEMENT flames EMPTY>
<!ATTLIST flames
        position CDATA #REQUIRED
        nbflames CDATA #REQUIRED
        transparent yes|no #REQUIRED>

<!ELEMENT cat EMPTY>
<!ATTLIST cat
        position CDATA #REQUIRED
        id CDATA #REQUIRED
        initturn CDATA #REQUIRED
        selected yes|no #REQUIRED
        donesomething yes|no #REQUIRED
        actionpts CDATA #REQUIRED
        taken yes|not #REQUIRED
        istaken yes|no #REQUIRED>

<!ELEMENT blip EMPTY>
<!ATTLIST blip
        position CDATA #REQUIRED
        id CDATA #REQUIRED
        initturn CDATA #REQUIRED
        selected yes|no #REQUIRED
        donesomething yes|no #REQUIRED
        actionpts CDATA #REQUIRED
        taken yes|not #REQUIRED
        nbgen CDATA #REQUIRED>

<!ELEMENT genestealer EMPTY>
<!ATTLIST genestealer
        position CDATA #REQUIRED
        id CDATA #REQUIRED
        initturn CDATA #REQUIRED
        selected yes|no #REQUIRED
        donesomething yes|no #REQUIRED
        actionpts CDATA #REQUIRED
        taken yes|not #REQUIRED
        orientation north|south|east|west #REQUIRED
        history none|turn90|turn180|forward|backward|shoot|overwatch|fire>

<!ELEMENT bolter EMPTY>
<!ATTLIST bolter
        position CDATA #REQUIRED
        id CDATA #REQUIRED
        initturn CDATA #REQUIRED
        selected yes|no #REQUIRED
        donesomething yes|no #REQUIRED
        actionpts CDATA #REQUIRED
        taken yes|not #REQUIRED
        orientation north|south|east|west #REQUIRED
        history none|turn90|turn180|forward|backward|shoot|overwatch|fire
        previoustarget CDATA #REQUIRED
        jammed yes|no #REQUIRED>

<!ELEMENT sergeant EMPTY>
<!ATTLIST sergeant
        position CDATA #REQUIRED
        id CDATA #REQUIRED
        initturn CDATA #REQUIRED
        selected yes|no #REQUIRED
        donesomething yes|no #REQUIRED
        actionpts CDATA #REQUIRED
        taken yes|not #REQUIRED
        orientation north|south|east|west #REQUIRED
        history none|turn90|turn180|forward|backward|shoot|overwatch|fire
        previoustarget CDATA #REQUIRED
        jammed yes|no #REQUIRED>

<!ELEMENT flamer (currentfiring)*>
<!ATTLIST flamer
        position CDATA #REQUIRED
        id CDATA #REQUIRED
        initturn CDATA #REQUIRED
        selected yes|no #REQUIRED
        donesomething yes|no #REQUIRED
        actionpts CDATA #REQUIRED
        taken yes|not #REQUIRED
        orientation north|south|east|west #REQUIRED
        history none|turn90|turn180|forward|backward|shoot|overwatch|fire
        previoustarget CDATA #REQUIRED
        ammunition CDATA #REQUIRED
        charger CDATA #REQUIRED>

<!ELEMENT currentfiring EMPTY>
<!ATTLIST currentfiring position CDATA #REQUIRED>