diff --git a/Pathfinder-Neceros/pathfinder-neceros.css b/Pathfinder-Neceros/pathfinder-neceros.css
index 2f9a5f4d61..13826e3aa1 100644
--- a/Pathfinder-Neceros/pathfinder-neceros.css
+++ b/Pathfinder-Neceros/pathfinder-neceros.css
@@ -58,7 +58,6 @@ textarea {
resize:both;
}
-
.sheet-cheat {
width:100%;
display:block;
@@ -233,6 +232,10 @@ input[type="text"]{
display: table;
width: 100%;
}
+.charsheet .sheet-3colrow .sheet-col {
+ width:33% !important;
+ margin-right:-5px !important;
+}
/* make error row more visible (colorblind users could not see slightly darker border )
also need 1 more level in selector or base css will override border */
@@ -390,9 +393,20 @@ span.sheet-text-button {
background-color:#ce0f69;
color:#FFFFFF;
}
+.sheet-skills .sheet-table-row .sheet-table-cell:first-child {
+ font-size:1rem;
+ padding-left:0;
+}
+.sheet-skills button[type=roll] {
+ width:1.25rem;
+ height:1.6rem;
+ padding-left:1px;
+}
+
+button[type=roll].sheet-custom-button::before,
button[type=roll].sheet-command-button::before {
- content: "";
+ content: "" !important;
}
/************************************* BUFFS ******************************************/
.sheet-linked-fields {
@@ -492,11 +506,11 @@ input.sheet-tabinput {
margin-right:-14%;
}
.sheet-tab.sheet-tab99 {
- width:10%;
+ width:11%;
}
.sheet-tabinput.sheet-tab99 {
- width:10%;
- margin-right:-10%;
+ width:11%;
+ margin-right:-11%;
}
@@ -1566,6 +1580,35 @@ input[type="number"].sheet-entry-wide {
display:none;
}
+.sheet-textarea-gray:not(:checked) ~ .sheet-small-label2 textarea {
+ background-color: silver !important;
+ color: dimgrey !important;
+ pointer-events: none;
+}
+.sheet-textarea-gray:not(:checked) ~ .sheet-small-label2 {
+ pointer-events: none;
+}
+.sheet-insertmacrocell {
+ min-width:23.85%;
+ max-width:48.5%;
+ display:inline-block;
+}
+.sheet-insertmacrocell.sheet-col1{
+ width:24%;
+}
+.sheet-insertmacrocell.sheet-col2{
+ width:25%;
+}
+.sheet-insertmacrocell.sheet-col3{
+ width:25%;
+}
+.sheet-insertmacrocell.sheet-col4{
+ width:20%;
+}
+.sheet-insertmacrocell .sheet-small-label2{
+ width:95%;
+ display:inline;
+}
/* top of repeating section */
.sheet-minimize-show:checked ~ .sheet-repeating-fields .sheet-expand,
.sheet-minimize-show:checked ~ .sheet-repeating-fields .sheet-sect,
@@ -2321,4 +2364,4 @@ input[type="number"].sheet-entry-wide {
border-color:#4A57ED;
color:White;
background-color: #4A57ED;
-}
+}
\ No newline at end of file
diff --git a/Pathfinder-Neceros/pathfinder-neceros.html b/Pathfinder-Neceros/pathfinder-neceros.html
index 293af1bfca..e0aaf5c17c 100644
--- a/Pathfinder-Neceros/pathfinder-neceros.html
+++ b/Pathfinder-Neceros/pathfinder-neceros.html
@@ -10,15 +10,25 @@
Expand All
+
Spell Fail
@@ -2203,47 +2212,80 @@
Ranged Notes
CMB Notes
Attack Notes
- Header Image
+ Header Image
Simple Template
+ Include Attack Totals?
-
-
-
+
+
+
-
-
+
+
@@ -2548,14 +2590,22 @@
@@ -2787,7 +2890,7 @@
+
-
+
@@ -2828,7 +2931,7 @@
+
-
+
@@ -2861,7 +2964,7 @@
+
-
+
@@ -2894,7 +2997,7 @@
+
-
+
@@ -2927,7 +3030,7 @@
+
-
+
@@ -2960,7 +3063,7 @@
+
-
+
@@ -2993,7 +3096,7 @@
+
-
+
@@ -3026,7 +3129,7 @@
+
-
+
@@ -3059,7 +3162,7 @@
+
-
+
@@ -3092,7 +3195,7 @@
+
-
+
@@ -3125,7 +3228,7 @@
+
-
+
@@ -3158,7 +3261,7 @@
+
-
+
@@ -3191,7 +3294,7 @@
+
-
+
@@ -3231,7 +3334,7 @@
+
-
+
@@ -3264,7 +3367,7 @@
+
-
+
@@ -3297,7 +3400,7 @@
+
-
+
@@ -3330,7 +3433,7 @@
+
-
+
@@ -3363,7 +3466,7 @@
+
-
+
@@ -3396,7 +3499,7 @@
+
-
+
@@ -3429,7 +3532,7 @@
+
-
+
@@ -3462,7 +3565,7 @@
+
-
+
@@ -3495,7 +3598,7 @@
+
-
+
@@ -3528,7 +3631,7 @@
+
-
+
@@ -3561,7 +3664,7 @@
+
-
+
@@ -3594,7 +3697,7 @@
+
-
+
@@ -3627,7 +3730,7 @@
+
-
+
@@ -3660,7 +3763,7 @@
+
-
+
@@ -3693,7 +3796,7 @@
+
-
+
@@ -3726,7 +3829,7 @@
+
-
+
@@ -3759,7 +3862,7 @@
+
-
+
@@ -3792,7 +3895,7 @@
+
-
+
@@ -3832,7 +3935,7 @@
+
-
+
@@ -3865,7 +3968,7 @@
+
-
+
@@ -3898,7 +4001,7 @@
+
-
+
@@ -3931,7 +4034,7 @@
+
-
+
@@ -3964,7 +4067,7 @@
+
-
+
@@ -3997,7 +4100,7 @@
+
-
+
@@ -4030,7 +4133,7 @@
+
-
+
@@ -4063,7 +4166,7 @@
+
-
+
@@ -4096,7 +4199,7 @@
+
-
+
@@ -4129,7 +4232,7 @@
+
-
+
@@ -4162,7 +4265,7 @@
+
-
+
@@ -4202,7 +4305,7 @@
+
-
+
@@ -4235,7 +4338,7 @@
+
-
+
@@ -4268,7 +4371,7 @@
+
-
+
@@ -4301,7 +4404,7 @@
+
-
+
@@ -4334,7 +4437,7 @@
+
-
+
@@ -4367,7 +4470,7 @@
+
-
+
@@ -4400,7 +4503,7 @@
+
-
+
@@ -4433,7 +4536,7 @@
+
-
+
@@ -4466,7 +4569,7 @@
+
-
+
@@ -4499,7 +4602,7 @@
+
-
+
@@ -4532,7 +4635,7 @@
+
-
+
@@ -4572,7 +4675,7 @@
+
-
+
@@ -4605,7 +4708,7 @@
+
-
+
@@ -4638,7 +4741,7 @@
+
-
+
@@ -4671,7 +4774,7 @@
+
-
+
@@ -4704,7 +4807,7 @@
+
-
+
@@ -4737,7 +4840,7 @@
+
-
+
@@ -4770,7 +4873,7 @@
+
-
+
@@ -4803,7 +4906,7 @@
+
-
+
@@ -4836,7 +4939,7 @@
+
-
+
@@ -4869,7 +4972,7 @@
+
-
+
@@ -4908,7 +5011,7 @@
+
-
+
@@ -4941,7 +5044,7 @@
+
-
+
@@ -4974,7 +5077,7 @@
+
-
+
@@ -5007,7 +5110,7 @@
+
-
+
@@ -5040,7 +5143,7 @@
+
-
+
@@ -5073,7 +5176,7 @@
+
-
+
@@ -5106,7 +5209,7 @@
+
-
+
@@ -5139,7 +5242,7 @@
+
-
+
@@ -5172,7 +5275,7 @@
+
-
+
@@ -5205,7 +5308,7 @@
+
-
+
@@ -5238,7 +5341,7 @@
+
-
+
@@ -5271,7 +5374,7 @@
+
-
+
@@ -5304,7 +5407,7 @@
+
-
+
@@ -5337,7 +5440,7 @@
+
-
+
@@ -5370,7 +5473,7 @@
+
-
+
@@ -5403,7 +5506,7 @@
+
-
+
@@ -5436,7 +5539,7 @@
+
-
+
@@ -5469,7 +5572,7 @@
+
-
+
@@ -5510,7 +5613,7 @@
+
-
+
@@ -5544,7 +5647,7 @@
+
-
+
@@ -5578,7 +5681,7 @@
+
-
+
@@ -5612,7 +5715,7 @@
+
-
+
@@ -5646,7 +5749,7 @@
+
-
+
@@ -5680,7 +5783,7 @@
+
-
+
@@ -5714,7 +5817,7 @@
+
-
+
@@ -5748,7 +5851,7 @@
+
-
+
@@ -5782,7 +5885,7 @@
+
-
+
@@ -5816,7 +5919,7 @@
+
-
+
@@ -5850,7 +5953,7 @@
+
-
+
@@ -5883,7 +5986,7 @@
+
-
+
@@ -5916,7 +6019,7 @@
+
-
+
@@ -5949,7 +6052,7 @@
+
-
+
@@ -5982,7 +6085,7 @@
+
-
+
@@ -6015,7 +6118,7 @@
+
-
+
@@ -6048,7 +6151,7 @@
+
-
+
@@ -6081,7 +6184,7 @@
+
-
+
@@ -6114,7 +6217,7 @@
+
-
+
@@ -6147,7 +6250,7 @@
+
-
+
@@ -6180,7 +6283,7 @@
+
-
+
@@ -6213,7 +6316,7 @@
+
-
+
@@ -6246,14 +6349,36 @@
+
-
+
CS = Class Skill
RT = Requires Training
Cl/Ac/Sz/Co = Class Skill Bonus / Armor check penalty / Size mod / Condition penalty
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -6668,12 +6793,13 @@
-
+
+
- Caster-Level
+ Caster-Level
=
@@ -6697,8 +6823,9 @@
-
-
+
+
+
@@ -7008,12 +7135,13 @@
-
+
+
- Caster-Level
+ Caster-Level
=
@@ -7037,8 +7165,9 @@
-
-
+
+
+
@@ -7348,12 +7477,13 @@
-
+
+
- Caster-Level
+ Caster-Level
=
@@ -7377,8 +7507,9 @@
-
-
+
+
+
@@ -7711,21 +7842,21 @@
Spellbook
-
+
Spellbook
-
+
Spellbook
-
+
@@ -7891,7 +8022,7 @@
IS NPC :
-
+
CR
@@ -8166,9 +8297,9 @@
All Attacks
-
+
NPC Attacks
-
+
@@ -8274,12 +8405,12 @@
Notes
-
-
-
-
-
-
+
+
+
+
+
+
@@ -8439,14 +8570,22 @@
-
- Attack Insert Macro:
-
-
-
- Damage Insert Macro:
-
-
+
+
+
+ Attack Insert Macro:
+
+
+
+
+
+
+
+ Damage Insert Macro:
+
+
+
+
Full Macro:
@@ -8565,21 +8704,21 @@
NPC Spellbook
-
+
NPC Spellbook
-
+
NPC Spellbook
-
+
@@ -8984,308 +9123,402 @@
+
+
+
+
-
-
-
@@ -9679,12 +9923,14 @@
@@ -10645,7 +10891,7 @@
{{/accessible}}
@@ -11210,7 +11456,7 @@
- {{#description}}
{{/description}}
+ {{#description}}
{{/description}}
{{/accessible}}
@@ -11233,7 +11479,7 @@
{{#allprops() color accessible rounded header_image character_name character_id name_link subtitle dr_notes resistances_notes immunities_notes weaknesses_notes sr0_notes armor_notes save_notes cmd_notes defense_notes description}}
**{{key}}**:{{value}}
{{/allprops() color accessible rounded header_image character_name character_id name_link subtitle dr_notes resistances_notes immunities_notes weaknesses_notes sr0_notes armor_notes save_notes cmd_notes defense_notes description}}
- {{#description}}Description {{description}} {{/description}}
+ {{#description}}Description {{description}} {{/description}}
{{/accessible}}
@@ -11271,11 +11517,13 @@
{{#righttext_5}}{{/righttext_5}}
+
+
- {{#allprops() color accessible rounded header_image character_name character_id name_link subtitle init_notes description righttext_1 lefttext_1 righttext_2 lefttext_2 righttext_3 lefttext_3 righttext_4 lefttext_4 righttext_5 lefttext_5 righttext_6 lefttext_6 righttext_7 lefttext_7 righttext_8 lefttext_8 righttext_9 lefttext_9 righttext_10 lefttext_10 }}
+ {{#allprops() color accessible rounded header_image character_name name character_id name_link subtitle init_notes description untrained righttext_1 lefttext_1 righttext_2 lefttext_2 righttext_3 lefttext_3 righttext_4 lefttext_4 righttext_5 lefttext_5 righttext_6 lefttext_6 righttext_7 lefttext_7 righttext_8 lefttext_8 righttext_9 lefttext_9 righttext_10 lefttext_10 }}
- {{/allprops() color accessible rounded header_image character_name character_id name_link subtitle init_notes description righttext_1 lefttext_1 righttext_2 lefttext_2 righttext_3 lefttext_3 righttext_4 lefttext_4 righttext_5 lefttext_5 righttext_6 lefttext_6 righttext_7 lefttext_7 righttext_8 lefttext_8 righttext_9 lefttext_9 righttext_10 lefttext_10 }}
+ {{/allprops() color accessible rounded header_image character_name name character_id name_link subtitle init_notes description untrained righttext_1 lefttext_1 righttext_2 lefttext_2 righttext_3 lefttext_3 righttext_4 lefttext_4 righttext_5 lefttext_5 righttext_6 lefttext_6 righttext_7 lefttext_7 righttext_8 lefttext_8 righttext_9 lefttext_9 righttext_10 lefttext_10 }}
@@ -11292,7 +11540,8 @@
{{#lefttext_10}}{{/lefttext_10}}
{{#righttext_10}}{{/righttext_10}}
- {{#description}}{{/description}}
+ {{#untrained}}{{/untrained}}
+ {{#description}}{{/description}}
{{/accessible}}
@@ -11313,9 +11562,9 @@
{{#righttext_4}}{{righttext_4}} {{/righttext_4}}
{{#lefttext_5}}{{lefttext_5}} {{/lefttext_5}}
{{#righttext_5}}{{righttext_5}} {{/righttext_5}}
- {{#allprops() color accessible rounded header_image character_name character_id name_link subtitle init_notes description righttext_1 lefttext_1 righttext_2 lefttext_2 righttext_3 lefttext_3 righttext_4 lefttext_4 righttext_5 lefttext_5 righttext_6 lefttext_6 righttext_7 lefttext_7 righttext_8 lefttext_8 righttext_9 lefttext_9 righttext_10 lefttext_10 }}
+ {{#allprops() color accessible rounded header_image character_name name character_id name_link subtitle init_notes description untrained righttext_1 lefttext_1 righttext_2 lefttext_2 righttext_3 lefttext_3 righttext_4 lefttext_4 righttext_5 lefttext_5 righttext_6 lefttext_6 righttext_7 lefttext_7 righttext_8 lefttext_8 righttext_9 lefttext_9 righttext_10 lefttext_10 }}
**{{key}}** {{value}}
- {{/allprops() color accessible rounded header_image character_name character_id name_link subtitle init_notes description righttext_1 lefttext_1 righttext_2 lefttext_2 righttext_3 lefttext_3 righttext_4 lefttext_4 righttext_5 lefttext_5 righttext_6 lefttext_6 righttext_7 lefttext_7 righttext_8 lefttext_8 righttext_9 lefttext_9 righttext_10 lefttext_10 }}
+ {{/allprops() color accessible rounded header_image character_name name character_id name_link subtitle init_notes description untrained righttext_1 lefttext_1 righttext_2 lefttext_2 righttext_3 lefttext_3 righttext_4 lefttext_4 righttext_5 lefttext_5 righttext_6 lefttext_6 righttext_7 lefttext_7 righttext_8 lefttext_8 righttext_9 lefttext_9 righttext_10 lefttext_10 }}
{{#lefttext_6}}{{lefttext_6}} {{/lefttext_6}}
{{#righttext_6}}{{righttext_6}} {{/righttext_6}}
{{#lefttext_7}}{{lefttext_7}} {{/lefttext_7}}
@@ -11327,7 +11576,8 @@
{{#lefttext_10}}{{lefttext_10}} {{/lefttext_10}}
{{#righttext_10}}{{righttext_10}} {{/righttext_10}}
- {{#description}}Description {{description}} {{/description}}
+ {{#untrained}}** ** {{/untrained}}
+ {{#description}}Description {{description}} {{/description}}
{{/accessible}}
@@ -11353,13 +11603,13 @@
- {{#allprops() color accessible rounded header_image character_name character_id name_link subtitle description long}}
+ {{#allprops() color accessible rounded name header_image character_name character_id name_link subtitle description long}}
- {{/allprops() color accessible rounded header_image character_name character_id name_link subtitle description long}}
+ {{/allprops() color accessible rounded name header_image character_name character_id name_link subtitle description long}}
- {{#description}}
{{/description}}
+ {{#description}}
{{/description}}
{{#long}}
{{/long}}
@@ -11372,10 +11622,10 @@
{{#name}}{{name}}{{/name}}
{{#subtitle}}{{subtitle}} {{/subtitle}}
- {{#allprops() color accessible rounded header_image character_name character_id name_link subtitle description }}
- **{{key}}**{{value}}
- {{/allprops() color accessible rounded header_image character_name character_id name_link subtitle description }}
- {{#description}}Description {{description}} {{/description}}
+ {{#allprops() color accessible rounded name header_image character_name character_id name_link subtitle description }}
+ {{value}}
+ {{/allprops() color accessible rounded name header_image character_name character_id name_link subtitle description }}
+ {{#description}}Description {{description}} {{/description}}
{{/accessible}}
@@ -12053,7 +12303,8 @@ var TAS = TAS || (function () {
}());
/* ---- END: TheAaronSheet.js ---- */
-TAS.config({ logging: { info: false} });
+//TAS.config({ logging: { info: false} });
+TAS.config({ logging: { info: false,debug:false} });
//TAS.debugMode();
var ExExp = ExExp || (function () {
@@ -12608,7 +12859,7 @@ var ExExp = ExExp || (function () {
} // error
if (x.type === "number") {
// number node; coerce to string
- x.value = "" + x.value;
+ x.value = String(x.value);
x.type = "string";
}
if (x.type !== "string") {
@@ -12785,7 +13036,7 @@ var ExExp = ExExp || (function () {
} // error
if (x.type === "number") {
// number node; coerce to string
- x.value = "" + x.value;
+ x.value = String(x.value);
x.type = "string";
}
if (x.type !== "string") {
@@ -13250,45 +13501,36 @@ var SWUtils = SWUtils || (function () {
*
*/
evaluateAndSetNumber = function (readField, writeField, defaultVal, callback) {
- //TAS.debug("at evaluateAndSetNumber read:" + readField + ", write:" + writeField);
+ var hasCallback=(typeof callback ==="function");
getAttrs([readField, writeField], function (values) {
var setter = {},
trueDefault = defaultVal || 0,
currVal = parseInt(values[writeField], 10),
- hasCallback=(typeof callback ==="function"),
value = Number(values[readField]);
if (typeof values[readField] === "undefined"){
value=0;
- setter[writeField] = value;
- if (hasCallback){
- setAttrs(setter,{},callback(value));
+ if (currVal!==0){
+ setter[writeField] = value;
+ setAttrs(setter,{},function(){if (hasCallback){callback(value,true);}});
} else {
- setAttrs(setter);
+ if (hasCallback){callback(value,false);}
}
} else if (!isNaN(value)) {
- //TAS.debug("it was a number");
if (currVal !== value) {
- //TAS.debug({ "function": "evaluateAndSetNumber", "currVal": currVal, "newVal": value });
setter[writeField] = value;
- if (hasCallback){
- setAttrs(setter,{},callback(value));
- } else {
- setAttrs(setter);
- }
- }
+ setAttrs(setter,{},function(){if (hasCallback){callback(value,true);}});
+ } else {
+ if (hasCallback){callback(value,false);}
+ }
} else {
- //TAS.debug("ok evaluate " + values[readField]);
evaluateExpression(values[readField], function (value2) {
- //look for ( and ) at beginning and end
value2 = isNaN(value2) ? trueDefault : value2;
if (isNaN(currVal) || currVal !== value2) {
setter[writeField] = value2;
- if (hasCallback){
- setAttrs(setter,{},callback(value2));
- } else {
- setAttrs(setter);
- }
- }
+ setAttrs(setter,{},function(){if (hasCallback){callback(value2,true);}});
+ } else {
+ if (hasCallback){callback(value,false);}
+ }
});
}
});
@@ -13524,14 +13766,36 @@ var SWUtils = SWUtils || (function () {
array1.push(stringOrArray);
}
return array1;
+ },
+
+
+ cartesianAppend=function() {
+ return _.reduce(arguments, function(a, b) {
+ return _.flatten(_.map(a, function(x) {
+ return _.map(b, function(y) {
+ return x+y;
+ });
+ }), true);
+ }, [ [] ]);
+ },
+ cartesianProduct=function() {
+ return _.reduce(arguments, function(a, b) {
+ return _.flatten(_.map(a, function(x) {
+ return _.map(b, function(y) {
+ return x.concat([y]);
+ });
+ }), true);
+ }, [ [] ]);
}
+
+
;
return {
- util: {
- validNumericStr: validNumericStr
- }
+ validNumericStr: validNumericStr
+ , cartesianAppend: cartesianAppend
+ , cartesianProduct: cartesianProduct
, searchAndReplaceFields: searchAndReplaceFields
, evaluateExpression: evaluateExpression
, evaluateAndSetString: evaluateAndSetString
@@ -13555,7 +13819,7 @@ var SWUtils = SWUtils || (function () {
var PFSheet = PFSheet || (function () {
'use strict';
- var version = 0.64,
+ var version = 0.65,
/* isOptionTemplateReversed - for dropdowns in templates where value is before equals */
isOptionTemplateReversed = function(spellOptionKey){
@@ -13612,10 +13876,21 @@ var PFSheet = PFSheet || (function () {
, "CMB-ability": "CMB-ability-mod"
, "CMB2-ability": "CMB2-ability-mod"
},
+
+ equationMacros= {
+ "init-misc": "init-misc-mod"
+ , "HP-formula-macro-text": "HP-formula-mod"
+ , "Max-Skill-Ranks-Misc": "Max-Skill-Ranks-mod"
+ , "SR-macro-text": "SR"
+ , "npc-hd-misc": "npc-hd-misc-mod"
+ , "spellclass-0-SP_misc": "spellclass-0-SP-mod"
+ , "spellclass-1-SP_misc": "spellclass-1-SP-mod"
+ , "spellclass-2-SP_misc": "spellclass-2-SP-mod"
+ },
+
repeatingDropdowns = [
{"sect":"weapon","dd":"attack-type","ddmod":"attack-type-mod"}
, {"sect":"weapon","dd":"damage-ability","ddmod":"damage-ability-mod"}
- //, {"sect":"class-ability","dd":"class-number","ddmod":"class-name"} //this is handled by
],
//Special defense tab dropdowns (since they are synced across each other)
@@ -13629,65 +13904,98 @@ var PFSheet = PFSheet || (function () {
},
attackGridFields = {
- "melee": { "size": "size", "atk": "attk-melee", "buff": "buff_Melee-total", "abilityMod": "melee-ability-mod", "misc": "attk-melee-misc", "crit":"attk_melee_crit_conf", "attackmacro":"@{global_melee_macro_insert}", "damagemacro":"@{global_melee_damage_macro_insert}" }
- , "melee2": { "size": "size", "atk": "attk-melee2", "buff": "buff_Melee-total", "abilityMod": "melee2-ability-mod", "misc": "attk-melee2-misc", "crit":"attk_melee2_crit_conf", "attackmacro":"@{global_melee_macro_insert}", "damagemacro":"@{global_melee_damage_macro_insert}" }
- , "ranged": { "size": "size", "atk": "attk-ranged", "buff": "buff_Ranged-total", "abilityMod": "ranged-ability-mod", "misc": "attk-ranged-misc", "crit":"attk_ranged_crit_conf", "attackmacro":"@{global_ranged_macro_insert}", "damagemacro":"@{global_ranged_damage_macro_insert}" }
- , "ranged2": { "size": "size", "atk": "attk-ranged2", "buff": "buff_Ranged-total", "abilityMod": "ranged2-ability-mod", "misc": "attk-ranged2-misc", "crit":"attk_ranged2_crit_conf", "attackmacro":"@{global_ranged_macro_insert}", "damagemacro":"@{global_ranged_damage_macro_insert}" }
- , "CMB": { "size": "CMD-size", "atk": "CMB", "buff": "buff_Melee-total", "abilityMod": "CMB-ability-mod", "misc": "attk-CMB-misc", "crit":"attk_cmb_crit_conf", "attackmacro":"@{global_cmb_macro_insert}", "damagemacro":"@{global_cmb_damage_macro_insert}" }
- , "CMB2": { "size": "CMD-size", "atk": "CMB2", "buff": "buff_Melee-total", "abilityMod": "CMB2-ability-mod", "misc": "attk-CMB2-misc", "crit":"attk_cmb2_crit_conf", "attackmacro":"@{global_cmb_macro_insert}", "damagemacro":"@{global_cmb_damage_macro_insert}" }
+ "melee": { "size": "size", "atk": "attk-melee", "buff": "buff_Melee-total", "abilityMod": "melee-ability-mod", "misc": "attk-melee-misc", "crit":"attk_melee_crit_conf", "attackmacro":"@{toggle_global_melee_macro_insert}", "damagemacro":"@{toggle_global_melee_damage_macro_insert}" }
+ , "melee2": { "size": "size", "atk": "attk-melee2", "buff": "buff_Melee-total", "abilityMod": "melee2-ability-mod", "misc": "attk-melee2-misc", "crit":"attk_melee2_crit_conf", "attackmacro":"@{toggle_global_melee_macro_insert}", "damagemacro":"@{toggle_global_melee_damage_macro_insert}" }
+ , "ranged": { "size": "size", "atk": "attk-ranged", "buff": "buff_Ranged-total", "abilityMod": "ranged-ability-mod", "misc": "attk-ranged-misc", "crit":"attk_ranged_crit_conf", "attackmacro":"@{toggle_global_ranged_macro_insert}", "damagemacro":"@{toggle_global_ranged_damage_macro_insert}" }
+ , "ranged2": { "size": "size", "atk": "attk-ranged2", "buff": "buff_Ranged-total", "abilityMod": "ranged2-ability-mod", "misc": "attk-ranged2-misc", "crit":"attk_ranged2_crit_conf", "attackmacro":"@{toggle_global_ranged_macro_insert}", "damagemacro":"@{toggle_global_ranged_damage_macro_insert}" }
+ , "CMB": { "size": "CMD-size", "atk": "CMB", "buff": "buff_Melee-total", "abilityMod": "CMB-ability-mod", "misc": "attk-CMB-misc", "crit":"attk_cmb_crit_conf", "attackmacro":"@{toggle_global_cmb_macro_insert}", "damagemacro":"@{toggle_global_cmb_damage_macro_insert}" }
+ , "CMB2": { "size": "CMD-size", "atk": "CMB2", "buff": "buff_Melee-total", "abilityMod": "CMB2-ability-mod", "misc": "attk-CMB2-misc", "crit":"attk_cmb2_crit_conf", "attackmacro":"@{toggle_global_cmb_macro_insert}", "damagemacro":"@{toggle_global_cmb_damage_macro_insert}" }
},
saveTypes = ["Fort", "Ref", "Will"],
-
- backgroundCoreSkills = [
- "Appraise", "Craft", "Craft2", "Craft3", "Craft4", "Craft5", "Craft6", "Craft7", "Craft8", "Craft9", "Craft10", "Handle-Animal"
- , "Knowledge-Engineering", "Knowledge-Geography", "Knowledge-History"
- , "Knowledge-Nobility", "Perform", "Perform2", "Perform3", "Perform4", "Perform5", "Perform6", "Perform7", "Perform8", "Perform9", "Perform10"
- , "Profession", "Profession2", "Profession3", "Profession4", "Profession5", "Profession6", "Profession7", "Profession8", "Profession9", "Profession10", "Sleight-of-Hand"
- , "Misc-Skill-5", "Misc-Skill-6", "Misc-Skill-7", "Misc-Skill-8", "Misc-Skill-9"
- ],
- //NEW skills for background in Unchained
- backgroundOnlySkills = ["Artistry", "Artistry2", "Artistry3", "Artistry4", "Artistry5", "Artistry6", "Artistry7", "Artistry8", "Artistry9", "Artistry10"
- , "Lore", "Lore2", "Lore3", "Lore4", "Lore5", "Lore6", "Lore7", "Lore8", "Lore9", "Lore10"],
- skillsWithFillInNames = ["Artistry","Craft","Lore","Misc-Skill","Perform","Profession"],
- adventureSkills = [
- "Acrobatics", "Bluff", "Climb", "Diplomacy", "Disable-Device"
- , "Disguise", "Escape-Artist", "Fly", "Heal", "Intimidate"
- , "Linguistics", "Knowledge-Arcana", "Knowledge-Dungeoneering"
- , "Knowledge-Local", "Knowledge-Nature", "Knowledge-Planes"
- , "Knowledge-Religion", "Perception", "Ride", "Sense-Motive"
- , "Spellcraft", "Stealth", "Survival", "Swim", "Use-Magic-Device"
- , "Misc-Skill-0", "Misc-Skill-1", "Misc-Skill-2", "Misc-Skill-3", "Misc-Skill-4"
- ],
- backgroundSkills = _.sortBy(backgroundCoreSkills.concat(backgroundOnlySkills), function(skill){return skill;}),
- allCoreSkills = _.sortBy(adventureSkills.concat(backgroundCoreSkills), function(skill){return skill;}),
- //consolidated skills for Unchained
- consolidatedSkills = [
- "CS-Acrobatics", "CS-Athletics", "CS-Finesse", "CS-Influence", "CS-Nature", "CS-Perception"
- , "CS-Performance", "CS-Religion", "CS-Society", "CS-Spellcraft", "CS-Stealth", "CS-Survival"
- ],
-
- //skills that depend on size, and 1 or 2:
- // 1 is the normal size modifier in size_skill, 2 is size_skill_double
- sizeSkills = { "Fly": 1, "Stealth": 2, "CS-Stealth": 2 },
- //the 3 spell classes at top of spells page
- spellClassIndexes = ["0", "1", "2"],
- //events for those 3 classes
- //first is event string, second is array of methods to call, each much take classidx as first/only param
- //spell levels for repeating spell sections
- spellLevels = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"],
- //events for repeating spells
- //first is event string, second is array of methods to call, each much take spell level as first/only param
+
wornEquipmentRows = ["Belt", "Body", "Chest", "Eyes", "Feet", "Hands", "Head", "Headband", "Neck", "Ring1", "Ring2", "Shoulders", "Wrist"],
wornEquipmentColumns = ["charges", "weight", "hp", "hp_max", "value"],
defenseArmorShieldRows = ["armor", "armor2", "armor3", "shield", "shield2", "shield3"],
defenseArmorShieldColumns = ["equipped", "acbonus", "max-dex", "acp", "spell-fail", "proficiency"],
+
+
+ /********************* SKILLS ****************************/
+ //these are for building the macros
+ regularCoreSkills = ["Appraise", "Acrobatics", "Bluff", "Climb", "Diplomacy", "Disable-Device"
+ , "Disguise", "Escape-Artist", "Fly", "Handle-Animal", "Heal", "Intimidate"
+ , "Linguistics", "Perception", "Ride", "Sense-Motive", "Sleight-of-Hand"
+ , "Spellcraft", "Stealth", "Survival", "Swim", "Use-Magic-Device"
+ ],
+ regularBackgroundSkills=[
+ "Appraise", "Handle-Animal", "Linguistics", "Sleight-of-Hand"
+ ],
+ regularAdventureSkills=[ "Acrobatics", "Bluff", "Climb", "Diplomacy", "Disable-Device"
+ , "Disguise", "Escape-Artist", "Fly", "Heal", "Intimidate"
+ , "Perception", "Ride", "Sense-Motive", "Sleight-of-Hand"
+ , "Spellcraft", "Stealth", "Survival", "Swim", "Use-Magic-Device"
+ ],
- //classes without their own spell lists - hunter handled special by parseCompendiumSpell
+
+ skillAppendNums=["","2","3","4","5","6","7","8","9","10"],
+ miscSkillAppendNums=["-0","-1","-2","-3","-4","-5","-6","-7","-8","-9"],
+ backgroundOnlySkillParents=["Artistry","Lore"],
+ backgroundOnlySkills = SWUtils.cartesianAppend(backgroundOnlySkillParents,skillAppendNums),
+ coreSkillsWithFillInNames=["Craft","Misc-Skill","Perform","Profession"],
+ skillsWithFillInNames = coreSkillsWithFillInNames.concat(backgroundOnlySkillParents).sort(),
+ coreSkillsWithSubSkills = coreSkillsWithFillInNames.concat(["Knowledge"]).sort(),
+ skillsWithSubSkills = skillsWithFillInNames.concat(["Knowledge"]).sort(),
+ knowledgeSubSkills = ["Arcana","Dungeoneering","Engineering","Geography","History","Local","Nature","Nobility","Planes","Religion"],
+ knowledgeSubSkillsTranslateKeys = _.map(knowledgeSubSkills,function(key){return key.toLowerCase();}),
+ knowledgeSkillAppends = _.map(knowledgeSubSkills,function(subskill){return "-"+subskill;}),
+ knowledgeSkills = _.map(knowledgeSubSkills,function(subskill){return "Knowledge-"+subskill;}),
+ //for each skill array of the possible skills {"Craft":["Craft","Craft2"...],"Perform":["Perform","Perform2"...] }
+ subskillArrays = _.reduce(skillsWithSubSkills,function(memo,skill){
+ var appenders= (skill==="Misc-Skill")?miscSkillAppendNums:(skill==="Knowledge")?knowledgeSkillAppends:skillAppendNums;
+ memo[skill]=SWUtils.cartesianAppend([skill],skillAppendNums);
+ return memo;
+ },{}),
+ allFillInSkillInstances = SWUtils.cartesianAppend(["Craft","Perform","Profession","Artistry","Lore"],
+ skillAppendNums).concat(SWUtils.cartesianAppend(["Misc-Skill"],miscSkillAppendNums) ).sort(),
+ backgroundCoreSkills = regularBackgroundSkills.concat( subskillArrays["Craft"])
+ .concat(subskillArrays["Perform"]).concat(subskillArrays["Profession"])
+ .concat(["Knowledge-Engineering", "Knowledge-Geography", "Knowledge-History", "Knowledge-Nobility"])
+ .concat(["Misc-Skill-5", "Misc-Skill-6", "Misc-Skill-7", "Misc-Skill-8", "Misc-Skill-9"]).sort(),
+
+ adventureSkills = regularAdventureSkills
+ .concat(["Knowledge-Arcana", "Knowledge-Dungeoneering", "Knowledge-Local", "Knowledge-Nature", "Knowledge-Planes"])
+ .concat(["Misc-Skill-0", "Misc-Skill-1", "Misc-Skill-2", "Misc-Skill-3", "Misc-Skill-4"]).sort(),
+ backgroundSkills =backgroundCoreSkills.concat(backgroundOnlySkills).sort(),
+ allCoreSkills = adventureSkills.concat(backgroundCoreSkills).sort(),
+ consolidatedSkills = ["CS-Acrobatics", "CS-Athletics", "CS-Finesse", "CS-Influence", "CS-Nature", "CS-Perception"
+ , "CS-Performance", "CS-Religion", "CS-Society", "CS-Spellcraft", "CS-Stealth", "CS-Survival"],
+
+ coreSkillAbilityDefaults = {"Acrobatics": "dex", "Appraise": "int", "Bluff": "cha",
+"Climb": "str", "Craft": "int", "Diplomacy": "cha", "Disable-Device": "dex",
+"Disguise": "cha", "Escape-Artist": "dex", "Fly": "dex", "Handle-Animal": "cha",
+"Heal": "wis", "Intimidate": "cha", "Knowledge-Arcana": "int", "Knowledge-Dungeoneering": "int",
+"Knowledge-Engineering": "int", "Knowledge-Geography": "int", "Knowledge-History": "int",
+"Knowledge-Local": "int", "Knowledge-Nature": "int", "Knowledge-Nobility": "int", "Knowledge": "int",
+"Knowledge-Planes": "int", "Knowledge-Religion": "int", "Linguistics": "int", "Perception": "wis",
+"Perform": "cha", "Profession": "wis", "Ride": "dex", "Sense-Motive": "wis", "Sleight-of-Hand": "dex",
+"Spellcraft": "int", "Stealth": "dex", "Survival": "wis", "Swim": "str", "Use-Magic-Device": "cha"},
+
+
+ // skills that depend on size 1 is the normal size modifier in size_skill, 2 is size_skill_double
+ sizeSkills = { "Fly": 1, "Stealth": 2, "CS-Stealth": 2 },
+ //the 3 spell classes at top of spells page
+ spellClassIndexes = ["0", "1", "2"],
+ //spell levels for repeating spell sections
+ spellLevels = ["0", "1", "2", "3", "4", "5", "6", "7", "8", "9"],
+
+
+ //classes without their own spell lists plus bloodrager, whose list is not in compendium - hunter handled special by parseCompendiumSpell
classesUsingOtherSpellLists = {
- "arcanist":"wizard"
- , "investigator":"alchemist"
- , "warpriest":"cleric"
+ "arcanist": "wizard"
+ , "investigator": "alchemist"
+ , "warpriest": "cleric"
+ , "skald": "bard"
+ , "bloodrager": "sorcerer"
},
@@ -13699,7 +14007,7 @@ var PFSheet = PFSheet || (function () {
, "Concentration-mod", "savedc", "SP-mod", "range_pick", "range"
, "spell_level", "spellclass", "casterlevel", "components", "spellclass_number"
],
- spellOptionHelperAttributes = ["spellclass_number","SP_misc","CL_misc","Concentration_misc"],
+ spellOptionHelperAttributes = ["spellclass_number","SP_misc","CL_misc","Concentration_misc","slot"],
//all fields that are printed to rolltemplate by spell options except "description"
spellOptionAttributesNoDescription = _.filter(spellOptionAttributes,function(field){
return (field !== "description");
@@ -13757,8 +14065,8 @@ var PFSheet = PFSheet || (function () {
spellOptionRegex = getOptionsCompiledRegexMap (spellOptions),
- spellOptionEventsPlayer = [ "school", "cast-time", "components", "duration", "save", "sr", "range", "targets"],
- spellOptionEventsAuto = ["casterlevel","Concentration-mod"],
+ //these only affect options
+ spellOptionEventsPlayer = [ "school", "cast-time", "components", "duration", "save", "sr", "range", "targets"],
spellOptionEventToToggleMap={
school:"toggle_spell_school_notes", "cast-time":"toggle_spell_casting_time_notes"
, components:"toggle_spell_components_notes", duration:"toggle_spell_duration_notes"
@@ -13769,9 +14077,6 @@ var PFSheet = PFSheet || (function () {
/****************** OPTIONS ATTACKS ************************/
-
-
-
attackOptions={
melee_notes:"{{melee_notes=REPLACE}}"
,ranged_notes:"{{ranged_notes=REPLACE}}"
@@ -13779,7 +14084,6 @@ var PFSheet = PFSheet || (function () {
,attack_notes:"{{attack_notes=REPLACE}}"
,header_image:"{{header_image=REPLACE}}"
},
-
attackOptionsDefaults={
notes:{
melee:"@{melee-attack-notes}"
@@ -13791,21 +14095,16 @@ var PFSheet = PFSheet || (function () {
, ranged:"@{header_image-pf_attack-ranged}"
, CMB:"@{header_image-pf_attack-cmb}"}
},
-
attackNonRepeatingOptionAttributes = ["melee-attack-notes","ranged-attack-notes","CMB-notes","attack-notes"
,"header_image-pf_attack-melee","header_image-pf_attack-ranged","header_image-pf_attack-cmb"],
- attackToggles=[
- "toggle_attack_melee_notes","toggle_attack_ranged_notes","toggle_attack_CMB_notes","toggle_attack_attack_notes","toggle_attack_header_image"
- ],
- attackOptionSetField="macro_options",
- attackOptionHelperAttributes=["attack-type"],
- attackOptionEventsPlayer = ["attack-type"],
-
+ attackToggles=["toggle_attack_melee_notes","toggle_attack_ranged_notes","toggle_attack_CMB_notes"
+ ,"toggle_attack_attack_notes","toggle_attack_header_image"],
+ attackOptionEventsPlayer = ["attack-type","damage-ability","damage-dice-num"],
attackOptionRegex = getOptionsCompiledRegexMap (attackOptions),
-
-
- /****************************UTILITIES ************************************/
+
+
+ /****************************UTILITIES ************************************/
/* findAbilityInString
* For dropdowns, this looks at the pass the value to here.
@@ -13881,24 +14180,14 @@ var PFSheet = PFSheet || (function () {
*/
getRepeatingIDStr = function (id) {
var idStr = "";
- if (id) { idStr = id + "_"; }
+ if (!(id===undefined || id===null)) { idStr = id + "_"; }
return idStr;
},
compiledBadIds = new RegExp("spell|weapon|class|ability|feat|attack|damage|trait|racial|mythic|psionic","i"),
isBadRowId = function (section, id, nullok) {
- //for some reason typeof does not catch them.
- if (!nullok && ( id === null || id === undefined )) {
- return true;
- }
- if (id === section) {
- return true;
- }
- if (compiledBadIds.test(id) ){
- return true;
- }
- return false;
+ return false;
},
@@ -13982,107 +14271,341 @@ var PFSheet = PFSheet || (function () {
}
},
-
-
-
updateAttackMacros = function () {
- var baseMacro = "/w \"@{character_name}\" &{template:pf_generic} @{toggle_attack_accessible} @{toggle_rounded_flag}{{color=@{rolltemplate_color}}} {{header_image=@{header_image-pf_attack-melee}}} {{character_name=@{character_name}}} {{character_id=@{character_id}}} {{subtitle}} {{name=Attacks}}"
- , npcBaseMacro = "/w \"@{character_name}\" &{template:pf_generic} @{toggle_attack_accessible} @{toggle_rounded_flag}{{color=@{rolltemplate_color}}} {{header_image=@{header_image-pf_attack-melee}}} {{character_name=@{character_name}}} {{character_id=@{character_id}}} {{subtitle}} {{name=NPC Attacks}}";
- getSectionIDs("repeating_weapon", function(idarray) {
- if (!idarray || idarray.length===0){
- var attrs = {};
- attrs["attacks-macro"] = baseMacro ;
- attrs["attacks-macro-npc"] = npcBaseMacro ;
- setAttrs(attrs);
- return;
- }
- getAttrs(["_reporder_repeating_weapon"], function(repValues) {
- var atkattrs =[];
- _.each(idarray,function(id) {
- atkattrs.push("repeating_weapon_"+id+"_attack-type");
- atkattrs.push("repeating_weapon_"+id+"_name");
- });
-
- getAttrs(atkattrs, function(values) {
- var repList ,orderedList,attackIDList ,melee = "",ranged = "",cmb = "",misc = "",attrs = {}
- ,NPCmelee = "",NPCranged = "",NPCcmb = "",NPCmisc = "";
- if (!_.isUndefined(repValues._reporder_repeating_weapon) && repValues._reporder_repeating_weapon != "") {
- repList=repValues._reporder_repeating_weapon.split(",");
- repList = _.map(repList,function(ID) { return ID.toLowerCase(); });
- }
- orderedList = _.union(repList,idarray);
- attackIDList = _.object(_.map(orderedList,function(id) {
- return [id,values["repeating_weapon_"+id+"_attack-type"]];
- }));
- orderedList = _.filter(orderedList,function(ID){
- if (typeof values["repeating_weapon_"+ID+"_name"] == "undefined"
- || typeof values["repeating_weapon_"+ID+"_attack-type"] == "undefined") {
- return false;
- }
- return true;
+ var baseMacro = "/w \"@{character_name}\" &{template:pf_generic} @{toggle_attack_accessible} @{toggle_rounded_flag}{{color=@{rolltemplate_color}}} {{header_image=@{header_image-pf_attack-melee}}} {{character_name=@{character_name}}} {{character_id=@{character_id}}} {{subtitle}} {{name=^{attacks}}}"
+ , npcBaseMacro = "/w \"@{character_name}\" &{template:pf_generic} @{toggle_attack_accessible} @{toggle_rounded_flag}{{color=@{rolltemplate_color}}} {{header_image=@{header_image-pf_attack-melee}}} {{character_name=@{character_name}}} {{character_id=@{character_id}}} {{subtitle}} {{name=^{npc} ^{attacks}}}";
+ getAttrs(["attacks-macro","attacks-macro-npc","include_attack_totals"],function(currMacros){
+ var showBonus=parseInt(currMacros["include_attack_totals"],10)||0;
+ getSectionIDs("repeating_weapon", function(idarray) {
+ if (!idarray || idarray.length===0){
+ var attrs = {};
+ if (currMacros["attacks-macro"]!==baseMacro){
+ attrs["attacks-macro"] = baseMacro;
+ }
+ if(currMacros["attacks-macro-npc"]!==npcBaseMacro){
+ attrs["attacks-macro-npc"] = npcBaseMacro;
+ }
+ if (_.size(attrs)){
+ setAttrs(attrs,{silent:true});
+ }
+ return;
+ }
+ getAttrs(["_reporder_repeating_weapon"], function(repValues) {
+ var atkattrs =[];
+ _.each(idarray,function(id) {
+ atkattrs.push("repeating_weapon_"+id+"_attack-type");
+ atkattrs.push("repeating_weapon_"+id+"_name");
});
- _.each(orderedList, function(ID) {
- var temproll="",NPCtemproll="",value="" ,
- attackName=values["repeating_weapon_"+ID+"_name"];
+
+ getAttrs(atkattrs, function(values) {
+ var repList ,orderedList,attackIDList ,melee = "",ranged = "",cmb = "",misc = "",attrs = {}
+ ,NPCmelee = "",NPCranged = "",NPCcmb = "",NPCmisc = "";
+ if (!_.isUndefined(repValues._reporder_repeating_weapon) && repValues._reporder_repeating_weapon != "") {
+ repList=repValues._reporder_repeating_weapon.split(",");
+ repList = _.map(repList,function(ID) { return ID.toLowerCase(); });
+ }
+ orderedList = _.union(repList,idarray);
+ attackIDList = _.object(_.map(orderedList,function(id) {
+ return [id,values["repeating_weapon_"+id+"_attack-type"]];
+ }));
+ orderedList = _.filter(orderedList,function(ID){
+ if (typeof values["repeating_weapon_"+ID+"_name"] == "undefined"
+ || typeof values["repeating_weapon_"+ID+"_attack-type"] == "undefined") {
+ return false;
+ }
+ return true;
+ });
+ _.each(orderedList, function(ID) {
+ var temproll="",NPCtemproll="",value="" ,
+ bonusStr=showBonus?(" + @{repeating_weapon_"+ID+"_total-attack}"):"",
+ attackName=values["repeating_weapon_"+ID+"_name"];
- if (attackName.search(/\[.*\]/) !== -1) {
- attackName = attackName.slice(attackName.indexOf('[')+1,attackName.indexOf(']'));
- }
-
- temproll=" ["+attackName+"](~@{character_id}|repeating_weapon_"+ID+"_attack-roll)";
- NPCtemproll =" ["+attackName+"](~@{character_id}|repeating_weapon_"+ID+"_attack-npc-roll)";
- if (attackIDList[ID]) {
- value = findAbilityInString( attackIDList[ID]);
- switch(value){
- case 'attk-melee':
- melee += temproll;
- NPCmelee += NPCtemproll;
- break;
- case 'attk-ranged':
- ranged += temproll;
- NPCranged += NPCtemproll;
- break;
- case 'CMB':
- cmb += temproll;
- NPCcmb += NPCtemproll;
- break;
- default:
- misc += temproll;
- NPCmisc += NPCtemproll;
- }
- }
- });
- if (melee) {melee = " {{**Melee**}} {{" + melee.trim() + "}}";}
- if (ranged){ranged = " {{**Ranged**}} {{" + ranged.trim() + "}}";}
- if (cmb){cmb = " {{**Combat Maneuvers**}} {{" + cmb.trim() + "}}";}
- if (misc){misc = " {{**Misc**}} {{" + misc.trim() + "}}";}
- if (NPCmelee) {NPCmelee = " {{**Melee**}} {{" + NPCmelee.trim() + "}}";}
- if (NPCranged){NPCranged = " {{**Ranged**}} {{" + NPCranged.trim() + "}}";}
- if (NPCcmb){NPCcmb = " {{**Combat Maneuvers**}} {{" + NPCcmb.trim() + "}}";}
- if (NPCmisc){NPCmisc = " {{**Misc**}} {{" + NPCmisc.trim() + "}}";}
+ if (attackName.search(/\[.*\]/) !== -1) {
+ attackName = attackName.slice(attackName.indexOf('[')+1,attackName.indexOf(']'));
+ }
+
+ temproll=" ["+attackName + bonusStr +"](~@{character_id}|repeating_weapon_"+ID+"_attack-roll)";
+ NPCtemproll =" ["+attackName + bonusStr +"](~@{character_id}|repeating_weapon_"+ID+"_attack-npc-roll)";
+ if (attackIDList[ID]) {
+ value = findAbilityInString( attackIDList[ID]);
+ switch(value){
+ case 'attk-melee':
+ melee += temproll;
+ NPCmelee += NPCtemproll;
+ break;
+ case 'attk-ranged':
+ ranged += temproll;
+ NPCranged += NPCtemproll;
+ break;
+ case 'CMB':
+ cmb += temproll;
+ NPCcmb += NPCtemproll;
+ break;
+ default:
+ misc += temproll;
+ NPCmisc += NPCtemproll;
+ }
+ }
+ });
+ if (melee) {melee = " {{**Melee**}} {{" + melee.trim() + "}}";}
+ if (ranged){ranged = " {{**Ranged**}} {{" + ranged.trim() + "}}";}
+ if (cmb){cmb = " {{**Combat Maneuvers**}} {{" + cmb.trim() + "}}";}
+ if (misc){misc = " {{**Misc**}} {{" + misc.trim() + "}}";}
+ if (NPCmelee) {NPCmelee = " {{**Melee**}} {{" + NPCmelee.trim() + "}}";}
+ if (NPCranged){NPCranged = " {{**Ranged**}} {{" + NPCranged.trim() + "}}";}
+ if (NPCcmb){NPCcmb = " {{**Combat Maneuvers**}} {{" + NPCcmb.trim() + "}}";}
+ if (NPCmisc){NPCmisc = " {{**Misc**}} {{" + NPCmisc.trim() + "}}";}
- attrs["attacks-macro"] = baseMacro + melee + ranged + cmb + misc;
- attrs["attacks-macro-npc"] = npcBaseMacro + NPCmelee + NPCranged + NPCcmb + NPCmisc;
- setAttrs(attrs);
- });
- });
- });
+ attrs["attacks-macro"] = baseMacro + melee + ranged + cmb + misc;
+ attrs["attacks-macro-npc"] = npcBaseMacro + NPCmelee + NPCranged + NPCcmb + NPCmisc;
+ setAttrs(attrs);
+ });
+ });
+ });
+ });
},
+
+ checkRTArray=["-ReqTrain","-ranks"],
+ baseGenMacro ="/w \"@{character_name}\" &{template:pf_generic} @{toggle_accessible_flag} @{toggle_rounded_flag}{{color=@{rolltemplate_color}}} {{header_image=@{header_image-pf_generic-skill}}} {{character_name=@{character_name}}} {{character_id=@{character_id}}} {{subtitle}} ",
+ skillHeaderMacro= "{{name=^{REPLACELOWER} ^{skills} }} ",
+ npcSkillHeaderMacro= "{{name=^{npc} ^{REPLACELOWER} ^{skills} }} ",
+ appendToSubSkills = function(skilllist, appendToEnd){
+ return _.reduce(skilllist,function(memo,skill){
+ var appendnums = (skill==="Misc-Skill")?miscSkillAppendNums:(skill==="Knowledge")?knowledgeSkillAppends:skillAppendNums;
+ return memo.concat(SWUtils.cartesianAppend([skill],appendnums,appendToEnd));
+ },[]);
+ },
+
+ /*updates the macros for only the 7 subskill rolltemplates
+ */
+ updateSubSkillMacros = function (background,rt,eventInfo,currMacros,isNPC,showBonus){
+ var headerString = isNPC?npcSkillHeaderMacro:skillHeaderMacro,
+ skillPrefix=isNPC?"NPC-":"",
+ assembleSubSkillButtonArray = function(skill,shouldEnforce,v){
+ var appendnums = (skill==="Misc-Skill")?miscSkillAppendNums:(skill==="Knowledge")?knowledgeSkillAppends:skillAppendNums,
+ subskills= SWUtils.cartesianAppend([skill],appendnums),
+ firstPass=[];
+ if (skill==="Knowledge") {
+ firstPass=subskills;
+ return firstPass;//knowledge rollable even if untrained
+ }
+ firstPass=_.filter(subskills, function(subskill){
+ if (skill==="Perform"){
+ TAS.debug("finding if filled in. "+subskill+"-name = "+v[subskill+"-name"] );
+ }
+ if (v[subskill+"-name"]) {return true;}
+ return false;
+ });
+ TAS.debug("first pass lookin gfor names is: ",firstPass);
+ if (!shouldEnforce){return firstPass;}
+ return _.filter(firstPass,function(skill){
+ if ((parseInt(v[skill+"-ReqTrain"],10)||0) ===0 || ( parseInt(v[skill+"-ranks"],10)||0 )>0){
+ return true;
+ }
+ return false;
+ });
+ },
+ getKnowledgeButtonMacro = function(showBonus){
+ var bonusStr=showBonus?"+ @{REPLACE}":"",
+ knowledgebutton = "[^{REPLACENAME}"+bonusStr+"](~@{character_id}|"+skillPrefix+"REPLACE-check) ";
+ return headerString.replace('REPLACELOWER','knowledge') + "{{ " +
+ _.reduce(knowledgeSubSkillsTranslateKeys,function(memo,subskill,idx){
+ memo += knowledgebutton.replace(/REPLACENAME/g,subskill).replace(/REPLACE/g,knowledgeSkills[idx]);
+ return memo;
+ },"") + " }}";
+ },
+ getSubSkillButtonMacro = function(skill,skillArray,showBonus){
+ var skillTransKey=skill.toLowerCase(),
+ bonusStr=showBonus?"+ @{REPLACE}":"",
+ baseMacro= headerString.replace('REPLACELOWER',skillTransKey),
+ singleRowButton = "[@{REPLACENAME}" + bonusStr + "](~@{character_id}|"+skillPrefix+"REPLACE-check) ",
+ tempstr="";
+ if (skill==="Knowledge"){ return getKnowledgeButtonMacro(); }
+ tempstr= _.reduce(skillArray,function(memo,subskill,idx){
+ memo += singleRowButton.replace(/REPLACENAME/g,subskill+"-name").replace(/REPLACE/g,subskill);
+ return memo;
+ },"");
+ if (! tempstr){
+ tempstr="description = ^{no-skills-available}";
+ }
+ return baseMacro + "{{ " + tempstr + " }}";
+ },
+ subskillParents = background?skillsWithFillInNames:coreSkillsWithFillInNames,
+ allsubskillFields = SWUtils.cartesianAppend(appendToSubSkills(subskillParents,["-name"]));
+ if (rt){
+ allsubskillFields = allsubskillFields.concat(appendToSubSkills(subskillParents,checkRTArray)).sort();
+ }
+ TAS.debug("updateSubSkillMacros: allsubskillFields are:",allsubskillFields);
+ getAttrs(allsubskillFields,function(v){
+ var setter={},tempKMac="";
+ TAS.debug("updateSubSkillMacros: event and data are:",eventInfo,v);
+ _.each(subskillParents,function (skill){
+ var canshowarray=assembleSubSkillButtonArray(skill,rt,v)
+ ,tempMacro=getSubSkillButtonMacro(skill,canshowarray,showBonus);
+ tempMacro = baseGenMacro + tempMacro;
+ if (currMacros[skillPrefix+skill.toLowerCase()+"_skills-macro"]!==tempMacro){
+ setter[skillPrefix+skill.toLowerCase()+"_skills-macro"]= tempMacro;
+ }
+ });
+ if (currMacros[skillPrefix+"knowledge_skills-macro"]){
+ tempKMac= baseGenMacro + getKnowledgeButtonMacro(showBonus);
+ if (currMacros[skillPrefix+"knowledge_skills-macro"]!==tempKMac){
+ setter[skillPrefix+"knowledge_skills-macro"] =tempKMac;
+ }
+ }
+ if (_.size(setter)>0){
+ setAttrs(setter,{silent:true});
+ }
+ });
+ },
+
+ updateSkillMacros = function (eventInfo) {
+ getAttrs(["BG-Skill-Use", "unchained_skills-show","enforce_requires_training","skills-macro","artistry_skills-macro","lore_skills-macro"
+ ,"craft_skills-macro","knowledge_skills-macro","perform_skills-macro","profession_skills-macro","misc-skill_skills-macro"
+ ,"is_npc","include_skill_totals","NPC-skills-macro","NPC-craft_skills-macro","NPC-knowledge_skills-macro","NPC-perform_skills-macro","NPC-profession_skills-macro","NPC-misc-skill_skills-macro"
+ ], function (bgv) {
+ var isNPC = parseInt(bgv["is_npc"],10)||0
+ , skillPrefix=isNPC?"NPC-":""
+ , showBonus=parseInt(bgv.include_skill_totals,10)||0
+ , assembleSkillButtonArray = function(skills,shouldEnforce,v){
+ if (!shouldEnforce){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){
+ return true;
+ }
+ return false;
+ });
+ }
+ , getSkillButtonMacro = function(name,skillArray,showBonus){
+ var skillTransKey=name.toLowerCase(),
+ bonusStr=showBonus?" + @{REPLACE}":"",
+ baseMacro="{{name= ^{"+skillTransKey+"} }} ",
+ rowbutton = "[^{REPLACELOWER}" + bonusStr + "](~@{character_id}|"+skillPrefix+"REPLACE-check) ",
+ subskillbutton = "[^{REPLACELOWER}](~@{character_id}|"+skillPrefix+"REPLACELOWERMAC_skills_buttons_macro) ",
+ tempstr= _.reduce(skillArray,function(memo,skill,idx){
+ var thistranskey=skill.toLowerCase(),
+ thisbutton = (_.contains(skillsWithSubSkills,skill))?subskillbutton:rowbutton;
+ thisbutton = thisbutton.replace (/REPLACELOWERMAC/g,thistranskey);
+ thisbutton = thisbutton.replace (/REPLACELOWER/g,thistranskey);
+ thisbutton=thisbutton.replace(/REPLACE/g,skill);
+ memo+=thisbutton+" ";
+ return memo;
+ },"");
+ if (! tempstr){
+ tempstr="^{no-skills-available}";
+ }
+ return baseMacro + "{{ " + tempstr + " }}";
+ }
+ , unchained = parseInt(bgv["unchained_skills-show"],10)||0
+ , background = unchained && (parseInt(bgv["BG-Skill-Use"],10)||0)
+ , consolidated = unchained && (!background)
+ , rt = parseInt(bgv["enforce_requires_training"],10)||0
+ , i=0
+ , attrs={}
+ , tempSkillArray=[],tempMacro="",allskillstitle="skills",coreArray
+ ;
+ if (isNPC){
+ consolidated=false;
+ background=false;
+ TAS.warn("NPC - set consolidated and background to false.");
+ }
+ if (!consolidated){
+ updateSubSkillMacros(background,rt,eventInfo,bgv,isNPC,showBonus);
+ //skills without sub skills
+ if (rt){
+ getAttrs(SWUtils.cartesianAppend(regularCoreSkills,checkRTArray),function(v){
+ var canshowarray=[],tempRTMacro="",setter={},temparray=[];
+ if (background){
+ canshowarray = assembleSkillButtonArray(regularBackgroundSkills,rt,v);
+ temparray=canshowarray;
+ canshowarray = canshowarray.concat(skillsWithSubSkills).sort();
+ tempRTMacro = baseGenMacro + getSkillButtonMacro("background-skills",canshowarray,showBonus);
+ if (bgv["background_skills-macro"]!=tempRTMacro){
+ setter["background_skills-macro"] = tempRTMacro;
+ }
+
+ canshowarray = assembleSkillButtonArray(regularAdventureSkills,rt,v);
+ temparray=temparray.concat(canshowarray);
+ canshowarray = canshowarray.concat(["Knowledge"]).sort();
+ tempRTMacro = baseGenMacro + getSkillButtonMacro("adventure-skills",canshowarray,showBonus);
+ if (bgv["adventure_skills-macro"]!=tempRTMacro){
+ setter["adventure_skills-macro"] = tempRTMacro;
+ }
+
+ temparray = temparray.concat(skillsWithSubSkills);
+ temparray=temparray.sort();
+ tempRTMacro = baseGenMacro + getSkillButtonMacro("skills",temparray,showBonus);
+ setter[skillPrefix+"skills-macro"] = baseGenMacro + tempRTMacro;
+ if (bgv["skills-macro"]!=tempRTMacro){
+ setter[skillPrefix+"skills-macro"] = tempRTMacro;
+ }
+
+ } else {
+ canshowarray=assembleSkillButtonArray(regularCoreSkills,rt,v);
+ temparray=canshowarray.concat(coreSkillsWithSubSkills).sort();
+ tempMacro = baseGenMacro + getSkillButtonMacro("skills",temparray,showBonus);
+ if (bgv[skillPrefix+"skills-macro"]!=tempMacro){
+ setter[skillPrefix+"skills-macro"] = tempMacro;
+ }
+ }
+ if(_.size(setter)>0){
+ setAttrs(setter,{silent:true});
+ }
+ });
+ } else {
+ coreArray=regularCoreSkills.concat(coreSkillsWithSubSkills);
+ //no require training
+ if (background){
+ coreArray.concat(["Artistry","Lore"]).sort();
+ allskillstitle="all-skills";
+ tempSkillArray = regularBackgroundSkills.concat(skillsWithSubSkills).sort();
+ tempMacro = getSkillButtonMacro("background-skills",tempSkillArray,showBonus);
+ attrs["background_skills-macro"] = baseGenMacro + tempMacro;
+ tempSkillArray = regularAdventureSkills.concat(["Knowledge"]).sort();
+ tempMacro = getSkillButtonMacro("adventure-skills",tempSkillArray,showBonus);
+ attrs["adventure_skills-macro"] = baseGenMacro + tempMacro;
+ }
+ tempMacro = baseGenMacro + getSkillButtonMacro(allskillstitle,coreArray,showBonus);
+ if (bgv[skillPrefix+"skills-macro"]!=tempMacro){
+ attrs[skillPrefix+"skills-macro"] = tempMacro;
+ setAttrs(attrs,{silent:true});
+ }
+ }
+ } else {
+ //consolidated
+ if (rt){
+ getAttrs(SWUtils.cartesianAppend(consolidatedSkills,["-ReqTrain","-ranks"]),function(v){
+ var canshowarray = assembleSkillButtonArray(consolidatedSkills,rt,v)
+ ,setter={}
+ ,tempMacro=getSkillButtonMacro("skills",canshowarray,showBonus);
+ setter["consolidated_skills-macro"] = baseGenMacro +tempMacro;
+ setAttrs(setter,{silent:true});
+ });
+ } else {
+ tempMacro=getSkillButtonMacro("skills",consolidatedSkills,showBonus);
+ attrs["consolidated_skills-macro"] = baseGenMacro +tempMacro;
+ setAttrs(attrs,{silent:true});
+ }
+ }
+ });
+ },
updateSpellbookMacros = function () {
//TAS.debug("at updateSpellbookMacros");
- var class0BaseMacro = "/w \"@{character_name}\" &{template:pf_generic} @{toggle_spell_accessible} @{toggle_rounded_flag}{{color=@{rolltemplate_color}}} {{header_image=@{header_image-pf_block}}} {{character_name=@{character_name}}} {{character_id=@{character_id}}} {{subtitle}} {{name=@{spellclass-0-name} Spells}}"
- , class1BaseMacro = "/w \"@{character_name}\" &{template:pf_generic} @{toggle_spell_accessible} @{toggle_rounded_flag}{{color=@{rolltemplate_color}}} {{header_image=@{header_image-pf_block}}} {{character_name=@{character_name}}} {{character_id=@{character_id}}} {{subtitle}} {{name=@{spellclass-1-name} Spells}}"
- , class2BaseMacro = "/w \"@{character_name}\" &{template:pf_generic} @{toggle_spell_accessible} @{toggle_rounded_flag}{{color=@{rolltemplate_color}}} {{header_image=@{header_image-pf_block}}} {{character_name=@{character_name}}} {{character_id=@{character_id}}} {{subtitle}} {{name=@{spellclass-2-name} Spells}}"
- , npcClass0BaseMacro = "/w \"@{character_name}\" &{template:pf_generic} @{toggle_spell_accessible} @{toggle_rounded_flag}{{color=@{rolltemplate_color}}} {{header_image=@{header_image-pf_block}}} {{character_name=@{character_name}}} {{character_id=@{character_id}}} {{subtitle}} {{name=NPC @{spellclass-0-name} Spells}}"
- , npcClass1BaseMacro = "/w \"@{character_name}\" &{template:pf_generic} @{toggle_spell_accessible} @{toggle_rounded_flag}{{color=@{rolltemplate_color}}} {{header_image=@{header_image-pf_block}}} {{character_name=@{character_name}}} {{character_id=@{character_id}}} {{subtitle}} {{name=NPC @{spellclass-1-name} Spells}}"
- , npcClass2BaseMacro = "/w \"@{character_name}\" &{template:pf_generic} @{toggle_spell_accessible} @{toggle_rounded_flag}{{color=@{rolltemplate_color}}} {{header_image=@{header_image-pf_block}}} {{character_name=@{character_name}}} {{character_id=@{character_id}}} {{subtitle}} {{name=NPC @{spellclass-2-name} Spells}}"
+ var class0BaseMacro = "/w \"@{character_name}\" &{template:pf_generic} @{toggle_spell_accessible} @{toggle_rounded_flag}{{color=@{rolltemplate_color}}} {{header_image=@{header_image-pf_block}}} {{character_name=@{character_name}}} {{character_id=@{character_id}}} {{subtitle}} {{name=@{spellclass-0-name} ^{spells}}}"
+ , class1BaseMacro = "/w \"@{character_name}\" &{template:pf_generic} @{toggle_spell_accessible} @{toggle_rounded_flag}{{color=@{rolltemplate_color}}} {{header_image=@{header_image-pf_block}}} {{character_name=@{character_name}}} {{character_id=@{character_id}}} {{subtitle}} {{name=@{spellclass-1-name} ^{spells}}}"
+ , class2BaseMacro = "/w \"@{character_name}\" &{template:pf_generic} @{toggle_spell_accessible} @{toggle_rounded_flag}{{color=@{rolltemplate_color}}} {{header_image=@{header_image-pf_block}}} {{character_name=@{character_name}}} {{character_id=@{character_id}}} {{subtitle}} {{name=@{spellclass-2-name} ^{spells}}}"
+ , npcClass0BaseMacro = "/w \"@{character_name}\" &{template:pf_generic} @{toggle_spell_accessible} @{toggle_rounded_flag}{{color=@{rolltemplate_color}}} {{header_image=@{header_image-pf_block}}} {{character_name=@{character_name}}} {{character_id=@{character_id}}} {{subtitle}} {{name=^{npc} @{spellclass-0-name} ^{spells}}}"
+ , npcClass1BaseMacro = "/w \"@{character_name}\" &{template:pf_generic} @{toggle_spell_accessible} @{toggle_rounded_flag}{{color=@{rolltemplate_color}}} {{header_image=@{header_image-pf_block}}} {{character_name=@{character_name}}} {{character_id=@{character_id}}} {{subtitle}} {{name=^{npc} @{spellclass-1-name} ^{spells}}}"
+ , npcClass2BaseMacro = "/w \"@{character_name}\" &{template:pf_generic} @{toggle_spell_accessible} @{toggle_rounded_flag}{{color=@{rolltemplate_color}}} {{header_image=@{header_image-pf_block}}} {{character_name=@{character_name}}} {{character_id=@{character_id}}} {{subtitle}} {{name=^{npc} @{spellclass-2-name} ^{spells}}}"
;
getAttrs(["spellclass-0-casting_type","spellclass-1-casting_type","spellclass-2-casting_type"
- ,"spellclass-0-hide_unprepared","spellclass-1-hide_unprepared","spellclass-2-hide_unprepared"],function(configV){
+ ,"spellclass-0-hide_unprepared","spellclass-1-hide_unprepared","spellclass-2-hide_unprepared"
+ ,"spellclass-0-book","spellclass-1-book","spellclass-2-book","spellclass-0-book-npc","spellclass-1-book-npc","spellclass-2-book-npc"],function(configV){
var isPrepared0=(parseInt(configV["spellclass-0-casting_type"],10)||0)===2?1:0
, isPrepared1=(parseInt(configV["spellclass-1-casting_type"],10)||0)===2?1:0
, isPrepared2=(parseInt(configV["spellclass-2-casting_type"],10)||0)===2?1:0
@@ -14095,13 +14618,21 @@ var PFSheet = PFSheet || (function () {
var attrs = {};
//TAS.debug(idarray);
if (!idarray || idarray.length === 0){
- attrs["spellclass-0-book"] = class0BaseMacro ;
- attrs["spellclass-1-book"] = class1BaseMacro ;
- attrs["spellclass-2-book"] = class2BaseMacro ;
- attrs["spellclass-0-book-npc"] = npcClass0BaseMacro ;
- attrs["spellclass-1-book-npc"] = npcClass1BaseMacro ;
- attrs["spellclass-2-book-npc"] = npcClass2BaseMacro ;
- setAttrs(attrs);
+ if(configV["spellclass-0-book"]!=class0BaseMacro){
+ attrs["spellclass-0-book"] = class0BaseMacro ;}
+ if(configV["spellclass-1-book"]!=class1BaseMacro){
+ attrs["spellclass-1-book"] = class1BaseMacro ;}
+ if(configV["spellclass-2-book"]!=class2BaseMacro){
+ attrs["spellclass-2-book"] = class2BaseMacro ;}
+ if(configV["spellclass-0-book-npc"]!=npcClass0BaseMacro){
+ attrs["spellclass-0-book-npc"] = npcClass0BaseMacro ;}
+ if(configV["spellclass-1-book-npc"]!=npcClass1BaseMacro){
+ attrs["spellclass-1-book-npc"] = npcClass1BaseMacro ;}
+ if(configV["spellclass-2-book-npc"]!=npcClass2BaseMacro){
+ attrs["spellclass-2-book-npc"] = npcClass2BaseMacro ;}
+ if (_.size(attrs)>0){
+ setAttrs(attrs,{silent:true});
+ }
return;
}
@@ -14119,7 +14650,7 @@ var PFSheet = PFSheet || (function () {
//TAS.debug(spellAttrs);
getAttrs(spellAttrs, function(values) {
//TAS.debug(values);
- var orderedList,repList,filteredIds, spellIDList, spellsArray, npcSpellsArray, attrs = {};
+ var orderedList,repList,filteredIds, spellIDList, spellsArray, npcSpellsArray, attrs = {},tempstr;
if (!_.isUndefined(repValues._reporder_repeating_spells) && repValues._reporder_repeating_spells != "") {
repList = repValues._reporder_repeating_spells.split(",");
repList = _.map(repList,function(ID) { return ID.toLowerCase(); });
@@ -14197,14 +14728,21 @@ var PFSheet = PFSheet || (function () {
});
//TAS.debug(spellsArray);
-
- attrs["spellclass-0-book"] = class0BaseMacro + spellsArray[0][0] + spellsArray[0][1] + spellsArray[0][2] + spellsArray[0][3] + spellsArray[0][4] + spellsArray[0][5] + spellsArray[0][6] + spellsArray[0][7] + spellsArray[0][8] + spellsArray[0][9];
- attrs["spellclass-1-book"] = class1BaseMacro + spellsArray[1][0] + spellsArray[1][1] + spellsArray[1][2] + spellsArray[1][3] + spellsArray[1][4] + spellsArray[1][5] + spellsArray[1][6] + spellsArray[1][7] + spellsArray[1][8] + spellsArray[1][9];
- attrs["spellclass-2-book"] = class2BaseMacro + spellsArray[2][0] + spellsArray[2][1] + spellsArray[2][2] + spellsArray[2][3] + spellsArray[2][4] + spellsArray[2][5] + spellsArray[2][6] + spellsArray[2][7] + spellsArray[2][8] + spellsArray[2][9];
- attrs["spellclass-0-book-npc"] = npcClass0BaseMacro + npcSpellsArray[0][0] + npcSpellsArray[0][1] + npcSpellsArray[0][2] + npcSpellsArray[0][3] + npcSpellsArray[0][4] + npcSpellsArray[0][5] + npcSpellsArray[0][6] + npcSpellsArray[0][7] + npcSpellsArray[0][8] + npcSpellsArray[0][9];
- attrs["spellclass-1-book-npc"] = npcClass1BaseMacro + npcSpellsArray[1][0] + npcSpellsArray[1][1] + npcSpellsArray[1][2] + npcSpellsArray[1][3] + npcSpellsArray[1][4] + npcSpellsArray[1][5] + npcSpellsArray[1][6] + npcSpellsArray[1][7] + npcSpellsArray[1][8] + npcSpellsArray[1][9];
- attrs["spellclass-2-book-npc"] = npcClass2BaseMacro + npcSpellsArray[2][0] + npcSpellsArray[2][1] + npcSpellsArray[2][2] + npcSpellsArray[2][3] + npcSpellsArray[2][4] + npcSpellsArray[2][5] + npcSpellsArray[2][6] + npcSpellsArray[2][7] + npcSpellsArray[2][8] + npcSpellsArray[2][9];
- setAttrs(attrs);
+ tempstr = class0BaseMacro + spellsArray[0][0] + spellsArray[0][1] + spellsArray[0][2] + spellsArray[0][3] + spellsArray[0][4] + spellsArray[0][5] + spellsArray[0][6] + spellsArray[0][7] + spellsArray[0][8] + spellsArray[0][9];
+ if(configV["spellclass-0-book"]!=tempstr){attrs["spellclass-0-book"] = tempstr;}
+ tempstr = class1BaseMacro + spellsArray[1][0] + spellsArray[1][1] + spellsArray[1][2] + spellsArray[1][3] + spellsArray[1][4] + spellsArray[1][5] + spellsArray[1][6] + spellsArray[1][7] + spellsArray[1][8] + spellsArray[1][9];
+ if(configV["spellclass-1-book"]!=tempstr){attrs["spellclass-1-book"] = tempstr;}
+ tempstr = class2BaseMacro + spellsArray[2][0] + spellsArray[2][1] + spellsArray[2][2] + spellsArray[2][3] + spellsArray[2][4] + spellsArray[2][5] + spellsArray[2][6] + spellsArray[2][7] + spellsArray[2][8] + spellsArray[2][9];
+ if(configV["spellclass-2-book"]!=tempstr){attrs["spellclass-2-book"] = tempstr;}
+ tempstr = npcClass0BaseMacro + npcSpellsArray[0][0] + npcSpellsArray[0][1] + npcSpellsArray[0][2] + npcSpellsArray[0][3] + npcSpellsArray[0][4] + npcSpellsArray[0][5] + npcSpellsArray[0][6] + npcSpellsArray[0][7] + npcSpellsArray[0][8] + npcSpellsArray[0][9];
+ if(configV["spellclass-0-book-npc"]!=tempstr){attrs["spellclass-0-book-npc"] = tempstr;}
+ tempstr = npcClass1BaseMacro + npcSpellsArray[1][0] + npcSpellsArray[1][1] + npcSpellsArray[1][2] + npcSpellsArray[1][3] + npcSpellsArray[1][4] + npcSpellsArray[1][5] + npcSpellsArray[1][6] + npcSpellsArray[1][7] + npcSpellsArray[1][8] + npcSpellsArray[1][9];
+ if(configV["spellclass-1-book-npc"]!=tempstr){attrs["spellclass-1-book-npc"] = tempstr;}
+ tempstr = npcClass2BaseMacro + npcSpellsArray[2][0] + npcSpellsArray[2][1] + npcSpellsArray[2][2] + npcSpellsArray[2][3] + npcSpellsArray[2][4] + npcSpellsArray[2][5] + npcSpellsArray[2][6] + npcSpellsArray[2][7] + npcSpellsArray[2][8] + npcSpellsArray[2][9];
+ if(configV["spellclass-2-book-npc"]!=tempstr){attrs["spellclass-2-book-npc"] = tempstr;}
+ if (_.size(attrs)>0){
+ setAttrs(attrs,{silent:true});
+ }
});
});
});
@@ -14386,10 +14924,10 @@ var PFSheet = PFSheet || (function () {
, allSkillsMod = buffCheck + drained + fear + sick + wounds
, casterlevel = drained + wounds
, blindedMod = -2 * (parseInt(v["condition-Blinded"], 10) || 0)
- , currAllSkills = parseInt(v["checks-cond"], 10)
- , currPhysSkills = parseInt(v["Phys-skills-cond"], 10)
- , currPerSkills = parseInt(v["Perception-cond"], 10)
- , currCaster = parseInt(v["CasterLevel-Penalty"], 10)
+ , currAllSkills = parseInt(v["checks-cond"], 10)||0
+ , currPhysSkills = parseInt(v["Phys-skills-cond"], 10)||0
+ , currPerSkills = parseInt(v["Perception-cond"], 10)||0
+ , currCaster = parseInt(v["CasterLevel-Penalty"], 10)||0
, setter = {};
if (allSkillsMod !== currAllSkills || isNaN(currAllSkills)) {
@@ -14549,80 +15087,6 @@ var PFSheet = PFSheet || (function () {
});
},
-
-
- /* Migrate to new repeating entry buff system */
- migrateBuffs = function () {
- var m, n, attribListOuter = [],
- copyOldBuffToNewBuff = function (attribList) {
- // This routine will generate a new repeating_buff entry using the old attribute data if it is populated
- getAttrs(attribList, function (v) {
- var buffData = [],
- hasMacro = false, showStr = ""
- , newRowId = "", newRowAttrs = {}, setters = {}, i, j, targetAttribList = [];
-
-
- // Check for existing data in old buff attributes
- attribList.forEach(function (attrib) {
- buffData[attrib] = v[attrib];
- if (typeof buffData[attrib] !== "undefined" && attrib.indexOf("macro") > 0) { hasMacro = true; }
- });
- if (hasMacro || (typeof buffData[attribList[0]] !== "undefined" && buffData[attribList[0]].length > 0)) { // If the Name or a macro-text is populated
- newRowId = generateRowID();
-
- // Construct target attribute list
- targetAttribList = ["repeating_buff_" + newRowId + "_buff-name"];
- for (j = 0; j < buffColumns.length; j++) {
- targetAttribList.push("repeating_buff_" + newRowId + "_buff-" + buffColumns[j] + "_macro-text");
- }
- targetAttribList.push("repeating_buff_" + newRowId + "_buff-enable_toggle");
- targetAttribList.push("repeating_buff_" + newRowId + "_buff-notes");
-
- // Create new repeating_buff entry
- for (i = 0; i < targetAttribList.length; i++) {
- if (typeof buffData[attribList[i]] !== "undefined") {
- newRowAttrs[targetAttribList[i]] = buffData[attribList[i]];
- // Enable "show" for populated attribute
- if (targetAttribList[i].indexOf("macro") > 0) {
- showStr = targetAttribList[i].replace("_macro-text", "-show");
- newRowAttrs[showStr] = "1";
- } else if (targetAttribList[i].indexOf("notes") > 0 && buffData[attribList[i]].length > 0) {
- showStr = targetAttribList[i].replace("buff-notes", "description-show");
- newRowAttrs[showStr] = "1";
- }
- }
- }
- //TAS.debug("Creating new repeating entry", newRowAttrs);
- setAttrs(newRowAttrs);
-
-
- // Wipe out old data
- for (i = 0; i < attribList.length; i++) {
- setters[attribList[i]] = "";
- }
- //TAS.warn("Wiping out old buff data", setters);
- setAttrs(setters);
- }
- });
- };
-
-
- for (m = 1; m <= 10; m++) {
- // Contruct old buff attribute list
- attribListOuter = ["buff" + m + "_Name"]; // start a new list
- for (n = 0; n < buffColumns.length; n++) {
- attribListOuter.push("buff" + m + "_" + buffColumns[n] + "_macro-text");
- }
- attribListOuter.push("buff" + m + "_Toggle");
- attribListOuter.push("buff" + m + "-notes");
- copyOldBuffToNewBuff(attribListOuter);
- }
- setAttrs({"migrated_buffs":"1"});
-
- },
-
-
-
/***SPEED *****/
/* updateModifiedSpeed
@@ -14839,9 +15303,6 @@ var PFSheet = PFSheet || (function () {
/* updateCurrHP- when updating hp, check nonLethalDmg level and wound threshold levels
*/
updateCurrHP = function (hp,nonLethalDmg,usesWounds,hpAbility,hpAbilityMod,staggered,syncNPCHP) {
- //TAS.notice("at updateCurrHP");
- //TAS.debug("hp",hp,"NLD",nonLethalDmg,"usesWounds",usesWounds,"hpAbility",hpAbility,"hpAbilityMod",hpAbilityMod,"staggered",staggered);
- //TAS.debug("value is: " + (hp + (usesWounds?(1+hpAbilityMod):0)) );
if (syncNPCHP) {
setAttrs({"NPC-HP":hp},{silent:true});
}
@@ -14965,9 +15426,7 @@ var PFSheet = PFSheet || (function () {
/***********************************CLASS PAGE ***********************************/
- /* updateClassInformation
- * Updates totals at bottom of Class Information grid
- *
+ /* updateClassInformation Updates totals at bottom of Class Information grid
* @col the unique part of the string for the cell modified:
* hp, fchp, bab, skill, fcskill, alt, Fort, Ref, Will, level
*/
@@ -15021,10 +15480,8 @@ var PFSheet = PFSheet || (function () {
/*****MYTHIC ***************/
-
/* updateMythicPathInformation
- * Updates total at bottom of Mythic Path Information grid
- */
+ * Updates total at bottom of Mythic Path Information grid*/
updateMythicPathInformation = function () {
getAttrs(["mythic-tier", "mythic-hp", "total-mythic-hp"], function (values) {
var tot = (parseInt(values["mythic-tier"], 10) || 0) * (parseInt(values["mythic-hp"], 10) || 0),
@@ -15035,8 +15492,7 @@ var PFSheet = PFSheet || (function () {
},
/* updateTierMythicPower
- * sets tier mp
- */
+ * sets tier mp */
updateTierMythicPower = function () {
//TAS.debug("entered updateTierMythicPower");
getAttrs(["tier-mythic-power", "mythic-tier"], function (values) {
@@ -15048,7 +15504,6 @@ var PFSheet = PFSheet || (function () {
},
/*****PSIONIC ***************/
-
updatePsionicBonusPower = function () {
getAttrs(["selected-ability-psionic-power", "psionic-level-total", "ability-psionic-power"], function (v) {
SWUtils.evaluateExpression(v["selected-ability-psionic-power"], function (value) {
@@ -15062,10 +15517,9 @@ var PFSheet = PFSheet || (function () {
},
/***********************************DEFENSE PAGE ***********************************/
-
/*updateConditionDefensePenalty
* Updates the AC-penalty and CMD-penalty field based on conditions
- *only difference is CMD penalty affected by energy drain for some reason
+ * only difference is CMD penalty affected by energy drain for some reason
*/
updateConditionDefensePenalty = function (eventInfo) {
getAttrs(["AC-penalty","CMD-penalty","condition-Blinded", "condition-Cowering", "condition-Stunned"
@@ -15101,7 +15555,6 @@ var PFSheet = PFSheet || (function () {
*
*/
updateDefenses = function (eventInfo) {
- TAS.debug("updateDefenses");
getAttrs(["AC-ability-mod", "FF-DEX", "AC-penalty", "CMD-penalty", "size", "max-dex",
"AC-dodge", "AC-natural", "AC-deflect", "AC-misc", "buff_AC-total", "buff_Touch-total",
"buff_CMD-total","CMD-DEX", "FF-CMD-DEX", "CMD-STR", "bab", "CMD-misc",
@@ -15486,6 +15939,69 @@ var PFSheet = PFSheet || (function () {
handleDropdown(prefix + from, prefix + to);
},
/********* REPEATING WEAPON FIELDSET *********/
+
+
+
+
+ /* Migrate to new repeating entry buff system */
+ migrateBuffs = function () {
+ var m, n, attribListOuter = [],
+ copyOldBuffToNewBuff = function (attribList) {
+ // This routine will generate a new repeating_buff entry using the old attribute data if it is populated
+ getAttrs(attribList, function (v) {
+ var buffData = [], hasMacro = false, showStr = ""
+ , newRowId = "", newRowAttrs = {}, setters = {}, i, j, targetAttribList = [];
+ // Check for existing data in old buff attributes
+ attribList.forEach(function (attrib) {
+ buffData[attrib] = v[attrib];
+ if (typeof buffData[attrib] !== "undefined" && attrib.indexOf("macro") > 0) { hasMacro = true; }
+ });
+ if (hasMacro || (typeof buffData[attribList[0]] !== "undefined" && buffData[attribList[0]].length > 0)) { // If the Name or a macro-text is populated
+ newRowId = generateRowID();
+ // Construct target attribute list
+ targetAttribList = ["repeating_buff_" + newRowId + "_buff-name"];
+ for (j = 0; j < buffColumns.length; j++) {
+ targetAttribList.push("repeating_buff_" + newRowId + "_buff-" + buffColumns[j] + "_macro-text");
+ }
+ targetAttribList.push("repeating_buff_" + newRowId + "_buff-enable_toggle");
+ targetAttribList.push("repeating_buff_" + newRowId + "_buff-notes");
+ // Create new repeating_buff entry
+ for (i = 0; i < targetAttribList.length; i++) {
+ if (typeof buffData[attribList[i]] !== "undefined") {
+ newRowAttrs[targetAttribList[i]] = buffData[attribList[i]];
+ // Enable "show" for populated attribute
+ if (targetAttribList[i].indexOf("macro") > 0) {
+ showStr = targetAttribList[i].replace("_macro-text", "-show");
+ newRowAttrs[showStr] = "1";
+ } else if (targetAttribList[i].indexOf("notes") > 0 && buffData[attribList[i]].length > 0) {
+ showStr = targetAttribList[i].replace("buff-notes", "description-show");
+ newRowAttrs[showStr] = "1";
+ }
+ }
+ }
+ setAttrs(newRowAttrs);
+ setAttrs({"migrated_buffs":"1"},{silent:true});
+ // Wipe out old data
+ for (i = 0; i < attribList.length; i++) {
+ setters[attribList[i]] = "";
+ }
+ //TAS.warn("Wiping out old buff data", setters);
+ setAttrs(setters);
+ }
+ });
+ };
+
+ for (m = 1; m <= 10; m++) {
+ // Contruct old buff attribute list
+ attribListOuter = ["buff" + m + "_Name"]; // start a new list
+ for (n = 0; n < buffColumns.length; n++) {
+ attribListOuter.push("buff" + m + "_" + buffColumns[n] + "_macro-text");
+ }
+ attribListOuter.push("buff" + m + "_Toggle");
+ attribListOuter.push("buff" + m + "-notes");
+ copyOldBuffToNewBuff(attribListOuter);
+ }
+ },
/* break the damage dropdown into 2 dropdowns, one for the multiplier and one for the attribute
* done as part of migration to .60
@@ -15500,8 +16016,6 @@ var PFSheet = PFSheet || (function () {
fields.push(abilityMultField);
}
});
- TAS.debug("migrateRepeatingDamage","get fields",fields);
-
getAttrs(fields, function (v) {
var setter={};
TAS.debug("migrateRepeatingDamage","values",v);
@@ -15526,13 +16040,13 @@ var PFSheet = PFSheet || (function () {
}
}
});
- TAS.debug("migrateRepeatingDamage","Setting: ",setter);
setter["migrated_damage-multiplier"]="1";
if (_.size(setter)){
setAttrs(setter,{silent:true});
}
});
},
+
/* default repeating_weapon macro texts and iteratives. old = .56, new = .60 */
oldPCAttackMacro="@{PC-whisper} &{template:pf_attack} @{toggle_accessible_flag} @{toggle_rounded_flag}{{color=@{rolltemplate_color}}} {{character_name=@{character_name}}} {{character_id=@{character_id}}} {{subtitle}} {{name=@{name}}} {{attack=[[ 1d20cs>[[ @{crit-target} ]] + [[ @{total-attack} ]] ]]}} {{damage=[[ @{damage-dice-num}d@{damage-die} + [[ @{total-damage} ]] ]]}} {{crit_confirm=[[ 1d20 + [[ @{total-attack} ]] ]]}} {{crit_damage=[[ [[ (@{damage-dice-num} * (@{crit-multiplier} - 1)) ]]d@{damage-die} + [[ (@{total-damage} * (@{crit-multiplier} - 1)) ]] ]]}} {{type=@{type}}} {{weapon_notes=@{notes}}} @{iterative_attacks} @{macro_options}",
newPCAttackMacro="@{PC-whisper} &{template:pf_attack} @{toggle_attack_accessible} @{toggle_rounded_flag}{{color=@{rolltemplate_color}}} {{character_name=@{character_name}}} {{character_id=@{character_id}}} {{subtitle}} {{name=@{name}}} {{attack=[[ 1d20cs>[[ @{crit-target} ]] + @{attack_macro} ]]}} {{damage=[[@{damage-dice-num}d@{damage-die} + @{damage_macro}]]}} {{crit_confirm=[[ 1d20 + @{attack_macro} + [[ @{crit_conf_mod} ]] ]]}} {{crit_damage=[[ [[ @{damage-dice-num} * (@{crit-multiplier} - 1) ]]d@{damage-die} + ((@{damage_macro}) * [[@{crit-multiplier} - 1]]) ]]}} {{precision_dmg1=@{precision_dmg_macro}}} {{precision_dmg1_type=@{precision_dmg_type}}} {{precision_dmg2=@{global_precision_dmg_macro}}} {{precision_dmg2_type=@{global_precision_dmg_type}}} {{critical_dmg1=@{critical_dmg_macro}}} {{critical_dmg1_type=@{critical_dmg_type}}} {{critical_dmg2=@{global_critical_dmg_macro}}} {{critical_dmg2_type=@{global_critical_dmg_type}}} {{type=@{type}}} {{weapon_notes=@{notes}}} @{iterative_attacks} @{macro_options} {{vs=@{vs}}} {{vs@{vs}=@{vs}}}",
@@ -15567,60 +16081,6 @@ var PFSheet = PFSheet || (function () {
return currText;
},
- /* migrateVeryOldAttackMacroText updates repeating_weapon macro text up to version .56
- * pc is "PC" or "NPC"
- */
- migrateVeryOldAttackMacroText = function(currText,pc) {
- var newCurrText="";
- TAS.debug("migrateVeryOldAttackMacroText",pc,currText);
- if (pc != "PC" && pc != "NPC") {
- pc = "PC";
- }
- if (currText.indexOf ("-whisper") < 0) {
- //super old!
- TAS.debug("super old no whisper");
- newCurrText = "@{"+pc+"-whisper} ";
- if (currText.indexOf("&{template:pf_attack}") >=0) {
- currText = currText.replace(/.*?pf_attack\}\s/,"");
- TAS.debug("found pf attack");
- }
- newCurrText += "&{template:pf_attack} ";
- TAS.debug("now 1 values are",newCurrText,currText);
- } else {
- TAS.debug("Whisper is present");
- newCurrText = "@{"+pc+"-whisper} &{template:pf_attack} ";
- currText = currText.replace(/.*?pf_attack\}\s/,"");
- TAS.debug("now 2 values are",newCurrText,currText);
- }
- //next two came out in same release
- if (currText.indexOf("toggle_attack_access") < 0 ) {
- newCurrText += "@{toggle_attack_accessible}";
- }
- if (currText.indexOf("toggle_rounded_flag") < 0 ) {
- newCurrText += "@{toggle_rounded_flag}";
- }
- if (currText.indexOf("{{color=")< 0) {
- TAS.debug("very old no color");
- //2nd oldest
- newCurrText += "{{color=@{rolltemplate_color}}} ";
- }
- //add rest
- newCurrText+= currText;
- //check end:
- if (currText.indexOf("{{type=") < 0 ) {
- newCurrText += "{{type=@{type}}}";
- }
- if (currText.indexOf("description=") < 0 ) {
- newCurrText += "{{description=@{notes}}}";
- }
- if (currText.indexOf("iterative") < 0 ) {
- newCurrText += "@{iterative_attacks}";
- }
- if (currText.indexOf("macro_options") < 0 ) {
- newCurrText += "@{macro_options}";
- }
- return newCurrText;
- },
/* migrateAttackMacroText updates repeating weapon macro-text to version .60 using search and replace
* this should be used if the user customized the macro text
@@ -15643,7 +16103,6 @@ var PFSheet = PFSheet || (function () {
fixRepeatingAttackMacros = function(version){
- TAS.notice("at fixRepeatingAttackMacros" );
getAttrs(["migrated_attack_macros64"],function(vm){
var migrateMacros = parseInt(vm["migrated_attack_macros64"],10)||0;
if (!migrateMacros) {
@@ -15661,9 +16120,7 @@ var PFSheet = PFSheet || (function () {
update=false;
fieldname = prefix + "var_iterative_attack"+i+"_macro";
tempmacro=v[fieldname];
- TAS.debug("at id "+id+" iterative "+ i +" looking for "+ fieldname +", macro is:"+ tempmacro );
if (/\s*\+\s*@\{attack_macro\}\s*\+\s*\[\[\s*@\{iterative/i.test(tempmacro)){
- TAS.notice("it contains the string! move the brackets!");
tempmacro= tempmacro.replace(/\s*\+\s*@\{attack_macro\}\s*\+\s*\[\[\s*@\{iterative/ig,' + [[ @{attack_macro} + @{iterative');
update=true;
}
@@ -15738,7 +16195,63 @@ var PFSheet = PFSheet || (function () {
* If it's still differnt, the use may have customized it, so call the migrate functions above to search and replace the necessary fields.
*/
migrateRepeatingAttackMacros = function(ids){
- var macroFieldsList = _.reduce(ids,function(memo,id){
+ var
+ migrateVeryOldAttackMacroText = function(currText,pc) {
+ var newCurrText="";
+ TAS.debug("migrateVeryOldAttackMacroText",pc,currText);
+ if (pc != "PC" && pc != "NPC") {
+ pc = "PC";
+ }
+ if (currText.indexOf ("-whisper") < 0) {
+ //super old!
+ TAS.debug("super old no whisper");
+ newCurrText = "@{"+pc+"-whisper} ";
+ if (currText.indexOf("&{template:pf_attack}") >=0) {
+ currText = currText.replace(/.*?pf_attack\}\s/,"");
+ TAS.debug("found pf attack");
+ }
+ newCurrText += "&{template:pf_attack} ";
+ TAS.debug("now 1 values are",newCurrText,currText);
+ } else {
+ TAS.debug("Whisper is present");
+ newCurrText = "@{"+pc+"-whisper} &{template:pf_attack} ";
+ currText = currText.replace(/.*?pf_attack\}\s/,"");
+ TAS.debug("now 2 values are",newCurrText,currText);
+ }
+ //next two came out in same release
+ if (currText.indexOf("toggle_attack_access") < 0 ) {
+ newCurrText += "@{toggle_attack_accessible}";
+ }
+ if (currText.indexOf("toggle_rounded_flag") < 0 ) {
+ newCurrText += "@{toggle_rounded_flag}";
+ }
+ if (currText.indexOf("{{color=")< 0) {
+ TAS.debug("very old no color");
+ //2nd oldest
+ newCurrText += "{{color=@{rolltemplate_color}}} ";
+ }
+ //add rest
+ newCurrText+= currText;
+ //check end:
+ if (currText.indexOf("{{type=") < 0 ) {
+ newCurrText += "{{type=@{type}}}";
+ }
+ if (currText.indexOf("description=") < 0 ) {
+ newCurrText += "{{description=@{notes}}}";
+ }
+ if (currText.indexOf("iterative") < 0 ) {
+ newCurrText += "@{iterative_attacks}";
+ }
+ if (currText.indexOf("macro_options") < 0 ) {
+ newCurrText += "@{macro_options}";
+ }
+ return newCurrText;
+ },
+
+
+
+
+ macroFieldsList = _.reduce(ids,function(memo,id){
memo.push("repeating_weapon_"+id+"_macro-text");
memo.push("repeating_weapon_"+id+"_NPC-macro-text");
return memo;
@@ -15816,7 +16329,6 @@ var PFSheet = PFSheet || (function () {
var migrateMacros = 0, migrateDamage=0;
migrateMacros = parseInt(v["migrated_attack_macros"],10)||0;
migrateDamage= parseInt(v["migrated_damage-multiplier"],10)||0;
- TAS.notice("migrateRepeatingAttacks",v);
if (!(migrateMacros && migrateDamage)) {
TAS.debug("attacks to migrate");
getSectionIDs("repeating_weapon", function(ids){
@@ -15847,7 +16359,7 @@ var PFSheet = PFSheet || (function () {
setter[ prefix + "attack-type_macro_insert"]= attackGridFields[attkType].attackmacro;
setter[ prefix + "damage-type_macro_insert"]= attackGridFields[attkType].damagemacro;
} else {
- setter[prefix + "attack-type_macro_insert"]="0";
+ setter[ prefix + "attack-type_macro_insert"]="0";
}
//TAS.debug("setRepeatingWeaponInsertMacro",setter);
setAttrs(setter,{silent:true});
@@ -15984,8 +16496,6 @@ var PFSheet = PFSheet || (function () {
updateRepeatingWeaponsFromCrit = function (attacktype,eventInfo) {
var globalCritBonusField= attackGridFields[attacktype].crit;
- //TAS.log("is "+ attackGridFields[attacktype].crit+" = "+"attk_"+attacktype.toLowerCase()+"_crit_conf ?");
- //TAS.notice("at updateRepeatingWeaponsFromCrit for type: "+attacktype);
getSectionIDs("repeating_weapon", function (ids) {
var attrs=[globalCritBonusField];
_.each(ids,function(id){
@@ -16064,17 +16574,26 @@ var PFSheet = PFSheet || (function () {
});
},
+ getRepeatingAttackMacroText = function(id,eventInfo,rowValues){
+
+ },
+ getRepeatingDamageMacroText = function(id,eventInfo,rowValues){
+
+ },
+ resetRepeatingAttackMacros = function(id,eventInfo){
+
+ },
- /* getAttackOptionsText - resets entire macro options text for a repeating_weapon row
- */
+
+ /* getAttackOptionsText - resets entire macro options text for a repeating_weapon row */
getAttackOptionsText = function(id,eventInfo,toggleValues,rowValues) {
var prefix = "repeating_weapon_" + getRepeatingIDStr(id)
, attackType=findAbilityInString(rowValues[prefix+"attack-type"])
, optionText = "", newValue="";
-
+ TAS.notice("getAttackOptionsText !!!!!!!!!!!!!!!!!!!!!!!!!");
+ TAS.debug("getAttackOptionsText: attack type:"+attackType,rowValues);
if ( attackType ) {
attackType = attackType.replace('attk-','').replace('2','');
- TAS.debug("is now"+attackType);
if ((attackType==="melee" && toggleValues.showmelee)
|| (attackType==="ranged" && toggleValues.showranged)
|| (attackType==="CMB" && toggleValues.showcmb) ) {
@@ -16083,11 +16602,16 @@ var PFSheet = PFSheet || (function () {
if (toggleValues.showheader_image){
optionText += attackOptions.header_image.replace("REPLACE",attackOptionsDefaults.image[attackType] );
}
- } else {
- TAS.debug("getAttackOptionsText","attackType is not defined for "+prefix+"attack-type",id,rowValues);
-
+ } else if (attackType==="" && (parseInt(rowValues[prefix+"total-attack"],10)||0)===0){
+ optionText+= "{{no_attack_roll=1}}";
}
-
+ if (!findAbilityInString(rowValues[prefix+"damage-ability"]) &&
+ (parseInt(rowValues[prefix+"damage-dice-num"],10)||0)===0 &&
+ (parseInt(rowValues[prefix+"damage-die"],10)||0)===0 &&
+ (parseInt(rowValues[prefix+"total-damage"],10)||0)===0) {
+ optionText+= "{{no_damage=1}}";
+ }
+
if (toggleValues.showattack){
optionText += attackOptions.attack_notes.replace("REPLACE",attackOptionsDefaults.notes.attack );
}
@@ -16100,8 +16624,11 @@ var PFSheet = PFSheet || (function () {
* note this is almost exactly like resetSpellOptions suggesting there is a way to refactor these*/
resetAttackOptions = function(id,eventInfo){
var prefix = "repeating_weapon_" + getRepeatingIDStr(id)
- , rowfields=[ prefix+"attack-type" ]
- , allFields = attackToggles.concat(rowfields);
+ , rowfields= _.map(attackOptionEventsPlayer,function(attr){return prefix+attr;})
+ , allFields = attackToggles;
+ rowfields.push(prefix+"total-attack");
+ rowfields.push(prefix+"total-damage");
+ allFields=allFields.concat(rowfields);
//TAS.log("resetAttackOptions, fields to get",allFields);
getAttrs(allFields,function(v){
var toggleValues = _.reduce(attackToggles,function(memo,attr){
@@ -16110,13 +16637,10 @@ var PFSheet = PFSheet || (function () {
}, {} )
, optionText=""
, setter={};
- //TAS.debug("resetAttackOptions, toggles:",toggleValues);
optionText = getAttackOptionsText(id,eventInfo,toggleValues,v);
- TAS.debug("resetAttackOptions, received text:"+optionText);
if (optionText) {
setter[prefix + "macro_options"]=optionText;
}
- TAS.debug("resetAttackOptions, About to set",setter);
if (_.size(setter)>0) {
setAttrs(setter,{silent:true});
}
@@ -16126,21 +16650,38 @@ var PFSheet = PFSheet || (function () {
/*resetAllAttackOptions - updates repeating_spells_ attack _options for all spells.*/
resetAllAttackOptions = function(eventInfo,callback){
- //TAS.notice("at resetAllAttackOptions");
getAttrs(attackToggles,function(tv){
var toggleValues = _.reduce(attackToggles,function(memo,attr){
memo['show'+attr.toLowerCase().slice(14).replace('_notes','')]=(parseInt(tv[attr],10)||0);
return memo;
}, {} );
getSectionIDs("repeating_weapon",function(ids){
- var fields = _.map(ids,function(id){
- return ("repeating_weapon_"+id+ "_attack-type");
- });
+ /*var fields = _.reduce(ids,function(memo,id){
+ var prefix= "repeating_weapon_"+id+"_",
+ rowfields= _.reduce(attackOptionEventsPlayer,function(memo,attr){
+ var field=prefix+attr;
+ TAS.debug("resetAllAttackOptions: adding "+field);
+ memo.push(field);
+ return memo;
+ },[]);
+ rowfields.push(prefix+"total-attack");
+ rowfields.push(prefix+"total-damage");
+ memo.concat(rowfields);
+ return memo;
+ },[]);*/
+ var idstofind = _.map(ids,function(id){
+ return "repeating_weapon_"+id+"_";
+ }),
+ appends=attackOptionEventsPlayer.concat(["total-attack","total-damage"]),
+ fields = SWUtils.cartesianAppend(idstofind,appends);
+ TAS.debug("finding fields:",fields);
+
+
//TAS.debug("resetAllAttackOptions fields are:",fields);
TAS.debug("resetAllAttackOptions, toggles:",toggleValues);
getAttrs(fields,function(v){
var setter={};
- //TAS.debug("resetAllAttackOptions, got field values:",v);
+ TAS.debug("resetAllAttackOptions, got field values:",v);
_.each(ids,function(id){
var optionText = getAttackOptionsText(id,eventInfo,toggleValues,v);
TAS.debug("resetAllAttackOptions, received text:"+optionText);
@@ -16203,7 +16744,7 @@ var PFSheet = PFSheet || (function () {
* called with true if you should update, or false if not.
*/
verifyHasSkill = function (skill, callback) {
- var first3, first4, core = false, bg = false, cs = false;
+ var first3, first4, core = false, bg = false, cs = false, isSub=false, fields=["BG-Skill-Use", "unchained_skills-show"];
if (skill && typeof callback === "function") {
first4 = skill.slice(0, 4).toLowerCase();
first3 = first4.slice(0, 3);
@@ -16214,8 +16755,11 @@ var PFSheet = PFSheet || (function () {
} else {
core = true;
}
-
- getAttrs(["BG-Skill-Use", "unchained_skills-show"], function (v) {
+ if (_.contains(allFillInSkillInstances,skill)){
+ isSub=true;
+ fields=fields.concat([skill+"-name",skill+"-ranks"]);
+ }
+ getAttrs(fields, function (v) {
var retval = false;
//TAS.debug("verifyHasSkill",skill,"first4",first4,"cs",cs,"bg",bg,"core",core,"getAttrs",v);
if (core) {
@@ -16242,7 +16786,7 @@ var PFSheet = PFSheet || (function () {
* @ability {string} {optional} = the value of the ability dropdown
* @abilityMod {string} {optional} = the value of the ability mod
*/
- updateSkill = function (skill,silently) {
+ updateSkill = function (skill) {
var csNm = skill + "-cs",
ranksNm = skill + "-ranks",
classNm = skill + "-class",
@@ -16252,12 +16796,13 @@ var PFSheet = PFSheet || (function () {
featNm = skill + "-feat",
itemNm = skill + "-item",
miscNm = skill + "-misc-mod",
- rtNm = skill + "-ReqTrain";
+ utNm = skill + "-ut", //untrained
+ rtNm = skill + "-ReqTrain"
+ ;
verifyHasSkill(skill, function (hasSkill) {
if (hasSkill) {
- getAttrs([skill, csNm, ranksNm, classNm, abNm, modNm, racialNm, featNm, itemNm, miscNm, rtNm,
- "size_skill", "size_skill_double", "acp", "checks-cond", "Phys-skills-cond", "Perception-cond"], function (v) {
-
+ 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, skillTot = 0, setter = {}, mods = "", setAny = 0, cond = 0,
cs = parseInt(v[csNm], 10) || 0,
currSkill = parseInt(v[skill], 10),//no default
@@ -16266,82 +16811,81 @@ var PFSheet = PFSheet || (function () {
allCond = parseInt(v["checks-cond"], 10) || 0,
abilityName = findAbilityInString(v[abNm]),
physCond = 0, perCond = 0,
- params = {silent:false};
+ watchrt= parseInt(v["enforce_requires_training"],10)||0
+ ;
- if (ranks && cs) {
- skillTot += 3;
- mods = "3/";
- } else {
- mods = "0/";
- }
- if (abilityName === "DEX-mod" || abilityName === "STR-mod") {
- adj = parseInt(v["acp"], 10) || 0;
- skillTot += adj;
- mods += adj + "/";
- } else {
- mods += "0/";
- }
- skillSize = sizeSkills[skill];
- if (skillSize) {
- if (skillSize === 1) {
- adj = parseInt(v["size_skill"], 10) || 0;
- skillTot += adj;
- mods += adj + "/";
- } else if (skillSize === 2) {
- adj = parseInt(v["size_skill_double"], 10) || 0;
- skillTot += adj;
- mods += adj + "/";
- }
- } else {
- mods += "0/";
- }
- if (abilityName === "DEX-mod" || abilityName === "STR-mod") {
- physCond = parseInt(v["Phys-skills-cond"], 10) || 0;
- }
- if (skill === "Perception" || skill === "CS-Perception") {
- perCond = parseInt(v["Perception-cond"], 10) || 0;
- }
- cond = allCond + physCond + perCond;
- mods += cond;
+ try {
+ if (rt && ranks===0 ){
+ if ( v[utNm]!=="{{untrained=1}}" ){
+ setter[utNm]="{{untrained=1}}";
+ }
+ } else if (v[utNm]!=="{{untrained=}}" ){
+ setter[utNm]="{{untrained=}}";//cannot set to "" because then it chooses the default which is "{{untrained=1}}"
+ }
+
+
+ //if enforce_requires_training and no ranks then set to 0
+ //if (watchrt && rt && ranks===0 && (! /^Knowled|^Linguis|^Sleight/i.test(skill.slice(0,7)))){setter[skill] = skillTot;setAttrs(setter,params);return;}
+
+ if (ranks && cs) {
+ skillTot += 3;
+ mods = "3/";
+ } else {
+ mods = "0/";
+ }
+ if (abilityName === "DEX-mod" || abilityName === "STR-mod") {
+ adj = parseInt(v["acp"], 10) || 0;
+ skillTot += adj;
+ mods += adj + "/";
+ } else {
+ mods += "0/";
+ }
+ skillSize = sizeSkills[skill];
+ if (skillSize) {
+ if (skillSize === 1) {
+ adj = parseInt(v["size_skill"], 10) || 0;
+ skillTot += adj;
+ mods += adj + "/";
+ } else if (skillSize === 2) {
+ adj = parseInt(v["size_skill_double"], 10) || 0;
+ skillTot += adj;
+ mods += adj + "/";
+ }
+ } else {
+ mods += "0/";
+ }
+ if (abilityName === "DEX-mod" || abilityName === "STR-mod") {
+ physCond = parseInt(v["Phys-skills-cond"], 10) || 0;
+ }
+ if (skill === "Perception" || skill === "CS-Perception") {
+ perCond = parseInt(v["Perception-cond"], 10) || 0;
+ }
+ cond = allCond + physCond + perCond;
+ mods += cond;
+ skillTot += ranks + cond + (parseInt(v[modNm], 10) || 0) + (parseInt(v[racialNm], 10) || 0) +
+ (parseInt(v[featNm], 10) || 0) + (parseInt(v[itemNm], 10) || 0) + (parseInt(v[miscNm], 10) || 0);
+ if (currSkill !== skillTot) {
+ setter[skill] = skillTot;
+ }
+ if ((v[classNm] || "0/0/0/0") !== mods) {
+ setter[classNm] = mods;
+ }
+ } catch (err) {
+ TAS.error(err);
+ }
+ if (_.size(setter)>0){
+ if (rt && ranks===0 && !v[utNm]){
+ TAS.debug("settting "+utNm+" to " +setter[utNm]);
+ }
- skillTot += ranks + cond + (parseInt(v[modNm], 10) || 0) + (parseInt(v[racialNm], 10) || 0) +
- (parseInt(v[featNm], 10) || 0) + (parseInt(v[itemNm], 10) || 0) + (parseInt(v[miscNm], 10) || 0);
-
- if (currSkill !== skillTot) {
- setter[skill] = skillTot;
- setAny++;
- }
-
-
- if ((v[classNm] || "0/0/0/0") !== mods) {
- setter[classNm] = mods;
- setAny++;
- }
- if (setAny) {
- //TAS.debug({"function":"updateSkill","currSkill":currSkill,"newSkill":skillTot,"oldmods":v[classNm],"mods":mods });
- if (silently) {
- params.silent=true;
- }
- setAttrs(setter,params);
- }
+ setAttrs(setter,{silently:true});
+ }
});
}
});
},
/******ITEMS PAGE ********/
- /* migrateMaxDexAndACP on defense page
- * sets old dropdown values to new ones, make sure to only call this if version > 0 (did not hit recalc button)
- * we only care if they set it to none, all others leave as armor and load.
- */
- migrateMaxDexAndACP = function(){
- getAttrs(["max-dex-source","acp-source"],function(v){
- var newAcp=0, newMaxDex=0, currAcp=v["acp-source"], currMaxDex=v["max-dex-source"];
- if (currMaxDex=="9999") { newMaxDex=3; }
- if (currAcp=="0") {newAcp=3;}
- setAttrs({"acp-source":newAcp,"max-dex-source":newMaxDex});
- });
- },
/* updateWornEquipment
* updates the totals for worn equipment
@@ -16783,11 +17327,15 @@ var PFSheet = PFSheet || (function () {
/* updateCastingPenaltyNote - for condition deafened update penalty note on DEFENSE PAGE
*/
updateCastingPenaltyNote = function () {
- getAttrs(["condition-Deafened"],function(v){
+ getAttrs(["condition-Deafened","SpellFailureNote"],function(v){
if (v["condition-Deafened"]=="4") {
- setAttrs({"SpellFailureNote":"Yes"},{silent:true});
+ if(!v["SpellFailureNote"]) {
+ setAttrs({"SpellFailureNote":"Yes"},{silent:true});
+ }
} else {
- setAttrs({"SpellFailureNote":""},{silent:true});
+ if(v["SpellFailureNote"]){
+ setAttrs({"SpellFailureNote":""},{silent:true});
+ }
}
});
},
@@ -16808,12 +17356,7 @@ var PFSheet = PFSheet || (function () {
"Concentration-" + classidx + "-misc"],0,null,false,{silent:true});
},
- /*updateClassSpellPenetration
- */
- updateClassSpellPenetration = function (classidx, eventInfo) {
- SWUtils.updateRowTotal(["spellclass-" + classidx + "-SP-mod", "spellclass-" + classidx + "-SP_misc",
- "spellclass-" + classidx + "-level-total"],0,null,false,{silent:true});
- },
+
/*********************************** SPELLS PER DAY section *************************************/
/* updateSaveDCs - update save DCs on left column of Spells Per Day grid
@@ -16875,13 +17418,71 @@ var PFSheet = PFSheet || (function () {
, "spellclass-" + classidx + "-level-" + spelllvl + "-bonus"
, "spellclass-" + classidx + "-level-" + spelllvl + "-misc"]);
},
-
-
+ resetSpellsTotals = function(dummy,eventInfo) {
+ var spellTotalSums = _.reduce(spellClassIndexes,function(memo,classidx){
+ memo[classidx]= _.reduce(spellLevels,function(imemo,spelllevel){
+ imemo[spelllevel]=0;
+ return imemo;
+ },{}) ;
+ return memo;
+ },{}),
+ totalListed = _.mapObject(spellTotalSums,_.clone),
+ totalPrepped = _.mapObject(spellTotalSums,_.clone),
+ rowattrs=['spellclass_number','spell_level','slot','metamagic','used'];
+ getSectionIDs("repeating_spells",function(ids){
+ var fields =[];
+ _.each(ids,function(id){
+ var prefix= "repeating_spells_"+getRepeatingIDStr(id);
+ _.each(rowattrs,function(attr){
+ fields.push(prefix+attr);
+ });
+ });
+ _.each(spellClassIndexes,function(classidx){
+ _.each(spellLevels,function(spellLevel){
+ fields.push("spellclass-"+classidx+"-level-"+spellLevel+"-total-listed");
+ fields.push("spellclass_"+classidx+"_level_"+spellLevel+"_spells_prepared");
+ });
+ });
+ getAttrs(fields,function(v){
+ var setter={};
+ _.each(ids,function(id){
+ var prefix= "repeating_spells_"+getRepeatingIDStr(id),
+ spellLevel = parseInt(v[prefix+"spell_level"],10),
+ classNum = parseInt(v[prefix+"spellclass_number"],10),
+ metamagic = parseInt(v[prefix+"metamagic"],10)||0,
+ slot = isNaN(parseInt(v[prefix+"slot"],10))?spellLevel:parseInt(v[prefix+"slot"],10),
+ truelevel = metamagic?slot:spellLevel,
+ uses = parseInt(v[prefix+"used"],10)||0;
+ if (!(isNaN(spellLevel) || isNaN(classNum))) {
+ TAS.debug("resetSpellsTotals","spellLevel",spellLevel,"classNum",classNum,"metamagic",metamagic,"slot",slot,truelevel,"truelevel",uses,"uses");
+ totalPrepped[classNum][truelevel]+=uses;
+ totalListed[classNum][truelevel]+=1;
+ } else {
+ TAS.warn("at resetSpellsTotals, ONE OF THESE IS NAN ","spellLevel",spellLevel,"classNum",classNum);
+ }
+ });
+
+ _.each(spellClassIndexes,function(classidx){
+ _.each(spellLevels,function(spellLevel){
+ if ((parseInt(v["spellclass-"+classidx+"-level-"+spellLevel+"-total-listed"],10)||0) !== totalListed[classidx][spellLevel]){
+ setter["spellclass-"+classidx+"-level-"+spellLevel+"-total-listed"]=totalListed[classidx][spellLevel];
+ }
+ if ((parseInt(v["spellclass_"+classidx+"_level_"+spellLevel+"_spells_prepared"],10)||0) !== totalPrepped[classidx][spellLevel]){
+ setter["spellclass_"+classidx+"_level_"+spellLevel+"_spells_prepared"]=totalPrepped[classidx][spellLevel];
+ }
+ });
+ });
+ if (_.size(setter)){
+ setAttrs(setter,{silent:true});
+ }
+ });
+ });
+ },
+
+
/********************************* REPEATING SPELL FUNCTIONS ***********************************/
-
updatePreparedSpellState = function (id,eventInfo) {
- //TAS.notice("<====== Checking if Spell is Prepared ======>");
getAttrs(["repeating_spells_used","repeating_spells_spellclass_number","repeating_spells_prepared_state"
,"spellclass-0-hide_unprepared","spellclass-1-hide_unprepared","spellclass-2-hide_unprepared"], function(values) {
var uses = parseInt(values.repeating_spells_used,10)||0
@@ -16890,7 +17491,6 @@ var PFSheet = PFSheet || (function () {
, isPrepared=(parseInt(values["spellclass-"+classnum+"-casting_type"],10)||0)===2?1:0
, hideUnprepared = isPrepared*(parseInt(values["spellclass-"+classnum+"-hide_unprepared"],10)||0)
, setter={};
- TAS.debug("Number Prepared: " + values.repeating_spells_used+", prepared flag:"+values.repeating_spells_prepared_state );
if (uses > 0 && preparedState === 0 ) {
setter["repeating_spells_prepared_state"]="1";
} else if (uses < 1 && preparedState != 0) {
@@ -16908,7 +17508,6 @@ var PFSheet = PFSheet || (function () {
/* resetSpellsPrepared - sets prepared_state to 1 if used has a value > 0 */
resetSpellsPrepared = function(){
- TAS.debug("at reset spells prepared");
getSectionIDs("repeating_spells",function(ids){
var fieldarray=[];
_.each(ids,function(id){
@@ -16917,10 +17516,8 @@ var PFSheet = PFSheet || (function () {
fieldarray.push( prefix+"used" );
fieldarray.push( prefix+"prepared_state");
});
- TAS.debug("resetSpellsPrepared",fieldarray);
getAttrs(fieldarray,function(v){
var setter={};
- TAS.debug("resetSpellsPrepared",v);
_.each(ids,function(id){
var idStr=getRepeatingIDStr(id)
, prefix = "repeating_spells_"+idStr
@@ -16941,63 +17538,6 @@ var PFSheet = PFSheet || (function () {
});
},
-
- spellTotalSums = _.reduce(spellClassIndexes,function(memo,classidx){
- memo[classidx]= _.reduce(spellLevels,function(imemo,spelllevel){
- imemo[spelllevel]=0;
- return imemo;
- },{}) ;
- return memo;
- },{}),
-
- resetSpellsTotals = function(dummy,eventInfo) {
- var totalListed = _.mapObject(spellTotalSums,_.clone),
- totalPrepped = _.mapObject(spellTotalSums,_.clone),
- rowattrs=['spellclass_number','spell_level','slot','metamagic','used'];
- TAS.debug("resetSpellsTotals");
- getSectionIDs("repeating_spells",function(ids){
- var fields =[];
- _.each(ids,function(id){
- var prefix= "repeating_spells_"+getRepeatingIDStr(id);
- _.each(rowattrs,function(attr){
- fields.push(prefix+attr);
- });
- });
- TAS.debug("resetSpellsTotals, getting fields:",fields);
- getAttrs(fields,function(v){
- var setter={};
- TAS.debug(v);
- _.each(ids,function(id){
- var prefix= "repeating_spells_"+getRepeatingIDStr(id),
- spellLevel = parseInt(v[prefix+"spell_level"],10),
- classNum = parseInt(v[prefix+"spellclass_number"],10),
- metamagic = parseInt(v[prefix+"metamagic"],10)||0,
- slot = isNaN(parseInt(v[prefix+"slot"],10))?spellLevel:parseInt(v[prefix+"slot"],10),
- truelevel = metamagic?slot:spellLevel,
- uses = parseInt(v[prefix+"used"],10)||0;
- if (!(isNaN(spellLevel) || isNaN(classNum))) {
- TAS.debug("resetSpellsTotals","spellLevel",spellLevel,"classNum",classNum,"metamagic",metamagic,"slot",slot,truelevel,"truelevel",uses,"uses");
- totalPrepped[classNum][truelevel]+=uses;
- totalListed[classNum][truelevel]+=1;
- } else {
- TAS.debug("resetSpellsTotals, ONE OF THESE IS NAN ","spellLevel",spellLevel,"classNum",classNum);
- }
- });
-
- _.each(spellClassIndexes,function(classidx){
- _.each(spellLevels,function(spellLevel){
- setter["spellclass-"+classidx+"-level-"+spellLevel+"-total-listed"]=totalListed[classidx][spellLevel];
- setter["spellclass_"+classidx+"_level_"+spellLevel+"_spells_prepared"]=totalPrepped[classidx][spellLevel];
- });
- });
- setAttrs(setter,{silent:true});
- });
- });
- },
-
-
-
-
/************* SPELL OPTIONS *********************/
/* updateSpellOption - updates an existing @{spell_options} text for a row depending on the field updated
* If save or spell resist is none, then don't print DC either.
@@ -17060,9 +17600,11 @@ var PFSheet = PFSheet || (function () {
, customCasterlevel = parseInt(rowValues[prefix+"CL_misc"],10)||0
, classNum = parseInt(rowValues[prefix + "spellclass_number"],10)
, spellLevel = parseInt(rowValues[prefix+"spell_level"], 10)
+ , spellSlot = parseInt(rowValues[prefix+"slot"], 10)
, casterlevel = parseInt(rowValues[prefix + "casterlevel"],10)
, concentrationMod = parseInt(rowValues[prefix+"Concentration-mod"],10)
- , defDC = 15+(spellLevel * 2)
+ , levelForConcentrate = (isNaN(spellSlot)||spellSlot===spellLevel)?spellLevel:spellSlot
+ , defDC = 15+(levelForConcentrate * 2)
, defMod = parseInt(rowValues["Concentration-"+classNum+"-def"],10)||0
, optionText = "", newValue="";
TAS.debug("getSpellOptionsText, defMod: "+defMod);
@@ -17150,15 +17692,12 @@ var PFSheet = PFSheet || (function () {
} else {
optionText+="{{description=}}";
}
-
- //TAS.debug("returning :"+optionText);
return optionText;
},
resetSpellOptions = function(id,eventInfo){
var prefix = "repeating_spells_" + getRepeatingIDStr(id)
, allFields;
- //TAS.debug("at resetSpellOptions");
allFields= _.chain(spellOptionAttributesNoDescription)
.union(spellOptionHelperAttributes)
.flatten(true)
@@ -17180,7 +17719,6 @@ var PFSheet = PFSheet || (function () {
.value()
, optionText=""
, setter={};
- TAS.notice("concentration defensively0 : " + (parseInt(v["Concentration-0-def"],10)||0) , "From toggleValues: "+toggleValues[ "Concentration-0-def"]);
optionText = getSpellOptionsText(id,eventInfo,toggleValues,v);
//TAS.debug("resetSpellOptions","About to set",setter);
@@ -17189,7 +17727,6 @@ var PFSheet = PFSheet || (function () {
});
},
-
/*resetAllSpellsOptions - updates repeating_spells_spell_options for all spells.*/
resetAllSpellsOptions = function(eventInfo,callback){
getAttrs(spellTogglesPlusNonRepeatOptionAttrs,function(tv){
@@ -17205,7 +17742,6 @@ var PFSheet = PFSheet || (function () {
, "Concentration-2-def":(parseInt(tv["Concentration-2-def"],10)||0)
} )
.value();
- TAS.notice("concentration defensively0 : " + (parseInt(tv["Concentration-0-def"],10)||0) , "From toggleValues: "+toggleValues[ "Concentration-0-def"]);
getSectionIDs("repeating_spells",function(ids){
var fields = _.map(ids,function(id){
@@ -17241,7 +17777,7 @@ var PFSheet = PFSheet || (function () {
var updateDefensiveCasting = eventInfo?(/\-def$/i.test(eventInfo.sourceAttribute)):false;
getSectionIDs("repeating_spells",function(ids){
var fields = ["spellclass-"+classIdx+"-level-total", "spellclasses_multiclassed", "Concentration-"+classIdx+"-misc", "spellclass-"+classIdx+"-name"
- , "spellclass-"+classIdx+"-SP_misc", "Concentration-"+classIdx+"-def", "Concentration-"+classIdx+"-mod"];
+ , "spellclass-"+classIdx+"-SP-mod", "Concentration-"+classIdx+"-def", "Concentration-"+classIdx+"-mod"];
_.each(ids,function(id){
var prefix = "repeating_spells_" + getRepeatingIDStr(id);
fields=fields.concat([ prefix + "casterlevel", prefix + "CL_misc" //, prefix + "cast_def-mod"
@@ -17256,7 +17792,7 @@ var PFSheet = PFSheet || (function () {
, multiclassed = parseInt(v["spellclasses_multiclassed"],10)||0
, defMod = parseInt(v["Concentration-" + classIdx + "-def"], 10)
, classConcentrationMisc = parseInt(v["Concentration-"+classIdx+"-misc"],10)||0
- , classSPMisc = parseInt(v["Concentration-"+classIdx+"-SP_misc"],10)||0
+ , classSPMisc = parseInt(v["spellclass-"+classIdx+"-SP-mod"],10)||0
, classNumSetter={}
, setter={};
if (classLevel > 0) {
@@ -17334,10 +17870,11 @@ var PFSheet = PFSheet || (function () {
setOption=1;
}
}
-
newSP = classSPMisc + (parseInt(v[prefix + "SP_misc"],10)||0);
+ TAS.debug("new sp for this row: "+newSP+", class:"+classSPMisc+", rowuser:"+ (parseInt(v[prefix + "SP_misc"],10)||0) +", and current= "+(parseInt(v[prefix + "SP-mod"],10)||0) );
if (newSP !== (parseInt(v[prefix + "SP-mod"],10)||0) ) {
- setter[prefix + "SP-mod"]=newSP;
+
+ setter[prefix + "SP-mod"]=newSP;
if (optionText) {
optionText = optionText.replace(spellOptionRegex.spellPen,spellOptions.spellPen.replace("REPLACE",newSP));
setOption=1;
@@ -17345,13 +17882,11 @@ var PFSheet = PFSheet || (function () {
}
if (setOption){
- //TAS.debug("setting option for id "+ id +" to "+optionText);
setter[prefix+"spell_options"]=optionText;
}
}
});
- //TAS.debug(setter);
if (_.size(classNumSetter)>0){
setAttrs(classNumSetter);
}
@@ -17365,17 +17900,13 @@ var PFSheet = PFSheet || (function () {
});
});
},
-
/* updateSpellsCasterAbilityRelated - updates all spells when caster ability or DCs are updated */
updateSpellsCasterAbilityRelated = function(classIdx,eventInfo,callback){
if (!(classIdx >=0 && classIdx<=2)|| isNaN(parseInt(classIdx,10))) {return;}
- //var updateAbility = eventInfo?(/concentration\-[012]\-mod/i.test(eventInfo.sourceAttribute)):true;
getSectionIDs("repeating_spells",function(ids){
var fields = ["Concentration-"+classIdx+"-mod","Concentration-"+classIdx+"-misc","spellclasses_multiclassed"];
- //TAS.debug("updateSpellsCasterAbilityRelated",classIdx,eventInfo);
- //TAS.debug(ids);
_.each(ids,function(id){
var prefix = "repeating_spells_" + getRepeatingIDStr(id);
fields=fields.concat([prefix+"spellclass_number",prefix+"spell_level"
@@ -17438,12 +17969,10 @@ var PFSheet = PFSheet || (function () {
}
}
if (setOption){
- //TAS.debug("setting option for id "+ id +" to "+optionText);
setter[prefix+"spell_options"]=optionText;
}
}
});
- //TAS.debug(setter);
if (_.size(setter)>0){
setAttrs(setter,{silent:true},function(){if (typeof callback === "function"){callback();}});
} else if (typeof callback === "function") {
@@ -17462,7 +17991,6 @@ var PFSheet = PFSheet || (function () {
, spellSlotField = prefix + "slot"
, spellLevelField = prefix + "spell_level"
, metamagicField = prefix + "metamagic";
- TAS.debug("updateSpellSlot",eventInfo,id);
getAttrs([spellSlotField,spellLevelField,spellLevelRadioField],function(v){
var slot = parseInt(v[spellSlotField],10)
, level = parseInt(v[spellLevelField],10)
@@ -17505,12 +18033,11 @@ var PFSheet = PFSheet || (function () {
, prefix + "spell_options", prefix + "used", prefix + "slot", prefix + "metamagic"
, spellLevelField, spellLevelRadioField, dcMiscField, currDCField
, "spellclass-0-level-total" ,"spellclass-1-level-total" ,"spellclass-2-level-total"
- , "spellclass-0-SP_misc", "spellclass-1-SP_misc", "spellclass-2-SP_misc"
+ , "spellclass-0-SP-mod", "spellclass-1-SP-mod", "spellclass-2-SP-mod"
, "Concentration-0-mod", "Concentration-1-mod", "Concentration-2-mod"
, "Concentration-0-misc", "Concentration-1-misc", "Concentration-2-misc"
, "Concentration-0-def", "Concentration-1-def", "Concentration-2-def"
, "spellclass-0-name", "spellclass-1-name", "spellclass-2-name"];
-
getAttrs(fields,function(v){
var baseClassNum = parseInt(v[classNumberField],10)
, classNum =baseClassNum||0
@@ -17525,22 +18052,20 @@ var PFSheet = PFSheet || (function () {
, casterlevel =currCasterLevel||0
, spellAbilityMod = parseInt(v["Concentration-" + classNum + "-mod"],10)||0
, newDC =10
- , levelSlot = (metaMagic?spellSlot:baseSpellLevel)
+ , levelSlot = (metaMagic?spellSlot:spellLevel)
, currRange=parseInt(v[prefix+"range_numeric"],10)||0
, currChosenRange = v[prefix+"range_pick"]||"blank"
, newSP = 0, newConcentration = 0
, updateClass= false, updateClassLevel=false, updateRange=false, updateSP=false
, updateConcentration=false, updateSpellLevel=false, updateDC=false, updateSlot=false
, updateStr="", tempMatches
- , hadToSetClass =false, spellLevelUndefined=false
+ , hadToSetClass =false, spellLevelUndefined=false
, newRange=0
, setter={}, setAny=0;
//cannot perform calculations
- TAS.warn("updateSpell",eventInfo,"baseClassNum:"+baseClassNum+", classNum:"+classNum+", baseSpellLevel:"+baseSpellLevel+", spellLevel:"+spellLevel);
if ( isNaN(baseClassNum) && isNaN(baseSpellLevel) ) {
- TAS.warn("cannot update spell! id:"+id +" both class and level are not numbers");
- TAS.warn(v);
+ TAS.warn("cannot update spell! id:"+id +" both class and level are not numbers",v);
return;
}
TAS.debug("spell slot:"+ spellSlot+", metamagic:"+metaMagic+", spelllevel:"+spellLevel+", radio:"+spellLevelRadio);
@@ -17600,19 +18125,17 @@ var PFSheet = PFSheet || (function () {
}
spellLevelUndefined=true;
} else if (!metaMagic && (updateSpellLevel || spellLevel !== spellLevelRadio)) {
- TAS.debug("reset radio field after spell update");
setter[spellLevelRadioField]=spellLevel;
updateSpellLevel = true;
- } else if (metaMagic && (updateSlot || spellSlot !== spellLevelRadio)) {
- TAS.debug("reset radio field after spell SLOT update");
+ } else if (metaMagic && !isNaN(spellSlot) && (updateSlot || spellSlot !== spellLevelRadio)) {
setter[spellLevelRadioField]= spellSlot;
}
-
//keep slot in sync
if ( !spellLevelUndefined) {
if (isNaN(spellSlot)){
setter[prefix+"slot"]=spellLevel;
spellSlot = spellLevel;
+ updateSlot=true;
} else if (!metaMagic && (updateSpellLevel || spellSlot!==spellLevel) ){
setter[prefix+"slot"] = spellLevel;
}
@@ -17665,18 +18188,16 @@ var PFSheet = PFSheet || (function () {
}
if (updateClass || updateSP || updateClassLevel ) {
- newSP = (parseInt(v["spellclass-" + classNum + "-SP_misc"],10)||0) + (parseInt(v[prefix + "SP_misc"],10)||0);
+ newSP = (parseInt(v["spellclass-" + classNum + "-SP-mod"],10)||0) + (parseInt(v[prefix + "SP_misc"],10)||0);
if (newSP !== (parseInt(v[prefix + "SP-mod"],10)||0) ) {
setter[prefix + "SP-mod"]=newSP;
}
}
-
if (_.size(setter)>0){
setAttrs(setter,{silent:true},function(){
- //TAS.debug("done setting, check spell options");
if (!spellLevelUndefined){
- //TAS.debug("updateSpell - made changes - Calling resetSpellOptions from updateSpell");
+ TAS.debug("updateSpell - made changes - Calling resetSpellOptions from updateSpell");
resetSpellOptions(id,eventInfo);
//if class or level changed update macro
if ( hadToSetClass || updateSpellLevel || updateSlot ){
@@ -17687,8 +18208,8 @@ var PFSheet = PFSheet || (function () {
});
} else {
//TAS.debug("Nothing to set , double check spell options");
- if (!spellLevelUndefined && (id||eventInfo) ){
- //TAS.debug("updateSpell - no changes - call resetSpellOptions from updateSpell");
+ if (updateSlot || updateSpellLevel || ( !spellLevelUndefined && (id||eventInfo) )){
+ TAS.debug("updateSpell - no changes - call resetSpellOptions from updateSpell");
resetSpellOptions(id,eventInfo);
}
}
@@ -17701,7 +18222,6 @@ var PFSheet = PFSheet || (function () {
});
},
-
/*updateAllSpells - updates all spells*/
updateAllSpells = function() {
getSectionIDs("repeating_spells",function(ids){
@@ -17714,7 +18234,6 @@ var PFSheet = PFSheet || (function () {
});
},
-
/* parseSpellRangeText - Initial parse of a string from spell , it returns the value to set in the dropdown,
* plus whether to run the range text through a secondary parse for numbers.
* returns object with keys: dropdown, useorig, number, rangetext
@@ -17724,7 +18243,6 @@ var PFSheet = PFSheet || (function () {
parseSpellRangeText = function (range, area) {
var newRangeDropdown = "", tempRange = 0, tempMatches, tempMatches2, useOrigRangeText = false
, flatRange=-1, areaRange, newRangeText="";
- //TAS.debug("at parseSpellRangeText: range:"+range+", area:"+area);
try {
if (!range) {
//if range is blank, use the number in area/effect/targets since it will be "30ft emanation" or something similar
@@ -17876,11 +18394,9 @@ var PFSheet = PFSheet || (function () {
newRangeText = range;
}
}
- //TAS.debug("returning: newRangeDropdown:"+newRangeDropdown+", origtext?:"+useOrigRangeText+", flatrange:"+flatRange + ", rangetext:"+newRangeText);
return {"dropdown":newRangeDropdown,"useorig":useOrigRangeText,"number":flatRange,"rangetext":newRangeText};
},
-
/* parseCompendiumSpell - gets level and class from repeating_spells_spell_lvlstr then updates spell
* matches class name in compendium against current spell classes in this order:
* spell class already selected by spell dropdown, spellclass0, spellclass1, spellclass2
@@ -18064,15 +18580,12 @@ var PFSheet = PFSheet || (function () {
saveEventsAuto = "change:saves-cond change:total-REPLACE change:REPLACE-ability-mod",
saveEventsPlayer = "change:REPLACE-trait change:REPLACE-enhance change:REPLACE-resist change:REPLACE-misc",
skillEventsAuto = "change:acp change:checks-cond change:phys-skills-cond change:REPLACE-ability-mod change:REPLACE-misc-mod",
- skillEventsPlayer = "change:REPLACE-cs change:REPLACE-ranks change:REPLACE-racial change:REPLACE-feat change:REPLACE-item",
+ skillEventsPlayer = "change:REPLACE-cs change:REPLACE-ranks change:REPLACE-racial change:REPLACE-feat change:REPLACE-item change:REPLACE-ReqTrain",
defenseEventsAuto = "change:bab change:ac-penalty change:cmd-penalty change:size change:ac-shield change:ac-armor change:ac-ability-mod change:ff-dex change:cmd-dex change:ff-cmd-dex change:cmd-str change:max-dex",
defenseEventsPlayer = "change:ff-dex change:ac-penalty change:cmd-penalty change:size change:ac-dodge change:ac-natural change:ac-deflect change:ac-misc change:cmd-misc",
defenseEventsEither = "change:size change:AC-ability change:FF-ability change:CMD-ability1 change:CMD-ability2 change:CMD-ability",
-
-
/*************************************** Events to Methods ***************************************************/
-
conditionEventsEither={
"change:condition-grappled": [updateGrapple, updateConditionAttackPenalty, updateConditionAttackNote]
, "change:condition-pinned": [updatePin, updateConditionDefensePenalty]
@@ -18108,7 +18621,8 @@ var PFSheet = PFSheet || (function () {
// events for updates to top of class page, each one calls isSpellClassExists
spellcastingClassEventsAuto = {
"change:concentration-REPLACE-mod": [updateBonusSpells, updateSaveDCs, updateConcentration, updateSpellsCasterAbilityRelated]
- , "change:spellclass-REPLACE-level-total": [updateConcentration, updateClassSpellPenetration, updateCasterRanges, updateSpellsCasterLevelRelated]
+ , "change:spellclass-REPLACE-level-total": [updateConcentration, updateCasterRanges, updateSpellsCasterLevelRelated]
+ , "change:spellclass-REPLACE-SP-mod": [updateSpellsCasterLevelRelated]
},
spellcastingClassEventsEither = {
"change:concentration-REPLACE-ability": [handleConcentrationAbilityDropdown, updateBonusSpells]
@@ -18118,7 +18632,6 @@ var PFSheet = PFSheet || (function () {
spellcastingClassEventsPlayer = {
"change:concentration-REPLACE-misc": [updateConcentration, updateSpellsCasterLevelRelated]
, "change:concentration-REPLACE-def": [updateSpellsCasterLevelRelated]
- , "change:spellclass-REPLACE-SP_misc": [updateClassSpellPenetration, updateSpellsCasterLevelRelated]
},
// events for updates to top of class page even if no spellcasting class exists
spellcastingClassEventsIgnoreLevel = {
@@ -18131,20 +18644,30 @@ var PFSheet = PFSheet || (function () {
spellcastingClassEventsPerSpellLevel = "change:spellclass-CLASSIDX-level-SPELLLEVEL-class change:spellclass-CLASSIDX-level-SPELLLEVEL-bonus change:spellclass-CLASSIDX-level-SPELLLEVEL-misc",
//events for spell repeating rows
repeatingSpellEventsPlayer = {
- "change:repeating_spells:DC_misc change:repeating_spells:Concentration_misc change:repeating_spells:range change:repeating_spells:range_pick change:repeating_spells:CL_misc change:repeating_spells:SP_misc": [updateSpell]
+ "change:repeating_spells:DC_misc change:repeating_spells:slot change:repeating_spells:Concentration_misc change:repeating_spells:range change:repeating_spells:range_pick change:repeating_spells:CL_misc change:repeating_spells:SP_misc": [updateSpell]
, "change:repeating_spells:spell_lvlstr": [parseCompendiumSpell]
, "change:repeating_spells:used":[resetSpellsTotals,updatePreparedSpellState]
- , "change:repeating_spells:slot":[updateSpellSlot]
+ , "change:repeating_spells:slot":[updateSpellSlot]
},
repeatingSpellEventsEither = {
"change:repeating_spells:spellclass_number change:repeating_spells:spell_level": [updateSpell]
},
/********************************************** MIGRATIONS **********************************/
-
+ /* migrateMaxDexAndACP on defense page
+ * sets old dropdown values to new ones, make sure to only call this if version > 0 (did not hit recalc button)
+ * we only care if they set it to none, all others leave as armor and load.
+ */
+ migrateMaxDexAndACP = function(){
+ getAttrs(["max-dex-source","acp-source"],function(v){
+ var newAcp=0, newMaxDex=0, currAcp=v["acp-source"], currMaxDex=v["max-dex-source"];
+ if (currMaxDex=="9999") { newMaxDex=3; }
+ if (currAcp=="0") {newAcp=3;}
+ setAttrs({"acp-source":newAcp,"max-dex-source":newMaxDex});
+ });
+ },
migrateSpellRanges = function(callback) {
- //TAS.debug("at migrateSpellRanges ");
getAttrs(["spellranges_migrated"],function(m){
if (m["spellranges_migrated"]=="1"){
if (typeof callback === "function"){
@@ -18153,7 +18676,6 @@ var PFSheet = PFSheet || (function () {
return;
}
}
-
getSectionIDs("repeating_spells",function(ids){
var fields = [];
_.each(ids,function(id){
@@ -18172,7 +18694,6 @@ var PFSheet = PFSheet || (function () {
, newRange = 0, rangeUpdates
, resetDropdown=false
;
- //TAS.debug("migrateRanges evaluating "+name+", dropdown:"+ chosenRange +" rangeText;"+rangeText );
//if dropdown is blank but text filled in try to migrate
if (!chosenRange && !rangeText){
setter[prefix+"range"]="";
@@ -18211,11 +18732,7 @@ var PFSheet = PFSheet || (function () {
});
},
-
-
-
- /* handleOldSpellClassDropdown - determines spell class from class dropdown in the spell repeating row
- */
+ /* handleOldSpellClassDropdown - determines spell class from class dropdown in the spell repeating row */
handleOldSpellClassDropdown = function (selected, class0name, class1name, class2name) {
if (!selected) { return 0; } //it is undefined if it is default set to the first one
if (selected.indexOf("0") >= 0) { return 0; }
@@ -18275,7 +18792,7 @@ var PFSheet = PFSheet || (function () {
, classCL = (parseInt(v[classCLField], 10) || 0)
, classCon = (parseInt(v[classConField], 10) || 0)
, classDefConMod = (parseInt(v[classDefConField], 10) || 0)
- , classSpellPen = (parseInt(v[classSpellPenField], 10) || 0)
+ , classSpellPen = classCL + (parseInt(v[classSpellPenField], 10) || 0)
, defDC = 15 + (spellLevel * 2)
, currClassNum = parseInt(v[hiddenclassNumField], 10)
, currRange = parseInt(v[spellRangeNum], 10)
@@ -18435,7 +18952,7 @@ var PFSheet = PFSheet || (function () {
//if any are null or undefined skip this row,
_.each(v,function(val){
//saw some that were undefined but typeof came back something else? how?
- if (val === undefined || val===null || typeof val === "undefined" ) {
+ if (val === undefined || val===null ) {
TAS.error("cannot migrate " + id);
updateAtEnd();
return;
@@ -18452,7 +18969,6 @@ var PFSheet = PFSheet || (function () {
}
//passed check, so generate new id and attribute list
newId=generateRowID();
- //TAS.debug("Passed test, migrating " + id +" to new "+newId);
newPrefix="repeating_spells_"+newId+"_";
idmap["repeating_"+section+"_"+id+"_"]= "repeating_spells_"+newId+"_";
_.each(v,function(val,field){
@@ -18491,9 +19007,6 @@ var PFSheet = PFSheet || (function () {
setter[newPrefix+"spell_level_r"]=spellLevel;
}
setter[newPrefix+"spell_class_r"] = parseInt(v[prefix+"spellclass_number"],10)||0;
- //TAS.notice("Setting "+newPrefix+"spellclass_number:"+ setter[newPrefix+"spellclass_number"] +", spell_level_r:"+setter[newPrefix+"spell_level"]+" and ensure undefined old level "+ setter[prefix+"spell_level"]+" for spell new "+setter[newPrefix+"name"]+", old:" + v[prefix+"name"]);
- //TAS.log(setter);
-
setAttrs(setter,{silent:true},function(){
updateAtEnd();
return;
@@ -18543,9 +19056,7 @@ var PFSheet = PFSheet || (function () {
});
});
});
- }
- ;
-
+ };
//create array from keys from spellUserFieldDefaults
_.each(spellUserFieldDefaults,function(defMap,field){
@@ -18559,20 +19070,14 @@ var PFSheet = PFSheet || (function () {
sectionsCounted++;
if (sectionsCounted === countofSections) {
updateAtEnd = _.after(countofSpells,function(){
- //TAS.debug("called updateAtEnd");
finishUp();});
- //TAS.debug("there are "+ countofSpells + " spells to migrate!");
updateOldSpells();
}
});
});
setAttrs({"migrated_spells":"1"});
-
});
};
-
-
-
getAttrs(["migrated_spells"],function (vm){
if (vm["migrated_spells"]=="1"){return;}
migrateCheckedSpells();
@@ -18650,33 +19155,32 @@ var PFSheet = PFSheet || (function () {
});
},
- /* migrateClassSkill - updates the class skill checkbox from that long string to a number 0 or 3
- from the original sheet */
- migrateClassSkill = function (skill) {
- var csNm = skill + "-cs";
- getAttrs([csNm], function (v) {
- var cs = 0, setter = {};
- cs = parseInt(v[csNm], 10);
- if (isNaN(cs)) {
- if (v[csNm] == "0") { cs = 0; }
- else if (v[csNm]) { cs = 3; }
- else if (!v[csNm]) { cs = 0; }
- if (cs === 3) {
- //TAS.debug({"function":"migrateClassSkill","raw":v[csNm],"cs":cs});
- setter[csNm] = cs;
- setAttrs(setter);
- }
- }
- });
- },
- migrateClassSkillArray = function (skills) {
- skills.forEach(function (skill) {
- migrateClassSkill(skill);
- });
- },
/* migrateClassSkills calls migrateClassSkill for all skills */
migrateClassSkills = function () {
- getAttrs(["unchained_skills-show", "BG-Skill-Use"], function (uv) {
+ /* migrateClassSkill - updates the class skill checkbox from that long string to a number 0 or 3 from the original sheet */
+ var migrateClassSkill = function (skill) {
+ var csNm = skill + "-cs";
+ getAttrs([csNm], function (v) {
+ var cs = 0, setter = {};
+ cs = parseInt(v[csNm], 10);
+ if (isNaN(cs)) {
+ if (v[csNm] == "0") { cs = 0; }
+ else if (v[csNm]) { cs = 3; }
+ else if (!v[csNm]) { cs = 0; }
+ if (cs === 3) {
+ //TAS.debug({"function":"migrateClassSkill","raw":v[csNm],"cs":cs});
+ setter[csNm] = cs;
+ setAttrs(setter);
+ }
+ }
+ });
+ },
+ migrateClassSkillArray = function (skills) {
+ skills.forEach(function (skill) {
+ migrateClassSkill(skill);
+ });
+ };
+ getAttrs(["unchained_skills-show", "BG-Skill-Use"], function (uv) {
if (uv["unchained_skills-show"] == "1") {
if (uv["BG-Skill-Use"] == "1") {
migrateClassSkillArray(allCoreSkills);
@@ -18690,7 +19194,103 @@ var PFSheet = PFSheet || (function () {
});
},
+ migrateSkillMacros = function(){
+ var srchstr='{{Check=[[ 1d20 + [[ @{REPLACE} ]] ]]}}'
+ , repstr='{{Check=[[ @{skill-query} + [[ @{REPLACE} ]] ]]}}';
+ getAttrs(["migrated_skill_macros"],function(mv){
+ if (!(parseInt(mv.migrated_skill_macros,10)||0)) {
+ var skillNames=backgroundCoreSkills.concat(backgroundOnlySkills).concat(adventureSkills).concat(consolidatedSkills)
+ , fieldNames = SWUtils.cartesianAppend(skillNames,["-macro"]);
+ getAttrs(fieldNames,function(v){
+ var setter={migrated_skill_macros:1};
+ setter=_.reduce(skillNames,function(memo,skill){
+ var currMacro = v[skill+"-macro"], newMacro="", lsrchstr="", lrepstr="", srchreg;
+ try {
+ if (! /skill_options/.test(currMacro)) {
+ if ( !/skill-query/.test(currMacro)){
+ lsrchstr=srchstr.replace('REPLACE',skill);
+ srchreg=new RegExp( SWUtils.escapeRegExp(lsrchstr),'i');
+ lrepstr=repstr.replace('REPLACE',skill);
+ newMacro=currMacro.replace(srchreg,lrepstr);
+ } else {
+ newMacro=currMacro;
+ }
+ newMacro += " @{"+skill+"-ut} @{skill_options}";
+ if (newMacro.indexOf('@{header_image-pf_generic}')>=0){
+ newMacro=newMacro.replace('@{header_image-pf_generic}','@{header_image-pf_generic-skill}');
+ }
+ if (newMacro!==currMacro){
+ memo[skill+"-macro"]=newMacro;
+ }
+ }
+ } catch(err){
+ TAS.error(err);
+ } finally {
+ return memo;
+ }
+ },setter);
+ setAttrs(setter,{silent:true});
+ });
+ }
+ });
+ },
+
+
+ migrateRollTemplateImages =function(){
+ getAttrs(['header_image-pf_spell','header_image-pf_attack-melee',
+ 'header_image-pf_attack-ranged','header_image-pf_attack-cmb','header_image-pf_defense'],
+ function(v){
+ var setter = _.chain(v)
+ .filter(function(val,attr){
+ return (/\[default\]/).test(val);
+ })
+ .reduce(function(memo,val,attr){
+ var newval="";
+ try{
+ switch(attr){
+ case 'header_image-pf_spell':
+ if(val!=="[default](http://imgur.com/9yjOsAD.png)"){
+ newval="[default](http://imgur.com/9yjOsAD.png)";
+ }
+ break;
+ case 'header_image-pf_attack-melee':
+ if (val!=="[default](http://i.imgur.com/AGq5VBG.png)"){
+ newval="[default](http://i.imgur.com/AGq5VBG.png)";
+ }
+ break;
+ case 'header_image-pf_attack-ranged':
+ if (val!=="[default](http://imgur.com/58j2e8P.png)"){
+ newval="[default](http://imgur.com/58j2e8P.png)";
+ }
+ break;
+ case 'header_image-pf_attack-cmb':
+ if (val!=="[default](http://imgur.com/RUJfMGe.png)"){
+ newval="[default](http://imgur.com/RUJfMGe.png)";
+ }
+ break;
+ case 'header_image-pf_defense':
+ if (val!=="[default](http://imgur.com/02fV6wh.png)"){
+ newval="[default](http://imgur.com/02fV6wh.png)";
+ }
+ break;
+ }
+ if (newval){
+ memo[attr]=newval;
+ }
+ } catch(err){
+ TAS.error("migrateRollTemplateImages: "+attr,err);
+ }
+ return memo;
+
+ },{})
+ .value();
+ if (_.size(setter)>0){
+ setAttrs(setter,{silent:true});
+ }
+ });
+ },
+
/************************************** RECALCULATES AND RESETS **********************************************/
/* recalculateRepeatingWeapons- recalculates all repeating weapons rows. */
recalculateRepeatingWeapons = function () {
@@ -18742,11 +19342,11 @@ var PFSheet = PFSheet || (function () {
skills.forEach(function (skill) {
handleDropdown(skill + "-ability", skill + "-ability-mod");
SWUtils.evaluateAndSetNumber(skill+"-misc", skill+"-misc-mod");
- updateSkill(skill,true);
+ updateSkill(skill);
});
},
- /* recalculateSkills - updates ALL skills - calls handleDropdown for ability then updateSkill
- * */
+
+ /* recalculateSkills - updates ALL skills - calls handleDropdown for ability then updateSkill */
recalculateSkills = function () {
getAttrs(["unchained_skills-show", "BG-Skill-Use"], function (v) {
if (v["unchained_skills-show"] == "1") {
@@ -18877,7 +19477,7 @@ var PFSheet = PFSheet || (function () {
});
updateInit();
-
+ SWUtils.evaluateAndSetNumber("init-misc", "init-misc-mod");
SWUtils.evaluateAndSetNumber("NPC-HD-misc", "NPC-HD-misc-mod");
updateCasterLevels();
@@ -18899,10 +19499,7 @@ var PFSheet = PFSheet || (function () {
}
if (oldversion < 0.17) {
//skills fixed in 0.17
- if (oldversion > 0) {
- //redo
- updateSkill("CS-Perception");
- }
+
updateConditionAbilityPenalty();
recalculateRepeatingMaxUsed("class-ability");
recalculateRepeatingMaxUsed("feat");
@@ -19003,7 +19600,7 @@ var PFSheet = PFSheet || (function () {
}
if (oldversion < 0.52) {
updateCasterLevels();
- recalculateSkills();
+
updateArmor();
updateDefenses();
setIsNPC();
@@ -19042,12 +19639,19 @@ var PFSheet = PFSheet || (function () {
if (oldversion < 0.64) {
fixRepeatingAttackMacros(0.64);
}
+ if (oldversion < 0.65) {
+ migrateRollTemplateImages();
+ migrateSkillMacros();
+ updateSkillMacros();
+ _.each(equationMacros,function(writeField,readField){
+ SWUtils.evaluateAndSetNumber(readField,writeField);
+ });
+ }
},
/* checkForUpdate looks at current version of page in PFSheet_Version and compares to code PFSheet.version
- * calls recalulateSheet if versions don't match or if recalculate button was pressed.
- */
+ * calls recalulateSheet if versions don't match or if recalculate button was pressed.*/
checkForUpdate = function () {
getAttrs(["PFSheet_Version", "PFSheet_forcesync", "recalc1"], function (v) {
var setter = {}, currVer = 0, setAny = 0, recalc = false;
@@ -19095,9 +19699,7 @@ try {
console.log('%cס§₪₪₪₪§|(Ξ≥≤≥≤≥≤ΞΞΞΞΞΞΞΞΞΞ> # | ## sheet version <ΞΞΞΞΞΞΞΞΞΞ≥≤≥≤≥≤Ξ)|§₪₪₪₪§ס', 'background: linear-gradient(to right,red,white,white,red); color:black;text-shadow: 0 0 8px white;');
console.log('%cס§₪₪₪₪§|(Ξ≥≤≥≤≥≤ΞΞΞΞΞΞΞΞΞΞ> ### / '+("0000" + version.toFixed(2) ).slice(-5)+
' <ΞΞΞΞΞΞΞΞΞΞ≥≤≥≤≥≤Ξ)|§₪₪₪₪§ס', 'background: linear-gradient(to right,red,white,white,red); color:black;text-shadow: 0 0 8px white;');
-} catch (er4){
- TAS.notice("Pathfinder sheet version " + version);
-}
+} catch (er4){}
return {
lists: {
@@ -19113,6 +19715,7 @@ try {
buffColumns: buffColumns,
dropdowns: dropdowns,
defenseDropdowns: defenseDropdowns,
+ equationMacros: equationMacros,
buffEvents:buffEvents,
buffEventsNoParam:buffEventsNoParam,
saveTypes: saveTypes,
@@ -19124,6 +19727,8 @@ try {
backgroundOnlySkills: backgroundOnlySkills,
consolidatedSkills: consolidatedSkills,
sizeSkills: sizeSkills,
+ skillsWithFillInNames: skillsWithFillInNames,
+ allFillInSkillInstances: allFillInSkillInstances,
skillEventsAuto: skillEventsAuto,
skillEventsPlayer: skillEventsPlayer,
spellClassIndexes: spellClassIndexes,
@@ -19151,7 +19756,8 @@ try {
findAbilityInString: findAbilityInString,
findMultiplier: findMultiplier,
handleDropdown: handleDropdown,
- isBadRowId: isBadRowId
+ isBadRowId: isBadRowId,
+ appendToSubSkills: appendToSubSkills
},
recalc: {
recalculateSkills: recalculateSkills
@@ -19216,7 +19822,6 @@ try {
updateCasterLevels: updateCasterLevels,
updateSaveDCs: updateSaveDCs,
updateBonusSpells: updateBonusSpells,
- updateClassSpellPenetration: updateClassSpellPenetration,
updateMaxSpellsPerDay: updateMaxSpellsPerDay,
updateCasterFromClassLevel: updateCasterFromClassLevel,
ifSpellClassExists: ifSpellClassExists,
@@ -19230,6 +19835,8 @@ try {
checkForUpdate: checkForUpdate,
updateSpellbookMacros: updateSpellbookMacros,
updateAttackMacros: updateAttackMacros,
+ updateSkillMacros: updateSkillMacros,
+ updateSubSkillMacros: updateSubSkillMacros,
resetAllSpellsOptions: resetAllSpellsOptions,
updateSpellOption: updateSpellOption,
resetAllAttackOptions: resetAllAttackOptions,
@@ -19404,12 +20011,8 @@ var PFEventHandler = PFEventHandler || (function () {
}
})
);
- on("change:max-skill-ranks-misc",
- TAS.callback(function eventMaxSkillRanksMisc(eventInfo) {
- TAS.debug("caught " + eventInfo.sourceAttribute + " event: " + eventInfo.sourceType);
- SWUtils.evaluateAndSetNumber("Max-Skill-Ranks-Misc", "Max-Skill-Ranks-mod");
- })
- );
+
+
//each skill has a dropdown handler and a skill update handler
//concat them all up, only happens once so no big deal
_.each(PFSheet.lists.allCoreSkills.concat(PFSheet.lists.backgroundOnlySkills).concat(PFSheet.lists.consolidatedSkills), function (skill) {
@@ -19449,6 +20052,24 @@ var PFEventHandler = PFEventHandler || (function () {
});
})
);
+ //these always displayed if rt or not
+ 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" ) {
+ PFSheet.verifyHasSkill(skill, function (hasSkill) {
+ getAttrs(["enforce_requires_training"],function(v){
+ if (v.enforce_requires_training == "1"){
+ PFSheet.updateSkillMacros(eventInfo);
+ }
+ });
+ });
+ }
+ })
+ );
+ }
+ //end of skill loop
});
//skills affected by size
@@ -19456,8 +20077,8 @@ var PFEventHandler = PFEventHandler || (function () {
if (mult === 1) {
on("change:size_skill",
TAS.callback(function eventUpdateSizeSkill(eventInfo) {
- TAS.debug("caught " + eventInfo.sourceAttribute + " event: " + eventInfo.sourceType);
if (eventInfo.sourceType !== "player" ) {
+ TAS.debug("caught " + eventInfo.sourceAttribute + " event: " + eventInfo.sourceType);
PFSheet.updateSkill(skill, eventInfo);
}
})
@@ -19474,12 +20095,58 @@ var PFEventHandler = PFEventHandler || (function () {
}
});
+ on("change:enforce_requires_training", TAS.callback(function eventRequiresTraining(eventInfo){
+ if (eventInfo.sourceType === "player" ) {
+ TAS.debug("caught " + eventInfo.sourceAttribute + " event: " + eventInfo.sourceType);
+ PFSheet.updateSkillMacros( eventInfo);
+ }
+ }
+ ));
+
+ _.each(SWUtils.cartesianAppend(PFSheet.lists.allFillInSkillInstances,["-name"]),function(skill){
+ on("change:"+ skill ,
+ TAS.callback(function eventSkillsWithFillInNames(eventInfo) {
+ if (eventInfo.sourceType==="player"){
+ TAS.debug("caught " + eventInfo.sourceAttribute + " event: " + eventInfo.sourceType);
+ var rt=skill.slice(0,-4)+"ReqTrain",r=skill.slice(0,-4)+"ranks";
+ //if we changed name on a skill that isn't choosable don't bother.
+ getAttrs(["enforce_requires_training",rt,r,"unchained_skills-show","BG-Skill-Use","artistry_skills-macro","lore_skills-macro"
+ ,"craft_skills-macro","knowledge_skills-macro","perform_skills-macro","profession_skills-macro","misc-skill_skills-macro"
+ ,"is_npc","include_skill_totals"
+ ,"NPC-craft_skills-macro","NPC-knowledge_skills-macro","NPC-perform_skills-macro","NPC-profession_skills-macro","NPC-misc-skill_skills-macro"],function(v){
+ var isrt=parseInt(v.enforce_requires_training,10),bg=0,isNPC=parseInt(v.is_npc,10)||0,
+ showBonus=parseInt(v.include_skill_totals,10)||0;
+ if (!(isrt && parseInt(v[rt],10) && isNaN(parseInt(v[r],10)))) {
+ bg= isNPC?0:((parseInt(v["unchained_skills-show"],10)||0)&& (parseInt(v["BG-Skill-Use"],10)||0));
+ TAS.debug("calling updatesubskillmacro: bg:"+bg+",isrt:"+isrt);
+ PFSheet.updateSubSkillMacros(bg,isrt,eventInfo,v,isNPC,showBonus);
+ }
+ });
+ }
+ })
+ );
+ });
+
//init
- on("change:init-ability-mod change:init-trait change:init-misc",
+ on("change:init-misc",
TAS.callback(function eventUpdateInit(eventInfo) {
TAS.debug("caught " + eventInfo.sourceAttribute + " event: " + eventInfo.sourceType);
- if (eventInfo.sourceType!=="player" || /trait|misc/i.test(eventInfo.sourceAttribute)){
+ SWUtils.evaluateAndSetNumber("init-misc","init-misc-mod");
+ })
+ );
+ on("change:init-trait",
+ TAS.callback(function eventUpdateInit(eventInfo) {
+ TAS.debug("caught " + eventInfo.sourceAttribute + " event: " + eventInfo.sourceType);
+ if (eventInfo.sourceType=="player"){
+ PFSheet.updateInit();
+ }
+ })
+ );
+ on("change:init-ability-mod change:init-misc-mod",
+ TAS.callback(function eventUpdateInit(eventInfo) {
+ if (eventInfo.sourceType!=="player" ){
+ TAS.debug("caught " + eventInfo.sourceAttribute + " event: " + eventInfo.sourceType);
PFSheet.updateInit();
}
})
@@ -19552,13 +20219,6 @@ var PFEventHandler = PFEventHandler || (function () {
})
);
-
- on("change:hp-formula-macro-text",
- TAS.callback(function eventHPFormulaMacroText(eventInfo) {
- TAS.debug("caught " + eventInfo.sourceAttribute + " event: " + eventInfo.sourceType);
- SWUtils.evaluateAndSetNumber("HP-formula-macro-text", "HP-formula-mod");
- })
- );
on("change:wound_threshold-show",
TAS.callback(function eventResetConditionWounds(eventInfo) {
TAS.debug("caught " + eventInfo.sourceAttribute + " event: " + eventInfo.sourceType);
@@ -19615,6 +20275,17 @@ var PFEventHandler = PFEventHandler || (function () {
})
);
});
+ //GENERIC EQUATIONS
+ _.each(PFSheet.lists.equationMacros, function (write, read) {
+ on("change:" + read,
+ TAS.callback(function eventGenericEquationMacro(eventInfo) {
+ TAS.debug("caught " + eventInfo.sourceAttribute + " event: " + eventInfo.sourceType);
+ SWUtils.evaluateAndSetNumber(read, write);
+ })
+ );
+ });
+
+
//DEFENSE DROPDOWNS
_.each(PFSheet.lists.defenseDropdowns, function (write, read) {
on("change:" + read,
@@ -19624,13 +20295,6 @@ var PFEventHandler = PFEventHandler || (function () {
})
);
});
- //Spell Resistance
- on("change:SR-macro-text",
- TAS.callback(function eventSRMacroText(eventInfo) {
- TAS.debug("caught " + eventInfo.sourceAttribute + " event: " + eventInfo.sourceType);
- SWUtils.evaluateAndSetNumber("SR-macro-text", "SR");
- })
- );
//mythic path and power
on("change:mythic-tier change:mythic-hp",
@@ -19762,7 +20426,6 @@ var PFEventHandler = PFEventHandler || (function () {
PFSheet.updateAttack(attack);
})
);
- //TAS.notice("setting up change:"+attackFields.misc+" for "+ attack);
on("change:"+attackFields.misc,
TAS.callback(function eventAttackMisc(eventInfo){
if (eventInfo.sourceType==="player"){
@@ -19771,7 +20434,6 @@ var PFEventHandler = PFEventHandler || (function () {
}
})
);
- //TAS.notice("setting up change:"+ attackFields.abilityMod + " change:"+attackFields.buff +" for "+ attack);
on("change:attk-penalty change:" + attackFields.abilityMod + " change:"+attackFields.buff,
TAS.callback(function eventAttackPenalty(eventInfo){
if (eventInfo.sourceType!=="player"){
@@ -19780,7 +20442,6 @@ var PFEventHandler = PFEventHandler || (function () {
}
})
);
- //TAS.notice("setting up change:" + attackFields.crit +" for "+attack);
on("change:" + attackFields.crit ,
TAS.callback(function eventAttackCrit(eventInfo){
if (eventInfo.sourceType==="player"){
@@ -19930,13 +20591,8 @@ var PFEventHandler = PFEventHandler || (function () {
}
})
);
- on("change:npc-hd-misc",
- TAS.callback(function eventNpcHdMisc(eventInfo) {
- TAS.debug("caught " + eventInfo.sourceAttribute + " event: " + eventInfo.sourceType);
- SWUtils.evaluateAndSetNumber("NPC-HD-misc", "NPC-HD-misc-mod");
- })
- );
-
+
+
//items
_.each(PFSheet.lists.wornEquipmentRows, function (row) {
_.each(PFSheet.lists.wornEquipmentColumns, function (column) {
@@ -20065,11 +20721,9 @@ var PFEventHandler = PFEventHandler || (function () {
var numberIdx = parseInt(spellClassIdx, 10)||0;
_.each(PFSheet.lists.spellcastingClassEventsPlayer, function (functions, event) {
var eventToWatch = event.replace(/REPLACE/g, numberIdx);
- TAS.notice("setting eventwatcher on "+ eventToWatch);
_.each(functions, function (methodToCall) {
on(eventToWatch,
TAS.callback(function eventSpellcasterClassSpecificUpdatePlayerOnly(eventInfo) {
- TAS.debug("BEFORE SOURCECHECK caught " + eventInfo.sourceAttribute + " event: " + eventInfo.sourceType);
if (eventInfo.sourceType === "player" ) {
TAS.debug("caught " + eventInfo.sourceAttribute + " event: " + eventInfo.sourceType);
PFSheet.ifSpellClassExists(numberIdx, function () {
@@ -20088,7 +20742,6 @@ var PFEventHandler = PFEventHandler || (function () {
_.each(functions, function (methodToCall) {
on(eventToWatch,
TAS.callback(function eventSpellcasterClassSpecificUpdateAuto(eventInfo) {
- TAS.debug("BEFORE SOURCECHECK caught " + eventInfo.sourceAttribute + " event: " + eventInfo.sourceType);
if (eventInfo.sourceType != "player" ) {
TAS.debug("caught " + eventInfo.sourceAttribute + " event: " + eventInfo.sourceType);
PFSheet.ifSpellClassExists(numberIdx, function () {
@@ -20119,7 +20772,6 @@ var PFEventHandler = PFEventHandler || (function () {
//all repeating spell updates
-
_.each(PFSheet.lists.repeatingSpellEventsPlayer, function (functions, eventToWatch) {
_.each(functions, function (methodToCall) {
on(eventToWatch,
@@ -20133,8 +20785,6 @@ var PFEventHandler = PFEventHandler || (function () {
});
});
-
-
_.each(PFSheet.lists.repeatingSpellEventsEither, function (functions, eventToWatch) {
_.each(functions, function (methodToCall) {
on(eventToWatch,
@@ -20196,6 +20846,15 @@ var PFEventHandler = PFEventHandler || (function () {
})
);
});
+ on("change:repeating_weapon:total-damage change:repeating_weapon:total-attack",
+ TAS.callback(function eventUpdateAttackTotalOption(eventInfo) {
+ if (eventInfo.sourceType!=="player"){
+ TAS.debug("caught " + eventInfo.sourceAttribute + " event: " + eventInfo.sourceType);
+ PFSheet.resetAttackOptions(null,eventInfo);
+ }
+ })
+ );
+
//attack options
_.each(PFSheet.lists.attackToggles, function(toggleField) {
@@ -20224,16 +20883,17 @@ var PFEventHandler = PFEventHandler || (function () {
);
});
//reset based on config changes
- on("change:unchained_skills-show change:BG-Skill-Use",
+ 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" ) {
PFSheet.recalc.recalculateSkills();
+ PFSheet.updateSkillMacros(eventInfo);
}
})
);
- on("remove:repeating_weapon change:repeating_weapon:attack-type change:_reporder_repeating_weapon", function(eventInfo) {
+ on("remove:repeating_weapon change:repeating_weapon:attack-type change:_reporder_repeating_weapon change:include_attack_totals", function(eventInfo) {
if (eventInfo.sourceType==="player"){
TAS.debug("caught " + eventInfo.sourceAttribute + " event: " + eventInfo.sourceType);
PFSheet.updateAttackMacros();
@@ -20260,18 +20920,6 @@ var PFEventHandler = PFEventHandler || (function () {
PFSheet.expandAll();
}
});
-
- on("change:pagetab change:abilities_tab change:skills_tab change:spellclass_tab change:spells_tab change:npc_spellclass_tab",function(eventInfo){
- TAS.log("caught " + eventInfo.sourceAttribute + " event: " + eventInfo.sourceType);
- getAttrs(["pagetab","abilities_tab","skills_tab","spellclass_tab","spells_tab","npc_spellclass_tab"],function(v){
- TAS.log("caught tab change, current values are:", v);
- });
- });
-
- on("change:conditions-show change:buffstop-show change:character-details-show change:ability-scores-show change:health-and-wounds-show change:initiative-and-speeds-show change:experience-and-hero-points-show change:class-info-show change:mythic-info-show change:psionic-info-show change:abilities-show change:feats-expand-show change:feat-column-show change:class-ability-expand-show change:class-ability-column-show change:racial-trait-expand-show change:racial-trait-column-show change:traits-expand-show change:traits-column-show change:defense-values-show change:special-defenses-show change:armor-penalties-show change:saves-show change:armor-shield-show change:defense-notes-show change:attack-bonuses-show change:attack-notes-show change:attack-options-show change:attacks-show change:attacks-expand-show change:weapon-column-show change:skills-show change:skill-ranks-show change:skill-notes-show change:misc-show change:artistry-show change:knowledge-show change:lore-show change:perform-show change:profession-show change:currency-show change:worn-equipment-show change:inventory-show change:carried-weight-show change:loads-show change:spellclasses-show change:spelloptions-show change:newspells-show change:domains-show change:spellsPerDay-show change:spell_ranges-show",
- function(eventInfo){
- TAS.log("caught " + eventInfo.sourceAttribute + " event: " + eventInfo.sourceType);
- });
}());
\ No newline at end of file
diff --git a/Pathfinder-Neceros/translation.json b/Pathfinder-Neceros/translation.json
index 8f1981f0dd..5a77147dec 100644
--- a/Pathfinder-Neceros/translation.json
+++ b/Pathfinder-Neceros/translation.json
@@ -1,4 +1,16 @@
{
+ "cs-athletics": "Athletics",
+ "cs-acrobatics": "Acrobatics",
+ "cs-finesse": "Finesse",
+ "cs-influence": "Influence",
+ "cs-nature": "Nature",
+ "cs-perception": "Perception",
+ "cs-performance": "Performance",
+ "cs-religion": "Religion",
+ "cs-society": "Society",
+ "cs-spellcraft": "Spellcraft",
+ "cs-stealth": "Stealth",
+ "cs-survival": "Survival",
"buffs-conditions-section":"Buffs and Conditions",
"1-ordinal": "1st",
"10-ordinal": "10th",
@@ -27,19 +39,20 @@
"additional-modifier-or-macro-(eg [[1d6]][investigator])": "Additional modifier or macro (eg [[1d6]][investigator]).",
"adjustment-abbrv": "Adj",
"adventure": "Adventure",
+ "adventure-skills": "Adventure Skills",
"age": "Age",
"alignment": "Alignment",
"all": "All",
"all-attacks": "All Attacks",
- "all-attacks-insert-macro-attack": "Global Attack Insert Macro:",
- "all-attacks-insert-macro-cmb": "CMB Attack Insert Macro:",
- "all-attacks-insert-macro-cmb-damage": "CMB Damage Insert Macro:",
- "all-attacks-insert-macro-damage": "Global Damage Insert Macro:",
- "all-attacks-insert-macro-melee": "Melee Attack Insert Macro:",
- "all-attacks-insert-macro-melee-damage": "Melee Damage Insert Macro:",
- "all-attacks-insert-macro-ranged": "Ranged Attack Insert Macro:",
- "all-attacks-insert-macro-ranged-damage": "Ranged Damage Insert Macro:",
- "all-attacks-macro-insert-section": "All Attacks Macros",
+ "all-attacks-insert-macro-attack": "Add to Attack Roll macro",
+ "all-attacks-insert-macro-cmb": "Add to CMB Roll macro",
+ "all-attacks-insert-macro-cmb-damage": "Add to CMB Dmg macro",
+ "all-attacks-insert-macro-damage": "Add to Dmg macro",
+ "all-attacks-insert-macro-melee": "Add to Melee Attack Roll macro",
+ "all-attacks-insert-macro-melee-damage": "Add to Melee Dmg macro",
+ "all-attacks-insert-macro-ranged": "Add to Ranged Attack Roll macro",
+ "all-attacks-insert-macro-ranged-damage": "Add to Ranged Dmg macro",
+ "all-attacks-macro-insert-section": "Attack Add-in Macros",
"all-skills": "All Skills",
"alternate-ability-cmb-desc": "Alternate ability combat maneuver",
"alternate-ability-melee-desc": "Alternate ability melee attack",
@@ -71,6 +84,13 @@
"announce-22": "Skill options added to Take 10 or Take 20 to skill rolls, and to add Investigator dice to rolls.",
"announce-23": "IF YOU USED SKILL TAKE 10 or TAKE 20 or INVESTIGATOR DICE DROPDOWN You must reset it by changing the dropdown values and changing them back.",
"announce-24": "Damage bonus fixed. Other fixes found at this link: http://tinyurl.com/PF-Thread",
+ "announce-25": "Skillbook button available on the skills page. Displays skill choices in chat area. Drag it to macro bar like other buttons.",
+ "announce-26": "GMs NOTE: NPC CHANGES COMING in v.70 of this sheet. Please do the following:",
+ "announce-27": "Preview changes at the beta site (link in post at 'feedbank' link in footer at bottom of this sheet). View the changes and give us feedback",
+ "announce-28": "IMPORT A MONSTER FROM YOUR CAMPAIGN to observe changes. Make sure your macros still work.",
+ "announce-29": "Drag a monster from the compendium and report any bugs at the feedback link below.",
+ "announce-30": "Make sure IS NPC is checked on all monster sheets. Starting with version .70 IS NPC will be a flag for the sheet to behave differently.",
+ "announce-31": "Non english speakers, please assist with translating this sheet. Details at the 'help translate' link in the footer.",
"announcements": "Announcements:",
"announcements-old": "Old Announcements:",
"appraise": "Appraise",
@@ -134,6 +154,7 @@
"aura": "Aura",
"azure": "Azure",
"background": "Background",
+ "background-skills": "Background Skills",
"background-ranks-remaining": "Background Ranks Remaining",
"base": "Base",
"base-attack-bonus": "Base Attack Bonus",
@@ -145,6 +166,7 @@
"before-combat": "Before Combat",
"before-combat-place": "List any spells and/or abilities used before combat. His stats should reflect these spells.",
"belt:": "Belt:",
+ "biography": "Bio",
"black": "Black",
"black-default": "•Black",
"blank": "Blank",
@@ -419,6 +441,7 @@
"encumbrance-off-ground-title": "A character can lift as much as double his maximum load off the ground, but he or she can only stagger around with it",
"encumbrance-str-bonus-title": "Bonus to Strength score for carrying capacity only",
"energy-drained": " Energy Drain",
+ "enforce-requires-training": "Enforce Requires Training?",
"enhancement-abbrv": "Enh",
"enhancement-bonus": "Enhancement Bonus",
"entangled": " Entangled",
@@ -480,6 +503,7 @@
"gear-used-place": "Gear used in combat",
"gender": "Gender",
"generic-roll-template": "Generic Roll Template ",
+ "global": "Global",
"gold-pieces-abbrv": " GP",
"grappled": " Grappled",
"grazed": " Grazed ",
@@ -524,6 +548,7 @@
"immunities": " Immunities",
"immunities-title": "Takes no damage from listed sources. (e.g. acid, fire, paralysis)",
"include-attack-notes": "Include notes or images in attack rolls? Notes and image will be mapped to attack type.",
+ "include-attack-totals": "Include Attack Totals?",
"include-attacks-?": "Include Attack?",
"include-eighth-attack": "Include an 8th attack?",
"include-fifth-attack": "Include a 5th attack?",
@@ -535,6 +560,8 @@
"include-second-attack": "Include a 2nd attack?",
"include-seventh-attack": "Include a 7th attack?",
"include-sixth-attack": "Include a 6th attack?",
+ "include-skill-notes": "Include Skill notes?",
+ "include-skill-totals": "Include Skill Totals?",
"include-third-attack": "Include a 3rd attack?",
"influence": "Influence",
"initiative": "Initiative",
@@ -542,8 +569,8 @@
"initiative-and-speeds": "Initiative and Speeds",
"initiative-notes": " Initiative Notes",
"initiative-notes-title": "Include initiative notes with roll.",
- "insert-macro-attack": "Attack Insert Macro:",
- "insert-macro-damage": "Damage Insert Macro:",
+ "insert-macro-attack": "'Add to Attack' Macro:",
+ "insert-macro-damage": "'Add to Damage' Macro:",
"intelligence-abbrv": "INT",
"intelligence-abbrv-default": "•INT",
"intelligence-calculation-abbrv": "INT Calc",
@@ -568,6 +595,14 @@
"knowledge-nobility": "Knowledge (Nobility)",
"knowledge-planes": "Knowledge (Planes)",
"knowledge-religion": "Knowledge (Religion)",
+ "arcana": "Arcana",
+ "dungeoneering": "Dungeoneering",
+ "engineering": "Engineering",
+ "geography": "Geography",
+ "history": "History",
+ "local": "Local",
+ "nobility": "Nobility",
+ "planes": "Planes",
"known-or-special": "Known / Specialties",
"languages": "Languages",
"legs-title": "How many legs the character has. Affects carrying capacity",
@@ -637,6 +672,7 @@
"miscellaneous-bonus": "Misc Bonus",
"miscellaneous-macro-abbrv": "Misc Macro",
"miscellaneous-skill-abbrv": "Misc Skill",
+ "misc-skill": "Misc Skill",
"modifier-2-abbrv": "Mod2",
"modifier-abbrv": "Mod",
"morale": "Morale",
@@ -696,6 +732,7 @@
"not-applicable-abbrv-default": "•N/A",
"not-carried": "Not Carried",
"notes": "Notes",
+ "no-skills-available": "No Skills Available",
"npc": "NPC",
"npc-experience-points-abbrv": "XP",
"npc-feats-text": "Feats from compendium",
@@ -902,6 +939,7 @@
"skill-ranks": "Skill Ranks",
"skill-size-modifier": "Skill",
"skill-size-title": "Size adjustment for skills. Double for stealth",
+ "skill-untrained": "Skill is untrained",
"skills": "Skills",
"skills-per-level": "Skill Ranks per level due to Class only",
"skills-per-level-abbrv": "Skills /lvl",