My goal is to add the list of DC for the various skills for usually do not like to search through pages for the DC of a particular action and have no mind to remember them.
Now after having asked you for the skill another dialog appear to ask you for which balance skill (the example is for Balance, but will add more actions for other skills) are you using.
For now it print the DC for the chosen action, but I'm still working on some other stuff.
I'd like to keep the data outside the macro, but how could it be done?
Note that this is to be used with the PC imported from PCgen since it ask for a number in the StatBonus.
Here is the first draft:
Code: Select all
[H: action1Balance = "desc=7-12 inches wide;dc=10;critfail=0;critsuc=0"]
[H: action2Balance = "desc=2-6 inches wide;dc=15;critfail=0;critsuc=0"]
[H: action3Balance = "desc=Less than 2 inches wide;dc=20;critfail=0;critsuc=0"]
[H: action4Balance = "desc=Uneven flagstone;dc=10;critfail=0;critsuc=0"]
[H: action5Balance = "desc=Hewn stone floor;dc=10;critfail=0;critsuc=0"]
[H: action6Balance = "desc=Sloped or angled floor;dc=10;critfail=0;critsuc=0"]
[H: skillAction1= ";"]
[H: skillAction1 = setStrProp(skillAction1, "1", encode(action1Balance))]
[H: skillAction1 = setStrProp(skillAction1, "2", encode(action2Balance))]
[H: skillAction1 = setStrProp(skillAction1, "3", encode(action3Balance))]
[H: skillAction1 = setStrProp(skillAction1, "4", encode(action4Balance))]
[H: skillAction1 = setStrProp(skillAction1, "5", encode(action5Balance))]
[H: skillAction1 = setStrProp(skillAction1, "6", encode(action6Balance))]
[H: skillActions = ";"]
[H: skillActions = setStrProp(skillAction1, "Balance", encode(skillAction1))]
[H: numSkills = countStrProp(Skills)]
[H: skillList = ""]
[H, C(numskills, ""): skillList = skillList + indexKeyStrProp(Skills, roll.count) + ", "]
[H: secret = getStrProp(Private, "SecretSkill")]
[H: secret = if(secret == "", 0, secret)]
[H: success = input(
"tempSkill | " + skillList + " | Select a skill | LIST | VALUE=STRING SELECT=" + listFind(skillList, getStrProp(Private, "LastSkill")),
"tempBonus | 0 | Temporary bonus",
"secret|Public, Secret|Secret?|RADIO|ORIENT=H SELECT=" + secret
)]
[H: abort(success)]
[H: tSkill = getStrProp(Skills, tempSkill)]
[H: tStatB = getStrProp(SkillStat, tempSkill)]
[H: tACP = ArmorCheckPenalty * getStrProp(SkillArmor, tempSkill)]
[H: tActions = getStrProp(skillActions,tempSkill)]
[H: tActions = decode(tActions)]
[H: numActions = countStrProp(tActions)]
[H: actionList = ""]
[COUNT(numActions, ""), CODE: {
[H: anAction = decode(indexValueStrProp(tActions, roll.count))]
[H: actionList = actionList + getStrProp(anAction,"desc") + ", "]
}]
[H: success1 = input(
"tempAction | " + actionList + " | Select an action for " + tempSkill + " | LIST | VALUE=NUMBER"
)]
[H: abort(success1)]
[H: theAction = decode(indexValueStrProp(tActions, tempAction))]
[H: actionDesc = getStrProp(theAction,"desc")]
[H: actionDC = getStrProp(theAction,"dc")]
[H: Private = setStrProp(Private, "LastSkill", tempSkill)]
[H: Private = setStrProp(Private, "SecretSkill", secret)]
[H: dieroll = 1d20]
[H: sCheck = dieroll + tSkill + tStatB + tACP + SkillMisc + tempBonus]
[IF(secret == 1 && isGM()), CODE:
{
[H: success = input(
"junk|" + sCheck + "|" + tempSkill + "Check|LABEL",
"junk2|DieRoll=" + dieroll + " Skill=" + tSkill + " StatBonus=" + tStatB +" ACP=" + tACP +" SkillMisc=" + SkillMisc +" temp=" + tempBonus +"|Details|LABEL"
)]
[H: abort(0)]
};
{
<b> [R: tempSkill] Check: </b> [T(sCheck): dieroll + tSkill + tStatB + tACP + SkillMisc + tempBonus]<br/>[R:actionDesc] (DC[R:actionDC])
}
]