L5R Sheets Script fix

All 3 L5R sheets had faulty sheet workers. Eacch script was in its own
script block, instead of having a single script block for all sheet
workers.
This commit is contained in:
G-G-G
2018-04-20 00:30:32 +01:00
parent 7bc679c385
commit a6ad859991
3 changed files with 154 additions and 154 deletions
+39 -39
View File
@@ -2630,21 +2630,22 @@
</tr>
</table>
</rolltemplate>
<script type="text/worker">
<!-- Rank Calculation Worker -->
//<!-- Rank Calculation Worker -->
<script type="text/worker">
on("sheet:opened change:Insight", function() {
getAttrs(["foo_insight"], function(values) {
setAttrs({ foo_rank: Math.max(1,Math.round((values.foo_insight - 112) / 25)) });
});
});
</script>
<!-- Insight Calculation Worker -->
//<!-- Insight Calculation Worker -->
<script type="text/worker">
var elements = ['foo_air', 'foo_earth', 'foo_fire', 'foo_water', 'foo_void'],
ranks = ['rank_acting', 'rank_artisan', 'rank_calligraphy', 'rank_courtier', 'rank_divination', 'rank_etiquette', 'rank_games', 'rank_investigation', 'rank_lore', 'rank_Lore2', 'rank_Lore3', 'rank_Medicine', 'rank_Meditation', 'rank_Perform', 'rank_Sincerity', 'rank_Spellcraft', 'rank_Tea_Ceremony', 'rank_rhigh', 'rank_Athletics', 'rank_Battle', 'rank_Defense', 'rank_Horsemanship', 'rank_Hunting', 'rank_Iaijutsu', 'rank_Jiujutsu', 'rank_Chain_Weapons', 'rank_Heavy_Weapons', 'rank_Kenjutsu', 'rank_Knives', 'rank_Kyujutsu', 'rank_Ninjutsu', 'rank_Polearms', 'rank_Spears', 'rank_Staves', 'rank_WarFan', 'rank_AnimalHandling', 'rank_Commerce', 'rank_Craft', 'rank_Engineering', 'rank_Sailing', 'rank_Forgery', 'rank_Intimidation', 'rank_SleightofHand', 'rank_Stealth', 'rank_Temptation', 'BCourtier', 'BEtiquette', 'add_insight'],
@@ -2681,12 +2682,12 @@
});
});
</script>
<!-- Ring Calculation Workers -->
//<!-- Ring Calculation Workers -->
<script type="text/worker">
on("sheet:opened change:reflexes change:awareness", function(eventInfo) {
getAttrs(["reflexes", "awareness"], function(values) {
@@ -2694,9 +2695,9 @@
});
});
</script>
<script type="text/worker">
on("sheet:opened change:stamina change:willpower", function(eventInfo) {
getAttrs(["stamina", "willpower"], function(values) {
@@ -2704,9 +2705,9 @@
});
});
</script>
<script type="text/worker">
on("sheet:opened change:agility change:intelligence", function(eventInfo) {
getAttrs(["agility", "intelligence"], function(values) {
@@ -2714,9 +2715,9 @@
});
});
</script>
<script type="text/worker">
on("sheet:opened change:strength change:perception", function(eventInfo) {
getAttrs(["strength", "perception"], function(values) {
@@ -2724,23 +2725,23 @@
});
});
</script>
<!-- Max Wounds Worker -->
//<!-- Max Wounds Worker -->
<script type="text/worker">
on("sheet:opened change:Out", function() {
getAttrs(["foo_out"], function(values) {
setAttrs({ Wounds_max: (values.foo_out) });
});
});
</script>
<!-- Wound Rank Workers -->
//<!-- Wound Rank Workers -->
<script type="text/worker">
on("sheet:opened change:foo_earth change:Bonus_wounds", function() {
getAttrs(["foo_earth", "Bonus_wounds"], function(values) {
@@ -2748,9 +2749,9 @@
});
});
</script>
<script type="text/worker">
on("sheet:opened change:foo_earth change:Lethality change:Bonus_wounds", function() {
getAttrs(["foo_earth", "Bonus_wounds", "Lethality"], function(values) {
@@ -2758,9 +2759,9 @@
});
});
</script>
<script type="text/worker">
on("sheet:opened change:foo_earth change:Lethality change:Bonus_wounds", function() {
getAttrs(["foo_earth", "Bonus_wounds", "Lethality"], function(values) {
@@ -2768,9 +2769,9 @@
});
});
</script>
<script type="text/worker">
on("sheet:opened change:foo_earth change:Lethality change:Bonus_wounds", function() {
getAttrs(["foo_earth", "Bonus_wounds", "Lethality"], function(values) {
@@ -2778,9 +2779,9 @@
});
});
</script>
<script type="text/worker">
on("sheet:opened change:foo_earth change:Lethality change:Bonus_wounds", function() {
getAttrs(["foo_earth", "Bonus_wounds", "Lethality"], function(values) {
@@ -2788,10 +2789,10 @@
});
});
</script>
<script type="text/worker">
on("sheet:opened change:foo_earth change:Lethality change:Bonus_wounds", function() {
getAttrs(["foo_earth", "Bonus_wounds", "Lethality"], function(values) {
@@ -2799,10 +2800,10 @@
});
});
</script>
<script type="text/worker">
on("sheet:opened change:foo_earth change:Lethality change:Bonus_wounds", function() {
getAttrs(["foo_earth", "Bonus_wounds", "Lethality"], function(values) {
@@ -2810,10 +2811,10 @@
});
});
</script>
<script type="text/worker">
on("sheet:opened change:foo_earth change:Lethality change:Bonus_wounds", function() {
getAttrs(["foo_earth", "Bonus_wounds", "Lethality"], function(values) {
@@ -2821,14 +2822,14 @@
});
});
</script>
<!-- Spell Ring Selection Worker -->
//<!-- Spell Ring Selection Worker -->
<script type="text/worker">
var elements = ['air', 'earth', 'fire', 'water', 'void'],
elementAttrs = [...elements.map(s => `foo_${s}`), ...elements.map(s => `${s}_affinity`)];
@@ -2941,12 +2942,11 @@ on('sheet:opened', function () {
});
});
});
</script>
<!-- Sheet Conversion Worker. -->
<script type="text/worker">
var convertFromOldSheet = function () {
// Non-repeating attributes to rename
+74 -74
View File
@@ -4485,10 +4485,10 @@ Version 0.8.3 Beta
<!-- Begin Sheet Workers -->
<script type="text/worker">
//<!-- Endurance Calculation Worker -->
<!-- Endurance Calculation Worker -->
<script type="text/worker">
on("sheet:opened change:earth change:water", function() {
getAttrs(["earth", "water"], function(values) {
@@ -4496,22 +4496,22 @@ Version 0.8.3 Beta
});
});
</script>
<!-- Max Fatigue Worker -->
//<!-- Max Fatigue Worker -->
<script type="text/worker">
on("sheet:opened change:foo_endurance", function() {
getAttrs(["foo_endurance"], function(values) {
setAttrs({ Fatigue_max: (values.foo_endurance) });
});
});
</script>
<!-- Endurance Calculation Worker -->
//<!-- Endurance Calculation Worker -->
<script type="text/worker">
on("sheet:opened change:earth change:fire", function() {
getAttrs(["earth", "fire"], function(values) {
@@ -4519,22 +4519,22 @@ Version 0.8.3 Beta
});
});
</script>
<!-- Max Strife Worker -->
//<!-- Max Strife Worker -->
<script type="text/worker">
on("sheet:opened change:foo_composure", function() {
getAttrs(["foo_composure"], function(values) {
setAttrs({ Strife_max: (values.foo_composure) });
});
});
</script>
<!-- Focus Calculation Worker -->
//<!-- Focus Calculation Worker -->
<script type="text/worker">
on("sheet:opened change:air change:fire", function() {
getAttrs(["air", "fire"], function(values) {
@@ -4542,11 +4542,11 @@ Version 0.8.3 Beta
});
});
</script>
<!-- Vigilance Calculation Worker -->
//<!-- Vigilance Calculation Worker -->
<script type="text/worker">
on("sheet:opened change:water change:air", function() {
getAttrs(["water", "air"], function(values) {
@@ -4554,33 +4554,33 @@ Version 0.8.3 Beta
});
});
</script>
<!-- Max NPC Fatigue Worker -->
//<!-- Max NPC Fatigue Worker -->
<script type="text/worker">
on("sheet:opened change:npc_endurance", function() {
getAttrs(["npc_endurance"], function(values) {
setAttrs({ NPC_Fatigue_max: (values.npc_endurance) });
});
});
</script>
<!-- Max NPC Strife Worker -->
//<!-- Max NPC Strife Worker -->
<script type="text/worker">
on("sheet:opened change:npc_composure", function() {
getAttrs(["npc_composure"], function(values) {
setAttrs({ NPC_Strife_max: (values.npc_composure) });
});
});
</script>
<!-- Set Emote Text Worker -->
<script type="text/worker">
//<!-- Set Emote Text Worker -->
on("sheet:opened", function() {
var skill_emote_1 = getTranslationByKey('skill-emote1-u');
@@ -4682,11 +4682,11 @@ Version 0.8.3 Beta
setAttrs({ npc_trade_trans});
});
</script>
<!-- Set Approach Worker -->
//<!-- Set Approach Worker -->
<script type="text/worker">
on('sheet:opened change:aesthetics_approach', () => {
getAttrs(['aesthetics_approach'], (values) => {
const val = parseInt(values['aesthetics_approach']);
@@ -4812,9 +4812,9 @@ on('sheet:opened change:blank_artisan_approach', () => {
});
});
</script>
<script type="text/worker">
on("sheet:opened change:repeating_reartisan", function() {
getSectionIDs('repeating_reartisan', function (idArray) {
@@ -4846,9 +4846,9 @@ on('sheet:opened change:blank_artisan_approach', () => {
});
});
});
</script>
<script type="text/worker">
on('sheet:opened change:fitness_approach', () => {
getAttrs(['fitness_approach'], (values) => {
const val = parseInt(values['fitness_approach']);
@@ -5024,10 +5024,10 @@ on('sheet:opened change:blank_martial_approach', () => {
});
});
</script>
<script type="text/worker">
on("sheet:opened change:repeating_remartial", function() {
getSectionIDs('repeating_remartial', function (idArray) {
@@ -5059,9 +5059,9 @@ on('sheet:opened change:blank_martial_approach', () => {
});
});
});
</script>
<script type="text/worker">
on('sheet:opened change:command_approach', () => {
getAttrs(['command_approach'], (values) => {
const val = parseInt(values['command_approach']);
@@ -5186,9 +5186,9 @@ on('sheet:opened change:blank_social_approach', () => {
setAttrs({blank_social_approach_selected});
});
});
</script>
<script type="text/worker">
on("sheet:opened change:repeating_resocial", function() {
getSectionIDs('repeating_resocial', function (idArray) {
@@ -5220,9 +5220,9 @@ on('sheet:opened change:blank_social_approach', () => {
});
});
});
</script>
<script type="text/worker">
on('sheet:opened change:culture_approach', () => {
getAttrs(['culture_approach'], (values) => {
const val = parseInt(values['culture_approach']);
@@ -5373,9 +5373,9 @@ on('sheet:opened change:blank_scholar_approach', () => {
});
});
</script>
<script type="text/worker">
on("sheet:opened change:repeating_rescholar", function() {
getSectionIDs('repeating_rescholar', function (idArray) {
@@ -5407,9 +5407,9 @@ on('sheet:opened change:blank_scholar_approach', () => {
});
});
});
</script>
<script type="text/worker">
on('sheet:opened change:commerce_approach', () => {
getAttrs(['commerce_approach'], (values) => {
const val = parseInt(values['commerce_approach']);
@@ -5560,9 +5560,9 @@ on('sheet:opened change:blank_trade_approach', () => {
});
});
</script>
<script type="text/worker">
on("sheet:opened change:repeating_retrade", function() {
getSectionIDs('repeating_retrade', function (idArray) {
@@ -5594,9 +5594,9 @@ on('sheet:opened change:blank_trade_approach', () => {
});
});
});
</script>
<script type="text/worker">
on('sheet:opened change:npc_artisan_approach', () => {
getAttrs(['npc_artisan_approach'], (values) => {
const val = parseInt(values['npc_artisan_approach']);
@@ -5747,9 +5747,9 @@ on('sheet:opened change:blank_npc_skill_approach', () => {
});
});
</script>
<script type="text/worker">
on("sheet:opened change:repeating_renpcskills", function() {
getSectionIDs('repeating_renpcskills', function (idArray) {
@@ -5781,9 +5781,9 @@ on('sheet:opened change:blank_npc_skill_approach', () => {
});
});
});
</script>
<script type="text/worker">
on('sheet:opened change:kata_approach', () => {
getAttrs(['kata_approach'], (values) => {
const val = parseInt(values['kata_approach']);
@@ -5909,9 +5909,9 @@ on('sheet:opened change:shuji_approach', () => {
});
});
</script>
<script type="text/worker">
on("sheet:opened change:repeating_rekata", function() {
getSectionIDs('repeating_rekata', function (idArray) {
@@ -6067,9 +6067,9 @@ on('sheet:opened change:shuji_approach', () => {
});
});
});
</script>
<script type="text/worker">
on('sheet:opened change:approach_weapon1', () => {
getAttrs(['approach_weapon1'], (values) => {
const val = parseInt(values['approach_weapon1']);
@@ -6270,9 +6270,9 @@ on('sheet:opened change:approach_weapon8', () => {
});
});
</script>
<script type="text/worker">
on('sheet:opened change:approach_npc_weapon1', () => {
getAttrs(['approach_npc_weapon1'], (values) => {
const val = parseInt(values['approach_npc_weapon1']);
@@ -6398,9 +6398,9 @@ on('sheet:opened change:approach_npc_weapon5', () => {
});
});
</script>
<script type="text/worker">
on("sheet:opened change:repeating_renpcsweapon", function() {
getSectionIDs('repeating_renpcsweapon', function (idArray) {
@@ -6433,9 +6433,9 @@ on('sheet:opened change:approach_npc_weapon5', () => {
});
});
</script>
<script type="text/worker">
on('sheet:opened change:npc_kata_approach', () => {
getAttrs(['npc_kata_approach'], (values) => {
const val = parseInt(values['npc_kata_approach']);
@@ -6561,9 +6561,9 @@ on('sheet:opened change:npc_shuji_approach', () => {
});
});
</script>
<script type="text/worker">
on("sheet:opened change:repeating_renpckata", function() {
getSectionIDs('repeating_renpckata', function (idArray) {
@@ -6719,11 +6719,11 @@ on('sheet:opened change:npc_shuji_approach', () => {
});
});
});
</script>
<!-- 8.1 Conversion Worker -->
<script type="text/worker">
//<!-- 8.1 Conversion Worker -->
var convertFromOldSheet = function () {
// Non-repeating attributes to rename
@@ -6787,11 +6787,11 @@ on('sheet:opened', function () {
});
});
</script>
<!-- 8.2 Conversion Worker -->
<script type="text/worker">
//<!-- 8.2 Conversion Worker -->
var convertFromOldSheet = function () {
// Non-repeating attributes to rename
+41 -41
View File
@@ -2629,21 +2629,21 @@
</tr>
</table>
</rolltemplate>
<script type="text/worker">
// Rank Calculation Worker
<!-- Rank Calculation Worker -->
<script type="text/worker">
on("sheet:opened change:Insight", function() {
getAttrs(["foo_insight"], function(values) {
setAttrs({ foo_rank: Math.max(1,Math.round((values.foo_insight - 112) / 25)) });
});
});
</script>
<!-- Insight Calculation Worker -->
//<!-- Insight Calculation Worker -->
<script type="text/worker">
var elements = ['foo_air', 'foo_earth', 'foo_fire', 'foo_water', 'foo_void'],
ranks = ['rank_acting', 'rank_artisan', 'rank_calligraphy', 'rank_courtier', 'rank_divination', 'rank_etiquette', 'rank_games', 'rank_investigation', 'rank_lore', 'rank_Lore2', 'rank_Lore3', 'rank_Medicine', 'rank_Meditation', 'rank_Perform', 'rank_Sincerity', 'rank_Spellcraft', 'rank_Tea_Ceremony', 'rank_rhigh', 'rank_Athletics', 'rank_Battle', 'rank_Defense', 'rank_Horsemanship', 'rank_Hunting', 'rank_Iaijutsu', 'rank_Jiujutsu', 'rank_Chain_Weapons', 'rank_Heavy_Weapons', 'rank_Kenjutsu', 'rank_Knives', 'rank_Kyujutsu', 'rank_Ninjutsu', 'rank_Polearms', 'rank_Spears', 'rank_Staves', 'rank_WarFan', 'rank_AnimalHandling', 'rank_Commerce', 'rank_Craft', 'rank_Engineering', 'rank_Sailing', 'rank_Forgery', 'rank_Intimidation', 'rank_SleightofHand', 'rank_Stealth', 'rank_Temptation', 'BCourtier', 'BEtiquette', 'add_insight'],
@@ -2680,12 +2680,12 @@
});
});
</script>
<!-- Ring Calculation Workers -->
//<!-- Ring Calculation Workers -->
<script type="text/worker">
on("sheet:opened change:reflexes change:awareness", function(eventInfo) {
getAttrs(["reflexes", "awareness"], function(values) {
@@ -2693,9 +2693,9 @@
});
});
</script>
<script type="text/worker">
on("sheet:opened change:stamina change:willpower", function(eventInfo) {
getAttrs(["stamina", "willpower"], function(values) {
@@ -2703,9 +2703,9 @@
});
});
</script>
<script type="text/worker">
on("sheet:opened change:agility change:intelligence", function(eventInfo) {
getAttrs(["agility", "intelligence"], function(values) {
@@ -2713,9 +2713,9 @@
});
});
</script>
<script type="text/worker">
on("sheet:opened change:strength change:perception", function(eventInfo) {
getAttrs(["strength", "perception"], function(values) {
@@ -2723,23 +2723,23 @@
});
});
</script>
<!-- Max Wounds Worker -->
//<!-- Max Wounds Worker -->
<script type="text/worker">
on("sheet:opened change:Out", function() {
getAttrs(["foo_out"], function(values) {
setAttrs({ Wounds_max: (values.foo_out) });
});
});
</script>
<!-- Wound Rank Workers -->
//<!-- Wound Rank Workers -->
<script type="text/worker">
on("sheet:opened change:foo_earth change:Bonus_wounds", function() {
getAttrs(["foo_earth", "Bonus_wounds"], function(values) {
@@ -2747,9 +2747,9 @@
});
});
</script>
<script type="text/worker">
on("sheet:opened change:foo_earth change:Lethality change:Bonus_wounds", function() {
getAttrs(["foo_earth", "Bonus_wounds", "Lethality"], function(values) {
@@ -2757,9 +2757,9 @@
});
});
</script>
<script type="text/worker">
on("sheet:opened change:foo_earth change:Lethality change:Bonus_wounds", function() {
getAttrs(["foo_earth", "Bonus_wounds", "Lethality"], function(values) {
@@ -2767,9 +2767,9 @@
});
});
</script>
<script type="text/worker">
on("sheet:opened change:foo_earth change:Lethality change:Bonus_wounds", function() {
getAttrs(["foo_earth", "Bonus_wounds", "Lethality"], function(values) {
@@ -2777,9 +2777,9 @@
});
});
</script>
<script type="text/worker">
on("sheet:opened change:foo_earth change:Lethality change:Bonus_wounds", function() {
getAttrs(["foo_earth", "Bonus_wounds", "Lethality"], function(values) {
@@ -2787,10 +2787,10 @@
});
});
</script>
<script type="text/worker">
on("sheet:opened change:foo_earth change:Lethality change:Bonus_wounds", function() {
getAttrs(["foo_earth", "Bonus_wounds", "Lethality"], function(values) {
@@ -2798,10 +2798,10 @@
});
});
</script>
<script type="text/worker">
on("sheet:opened change:foo_earth change:Lethality change:Bonus_wounds", function() {
getAttrs(["foo_earth", "Bonus_wounds", "Lethality"], function(values) {
@@ -2809,10 +2809,10 @@
});
});
</script>
<script type="text/worker">
on("sheet:opened change:foo_earth change:Lethality change:Bonus_wounds", function() {
getAttrs(["foo_earth", "Bonus_wounds", "Lethality"], function(values) {
@@ -2820,14 +2820,14 @@
});
});
</script>
<!-- Spell Ring Selection Worker -->
//<!-- Spell Ring Selection Worker -->
<script type="text/worker">
var elements = ['air', 'earth', 'fire', 'water', 'void'],
elementAttrs = [...elements.map(s => `foo_${s}`), ...elements.map(s => `${s}_affinity`)];
@@ -2940,12 +2940,12 @@ on('sheet:opened', function () {
});
});
});
</script>
<!-- Sheet Conversion Worker. -->
//<!-- Sheet Conversion Worker. -->
<script type="text/worker">
var convertFromOldSheet = function () {
// Non-repeating attributes to rename