Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <!--
- ====================================
- ====================================
- TEMPLATE - weapons ranged
- ====================================
- ====================================-->
- <xsl:template match="ranges">
- <xsl:param name="column_width" select="0.55 * $pagePrintableWidth - 2"/>
- <fo:table table-layout="fixed" keep-with-next="always" keep-together="always">
- <fo:table-column column-width="5mm"/>
- <fo:table-column>
- <xsl:attribute name="column-width"><xsl:value-of select="0.2 * ($column_width - 5)" />mm</xsl:attribute>
- </fo:table-column>
- <fo:table-column>
- <xsl:attribute name="column-width"><xsl:value-of select="0.2 * ($column_width - 5)" />mm</xsl:attribute>
- </fo:table-column>
- <fo:table-column>
- <xsl:attribute name="column-width"><xsl:value-of select="0.2 * ($column_width - 5)" />mm</xsl:attribute>
- </fo:table-column>
- <fo:table-column>
- <xsl:attribute name="column-width"><xsl:value-of select="0.2 * ($column_width - 5)" />mm</xsl:attribute>
- </fo:table-column>
- <fo:table-column>
- <xsl:attribute name="column-width"><xsl:value-of select="0.2 * ($column_width - 5)" />mm</xsl:attribute>
- </fo:table-column>
- <fo:table-body>
- <xsl:if test="./ammunition">
- <fo:table-row keep-with-next.within-column="always">
- <fo:table-cell number-columns-spanned="6">
- <xsl:call-template name="attrib">
- <xsl:with-param name="attribute" select="'weapon.title'"/>
- </xsl:call-template>
- <fo:block font-size="5pt" font-weight="bold">Ammunition: <xsl:value-of select="ammunition/name"/>
- <xsl:if test="string(./ammunition/special_properties) != ''">
- (<xsl:value-of select="./ammunition/special_properties"/>)
- </xsl:if>
- </fo:block>
- </fo:table-cell>
- </fo:table-row>
- </xsl:if>
- <xsl:choose>
- <xsl:when test="range[position()=6 and distance='']">
- </xsl:when>
- <xsl:when test="range[position()=11 and distance='']">
- </xsl:when>
- <xsl:otherwise>
- <!--> <xsl:if test="range[position() > 5]"> -->
- <!--> <xsl:if test="range[position() > 5 or ../../common/range > 10]"> -->
- <!--> <xsl:if test="count(./ranges/range) = 6 or count(./ranges/range) = 11">-->
- <fo:table-row keep-with-next.within-column="always">
- <xsl:for-each select="range[position() < 2]">
- <fo:table-cell number-columns-spanned="2">
- <xsl:call-template name="attrib">
- <xsl:with-param name="attribute" select="'weapon.title'"/>
- </xsl:call-template>
- <fo:block font-size="7pt" font-weight="bold">
- Range: <xsl:value-of select="distance"/>
- </fo:block>
- </fo:table-cell>
- <fo:table-cell number-columns-spanned="2">
- <xsl:call-template name="attrib">
- <xsl:with-param name="attribute" select="'weapon.title'"/>
- </xsl:call-template>
- <fo:block font-size="7pt" font-weight="bold">
- To Hit: <xsl:value-of select="to_hit"/>
- </fo:block>
- </fo:table-cell>
- <fo:table-cell number-columns-spanned="2">
- <xsl:call-template name="attrib">
- <xsl:with-param name="attribute" select="'weapon.title'"/>
- </xsl:call-template>
- <fo:block font-size="7pt" font-weight="bold">
- Damage: <xsl:value-of select="damage"/>
- </fo:block>
- </fo:table-cell>
- </xsl:for-each>
- </fo:table-row>
- <!--> </xsl:if> -->
- </xsl:otherwise>
- </xsl:choose>
- <xsl:if test="range[position() > 6]">
- <fo:table-row keep-with-next.within-column="always">
- <!-- Distances -->
- <fo:table-cell>
- <xsl:call-template name="attrib"><xsl:with-param name="attribute" select="'weapon.title'"/></xsl:call-template>
- </fo:table-cell>
- <xsl:for-each select="range[position() > 1 and position() < 8]">
- <fo:table-cell>
- <xsl:call-template name="attrib"><xsl:with-param name="attribute" select="'weapon.title'"/></xsl:call-template>
- <fo:block font-size="5pt" font-weight="bold">
- <xsl:value-of select="distance"/>
- </fo:block>
- </fo:table-cell>
- </xsl:for-each>
- </fo:table-row>
- <fo:table-row keep-with-next.within-column="always">
- <!-- Range To-Hits -->
- <fo:table-cell>
- <xsl:call-template name="attrib"><xsl:with-param name="attribute" select="'weapon.title'"/></xsl:call-template>
- <fo:block font-size="6pt" font-weight="bold">TH</fo:block>
- </fo:table-cell>
- <xsl:for-each select="range[position() > 1 and position() < 8]">
- <fo:table-cell>
- <xsl:call-template name="attrib"><xsl:with-param name="attribute" select="'weapon.hilight'"/></xsl:call-template>
- <fo:block space-before="1pt">
- <xsl:attribute name="font-size">
- <xsl:choose>
- <xsl:when test="string-length(to_hit) > 15">6pt</xsl:when>
- <xsl:otherwise>7pt</xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
- <xsl:value-of select="to_hit"/>
- </fo:block>
- </fo:table-cell>
- </xsl:for-each>
- </fo:table-row>
- <fo:table-row keep-with-next.within-column="always">
- <!-- Damages -->
- <fo:table-cell>
- <xsl:call-template name="attrib"><xsl:with-param name="attribute" select="'weapon.title'"/></xsl:call-template>
- <fo:block font-size="6pt" font-weight="bold">Dam</fo:block>
- </fo:table-cell>
- <xsl:for-each select="range[position() > 1 and position() < 8]">
- <fo:table-cell>
- <xsl:call-template name="attrib"><xsl:with-param name="attribute" select="'weapon.hilight'"/></xsl:call-template>
- <fo:block font-size="7pt" space-before="1pt">
- <xsl:value-of select="damage"/>
- </fo:block>
- </fo:table-cell>
- </xsl:for-each>
- </fo:table-row>
- </xsl:if>
- <!-- For Thrown Weapons -->
- <!-- New Row For Actual Range with 10 increments
- CHOOSE tests for Thrown or Ranged and then grants the -->
- <xsl:choose>
- <xsl:when test="range[position() > 6]">
- <fo:table-row keep-with-next.within-column="always">
- <!-- Distances -->
- <fo:table-cell>
- <xsl:call-template name="attrib"><xsl:with-param name="attribute" select="'weapon.title'"/></xsl:call-template>
- </fo:table-cell>
- <xsl:for-each select="range[position() > 6 and position() < 12]">
- <fo:table-cell>
- <xsl:call-template name="attrib"><xsl:with-param name="attribute" select="'weapon.title'"/></xsl:call-template>
- <fo:block font-size="5pt" font-weight="bold">
- <xsl:value-of select="distance"/>
- </fo:block>
- </fo:table-cell>
- </xsl:for-each>
- </fo:table-row>
- <fo:table-row keep-with-next.within-column="always">
- <!-- Range To-Hits -->
- <fo:table-cell>
- <xsl:call-template name="attrib"><xsl:with-param name="attribute" select="'weapon.title'"/></xsl:call-template>
- <fo:block font-size="6pt" font-weight="bold">TH</fo:block>
- </fo:table-cell>
- <xsl:for-each select="range[position() > 6 and position() < 12]">
- <fo:table-cell>
- <xsl:call-template name="attrib"><xsl:with-param name="attribute" select="'weapon.hilight'"/></xsl:call-template>
- <fo:block space-before="1pt">
- <xsl:attribute name="font-size">
- <xsl:choose>
- <xsl:when test="string-length(to_hit) > 15">6pt</xsl:when>
- <xsl:otherwise>7pt</xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
- <xsl:value-of select="to_hit"/>
- </fo:block>
- </fo:table-cell>
- </xsl:for-each>
- </fo:table-row>
- <fo:table-row keep-with-next.within-column="always">
- <!-- Damages -->
- <fo:table-cell>
- <xsl:call-template name="attrib"><xsl:with-param name="attribute" select="'weapon.title'"/></xsl:call-template>
- <fo:block font-size="6pt" font-weight="bold">Dam</fo:block>
- </fo:table-cell>
- <xsl:for-each select="range[position() > 6 and position() < 12]">
- <fo:table-cell>
- <xsl:call-template name="attrib"><xsl:with-param name="attribute" select="'weapon.hilight'"/></xsl:call-template>
- <fo:block font-size="7pt" space-before="1pt">
- <xsl:value-of select="damage"/>
- </fo:block>
- </fo:table-cell>
- </xsl:for-each>
- </fo:table-row>
- </xsl:when>
- <xsl:when test="range[position()=6 and distance='']">
- <!--> <xsl:when test="contains(rangetype, 'Thrown')"> -->
- <fo:table-row keep-with-next.within-column="always">
- <!-- Distances -->
- <fo:table-cell>
- <xsl:call-template name="attrib"><xsl:with-param name="attribute" select="'weapon.title'"/></xsl:call-template>
- </fo:table-cell>
- <xsl:for-each select="range[position() < 6]">
- <fo:table-cell>
- <xsl:call-template name="attrib"><xsl:with-param name="attribute" select="'weapon.title'"/></xsl:call-template>
- <fo:block font-size="5pt" font-weight="bold">
- <xsl:value-of select="distance"/>
- </fo:block>
- </fo:table-cell>
- </xsl:for-each>
- </fo:table-row>
- <fo:table-row keep-with-next.within-column="always">
- <!-- Range To-Hits -->
- <fo:table-cell>
- <xsl:call-template name="attrib"><xsl:with-param name="attribute" select="'weapon.title'"/></xsl:call-template>
- <fo:block font-size="6pt" font-weight="bold">TH</fo:block>
- </fo:table-cell>
- <xsl:for-each select="range[position() < 6]">
- <fo:table-cell>
- <xsl:call-template name="attrib"><xsl:with-param name="attribute" select="'weapon.hilight'"/></xsl:call-template>
- <fo:block space-before="1pt">
- <xsl:attribute name="font-size">
- <xsl:choose>
- <xsl:when test="string-length(to_hit) > 15">6pt</xsl:when>
- <xsl:otherwise>7pt</xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
- <xsl:value-of select="to_hit"/>
- </fo:block>
- </fo:table-cell>
- </xsl:for-each>
- </fo:table-row>
- <fo:table-row keep-with-next.within-column="always">
- <!-- Damages -->
- <fo:table-cell>
- <xsl:call-template name="attrib"><xsl:with-param name="attribute" select="'weapon.title'"/></xsl:call-template>
- <fo:block font-size="6pt" font-weight="bold">Dam</fo:block>
- </fo:table-cell>
- <xsl:for-each select="range[position() < 6]">
- <fo:table-cell>
- <xsl:call-template name="attrib"><xsl:with-param name="attribute" select="'weapon.hilight'"/></xsl:call-template>
- <fo:block font-size="7pt" space-before="1pt">
- <xsl:value-of select="damage"/>
- </fo:block>
- </fo:table-cell>
- </xsl:for-each>
- </fo:table-row>
- </xsl:when>
- <xsl:otherwise>
- <!--> <xsl:when test="range[position() < 8]"> -->
- <fo:table-row keep-with-next.within-column="always">
- <!-- Distances -->
- <fo:table-cell>
- <xsl:call-template name="attrib"><xsl:with-param name="attribute" select="'weapon.title'"/></xsl:call-template>
- </fo:table-cell>
- <!--> <xsl:for-each select="range[position() < 6]"> -->
- <xsl:for-each select="range[position() > 1 and position() < 8]">
- <fo:table-cell>
- <xsl:call-template name="attrib"><xsl:with-param name="attribute" select="'weapon.title'"/></xsl:call-template>
- <fo:block font-size="5pt" font-weight="bold">
- <xsl:value-of select="distance"/>
- </fo:block>
- </fo:table-cell>
- </xsl:for-each>
- </fo:table-row>
- <fo:table-row keep-with-next.within-column="always">
- <!-- Range To-Hits -->
- <fo:table-cell>
- <xsl:call-template name="attrib"><xsl:with-param name="attribute" select="'weapon.title'"/></xsl:call-template>
- <fo:block font-size="6pt" font-weight="bold">TH</fo:block>
- </fo:table-cell>
- <!--> <xsl:for-each select="range[position() < 6]"> -->
- <xsl:for-each select="range[position() > 1 and position() < 8]">
- <fo:table-cell>
- <xsl:call-template name="attrib"><xsl:with-param name="attribute" select="'weapon.hilight'"/></xsl:call-template>
- <fo:block space-before="1pt">
- <xsl:attribute name="font-size">
- <xsl:choose>
- <xsl:when test="string-length(to_hit) > 15">6pt</xsl:when>
- <xsl:otherwise>7pt</xsl:otherwise>
- </xsl:choose>
- </xsl:attribute>
- <xsl:value-of select="to_hit"/>
- </fo:block>
- </fo:table-cell>
- </xsl:for-each>
- </fo:table-row>
- <fo:table-row keep-with-next.within-column="always">
- <!-- Damages -->
- <fo:table-cell>
- <xsl:call-template name="attrib"><xsl:with-param name="attribute" select="'weapon.title'"/></xsl:call-template>
- <fo:block font-size="6pt" font-weight="bold">Dam</fo:block>
- </fo:table-cell>
- <xsl:for-each select="range[position() > 1 and position() < 8]">
- <!-- <xsl:for-each select="range[position() < 6]"> -->
- <fo:table-cell>
- <xsl:call-template name="attrib"><xsl:with-param name="attribute" select="'weapon.hilight'"/></xsl:call-template>
- <fo:block font-size="7pt" space-before="1pt">
- <xsl:value-of select="damage"/>
- </fo:block>
- </fo:table-cell>
- </xsl:for-each>
- </fo:table-row>
- </xsl:otherwise>
- </xsl:choose>
- </fo:table-body>
- </fo:table>
- </xsl:template>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement