This would be for Gaslight and the spell system. Problem, each Arcane background and Race may be able to cast the same spell but have different prereqs to cast, in this case one being Forbidden Knowledge Edge, the other the Race.
Races: Human, Vampire, Werewolf (for now)
Arcane Background: Mage, Mesmerist, Mystic (for now)
Spell: Armor, below is the whole code:
So what I expect to happen is to check if:
1) The character has the Arcane Background (Mage)
2) Check if the character has Forbidden Knowledge Edge
If both ARE true then player can select the Armor spell.
It could also be something like:
1) The character Race is Vampire
2) Check if the character has Forbidden Knowledge Edge
So somewhere in here I assume I need to make this work. And I have tried various permutations of this but never quite nailing it.
Another code attempt:
And:
I have never had to essentially write an if/then for a prereq or validation so struggling. Basically the last portion of finishing a complete datafile for Gaslight. I hope I explained this well enough
Cheers
Races: Human, Vampire, Werewolf (for now)
Arcane Background: Mage, Mesmerist, Mystic (for now)
Spell: Armor, below is the whole code:
Code:
<thing
id="powGArmor"
name="Armor"
description="{i}Armor{/i} creates a field of magical protection around a character or an actual shell of some sort, effectively giving the target Armor. Success grants the recipient 2 points of Armor. A raise grants 4 points of Armor.\n\nWhether the {i}armor{/i} is visible or not depends largely on the trapping."
compset="Power"
summary="Confers 2 or 4 points of Armor"
uniqueness="unique">
<fieldval field="powPoints" value="2"/>
<fieldval field="powRange" value="Touch"/>
<fieldval field="powLength" value="3"/>
<fieldval field="powMaint" value="1/round"/>
<fieldval field="powTraps" value="A mystical glow, hardened skin, ethereal armor, a mass of insects or worms, densening"/>
<fieldval field="powPrtMain" value="1/r"/>
<usesource source="Gaslight"/>
<tag group="MinRank" tag="0"/>
<pickreq ispreclude="yes" thing="racGWildin"/>
<prereq message="Arcance Background (Mage) and Forbidden Knowledge Edge required.">
<validate><![CDATA[
if (hero.tagis[Edge.edgArcGMag] = 1) then
validif (hero.tagis[Edge.edgGForKno] = 1)
endif
if (@ispick <> 0) then
altpick.linkvalid = 0
endif]]></validate>
</prereq>
</thing>
So what I expect to happen is to check if:
1) The character has the Arcane Background (Mage)
2) Check if the character has Forbidden Knowledge Edge
If both ARE true then player can select the Armor spell.
It could also be something like:
1) The character Race is Vampire
2) Check if the character has Forbidden Knowledge Edge
So somewhere in here I assume I need to make this work. And I have tried various permutations of this but never quite nailing it.
Code:
<prereq message="Arcance Background (Mage) and Forbidden Knowledge Edge required.">
<validate><![CDATA[
if (hero.tagis[Edge.edgArcGMag] = 1) then
validif (hero.tagis[Edge.edgGForKno] = 1)
endif
if (@ispick <> 0) then
altpick.linkvalid = 0
endif]]></validate>
</prereq>
</thing>
Another code attempt:
Code:
<prereq message="Arcance Background (Mage) and Forbidden Knowledge Edge required.">
<validate><![CDATA[
if (hero.tagis[Edge.edgArcGMag] >= 1) then
@valid = 1
done
endif
if (hero.tagis[Edge.edgGForKno] >= 1) then
@valid = 1
done
endif
altthing.linkvalid = 1]]></validate>
</prereq>
</thing>
And:
Code:
<prereq message="">
<validate><![CDATA[
if (hero.tagis[Edge.edgArcGMag] <> 0) then
@valid = 1
endif
if (hero.tagis[Edge.edgGForKno] <> 0) then
@valid = 1
endif]]>
</validate>
</prereq>
I have never had to essentially write an if/then for a prereq or validation so struggling. Basically the last portion of finishing a complete datafile for Gaslight. I hope I explained this well enough

Cheers