YOF Editor Test
Base Test Idea
3 Proficiencies:
- Weapon Proficiency, Bladed = wpb
- Weapon Proficiency, Ranged = wpr
- Special Proficiency, Melee = spm
2 Stats:
- Strength = str
- Dexterity = str
1 Radio button that indicates Ranged/vs bladed
Form spits out AV for ranged and melee at the end.
Code Logic
In this simple example, AV = appropriate proficiency, + special proficiency if applicable. The code needs to compare the proficiency to the stat and discard any points over the capping stat, then check to see if the special proficiency applies, and do the same with that. It needs to do this without changing the stats.
The logic should look something like this:
If wpb is greater than str, then wpb = str
- Else
- If wpb is less than or equal to str, wpb = wpb
If spm is greater than dex, then spm = dex
- Else
- If spm is less than or equal to dex, spm = spm
Melee AV = wpb + spm
If wpr is greater than dex, then wpr = dex
- Else
- If wpr is less than or equal to dex, wpr = wpr
Ranged AV = wpr
But the code needs to not modify the initial values the user puts in, just check them when calculating AV.