View Single Post
javadragon
Member
 
Join Date: Aug 2010
Posts: 50

Old May 30th, 2014, 03:37 AM
Thank you for the replies.

What I wound up doing in mine was to create new Skills called "Fighting (Smarts)" and "Fighting (Strength)" which were linked to the appropriate Attributes. I then kept this new skill and the original Fighting Skill in sync with each other.

However, set the linkage was a lot shorter and easier. I will have to test that code out to see how it works when the edge is bought after skills have already been bought using the original linked Attribute. Fore example, let's I had a d10 in Smarts and a d6 in Agility, but I bought up to a d8 in Fighting before taking the edge (meaning I spent 2 skills points to go from the d6 to the d8). If after taking the edge that changed the linked Attribute, would that mean I would get a skill point back? If I already spent that point before taking the edge, I do not think that skill point should be refunded back to me. I will have to test your code to see how it works.

I know that the other code is already above, but here is the code for me to keep the two Skills linked:
Quote:
<eval phase="PreTraits" priority="5000"><![CDATA[~ if this is added during user creation
if (hero.tagis[mode.creation] = 1) then
~This will offset the cost of adding the new skill
perform #resspent[resSkill,-,1,"Smart Fighter"]
endif

var smFightDie as number
var skillFight as number

~ get the current die for Fighting, -2 for initial d4
skillFight = 0
foreach pick in hero where "thingid.skFighting"
skillFight = eachpick.field[trtUser].value - 2
nexteach

foreach pick in hero where "thingid.skSmaFight"
~ get the current die for Fighting (Smarts), -2 for initial d4
smFightDie = eachpick.field[trtBonus].value + eachpick.field[trtUser].value - 2

~ add the current Fighting die to Fighting (Smarts)
eachpick.field[trtBonus].value += skillFight
nexteach

~ add the Fighting (Smarts) skill die to Fighting
foreach pick in hero where "thingid.skFighting"
eachpick.field[trtBonus].value += smFightDie
nexteach]]></eval>

<bootstrap thing="skSmaFight"></bootstrap>
javadragon is offline   #7 Reply With Quote