<Library Name="charlibcreate">
    <Functions>
        <Function Name="charlib_midval">
            <Return>Truncate(([param.0] + [param.1] + [param.2]) / 3)</Return>
        </Function>
        <Function Name="charlib_attributesum">
            <Return>[data.character.attributes.courage] + [data.character.attributes.intelligence] + [data.character.attributes.intuition] + [data.character.attributes.charisma] + [data.character.attributes.dexterity] + [data.character.attributes.agility] + [data.character.attributes.physique] + [data.character.attributes.strength]</Return>
        </Function>
        <Function Name="charlibcreate_fifteenattributessum">
            <Actions>
                <Action>
                    <Do>0</Do>
                    <Output>[local.sum]</Output>
                </Action>
                <Action>
                    <If>[data.character.attributes.courage] &gt;= 15</If>
                    <Do>[local.sum] + 1</Do>
                    <Output>[local.sum]</Output>
                </Action>
                <Action>
                    <If>[data.character.attributes.intelligence] &gt;= 15</If>
                    <Do>[local.sum] + 1</Do>
                    <Output>[local.sum]</Output>
                </Action>
                <Action>
                    <If>[data.character.attributes.intuition] &gt;= 15</If>
                    <Do>[local.sum] + 1</Do>
                    <Output>[local.sum]</Output>
                </Action>
                <Action>
                    <If>[data.character.attributes.charisma] &gt;= 15</If>
                    <Do>[local.sum] + 1</Do>
                    <Output>[local.sum]</Output>
                </Action>
                <Action>
                    <If>[data.character.attributes.dexterity] &gt;= 15</If>
                    <Do>[local.sum] + 1</Do>
                    <Output>[local.sum]</Output>
                </Action>
                <Action>
                    <If>[data.character.attributes.agility] &gt;= 15</If>
                    <Do>[local.sum] + 1</Do>
                    <Output>[local.sum]</Output>
                </Action>
                <Action>
                    <If>[data.character.attributes.physique] &gt;= 15</If>
                    <Do>[local.sum] + 1</Do>
                    <Output>[local.sum]</Output>
                </Action>
                <Action>
                    <If>[data.character.attributes.strength] &gt;= 15</If>
                    <Do>[local.sum] + 1</Do>
                    <Output>[local.sum]</Output>
                </Action>
            </Actions>
            <Return>[local.sum]</Return>
        </Function>
        <Function Name="charlibcreate_checkpreprint">
            <Actions>
                <Action>
                    <Do>true</Do>
                    <Output>[local.check]</Output>
                </Action>
                <Action>
                    <If>charlib_attributesum() &gt; 100</If>
                    <Do>false</Do>
                    <Output>[local.check]</Output>
                </Action>
                <Action>
                    <If>charlibcreate_fifteenattributessum() &gt; 1</If>
                    <Do>false</Do>
                    <Output>[local.check]</Output>
                </Action>
            </Actions>
            <Return>[local.check]</Return>
        </Function>
    </Functions>
</Library>