diff --git a/acks/npc/npc_party.py b/acks/npc/npc_party.py index 47cfe5e..8367747 100644 --- a/acks/npc/npc_party.py +++ b/acks/npc/npc_party.py @@ -106,9 +106,6 @@ def select_spell_list(npc, data): level_set.add(choice(overall_spell_list[level]).id) npc_spell_list.extend(level_set) - # FOR DEBUG XXX NOTE - npc_spell_list.append(106) - return ','.join(str(sid) for sid in npc_spell_list) def calc_hp(conmod, hit_die_size, level): diff --git a/roll20/base64.js b/roll20/base64.js new file mode 100644 index 0000000..f956b3a --- /dev/null +++ b/roll20/base64.js @@ -0,0 +1,144 @@ +// Github: https://github.com/shdwjk/Roll20API/blob/master/Base64/Base64.js +// By: The Aaron, Arcane Scriptomancer +// Contact: https://app.roll20.net/users/104025/the-aaron +// modified from: http://www.webtoolkit.info/ + +const Base64 = (() => { // eslint-disable-line no-unused-vars + const version = '0.3.2'; + const lastUpdate = 1576507905; + const keyStr = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="; + + const checkInstall = () => { + log('-=> Base64 v'+version+' <=- ['+(new Date(lastUpdate*1000))+']'); + }; + + // private method for UTF-8 encoding + const utf8_encode = (string) => { + let utftext = ''; + + for (let n = 0; n < string.length; n++) { + + let c1 = string.charCodeAt(n); + + if (c1 < 128) { + utftext += String.fromCharCode(c1); + } + else if((c1 > 127) && (c1 < 2048)) { + utftext += String.fromCharCode((c1 >> 6) | 192); + utftext += String.fromCharCode((c1 & 63) | 128); + } + else { + utftext += String.fromCharCode((c1 >> 12) | 224); + utftext += String.fromCharCode(((c1 >> 6) & 63) | 128); + utftext += String.fromCharCode((c1 & 63) | 128); + } + + } + + return utftext; + }; + + // private method for UTF-8 decoding + const utf8_decode = (utftext) => { + let string = ''; + let i = 0; + + while ( i < utftext.length ) { + + let c1 = utftext.charCodeAt(i); + + if (c1 < 128) { + string += String.fromCharCode(c1); + i++; + } + else if((c1 > 191) && (c1 < 224)) { + let c2 = utftext.charCodeAt(i+1); + string += String.fromCharCode(((c1 & 31) << 6) | (c2 & 63)); + i += 2; + } + else { + let c2 = utftext.charCodeAt(i+1); + let c3 = utftext.charCodeAt(i+2); + string += String.fromCharCode(((c1 & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63)); + i += 3; + } + } + return string; + }; + + const encode = (input) => { + let output = ''; + let i = 0; + + input = utf8_encode(input); + + while (i < input.length) { + + let chr1 = input.charCodeAt(i++); + let chr2 = input.charCodeAt(i++); + let chr3 = input.charCodeAt(i++); + + let enc1 = chr1 >> 2; + let enc2 = ((chr1 & 3) << 4) | (chr2 >> 4); + let enc3 = ((chr2 & 15) << 2) | (chr3 >> 6); + let enc4 = chr3 & 63; + + if (isNaN(chr2)) { + enc3 = enc4 = 64; + } else if (isNaN(chr3)) { + enc4 = 64; + } + + output = output + + keyStr.charAt(enc1) + keyStr.charAt(enc2) + + keyStr.charAt(enc3) + keyStr.charAt(enc4); + } + + return output; + }; + + // public method for decoding + const decode = (input) => { + let output = ''; + let i = 0; + + input = input.replace(/[^A-Za-z0-9+/=]/g, ""); + + while (i < input.length) { + + let enc1 = keyStr.indexOf(input.charAt(i++)); + let enc2 = keyStr.indexOf(input.charAt(i++)); + let enc3 = keyStr.indexOf(input.charAt(i++)); + let enc4 = keyStr.indexOf(input.charAt(i++)); + + let chr1 = (enc1 << 2) | (enc2 >> 4); + let chr2 = ((enc2 & 15) << 4) | (enc3 >> 2); + let chr3 = ((enc3 & 3) << 6) | enc4; + + output = output + String.fromCharCode(chr1); + + if (enc3 !== 64) { + output = output + String.fromCharCode(chr2); + } + if (enc4 !== 64) { + output = output + String.fromCharCode(chr3); + } + + } + + output = utf8_decode(output); + + return output; + + }; + + on("ready",()=>{ + checkInstall(); + }); + + return { + encode: encode, + decode: decode + }; + +})(); diff --git a/roll20/char_sheet.css b/roll20/char_sheet.css index f227587..439d5b0 100644 --- a/roll20/char_sheet.css +++ b/roll20/char_sheet.css @@ -120,7 +120,7 @@ div.sheet-currency-grid { } div.sheet-spells-grid { display: grid; - grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr 1fr; + grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr 1fr; row-gap: 5px; column-gap: 10px; margin-bottom: 5px; @@ -207,7 +207,7 @@ input.sheet-spells-input { grid-column: 1 / span 2; } .sheet-grid-span-4-2 { - grid-column: 4 / span 2; + grid-column: 4 / span 3; } input.sheet-input-big { width: 55px!important; @@ -250,7 +250,7 @@ input.sheet-input-big { } .sheet-spells-title { text-align: center; - grid-column: 1 / span 7; + grid-column: 1 / span 9; } .sheet-exp-title { text-align: center; diff --git a/roll20/char_sheet.html b/roll20/char_sheet.html index f8d3199..a6fdcfa 100644 --- a/roll20/char_sheet.html +++ b/roll20/char_sheet.html @@ -284,7 +284,7 @@