fix skills when low int, remove survey link

This commit is contained in:
Chris B
2016-12-19 06:05:28 -06:00
parent d869455e4d
commit fc2f0fa06f
2 changed files with 1233 additions and 2462 deletions
File diff suppressed because it is too large Load Diff
+94 -86
View File
@@ -4,7 +4,7 @@
<span class="sheet-offscreen" data-i18n="Instru-a-3">Screenreader users should check expand all to ensure all content is visible to the reader. It is the second checkbox on this page.</span>
<span class="sheet-offscreen" data-i18n="Instru-a-2">Screenreader users please turn on reading of Title attributes. A lot of information is still in the titles.</span>
<span class="sheet-offscreen" data-i18n="Instru-a-1">Checkboxes with a label cause the section with same name (h2 or h3 header) to be revealed or hidden.</span>
<input type="checkbox" name="attr_attention72-show" value="1" class="sheet-showarrow sheet-ack-button" data-i18n-title="show-announcements" aria-label="Check to reveal Announcements section" data-i18n-aria-label="show-announcements" tabindex="0" />
<input type="checkbox" name="attr_attention73-show" value="1" class="sheet-showarrow sheet-ack-button" data-i18n-title="show-announcements" aria-label="Check to reveal Announcements section" data-i18n-aria-label="show-announcements" tabindex="0" />
<label class="sheet-showsect" data-i18n-title="show-announcements" data-i18n="announcements">Announcements</label>
<input style="float:right;" type="checkbox" name="attr_expandall" aria-label="Expand All" data-i18n-aria-label="expand-all" aria-describedby="Acts like a button. Expands all areas and then resets." value="1" tabindex="0" />
<label style="float:right;margin-right:.5em;margin-left:1em;" data-i18n="expand-all">Expand All</label>
@@ -12,10 +12,11 @@
<div role="contentinfo" aria-label="Announces changes to sheet" data-i18n-aria-label="announcements" class="sheet-announcements sheet-selectable">
<div class="sheet-footer" style="text-align:left; padding:5px; margin:5px;">
<ul>
<li><span data-i18n="announce-44"></span></li>
<li><span data-i18n="announce-41"><strong>LASTPASS USERS NOTE:</strong> LastPass is still interfering with some Roll20 sheets. If you are experiencing degraded performance try disabling LastPass.</span></li>
<li><span data-i18n="announce-42">Fixes for .72: Buff check updates skills without hitting refresh. Fixes to attack and damage not appearing in rolls. Recalc will finish. Requires Training no longer removes skill submenus from skill menu.</span></li>
<li><span data-i18n="announce-43">Thank you for your survey feedback. New changes are coming to simply the sheet making it much easier to use.</span></li>
</ul>
<label class="sheet-boldlabel-check" style="margin-top:1em;display:block;"><input type="checkbox" name="attr_attention73-show" value="1">&nbsp;<b><span data-i18n="do-not-show-again">Do not show again</span></b></label>
<h2 style="font-weight:bold;"><span data-i18n="upcoming-changes">Upcoming Changes</span>:</h2>
<ol>
<li data-i18n="announce-37"><strong>INVENTORY PAGE CHANGING:</strong> see Beta link in footer. Armor set on inventory page. One list for equipment instead of 2.</li>
@@ -30,6 +31,7 @@
<h2 class="sheet-showsect"><label data-i18n-title="show-announcements" data-i18n="announcements-old">Old Announcements</label></h2>
<div class="sheet-sect sheet-announcements">
<ol>
<li><span data-i18n="announce-42">Fixes for .72: Buff check updates skills without hitting refresh. Fixes to attack and damage not appearing in rolls. Recalc will finish. Requires Training no longer removes skill submenus from skill menu.</span></li>
<li data-i18n="announce-39">39</li>
<li data-i18n="announce-34">More expand and collapsible areas added to Attack Grid, Class Grid, Spellcaster class fields to hide complexity not needed by simpler characters.</li>
<li data-i18n="announce-35">Attack macrobook has base Melee, Ranged, and CMB buttons at top. Spellbook has Concentration and Casterlevel check buttons at top.</li>
@@ -10895,16 +10897,13 @@
<div role="contentinfo" aria-label="Help links and footer information" data-i18n-aria-label="footer-aria" class="sheet-footer" style="margin-top:2em;">
<div class="sheet-table">
<div class="sheet-table-row">
<span class="sheet-table-cell"><span data-i18n="footer-info">Created by Samuel Marino w/contributions by Vince, Chris Buchholz, Magik, James W. | Last updated:</span> <i>12.12.2016&nbsp;&nbsp;</i>v.<input type="text" style="width:2.5em; height:1.4em; vertical-align:top; padding:0px 2px 0 2px; border:none;" name="attr_PFSheet_Version" value="0" class="sheet-calc" readonly title="A non-blank version indicates attributes have been successfully recalculated."></span>
<span class="sheet-table-cell"><span data-i18n="footer-info">Created by Samuel Marino w/contributions by Vince, Chris Buchholz, Magik, James W. | Last updated:</span> <i>12.19.2016&nbsp;&nbsp;</i>v.<input type="text" style="width:2.5em; height:1.4em; vertical-align:top; padding:0px 2px 0 2px; border:none;" name="attr_PFSheet_Version" value="0" class="sheet-calc" readonly title="A non-blank version indicates attributes have been successfully recalculated."></span>
</div>
<div class="sheet-table-row" style="font-size:.8em;">
<label style="font-weight:inherit;"><b data-i18n="questions-feedback">Questions/Feedback?:</b><span class="sheet-selectable" style="padding-left:1em;">http://tinyurl.com/PF-Thread</span></label>
<label style="font-weight:inherit;margin-left:2em;"><b data-i18n="sheet-guide">Wiki 'how to use' Sheet Guide:</b><span class="sheet-selectable" style="padding-left:1em;">http://tinyurl.com/Sheet-Guide</span></label>
<label style="font-weight:inherit;margin-left:2em;"><b data-i18n="help-translate">Help translate:</b><span class="sheet-selectable" style="padding-left:1em;">http://tinyurl.com/trans-pf-sheet</span></label>
</div>
<div class="sheet-table-row" style="font-size:.8em;">
<label style="font-weight:inherit;margin-left:2em;"><b >Take our Survey:</b><span class="sheet-selectable" style="padding-left:1em;">https://www.surveymonkey.com/r/BL797KV</span></label>
</div>
</div>
</div>
<div role="contentinfo" area-label="rolltemplates" class="sheet-section-roll_templates" style="visiblity:hidden;opacity:0;height:1em;overflow:hidden;">
@@ -11612,7 +11611,6 @@
</rolltemplate>
</div>
</div>
<script type="text/worker">
/* //UNCOMMENT FOR JS LINT
console.log('%c•!!!!!!!!!!!!!!!!!!IF YOU SEE THIS YOU FORGOT TO UNCOMMENT THE TEST CODE FOR JS LINT!!!!!!!•', 'background: linear-gradient(to right,red,white,white,red); color:black;text-shadow: 0 0 8px white;');
@@ -12203,6 +12201,7 @@ TAS.config({
});
//TAS.debugMode();
var CBHidden = (function (){
'use strict';
console.log(' ');
console.log(' ');
console.log(' %cOOOOOO','background-color:blue;color:white;font-weight:bold;');
@@ -20020,7 +20019,7 @@ var PFSkills = PFSkills || (function () {
* adds the numbers from 0-9 or 1-10 or knowledge, then appends the string , to generate all 10 versions.
* @param {string} skilllist The name of the skill in, member of skillsWithSubSkills
* @param {string} appendToEnd The string to append.
* @returns {?} ?
* @returns {Array[string]} array of skill names
*/
appendToSubSkills = function (skilllist, appendToEnd) {
return _.reduce(skilllist, function (memo, skill) {
@@ -20029,6 +20028,17 @@ var PFSkills = PFSkills || (function () {
return memo.concat(appendArray);
}, []);
},
/** migrate - calls the 3 migrate functions above
* @param {function} callback ?
* @param {boolean} silently ?
* @param {number} oldversion ?
*/
migrate = function (callback, silently, oldversion) {
var done = _.once(function () {
if (typeof callback === "function") {
callback();
}
}),
/** migrateOldClassSkillValue - converts class skill checkboxes from old autocalc string to number "" or 3.
* @param {function} callback ?
* @param {boolean} silently ?
@@ -20172,18 +20182,7 @@ var PFSkills = PFSkills || (function () {
}, done);
}
});
},
/** migrate - calls the 3 migrate functions above
* @param {function} callback ?
* @param {boolean} silently ?
* @param {number} oldversion ?
*/
migrate = function (callback, silently, oldversion) {
var done = _.once(function () {
if (typeof callback === "function") {
callback();
}
});
};
if (oldversion < 0.18) {
if (oldversion > 0) {
migrateOldClassSkillValue();
@@ -20196,12 +20195,13 @@ var PFSkills = PFSkills || (function () {
if (oldversion > 0.60 && oldversion < 0.69) {
setAdvancedMacroCheckbox();
}
if (oldversion < 0.68 ){
if (oldversion > 0 && oldversion < 0.68 ){
migrateOldClassSkillValue();
migrateSkillMacrosToV65();
}
done();
},
/* updateMaxSkills Calculates and sets maximum skill ranks. Minimum 1 per level.
* divides by 2 if using consolidated skills
* @param {event} eventInfo - from event
@@ -20212,8 +20212,13 @@ var PFSkills = PFSkills || (function () {
if (typeof callback === "function") {
callback();
}
});
getAttrs(["total-skill", "total-fcskill", "INT-mod", "level", "Max-Skill-Ranks-mod", "Max-Skill-Ranks", "Max-Skill-Ranks-Misc2", "unchained_skills-show", "BG-Skill-Use"], function (v) {
}),
fields=["total-skill", "total-fcskill", "INT-mod", "level", "Max-Skill-Ranks-mod", "Max-Skill-Ranks",
"Max-Skill-Ranks-Misc2", "unchained_skills-show", "BG-Skill-Use",
"class-0-skill","class-1-skill","class-2-skill","class-3-skill","class-4-skill","class-5-skill",
"class-0-level","class-1-level","class-2-level","class-3-level","class-4-level","class-5-level",
"npc-skill","npc-hd-num"];
getAttrs(fields, function (v) {
var intMod = parseInt(v["INT-mod"], 10) || 0,
classSkills = parseInt(v["total-skill"], 10) || 0,
otherMod = parseInt(v["Max-Skill-Ranks-Misc2"], 10) || 0,
@@ -20222,36 +20227,58 @@ var PFSkills = PFSkills || (function () {
extra = parseInt(v["Max-Skill-Ranks-mod"], 10) || 0,
currSkills = parseInt(v["Max-Skill-Ranks"], 10) || 0,
totIntMod=0,
classPlusInt=0,
totAllSkills=0,
minSkills=0,
i=0,
thislvl=0,
classPlusInt = 0,
thisSkill=0,
totAllSkills = 0,
setter = {};
try {
totIntMod = intMod * level;
classPlusInt = classSkills + totIntMod;
if (v["unchained_skills-show"] == "1" && (!v["BG-Skill-Use"] || v["BG-Skill-Use"] == "0")) {
classPlusInt = Math.floor(classPlusInt / 2);
}
if (classPlusInt < level) {
classPlusInt = level;
}
totAllSkills = classPlusInt + fcSkills + extra + otherMod;
if (currSkills !== totAllSkills) {
setter["Max-Skill-Ranks"] = totAllSkills;
}
} catch (err) {
TAS.error("PFSkills.updateMaxSkills", err);
} finally {
if (_.size(setter) > 0) {
setAttrs(setter, {
silent: true
}, done);
} else {
done();
for(i=0;i<6;i++){
thislvl=parseInt(v['class-'+i+'-level'],10)||0;
if (thislvl>0){
thisSkill=( (parseInt(v['class-'+i+'-skill'],10)||0) * thislvl ) + (intMod * thislvl);
if (thisSkill < thislvl){
thisSkill=thislvl;
}
classPlusInt += thisSkill;
}
});
},
/** verifyHasSkill - Checks to see if skill is in list of valid skills for this character (consolidated, background, core).
}
thislvl = parseInt(v['npc-hd-num'],10)||0;
thisSkill = parseInt(v['npc-skill'],10)||0;
if (thislvl && thisSkill){
thisSkill = thislvl * thisSkill + intMod * thislvl;
if (thisSkill < thislvl){
thisSkill=thislvl;
}
classPlusInt += thisSkill;
}
if (v["unchained_skills-show"] == "1" && (!v["BG-Skill-Use"] || v["BG-Skill-Use"] == "0")) {
classPlusInt = Math.floor(classPlusInt / 2);
}
totAllSkills = classPlusInt + extra + otherMod;
if (totAllSkills < level){
totAllSkills = level;
}
totAllSkills += fcSkills;
if (currSkills !== totAllSkills) {
setter["Max-Skill-Ranks"] = totAllSkills;
}
} catch (err) {
TAS.error("PFSkills.updateMaxSkills", err);
} finally {
if (_.size(setter) > 0) {
setAttrs(setter, {
silent: true
}, done);
} else {
done();
}
}
});
},
/** verifyHasSkill - Checks to see if skill is in list of valid skills for this character (consolidated, background, core).
* @param {string} skill = the skill name
* @param {function} callback = a function that takes a a boolean as a first parameter.
* called with true if skill is part of valid list, or false if not.
@@ -20328,9 +20355,6 @@ var PFSkills = PFSkills || (function () {
miscNm = skill + "-misc-mod",
utNm = skill + "-ut",
rtNm = skill + "-ReqTrain";
if ((/craft/i).test(skill)){
TAS.debug("PFSkills.updateSkill: "+skill);
}
getAttrs([skill, csNm, ranksNm, classNm, abNm, modNm, racialNm, featNm, itemNm, miscNm, rtNm, utNm, "enforce_requires_training", "size_skill", "size_skill_double", "acp", "checks-cond", "Phys-skills-cond", "Perception-cond"], function (v) {
var skillSize = 0,
adj,
@@ -20436,7 +20460,7 @@ var PFSkills = PFSkills || (function () {
}, fields);
} catch (err) {
TAS.error("PFSkills.recalculateSkillDropdowns could not create field list", err);
if (typeof errorcallback == "function") {
if (typeof errorcallback === "function") {
errorcallback();
}
return;
@@ -20497,7 +20521,7 @@ var PFSkills = PFSkills || (function () {
updateSkill(skill, done, silently);
},
doneDrop = function () {
TAS.debug("bPFSkills.recalculateSkillArray ack from dropdowns");
TAS.debug("PFSkills.recalculateSkillArray ack from dropdowns");
//second do misc one by one (since it is asynchronous)
_.each(skills, function (skill) {
SWUtils.evaluateAndSetNumber(skill + "-misc", skill + "-misc-mod", 0, function () {
@@ -20654,7 +20678,7 @@ var PFSkills = PFSkills || (function () {
return skills;
}
return _.filter(skills, function (skill) {
if (/^Knowled|^Linguis|^Sleight/i.test(skill.slice(0, 7)) || v[skill + "-ReqTrain"] != "1" || (parseInt(v[skill + "-ranks"], 10) || 0) > 0) {
if (/^Knowled|^Linguis|^Sleight/i.test(skill.slice(0, 7)) || (parseInt(v[skill + "-ReqTrain"],10)||0) !== 1 || (parseInt(v[skill + "-ranks"], 10) || 0) > 0) {
return true;
}
return false;
@@ -20709,29 +20733,29 @@ var PFSkills = PFSkills || (function () {
temparray=temparray.concat(canshowarray);
canshowarray=canshowarray.concat(skillsWithSubSkills).sort();
tempRTMacro = baseGenMacro + getSkillButtonMacro("background-skills", canshowarray, showBonus);
if (bgv["background_skills-macro"] != tempRTMacro) {
if (bgv["background_skills-macro"] !== tempRTMacro) {
setter["background_skills-macro"] = tempRTMacro;
}
canshowarray = assembleSkillButtonArray(regularAdventureSkills, rt, v) || [];
temparray = temparray.concat(canshowarray);
canshowarray = canshowarray.concat(["Knowledge","Misc-Skill"]).sort();
tempRTMacro = baseGenMacro + getSkillButtonMacro("adventure-skills", canshowarray, showBonus);
if (bgv["adventure_skills-macro"] != tempRTMacro) {
if (bgv["adventure_skills-macro"] !== tempRTMacro) {
setter["adventure_skills-macro"] = tempRTMacro;
}
temparray = temparray.concat(skillsWithSubSkills).sort();
tempRTMacro = baseGenMacro + getSkillButtonMacro("skills", temparray, showBonus);
setter[skillPrefix + "skills-macro"] = baseGenMacro + tempRTMacro;
if (bgv["skills-macro"] != tempRTMacro) {
if (bgv["skills-macro"] !== tempRTMacro) {
setter[skillPrefix + "skills-macro"] = tempRTMacro;
}
} else {
canshowarray = assembleSkillButtonArray(regularCoreSkills, rt, v) || [];
temparray=temparray.concat(canshowarray).concat(coreSkillsWithSubSkills);//temparray = canshowarray.concat(coreSkillsWithSubSkills);
temparray=temparray.concat(canshowarray).concat(coreSkillsWithSubSkills);
temparray=temparray.sort();
tempMacro = baseGenMacro + getSkillButtonMacro("skills", temparray, showBonus);
if (bgv[skillPrefix + "skills-macro"] != tempMacro) {
if (bgv[skillPrefix + "skills-macro"] !== tempMacro) {
setter[skillPrefix + "skills-macro"] = tempMacro;
}
}
@@ -20744,7 +20768,7 @@ var PFSkills = PFSkills || (function () {
}
});
} else {
coreArray = regularCoreSkills.concat(coreSkillsWithSubSkills).sort();
coreArray = regularCoreSkills.concat(coreSkillsWithSubSkills);
//no require training
if (background) {
coreArray = coreArray.concat(["Artistry", "Lore"]).sort();
@@ -20757,7 +20781,7 @@ var PFSkills = PFSkills || (function () {
attrs["adventure_skills-macro"] = baseGenMacro + tempMacro;
}
tempMacro = baseGenMacro + getSkillButtonMacro(allskillstitle, coreArray, showBonus);
if (bgv[skillPrefix + "skills-macro"] != tempMacro) {
if (bgv[skillPrefix + "skills-macro"] !== tempMacro) {
attrs[skillPrefix + "skills-macro"] = tempMacro;
setAttrs(attrs, {
silent: true
@@ -20789,14 +20813,12 @@ var PFSkills = PFSkills || (function () {
});
},
applyConditions = function (callback,silently,eventInfo){
TAS.notice("at apply conditions");
TAS.debug("at apply conditions");
_.each(allTheSkills, function (skill) {
verifyHasSkill(skill, function (hasSkill) {
if (hasSkill) {
updateSkill(skill, eventInfo);
} else {
TAS.debug("does not use skill: "+skill);
}
}
});
});
},
@@ -20805,7 +20827,7 @@ var PFSkills = PFSkills || (function () {
var done = _.once(function () {
TAS.debug("Leaving PFSkills.recalculate");
resetCommandMacro();
if (typeof callback == "function") {
if (typeof callback === "function") {
callback();
}
});
@@ -20830,25 +20852,12 @@ var PFSkills = PFSkills || (function () {
updateMaxSkills(eventInfo);
}
}));
on("change:checks-cond", TAS.callback(function eventChecksCond(eventInfo) {
on(events.skillGlobalEventAuto, TAS.callback(function eventChecksCond(eventInfo) {
TAS.debug("caught " + eventInfo.sourceAttribute + " event for " + eventInfo.sourceType);
if (eventInfo.sourceType !== "player") {
applyConditions(null,null,eventInfo);
}
}));
on("change:phys-skills-cond", TAS.callback(function eventPhysSkills(eventInfo) {
TAS.debug("caught " + eventInfo.sourceAttribute + " event for " + eventInfo.sourceType);
if (eventInfo.sourceType !== "player") {
applyConditions(null,null,eventInfo);
}
}));
on("change:acp", TAS.callback(function eventACP(eventInfo) {
TAS.debug("caught " + eventInfo.sourceAttribute + " event for " + eventInfo.sourceType);
if (eventInfo.sourceType !== "player") {
applyConditions(null,null,eventInfo);
}
}));
on("change:checks-cond change:phys-skills-cond change:acp",function(){applyConditions();});
//each skill has a dropdown handler and a skill update handler
//concat them all up, only happens once so no big deal
_.each(allTheSkills, function (skill) {
@@ -20892,7 +20901,7 @@ var PFSkills = PFSkills || (function () {
if (skill.slice(0, 9) !== "Knowledge" && skill !== "Linguistics" && skill !== "Sleight-of-Hand") {
on("change:" + skill + "-ReqTrain change:" + skill + "-ranks", TAS.callback(function eventSkillRequiresTrainingRanks(eventInfo) {
TAS.debug("caught " + eventInfo.sourceAttribute + " event for " + skill + ", " + eventInfo.sourceType);
if (eventInfo.sourceType == "player") {
if (eventInfo.sourceType === "player") {
verifyHasSkill(skill, function (hasSkill) {
getAttrs(["enforce_requires_training"], function (v) {
if (v.enforce_requires_training == "1") {
@@ -20954,7 +20963,7 @@ var PFSkills = PFSkills || (function () {
on("change:unchained_skills-show change:BG-Skill-Use change:include_skill_totals", TAS.callback(function eventResetUnchainedSkills(eventInfo) {
TAS.debug("caught " + eventInfo.sourceAttribute + " event: " + eventInfo.sourceType);
if (eventInfo.sourceType === "player") {
recalculate(eventInfo, resetCommandMacro(eventInfo));
recalculate(eventInfo, function(){resetCommandMacro(eventInfo);});
}
}));
};
@@ -20971,7 +20980,6 @@ var PFSkills = PFSkills || (function () {
skillsWithSpaces: skillsWithSpaces,
consolidatedSkills: consolidatedSkills,
coreSkillAbilityDefaults: coreSkillAbilityDefaults,
setAdvancedMacroCheckbox: setAdvancedMacroCheckbox,
allFillInSkillInstances: allFillInSkillInstances,
sizeSkills: sizeSkills,
skillsWithSubSkills: skillsWithSubSkills,
@@ -20984,7 +20992,7 @@ var PFSkills = PFSkills || (function () {
verifyHasSkill: verifyHasSkill
};
}());
var PFFeatures = PFFeatures || (function () {
var PFFeatures = PFFeatures || (function () {
'use strict';
var
/*createFeatEntries
@@ -25556,7 +25564,7 @@ var PFSheet = PFSheet || (function () {
}
if (oldversion < 0.70){
PFAbilityScores.updateAbilityScores();
PFSkills.setAdvancedMacroCheckbox();
}
if (oldversion < 0.71){
PFSkills.migrate68to71();