<!-- Skill component
Each skill derives from this component
-->
<component
id="Skill"
name="Skill"
autocompset="no"
panellink="skills">
<!-- Net final roll that includes the value of the linked attribute -->
<field
id="sklRoll"
name="Net Skill Roll"
type="derived">
<calculate phase="Final" priority="5000">
<after name="Calc trtFinal"/><![CDATA[
~only access the linkage if the skill is directly on the hero; if not, it is
~likely within an advancement gizmo and no linkage will exist there
if (container.ishero <> 0) then
@value = field[trtFinal].value + linkage[attribute].field[trtFinal].value
endif
]]></calculate>
</field>
<!-- Each skill is associated with a specific attribute that must be identified -->
<linkage linkage="attribute" optional="no"/>
<linkage linkage="skill" optional="yes"/>
<!-- Each skill needs its own identity tag so existing skills can be identified during advancement -->
<identity group="Skill"/>
<!-- Every skill is shown on the "Rolls" mouse-over on the Dashboard/TacCon -->
<tag group="DashTacCon" tag="Rolls"/>
<!-- Track the skill on the actor -->
<eval index="1" phase="Setup" priority="5000"><![CDATA[
perform forward[Skill.?]
]]></eval>
<!-- Each skill point that is allocated by the user costs base cost * rank in skill points -->
<eval index="2" phase="Traits" priority="10000">
<before name="Calc resLeft"/>
<after name="Bound trtUser"/><![CDATA[
~if this skill is not added directly to the hero (i.e. an advance), skip it entirely
doneif (origin.ishero = 0)
~adjust the resource appropriately
if (tagis[Skills.Broad] = 1) then
if (hero.intersect[Profession,Profession] <> 0) then
hero.child[resSkill].field[resSpent].value += maximum(field[baseCost].value-1,0)
else
hero.child[resSkill].field[resSpent].value += maximum(field[baseCost].value,0)
endif
else
if (hero.intersect[Profession,Profession] <> 0) then
var listcostmo as number
listcostmo = field[baseCost].value-1
hero.child[resSkill].field[resSpent].value += maximum(field[trtUser].value * listcostmo + field[trtUser].value,0)
else
hero.child[resSkill].field[resSpent].value += maximum(field[trtUser].value * field[baseCost].value + field[trtUser].value,0)
debug "values : " & field[trtUser].value & " basecost : " & field[baseCost].value
var testnum as number
testnum = field[trtUser].value * field[baseCost].value + field[trtUser].value
debug "calc: " & field[trtUser].value & " * " & field[baseCost].value & " + " & field[trtUser].value & " = " & testnum
endif
endif
]]></eval>
<eval index="3" phase="Setup" priority="5000"><![CDATA[
~pull the identity tag of the linked attribute into the skill
perform linkage[attribute].pullidentity[Attribute]
]]>
</eval>
</component>
<!-- Psionic component
Each psionic skill derives from this component
-->
<component
id="Psionics"
name="Psionics"
autocompset="no"
panellink="Psionics">
<!-- Net final roll that includes the value of the linked attribute -->
<field
id="sklPsiRoll"
name="Net psionic Roll"
type="derived">
<calculate phase="Final" priority="5000">
<after name="Calc trtFinal"/><![CDATA[
~only access the linkage if the psinoc is directly on the hero; if not, it is
~likely within an advancement gizmo and no linkage will exist there
if (container.ishero <> 0) then
@value = field[trtFinal].value + linkage[attribute].field[trtFinal].value
endif
]]></calculate>
</field>
<!-- Each psionic is associated with a specific attribute that must be identified -->
<linkage linkage="attribute" optional="no"/> *****THIS IS THE LINE CAUSING THE PROBLEM*****
<linkage linkage="psionic" optional="yes"/>
<!-- Each psionic needs its own identity tag so existing skills can be identified during advancement -->
<identity group="Psionics"/>
<!-- Every Psionic is shown on the "Rolls" mouse-over on the Dashboard/TacCon -->
<tag group="DashTacCon" tag="Rolls"/>
<!-- Track the psionic on the actor -->
<eval index="1" phase="Setup" priority="5000"><![CDATA[
perform forward[Psionics.?]
]]></eval>
<!-- Each psionic that is allocated by the user costs base cost * rank in skill points -->
<eval index="2" phase="Traits" priority="10000">
<before name="Calc resLeft"/>
<after name="Bound trtUser"/><![CDATA[
~if this skill is not added directly to the hero (i.e. an advance), skip it entirely
doneif (origin.ishero = 0)
~adjust the resource appropriately
if (tagis[Skills.Broad] = 1) then
if (hero.intersect[Profession,Profession] <> 0) then
hero.child[resSkill].field[resSpent].value += maximum(field[baseCost].value-1,0)
else
hero.child[resSkill].field[resSpent].value += maximum(field[baseCost].value,0)
endif
else
if (hero.intersect[Profession,Profession] <> 0) then
var listcostmo as number
listcostmo = field[baseCost].value-1
hero.child[resSkill].field[resSpent].value += maximum(field[trtUser].value * listcostmo + field[trtUser].value,0)
else
hero.child[resSkill].field[resSpent].value += maximum(field[trtUser].value * field[baseCost].value + field[trtUser].value,0)
debug "values : " & field[trtUser].value & " basecost : " & field[baseCost].value
var testnum as number
testnum = field[trtUser].value * field[baseCost].value + field[trtUser].value
debug "calc: " & field[trtUser].value & " * " & field[baseCost].value & " + " & field[trtUser].value & " = " & testnum
endif
endif
]]></eval>
<eval index="3" phase="Setup" priority="5000"><![CDATA[
~pull the identity tag of the linked attribute into the psionic
perform linkage[attribute].pullidentity[Attribute]
]]>
</eval>
</component>