ShadowWalker
Well-known member
Using the Add New Ability I was able to easily get Add New Skill to work.
I tried using the same formula for Add New Spell but it's not adding the new thing as a pick. It's properly displaying the the advancement with the name of the spell, but it's not adding it as a pick.
At a loss for what to do next.
component for adding a new spell
component for spells
I tried using the same formula for Add New Spell but it's not adding the new thing as a pick. It's properly displaying the the advancement with the name of the spell, but it's not adding it as a pick.
At a loss for what to do next.
component for adding a new spell
Code:
<thing
id="advNewSpel"
name="Gain a New Spell"
compset="Advance"
description="Select a new Spell of your choice.">
<fieldval field="advAction" value="New Spell"/>
<fieldval field="advDynamic" value="component.Spell"/>
<tag group="Advance" tag="AddNew"/>
<!-- Modify tagexpr to deny Skills that have already been added to the character -->
<eval index="1" phase="Render" priority="1000">
<before name="Assign Dynamic Tagexpr"/><![CDATA[
~get the list of all Skills on the hero and assemble it as a list of precluded tags
var tagexpr as string
tagexpr = hero.tagids[Spell.?," & !"]
~if there are any tags to exclude, append them to the tagexpr appropriately
field[advDynamic].text = splice(field[advDynamic].text,tagexpr," & !")
]]></eval>
<!-- Attach the child entity for tracking the advance -->
<child entity="Advance">
<tag group="Advance" tag="MustChoose"/>
</child>
</thing>
component for spells
Code:
<component
id="Spell"
name="Spell"
autocompset="no"
panellink="magic">
<field
id="spComplexL"
name="Complexity Level"
type="static">
</field>
<field
id="spTime"
name="Casting Time"
type="static"
maxlength="60">
</field>
<field
id="spRange"
name="Range"
type="static"
maxlength="60">
</field>
<field
id="spDuration"
name="Duration"
type="static"
maxlength="60">
</field>
<field
id="spEML"
name="Spell EML"
type="derived">
</field>
<linkage linkage="Skill1"/>
<identity group="Spell"/>
<eval index="1" phase="Final" priority="10000">
<after name="Calc sklMLFinal"/><![CDATA[
if (islinkage[Skill1] <> 0) then
field[spEML].value = linkage[Skill1].field[sklML].value - (field[spComplexL].value * 5)
endif
]]></eval>
<!-- Each spell costs 1 or 2 Spell Option Points -->
<eval index="2" phase="Traits" priority="10000">
<before name="Calc resLeft"/>
<after name="Bound trtUser"/><![CDATA[
~if this Spell is not added directly to the hero (i.e. an advance), skip it entirely
doneif (origin.ishero = 0)
~adjust the resource appropriately
if (tagis[Helper.StartSpell] <> 0) then
if (islinkage[Skill1] <> 0) then
if (linkage[Skill1].tagis[Skill.skNeutral] <> 0) then
hero.child[resSpell].field[resSpent].value += field[spComplexL].value * 2
else
hero.child[resSpell].field[resSpent].value += field[spComplexL].value * 1
endif
endif
endif
]]></eval>
<evalrule index="1" phase="Validate" priority="10000" message="?" issilent="yes"><![CDATA[
var expr as string
foreach pick in hero where "User.Convocatio"
if (empty(expr) <> 0) then
expr = eachpick.tagids[Skill.?,""]
else
expr &= " | " & eachpick.tagids[Skill.?,""]
endif
nexteach
validif (tagcountstr[expr] > 0)
~mark the tab as invalid
linkvalid = 0
]]></evalrule>
<prereq message="Convocation not avaiable!" issilent="yes">
<validate><![CDATA[
var expr as string
foreach pick in hero where "User.Convocatio"
if (empty(expr) <> 0) then
expr = eachpick.tagids[Skill.?,""]
else
expr &= " | " & eachpick.tagids[Skill.?,""]
endif
nexteach
if (@ispick = 0) then
@valid = altthing.tagcountstr[expr]
else
@valid = altpick.tagcountstr[expr]
endif
]]></validate>
</prereq>
</component>