diff --git a/Table Top Defined/Table_Top_Defined.css b/Table Top Defined/Table_Top_Defined.css
index 14d37b02cc5..7ec4d88be92 100644
--- a/Table Top Defined/Table_Top_Defined.css
+++ b/Table Top Defined/Table_Top_Defined.css
@@ -397,12 +397,12 @@
.ggrid{
display: grid;
- grid-template-columns: repeat(auto-fit, auto);
+ grid-auto-columns: auto;
}
.ggridc{
display: grid;
- grid-template-rows: repeat(auto-fit, auto);
+ grid-auto-rows: auto;
}
/*End General Grid -- End*/
@@ -920,6 +920,7 @@ input.sptoggle[value="1"] ~ .sheet-repeating-fields{
.minimizable-repeat-spells .spells_description{
width: 388px;
+ overflow: clip;
background-color: #FFFFFF;
color: #000000;
border: 1px solid black;
@@ -929,11 +930,12 @@ input.sptoggle[value="1"] ~ .sheet-repeating-fields{
display: none;
grid-template-columns: 50% 50%;
padding: 0;
- grid-template-rows: auto auto;
+ grid-template-rows: auto auto auto;
gap: 1px 1px;
grid-template-areas:
"Details-1 Details-2"
- "Description Description";
+ "Description Description"
+ "Advanced Advanced";
}
.minimizable-repeat-spells .spells-toggle[value="1"] ~ div.spells_description{
@@ -1021,6 +1023,14 @@ input.sptoggle[value="1"] ~ .sheet-repeating-fields{
padding: 0;
}
+.minimizable-repeat-spells .spells_description .Advanced {
+ grid-area: Advanced;
+}
+
+.minimizable-repeat-spells .spells_description .spells-advanced-toggle[value="1"] ~ div.grr2.ggridc{
+ display: none;
+}
+
/**/
@@ -1307,7 +1317,7 @@ input.sptoggle[value="1"] ~ .sheet-repeating-fields{
}
.ui-dialog .charsheet .sheet-gear .weapon-name{
- background-color: #323232;
+ background-color: #000000;
color: #FFFFFF;
text-align: center;
font-weight: bold;
@@ -1335,6 +1345,11 @@ input.sptoggle[value="1"] ~ .sheet-repeating-fields{
display: none;
}
+.sheet-gear .ggridc .grr1.ggrid .advancedweapon-toggle[value="0"] ~ .advancedweapon-shrink{
+ display: none;
+}
+
+
.sheet-gear .grr7{
grid-template-columns: repeat(2,1fr);
}
diff --git a/Table Top Defined/Table_Top_Defined.html b/Table Top Defined/Table_Top_Defined.html
index 498fafd7c75..c4e38035e97 100644
--- a/Table Top Defined/Table_Top_Defined.html
+++ b/Table Top Defined/Table_Top_Defined.html
@@ -1,27 +1,3 @@
-
-
-
-
-
- {{#allprops() title subtitle desc color}}
-
{{key}}
-
{{value}}
- {{/allprops() title subtitle desc color}}
- {{#desc}}
-
{{desc}}
- {{/desc}}
-
-
-
-
-
@@ -280,21 +256,21 @@
Save
Save
@@ -352,42 +328,42 @@
@@ -419,7 +395,7 @@
@@ -752,7 +728,7 @@
Spell Casting
Medium Range:
Long:
-
+
@@ -766,7 +742,7 @@
Spell Casting
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
-
+
@@ -1474,7 +1670,7 @@ Spell Casting
|
|
|
@@ -1489,7 +1685,7 @@ Spell Casting
|
|
|
@@ -1504,7 +1700,7 @@ Spell Casting
|
|
|
@@ -1519,7 +1715,7 @@ Spell Casting
|
|
|
@@ -1534,7 +1730,7 @@ Spell Casting
|
|
|
@@ -1549,7 +1745,7 @@ Spell Casting
|
|
|
@@ -1564,7 +1760,7 @@ Spell Casting
|
|
|
@@ -1579,7 +1775,7 @@ Spell Casting
|
|
|
@@ -1594,7 +1790,7 @@ Spell Casting
|
|
|
@@ -1609,7 +1805,7 @@ Spell Casting
|
|
|
@@ -1624,7 +1820,7 @@ Spell Casting
|
|
|
@@ -1639,7 +1835,7 @@ Spell Casting
|
|
|
@@ -1654,7 +1850,7 @@ Spell Casting
|
|
|
@@ -1669,7 +1865,7 @@ Spell Casting
|
|
|
@@ -1684,7 +1880,7 @@ Spell Casting
|
|
|
@@ -1699,7 +1895,7 @@ Spell Casting
|
|
|
@@ -1714,7 +1910,7 @@ Spell Casting
|
|
|
@@ -1729,7 +1925,7 @@ Spell Casting
|
|
|
@@ -1744,7 +1940,7 @@ Spell Casting
|
|
|
@@ -1759,7 +1955,7 @@ Spell Casting
|
|
|
@@ -1774,7 +1970,7 @@ Spell Casting
|
|
|
@@ -1789,7 +1985,7 @@ Spell Casting
|
|
|
@@ -1804,7 +2000,7 @@ Spell Casting
|
|
|
@@ -1819,7 +2015,7 @@ Spell Casting
|
|
|
@@ -1834,7 +2030,7 @@ Spell Casting
|
|
|
@@ -1849,7 +2045,7 @@ Spell Casting
|
|
|
@@ -1864,7 +2060,7 @@ Spell Casting
|
|
|
@@ -1879,7 +2075,7 @@ Spell Casting
|
|
|
@@ -1894,7 +2090,7 @@ Spell Casting
|
|
|
@@ -1909,7 +2105,7 @@ Spell Casting
|
|
|
@@ -1923,7 +2119,7 @@ Spell Casting
|
|
|
@@ -1938,7 +2134,7 @@ Spell Casting
|
|
|
@@ -1953,7 +2149,7 @@ Spell Casting
|
|
|
@@ -1968,7 +2164,7 @@ Spell Casting
|
|
|
@@ -1983,7 +2179,7 @@ Spell Casting
|
|
|
@@ -1998,7 +2194,7 @@ Spell Casting
|
|
|
@@ -2013,7 +2209,7 @@ Spell Casting
|
|
|
@@ -2028,7 +2224,7 @@ Spell Casting
|
|
|
@@ -2043,7 +2239,7 @@ Spell Casting
|
|
|
@@ -2067,7 +2263,7 @@ Spell Casting
Armor Bonus
AC Dex Limit
Skill Penalty
-
+
+
-
+
-
-
+
+
-
-
+
+
+
+
+ Advanced
+
+
+
+
+
+
Weapon Grand Master Bonus
+
+ None
+
+
+ 2nd
+
+
+ 3rd
+
+
+ 4th
+
+
+
-
+
@@ -2525,6 +2768,30 @@ Spell Casting
+
+
+
+
+
+ {{#allprops() title subtitle desc color}}
+
{{key}}
+
{{value}}
+ {{/allprops() title subtitle desc color}}
+ {{#desc}}
+
{{desc}}
+ {{/desc}}
+
+
+
+
+
@@ -2536,7 +2803,7 @@ Spell Casting
//
on("change:repeating_maininventory remove:repeating_maininventory", function(){
- getSectionIDs("repeating_maininventory",function(array){
+ getSectionIDs("repeating_maininventory",function(array){ //getting the section IDs
let AttrsToGet = [];
for (let arrayID of array){
AttrsToGet.push(`repeating_maininventory_${arrayID}_maintotalweight`);
@@ -3590,7 +3857,7 @@ Spell Casting
const WeaponCol = [1,2]
WeaponCol.forEach(col => {
- const maxMinWeaponList = ["weaponminimize","critconfirmminimize"];
+ const maxMinWeaponList = ["weaponminimize","critconfirmminimize","advancedweaponminimize"];
maxMinWeaponList.forEach(button => {
on(`clicked:repeating_weapons${col}:${button}`, function() {
getAttrs([`repeating_weapons${col}_${button}toggle`], function(v) {
@@ -3616,16 +3883,18 @@ Spell Casting
});
});
+ const advancedMin = ["","advanced"];
const maxMinSpellList = ["0_spell0minimize","1_spell1minimize","2_spell2minimize","3_spell3minimize","4_spell4minimize","5_spell5minimize",
"6_spell6minimize","7_spell7minimize","8_spell8minimize","9_spell9minimize"];
- maxMinSpellList.forEach(button => {
- on(`clicked:repeating_spells-${button.replace("_",":")}`, function() {
- getAttrs([`repeating_spells-${button}toggle`], function(v) {
- let toSetAttrs = {};
- toSetAttrs[`repeating_spells-${button}toggle`] = 1 - parseInt(v[`repeating_spells-${button}toggle`]);
- setAttrs(toSetAttrs);
- });
- });
+ advancedMin.forEach(subbutton => { maxMinSpellList.forEach(button => {
+ on(`clicked:repeating_spells-${button.replace("_", ":")}${subbutton}`, function () {
+ getAttrs([`repeating_spells-${button}${subbutton}toggle`], function (v) {
+ let toSetAttrs = {};
+ toSetAttrs[`repeating_spells-${button}${subbutton}toggle`] = 1 - parseInt(v[`repeating_spells-${button}${subbutton}toggle`]);
+ setAttrs(toSetAttrs);
+ });
+ });
+ });
});
//
@@ -3785,6 +4054,122 @@ Spell Casting
//
+ //Block of Constants used by the sheet for spell casting
+ const BasicMagicSPD = [ /*Vertical Index is 0 - 19 || Horizontal index is 0 - 3 */
+ [null,null,null,null],
+ [0,null,null,null],
+ [1,null,null,null],
+ [1,null,null,null],
+ [2,null,null,null],
+ [2,0,null,null],
+ [2,1,null,null],
+ [2,1,null,null],
+ [2,1,null,null],
+ [3,2,0,null],
+ [3,2,1,null],
+ [3,2,1,null],
+ [3,2,1,null],
+ [3,3,1,0],
+ [4,3,1,1],
+ [4,3,2,1],
+ [4,4,2,1],
+ [4,4,2,2],
+ [4,4,2,2],
+ [5,4,2,2]
+ ];
+ const StandardMagicSPD = [ /*Vertical Index is 0 - 19 || Horizontal index is 0 - 5 */
+ [0,null,null,null,null,null],
+ [1,null,null,null,null,null],
+ [2,0,null,null,null,null],
+ [3,1,null,null,null,null],
+ [3,2,0,null,null,null],
+ [3,2,1,null,null,null],
+ [3,2,2,0,null,null],
+ [4,2,2,1,null,null],
+ [4,3,2,2,null,null],
+ [4,3,2,2,0,null],
+ [4,3,3,2,1,null],
+ [5,3,3,2,2,null],
+ [5,4,3,3,2,0],
+ [5,4,3,3,2,1],
+ [5,4,4,3,2,2],
+ [5,4,4,3,3,2],
+ [5,5,4,4,3,2],
+ [5,5,4,4,3,2],
+ [5,5,5,4,3,3],
+ [5,5,5,4,4,3]
+ ];
+ const AdvancedMagicSPD = [ /*Vertical Index is 0 - 19 || Horizontal index is 0 - 8 */
+ [2,null,null,null,null,null,null,null,null],
+ [3,null,null,null,null,null,null,null,null],
+ [3,1,null,null,null,null,null,null,null],
+ [3,2,null,null,null,null,null,null,null],
+ [4,2,1,null,null,null,null,null,null],
+ [4,3,2,null,null,null,null,null,null],
+ [4,3,2,1,null,null,null,null,null],
+ [4,3,3,2,null,null,null,null,null],
+ [5,4,3,2,1,null,null,null,null],
+ [5,4,3,3,2,null,null,null,null],
+ [5,4,4,3,3,1,null,null,null],
+ [5,4,4,3,3,2,null,null,null],
+ [5,5,4,4,3,2,1,null,null],
+ [5,5,4,4,4,3,2,null,null],
+ [5,5,5,4,4,3,2,1,null],
+ [5,5,5,4,4,3,3,2,null],
+ [5,5,5,5,4,4,3,2,1],
+ [5,5,5,5,5,4,4,3,2],
+ [5,5,5,5,5,4,4,4,3],
+ [5,5,5,5,5,5,5,5,4]
+ ];
+ const SpellsPerDayLevel = [1,2,3,4,5,6,7,8,9];
+ const SpellMacroLevel = [0,1,2,3,4,5,6,7,8,9];
+
+ SpellsPerDayLevel.forEach(level => { //setting the spells per day
+ on(`change:hd change:magiccurve sheet:opened change:pma change:dexmod change:strmod `+
+ `change:intmod change:wismod change:chamod`, function () {
+ getAttrs(["HD", "PMA", "MagicCurve","strmod","dexmod","wismod","intmod","chamod"], function (values) {
+ let HD = parseInt(values.HD)||1;
+ let PMA;
+ switch(values.PMA){
+ case "@{strmod}" :
+ PMA = values.strmod;
+ break;
+ case "@{dexmod}":
+ PMA = values.dexmod;
+ break;
+ case "@{wismod}" :
+ PMA = values.wismod;
+ break;
+ case "@{intmod}" :
+ PMA = values.intmod;
+ break;
+ case "@{chamod}" :
+ PMA = values.chamod;
+ break;
+ }
+ let HDSpellsPerDay = null;
+ let bonusspell = Math.max(Math.ceil((PMA + 1 - level)/4),0);
+ switch (values.MagicCurve){
+ case "Basic":
+ HDSpellsPerDay = BasicMagicSPD[HD-1][level-1]; /*[ArrayID 1][ArrayID 2]*/
+ break;
+ case "Standard":
+ HDSpellsPerDay = StandardMagicSPD[HD-1][level-1];
+ break;
+ case "Advanced":
+ HDSpellsPerDay = AdvancedMagicSPD[HD-1][level-1];
+ break;
+ }
+ let FinalSPD;
+ if(HDSpellsPerDay === null) FinalSPD = 0;
+ else FinalSPD = HDSpellsPerDay + bonusspell;
+ toSetAttrs = {};
+ toSetAttrs[`${level}perday`] = FinalSPD
+ setAttrs(toSetAttrs);
+ });
+ });
+ });
+
on(`change:hd change:magiccurve sheet:opened`,function(){
getAttrs(["HD","MagicCurve"], function(values){
let HD = parseFloat(values.HD)||0;
@@ -3801,22 +4186,24 @@ Spell Casting
});
});
- const SpellMacroLevel = [0,1,2,3,4,5,6,7,8,9];
+
SpellMacroLevel.forEach(level => {
- on(`change:repeating_spells-${level}:spellsaving change:repeating_spells-${level}:category change:repeating_spells`+
+ on(`change:repeating_spells-${level}:spellsaving change:repeating_spells-${level}:category change:repeating_spells change:repeating_spells-${level}:savesucces `+
`change:repeating_spells-${level}:harmless change:repeating_spells-${level}:sr change:repeating_spells-${level}:spell${level}minimizetoggle `+
- `change:repeating_spells-${level}:minimizetoggle change:repeating_spells-${level}:spellname`, function () {
- getAttrs([`repeating_spells-${level}_spellsaving`,`repeating_spells-${level}_category`,
- `repeating_spells-${level}_harmless`, `repeating_spells-${level}_sr`],
+ `change:repeating_spells-${level}:minimizetoggle change:repeating_spells-${level}:spellname change:repeating_spells-${level}:spelldcmod`, function () {
+ getAttrs([`repeating_spells-${level}_spellsaving`,`repeating_spells-${level}_category`,`repeating_spells-${level}_savesucces`,
+ `repeating_spells-${level}_harmless`, `repeating_spells-${level}_sr`,`repeating_spells-${level}_spelldcmod`],
function (values) {
let save = values[`repeating_spells-${level}_spellsaving`];
+ let savesuccess = values[`repeating_spells-${level}_savesucces`];
+ let dcmod = parseInt(values[`repeating_spells-${level}_spelldcmod`])||0;
let type = values[`repeating_spells-${level}_category`];
let harmless = values[`repeating_spells-${level}_harmless`];
let spell_resistance = values[`repeating_spells-${level}_sr`];
let macro = `&{template:custom}{{title=@{spellname}}}{{subtitle=@{school}}}{{Components=@{components}}}`+
`{{Range=@{range}}}{{Casting Time=@{castingtime}}}{{Effect=@{effect}}}{{Duration=@{duration}}}`;
if (save !== "No") {
- macro = macro + `{{${save} save= DC [[10+@{PMA}+${level}+@{SpellProf}]]${harmless.replace(`0`,``)}}}`;
+ macro = macro + `{{${save} save= DC [[10+${dcmod}+@{PMA}+${level}+@{SpellProf}]]${savesuccess}${harmless.replace(`0`,``)}}}`;
}
if(type !== "0") {
macro = macro + `{{${type}=[[@{dicenum}@{dicetype}+(@{dicenum}*@{SpellProf})]]}}`;
@@ -3867,7 +4254,7 @@ Spell Casting
let type = (values.repeating_abilities_abilitytype);
let sr = (values.repeating_abilities_abilitysrconfirm);
let SpellProf = (values.repeating_abilities_asprof);
- let Macro = `&{template:custom}{{title=@{abilityname}}}{{subtitle=@{charname}}}{{Range=@{abilityrange}}}`+
+ let Macro = `&{template:custom}{{title=@{abilityname}}}{{subtitle=@{character_name}}}{{Range=@{abilityrange}}}`+
`{{Target=@{abilitytarget}}}{{Duration=@{abilityduration}}}`;
if(savethrow !== "N/A"){
Macro = Macro + `{{${savethrow} save=@{abilitydc}}}`;
@@ -3925,17 +4312,31 @@ Spell Casting
});
});
+ // WeaponCol.forEach(col =>{
+ // on(`change:repeating_weapons${col}:grandmaster change:repeating_weapons${col}:weaponminimize` +
+ // `change:repeating_weapons${col}:weaponhaste`,function(){
+ // getAttrs([`repeating_weapons${col}_grandmaster`],function(values){
+ // let grandmaster = parseFloat(values[`repeating_weapons${col}_grandmaster`]) || 0;
+ // if (grandmaster === 2){
+ // grandmaster =
+ // }
+ // })
+ // })
+ // })
+
WeaponCol.forEach(col => {
on(`change:repeating_weapons${col}:bonustoattack change:repeating_weapons${col}:weaponhaste change:repeating_weapons${col}:weaponslow` +
` change:repeating_weapons${col}:critlow change:repeating_weapons${col}:weaponbab change:repeating_weapons${col}:weaponminimize` +
- ` change:repeating_weapons${col}:enhancetoattack`, function(){
+ ` change:repeating_weapons${col}:enhancetoattack change:repeating_weapons${col}:grandmaster`, function(){
getAttrs([`repeating_weapons${col}_bonustoattack`,`repeating_weapons${col}_critlow`,`repeating_weapons${col}_weaponhaste`
- ,`repeating_weapons${col}_weaponbab`,`repeating_weapons${col}_weaponslow`,`repeating_weapons${col}_enhancetoattack`],function(values){
+ ,`repeating_weapons${col}_weaponbab`,`repeating_weapons${col}_weaponslow`,`repeating_weapons${col}_enhancetoattack`,
+ `repeating_weapons${col}_grandmaster`],function(values){
let featbonus = values[`repeating_weapons${col}_bonustoattack`] || 0;
let enhance = parseFloat(values[`repeating_weapons${col}_enhancetoattack`]) || 0;
let mincrit = parseFloat(values[`repeating_weapons${col}_critlow`]) || 0;
+ let grandmaster = parseFloat(values[`repeating_weapons${col}_grandmaster`]) || 0;
let BAB = parseFloat(values[`repeating_weapons${col}_weaponbab`]);
- let Macro = `&{template:custom}{{title=Attack(s)}}{{subtitle=@{charname}'s @{weaponname}}}`+
+ let Macro = `&{template:custom}{{title=Attack(s)}}{{subtitle=@{character_name}'s @{weaponname}}}`+
`{{First Attack=[[1d20cs>${mincrit}+${BAB}[Base Attack]+@{weapontohit}[Key Attribute]+${featbonus}[Feat Bonuses]+${enhance}[Enhancement]+(0?{`+
`Do you have any miscellaneous bonuses?|0})]]}}`;
if(values[`repeating_weapons${col}_weaponhaste`] === `1`){
@@ -3947,14 +4348,26 @@ Spell Casting
Macro = Macro + `{{Second Attack=[[1d20cs>${mincrit}+${BAB - 5}[Base Attack]+@{weapontohit}[Key Attribute]` +
`+${featbonus}[Feat Bonuses]+${enhance}[Enhancement]+(0?{Do you have any miscellaneous bonuses?|0})]]}}`;
}
+ if (grandmaster === 2){
+ Macro = Macro + `{{Second Attack=[[1d20cs>${mincrit}+${BAB}[Base Attack]+@{weapontohit}[Key Attribute]` +
+ `+${featbonus}[Feat Bonuses]+${enhance}[Enhancement]+(0?{Do you have any miscellaneous bonuses?|0})]]}}`;
+ }
if (BAB - 10 > 0) {
Macro = Macro + `{{Third Attack=[[1d20cs>${mincrit}+${BAB - 10}[Base Attack]+@{weapontohit}[Key Attribute]` +
`+${featbonus}[Feat Bonuses]+${enhance}[Enhancement]+(0?{Do you have any miscellaneous bonuses?|0})]]}}`;
}
+ if (grandmaster === 3){
+ Macro = Macro + `{{Third Attack=[[1d20cs>${mincrit}+${BAB - 5}[Base Attack]+@{weapontohit}[Key Attribute]` +
+ `+${featbonus}[Feat Bonuses]+${enhance}[Enhancement]+(0?{Do you have any miscellaneous bonuses?|0})]]}}`;
+ }
if (BAB - 15 > 0) {
Macro = Macro + `{{Fourth Attack=[[1d20cs>${mincrit}+${BAB - 15}[Base Attack]+@{weapontohit}[Key Attribute]` +
`+${featbonus}[Feat Bonuses]+${enhance}[Enhancement]+(0?{Do you have any miscellaneous bonuses?|0})]]}}`;
}
+ if (grandmaster === 4){
+ Macro = Macro + `{{Fourth Attack=[[1d20cs>${mincrit}+${BAB - 10}[Base Attack]+@{weapontohit}[Key Attribute]` +
+ `+${featbonus}[Feat Bonuses]+${enhance}[Enhancement]+(0?{Do you have any miscellaneous bonuses?|0})]]}}`;
+ }
}
toSetAttrs = {};
toSetAttrs[`repeating_weapons${col}_fullattackroll`] = Macro;