diff --git a/Beacon/beacon.css b/Beacon/beacon.css index ee47e7221d..fa54c213cc 100644 --- a/Beacon/beacon.css +++ b/Beacon/beacon.css @@ -1,9 +1,10 @@ /* Beacon: Tabbed Character Sheet CSS */ -/* Version 1 */ +/* Version 2 */ /* overall wrapper to fix moving width issues with overflow on hidden sections */ .charsheet .sheet-overall-wrapper { max-width: 832px; + min-width: 700px; } /* Tweak repeating section buttons so they have a bottom margin and dont overflow when in edit mode. */ @@ -16,6 +17,25 @@ visibility: hidden; } +/* ALTER repeating section controls */ +.charsheet .repcontrol_add, +.charsheet .repcontrol_edit, +.charsheet .repcontrol_del { + font-size: 9px; + text-align: center; + text-transform: uppercase; + margin-bottom: 5px; + color:#ffffff; + background-color:#000000; + background-image: -moz-repeating-radial-gradient(center center, circle cover, #000000, #ce0632 100%); + background-image: -webkit-repeating-radial-gradient(center center, circle cover, #000000, #ce0632 100%); + background-image: -o-repeating-radial-gradient(center center, circle cover, #000000, #ce0632 100%); + background-image: -ms-repeating-radial-gradient(center center, circle cover, #000000, #ce0632100%); + background-image: repeating-radial-gradient(center center, circle cover, #000000, #ce0632 100%); + margin-top: 10px; + border-radius: 10px; +} + /* Fake tabs style1 (reskinned radio button; fixed to work properly in firefox */ div.sheet-maintab-content { @@ -44,7 +64,7 @@ input.sheet-maintab .charsheet input.sheet-maintab:checked + span.sheet-player, .charsheet input.sheet-maintab:checked + span.sheet-update { - background: #009e73; + background: #009e73; /*GREEN*/ color: white; border-radius: 4px; } @@ -55,7 +75,7 @@ span.sheet-maintab { width: 15%; height: 16px; font-size: 9px; - background: #ad1d31; + background: #ce0632; /*REDish*/ color: white; font-weight: bold; border-radius: 4px; @@ -64,7 +84,7 @@ span.sheet-maintab { div.sheet-maintab-content { - border: 1px solid #a8a8a8; + border: 1px solid #a8a8a8; /*GREY*/ border-top-color: #000; margin: 2px 0 0 5px; padding: 5px; @@ -87,8 +107,9 @@ label div .charsheet input.sheet-tab1:checked ~ div.sheet-section-core, .charsheet input.sheet-tab2:checked ~ div.sheet-section-combat, -.charsheet input.sheet-tab3:checked ~ div.sheet-section-magic, -.charsheet input.sheet-tab4:checked ~ div.sheet-section-inventory { +.charsheet input.sheet-tab3:checked ~ div.sheet-section-inventory, +.charsheet input.sheet-tab4:checked ~ div.sheet-section-notes, +.charsheet input.sheet-tab5:checked ~ div.sheet-section-magic { max-height: 999999px; visibility: visible; opacity: 1; @@ -116,7 +137,7 @@ label div text-align: center; display: inline-block; font-size: 13px; - background: #7d160f; + background: #ce0632; color: white; font-weight: bold; border-radius: 4px; @@ -131,6 +152,7 @@ label div .charsheet input.sheet-tab2:checked + span.sheet-tab2, .charsheet input.sheet-tab3:checked + span.sheet-tab3, .charsheet input.sheet-tab4:checked + span.sheet-tab4, +.charsheet input.sheet-tab5:checked + span.sheet-tab5, .charsheet input.sheet-tab99:checked + span.sheet-tab99 { background: #009e73; color: white; @@ -245,7 +267,7 @@ label div text-align: center; display: inline-block; font-size: 13px; - background: #7d160f; + background: #ce0632; color: white; font-weight: bold; border-radius: 4px; @@ -258,6 +280,24 @@ label div /* END Spell Page Settings */ /* Borders for spell page and class action repeating section rows */ +div[data-groupname^="repeating_items"] .repitem, +.sheet-zero-row { + border: 1px solid #000000; + border-radius: 12px; + margin-left: 1px; + margin-bottom: 5px; + background: #eee; +} + +div[data-groupname^="repeating_"] .repitem, +.sheet-zero-row { + border: 1px solid #000000; + border-radius: 12px; + margin-left: 1px; + margin-bottom: 5px; + background: #eee; +} + div[data-groupname^="repeating_spellbook"] .repitem, .sheet-zero-row { border: 1px solid #000000; @@ -335,69 +375,6 @@ div[data-groupname^="repeating_spellbook"] .repitem, /* END Table settings */ -/* Inventory Page Settings */ -.charsheet div[class^="sheet-inventory-page"] { - visibility: hidden; - opacity: 0; - max-height:0; - overflow: hidden; -} - -.charsheet input.sheet-inventorytab1:checked ~ div.sheet-inventory-page1, -.charsheet input.sheet-inventorytab2:checked ~ div.sheet-inventory-page2, -.charsheet input.sheet-inventorytab3:checked ~ div.sheet-inventory-page3, -.charsheet input.sheet-inventorytab4:checked ~ div.sheet-inventory-page4 { - max-height: 999999px; - visibility: visible; - opacity: 1; - transition: opacity 0.5s linear 0s; -} - -.charsheet input.sheet-inventorytab99:checked ~ div[class^="sheet-inventory-page"]{ - max-height: 999999px; - visibility: visible; - opacity: 1; - transition: opacity 0.5s linear 0s; -} - -.charsheet input.sheet-inventorytab1:checked ~ span.sheet-inventorytab1, -.charsheet input.sheet-inventorytab2:checked ~ span.sheet-inventorytab2, -.charsheet input.sheet-inventorytab3:checked ~ span.sheet-inventorytab3, -.charsheet input.sheet-inventorytab4:checked ~ span.sheet-inventorytab4, -.charsheet input.sheet-inventorytab99:checked ~ span.sheet-inventorytab99 - { - background: rgb(0,158,115); - color: white; - border-radius: 4px; -} - -.charsheet input.sheet-inventorytab { - width: 155px; - height: 20px; - cursor: pointer; - position: relative; - opacity: 0; - z-index: 9999; -} - -.charsheet span.sheet-inventorytab { - text-align: center; - display: inline-block; - font-size: 13px; - background: rgb(86,180,233); - color: white; - font-weight: bold; - border-radius: 4px; - - width: 155px; - height: 20px; - cursor: pointer; - position: relative; - margin-left: -100px; -} - -/* END Inventory Page Settings */ - /* General sheet wide Styles */ .charsheet { @@ -436,7 +413,7 @@ div[data-groupname^="repeating_spellbook"] .repitem, } .charsheet .sheet-last-updated { - font-size: 85%!important; + font-size: 90%!important; font-style: italic; font-weight: bold; margin: 0; @@ -666,11 +643,11 @@ div[data-groupname^="repeating_spellbook"] .repitem, margin-bottom: 5px; color:#ffffff; background-color:#000000; - background-image: -moz-repeating-radial-gradient(center center, circle cover, #000000, #870202 100%); - background-image: -webkit-repeating-radial-gradient(center center, circle cover, #000000, #870202 100%); - background-image: -o-repeating-radial-gradient(center center, circle cover, #000000, #870202 100%); - background-image: -ms-repeating-radial-gradient(center center, circle cover, #000000, #870202 100%); - background-image: repeating-radial-gradient(center center, circle cover, #000000, #870202 100%); + background-image: -moz-repeating-radial-gradient(center center, circle cover, #000000, #ce0632 100%); + background-image: -webkit-repeating-radial-gradient(center center, circle cover, #000000, #ce0632 100%); + background-image: -o-repeating-radial-gradient(center center, circle cover, #000000, ##ce0632 100%); + background-image: -ms-repeating-radial-gradient(center center, circle cover, #000000, #ce0632 100%); + background-image: repeating-radial-gradient(center center, circle cover, #000000, #ce0632 100%); margin-top: 10px; border-radius: 12px; @@ -720,11 +697,6 @@ div[data-groupname^="repeating_spellbook"] .repitem, font-size: 10px; } -.charsheet .sheet-small-text { - font-family: Arial; - font-size: 10px; -} - .charsheet select { font-size: 90%; } @@ -734,9 +706,6 @@ div[data-groupname^="repeating_spellbook"] .repitem, color: #ff0000; } -.charsheet .sheet-grey-row { - background-color: #eee; -} .charsheet .sheet-sub-header { background-color: #cecece; @@ -790,13 +759,6 @@ div[data-groupname^="repeating_spellbook"] .repitem, text-align: center; } -.charsheet .sheet-large-button { - padding: 5px; - height: 45px; - vertical-align: middle; -} - - /* Skills section */ .charsheet .sheet-skill-row { @@ -823,38 +785,6 @@ div[data-groupname^="repeating_spellbook"] .repitem, margin-bottom: 5px; } -.charsheet label.sheet-subtab { - width:24px; - height: 22px; - vertical-align: middle; - display: inline; - font-size: 1.1em; -} - -.charsheet .sheet-class-label { - background-color: #000000; - color: #ffffff; - font-size: 14px!important; - font-weight: bold; - text-transform: uppercase; - vertical-align: middle; - line-height: 20px; - text-align: center; - border-radius: 12px; - padding-left: 5px; - margin-bottom: 5px; -} - -.charsheet label.sheet-subtabSpell { - display: inline; - width: 40px; - height: 22px; - vertical-align: middle; - margin-right: auto; - margin-left: auto; - font-size: 1.4em; -} - /* Custom Pure Grid CSS (24 cols) DO NOT EDIT BELOW THIS LINE OR RISK BREAKING FORMATTING */ .sheet-row, .sheet-rolltemplate-DccTabbed .sheet-row { diff --git a/Beacon/beacon.html b/Beacon/beacon.html index 592e55962a..83bdc661f7 100644 --- a/Beacon/beacon.html +++ b/Beacon/beacon.html @@ -1,372 +1,445 @@ - - +
-
-
Beacon Character Record Sheet

-
-
 
- - Play Mode - - Update Mode +
+
 
+ + Play Mode + + Update Mode
- Stats + Character Combat - Spellbook + Inventory - Inventory + Notes + + Spellbook Show All - + -
-
- -
-

Character Information

-
-

Character Name
-

Title
-
-
 
-
-
Race
-
Class
-
Experience Points
-
Level
-
-
 
-
-

Gender
-

Age
-

Height
-

Weight
-

Can Carry
-
-
-
 
-
-
-
Racial Abilities
-
-
-
 
-
-
- -
-

Combat Basics

-
-
-
-
 
-

.
-
-
-
-
-
 
-

.
-
-
-
Damage
-
Spell Fatigue
-
-
-
Armor Class
-
Current Hit Points
-
-
 
-
 
-
-
Hit Die
-
Attack Bonus
-
Damage Bonus
-
# Attacks
-
Base Speed
-
-
+
+
+
+

Character Information

+
+ +
- -
-

Stats

-
-
 
-
Base
-
Mod
-
Damage
-
Current
-
Bonus
-
-
-
Strength
-
-
-
-
-
-
-
-
Dexterity
-
-
-
-
-
-
-
-
Mind
-
-
-
-
-
-
-
-
Charisma
-
-
-
-
-
-
-
 
-
-
 
-
Conditions
-
-
- -
-

Skills

-
-
 
-
 
-
Base
-
Mod
-
Bonus
-
-
-
-
 
-
Physical
-
-
-
-
-
-
 
-
Subterfuge
-
-
-
-
-
-
 
-
Knowledge
-
-
-
-
-
-
 
-
Communication
-
-
-
-
-
-
 
-
Survival
-
-
-
-
-
-
 
-
Crafting
-
-
-
-
-
 
-
+

Character Name
+

Title
+
+
 
+
+
Race
+
Class
+
Experience Points
+
Level
+
+
 
+
+

Gender
+

Age
+

Height
+

Weight
+

Can Carry
+
+
+
 
+
+
+
Racial Abilities
+
+
+
 
- -
-

Notes

+ +
-
-
+
+
+
 
+

.
+
+
+
+
+
 
+

.
+
+
+
Damage
+
Spell Fatigue
+
+
+
Armor Class
+
Current Hit Points
+
+
 
+
+
Hit Die
+
Attack Bonus
+
Damage Bonus
+
# Attacks
+
Base Speed
+
Current Load
+
-
- -
-
 
- -

Melee Weapons

-
-
Equipped?
-
Weapon
-
Type
-
Base Damage
-
Magic or Bonus
-
To Hit Bonus
-
Dmg Bonus
-
Durability
-
- -
-
-
-
-
- -
-
-
-
- -
-
- -
-
-
-

Ranged Weapons

-
-
Equipped?
-
Ammo
-
Missile or Thrown
-
Weapon
-
Size
-
Rng
-
max Range
-
Base Damage
-
Magic or Bonus
-
To Hit
-
Dmg Bonus
-
Durability
-
- -
-
-
-
-
- -
-
-
- -
-
-
-
-
-
-
-
- -
-
-
- -
-
-

Armor

-

Add any equipment, effects or items here that give a benefit to your Armor Class (AC). This includes Armor, shields and any magical items or spells. -
Use the checkboxes to indicate whether each row is is worn/equipped and update AC. If you have another feature that also modifies your AC then add that here too.

+ +
+

Stats

+
+
 
+
Base
+
Mods
+
Damage
+
Current
+
Bonus
+
+
+
Strength
+
+
+
+
+
+
+
+
Dexterity
+
+
+
+
+
+
+
+
Mind
+
+
+
+
+
+
+
+
Charisma
+
+
+
+
+
+
+
 
+
+
Conditions
+
+
+
+
+
+
+
+ +
+

Skills

+
+
 
+
 
+
Base
+
Mods
+
Bonus
+
+
+
+
 
+
Physical
+
+
+
+
+
+
 
+
Subterfuge
+
+
+
+
+
+
 
+
Knowledge
+
+
+
+
+
+
 
+
Communication
+
+
+
+
+
+
 
+
Survival
+
+
+
+
+
+
 
+
Crafting
+
+
+
+
+
 
-
-
 
-

AC (worn armor)
- -
 
-

Dexerity Penalty
-
 
-

Total Speed Reduction
-
 
-
-
-
-
-
Worn?
-
Name
-
Type
- -
Speed Mod
-
Base AC
-
Magic or Bonus
-
Total AC Bonus
-
Durability
+
+ +
+

Character Details

+
+
Special Items and Abilities
+
Tasks, Deeds & Events
+
Appearance, Scars & Phobias
+
+
+
+
+
+
+
+
+ + +
+

Combat

+ +
+
+

Armor

+

Add any equipment, effects or items here that give a benefit to your Armor Class (AC). This includes Armor, shields and any magical items or spells. +
Use the checkboxes to indicate whether each row is is worn/equipped and update AC. If you have another feature that also modifies your AC then add that here too.

+
+
 
+

AC (worn armor)
+ +
 
+

Dexerity Penalty
+
 
+

Total Speed Reduction
+
 
+ + + +

Combat Load
+ +
+
+
+
+
Carried?
+
Worn?
+
Name
+
Type
+
AC
+
+ +
+
+
+
+
+
+
+
+
+ + +
+ + Details +
+
+
Base AC
+
Modifier
+
Speed
+
Durability
+
Notes
+
+
+
+
+
+
+ +
+
+
+
+
+
+
- -
+
+
+
+ + +
+
+

Melee Weapons

+
+
+
Carried?
+
Number
+
Weapon
+
To Hit Bonus
+
Base Damage
+
Dmg Bonus
+
+ +
+
+
-
-
-
+
+
+
+
+
+ + Details +
+
+
Atk Mod
+
Magic Mod
+
Dmg Mod
+
Type
+
Durability
+
Notes
+
+
+
+
+
+
+ +
+
+ +
+
+
+
+
+
+
+
+
+
+

Ranged Weapons

+
+
+
+
Carried?
+
Ammo
+
Weapon
+
Range
+
Max Range
+
To Hit Bonus
+
Base Dmg
+
Dmg Bonus
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+ + Details +
+
+
Atk Mod
+
Magic Mod
+
Dmg Mod
+
Type
+
Size
+
Durability
+
Notes
+
+
+
+
+
+
+ +
+
+
- -
-
-
-
-
- @@ -374,410 +447,536 @@
+
-
+
-
-
- -
-
 
-

Magic Info.

-

Magic Attack = (level +MIND bonus) vs. target DC (usually 10).
Spells that allow a save the target must match the Difficulty Class (DC) of 15 + Caster Level

-
 
-
Spell Fatigue
- -
-

Spell Book

-

Put in some text about spells here.

- - Level 0 - - Level 1 - - Level 2 - - Level 3 - - Level 4 - - Level 5 - - Level 6 - - Show All - - - -
-
-
Level 0
+ + +
+ + +
+

Inventory

+ +
+
+

Packs, Bags and Large Items

+ +
+ +
+
Carried?
+
Item/Container
+
Load
- -
-
+
+
+
+
+ + Contents +
-
Spell name
-
Range
-
Duration
-
Cost
+
Contents
+
Notes
- - -
-
-
-
- - Description -
-
-
Spell Description and Notes
-
-
-
-
 
-
-
+
+
- -
-
- - -
-
-
Level 1
- -
-
-
-
Spell name
-
Range
-
Duration
-
Cost
-
-
- - -
-
-
-
- - Description -
-
-
Spell Description and Notes
-
-
-
-
 
-
-
-
-
- -
+ +
+
+

Encumbrance

+
+
Can Carry
+
Items
+
Combat
+
Coins
+
Total Load
- - -
-
-
Level 2
-
- -
-
-
-
Spell name
-
Range
-
Duration
-
Cost
-
-
- - -
-
-
-
- - Description -
-
-
Spell Description and Notes
-
-
-
-
 
-
-
-
-
- -
+
 
+

Consumables

+
+
Water
+
Field Rations
+
Bulk Rations
+
Torches
+
- - -
-
-
Level 3
-
- -
-
-
-
Spell name
-
Range
-
Duration
-
Cost
-
-
- - -
-
-
-
- - Description -
-
-
Spell Description and Notes
-
-
-
-
 
-
-
-
-
- -
-
- - -
-
-
Level 4
-
- -
-
-
-
Spell name
-
Range
-
Duration
-
Cost
-
-
- - -
-
-
-
- - Description -
-
-
Spell Description and Notes
-
-
-
-
 
-
-
-
-
- -
-
- - -
-
-
Level 5
-
- -
-
-
-
Spell name
-
Range
-
Duration
-
Cost
-
-
- - -
-
-
-
- - Description -
-
-
Spell Description and Notes
-
-
-
-
 
-
-
-
-
- -
-
- - -
-
-
Level 6
-
- -
-
-
-
Spell name
-
Range
-
Duration
-
Cost
-
-
- - -
-
-
-
- - Description -
-
-
Spell Description and Notes
-
-
-
-
 
-
-
-
-
- -
-
- +
 
+

Money

+
+
Copper
+
Silver
+
Gold
+
Platinum
+
Total Silver
+
- - -
-
-
-

Inventory

-
 
+ +
 
+
+
+

Small and Miscellaneous Items

+
+
+
+
+
+
-
Water:
-
amount
-
Field Rations:
-
amount
-
Bulk Rations:
-
amount
-
Torches:
-
amount
-
-

Can Carry
-

Current
+
Item
+
Amount
+
Location
+
Item
+
Amount
+
Location
+
Item
+
Amount
+
Location
+
+
+
+
+
+
+
+
+
+
+
-

Consumable Items

-
 
-
-
-
Item Name
-
Amount
-
 
-
Item Name
-
Amount
-
 
-
Item Name
-
Amount
-
-
-
-
-
 
-
-
-

Coins Carried

-
-
-
-
-
-
CP
-
SP
-
GP
-
PP
-
Total in GP
-
Weight
-
-
-
-
-
-
-
-
-
-
-
-

Other Inventory

-
-
-
Backpack
-
Bag
-
Case/Bag/Sack
-
-
-
-
-
-
-
-
-

Stuff Not Carried

-
-
-
Equipment
-
Treasure
-
Other
-
-
-
-
-
-
-
+
+
-
+
+ + +
+
+

Notes

+
+
+
+
+
+
+ +
+
+

Henchmen, Hirelings and Companions

+
+
+
+
Dead?
+
Name
+
Max HP
+
Damage
+
AC
+
Attack Bonus
+
Attack Dmg
+
Ammo
+
+ +
+
+
+
+
+
+
+
+
+
+
+
+ + Notes +
+
+
Companion Notes
+
Companion Inventory
+
+
+
+
+
+
Load
+
Silver Owed
+
+
+
+
+
+
+
Rations
+
Torches/Oil
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+

Other Inventory

+
+
+
+
Equipment
+
Treasure
+
Other
+
+
+
+
+
+
+

Stuff Not Carried

+
+
+
Equipment
+
Treasure
+
Other
+
+
+
+
+
+
+
+
+ + +
+ +
+

Spell Book

+

Magic Attack = (level +MIND bonus) vs. target DC (usually 10).

+ + Level 0 + + Level 1 + + Level 2 + + Level 3 + + Level 4 + + Level 5 + + Level 6 + + Show All +
 
+
DC to Resist
+
Spell Fatigue
+ + + +
+
+
Cantrips (Level 0)
+
+ +
+
+
+
Spell name
+
Range
+
Duration
+
Cost
+
+
+ + +
+
+
+
+ + Description +
+
+
Description
+
Notes
+
+
+
+
+
+
+
+
+ +
+
+ + +
+
+
First Level
+
+ +
+
+
+
Spell name
+
Range
+
Duration
+
Cost
+
+
+ + +
+
+
+
+ + Description +
+
+
Description
+
Notes
+
+
+
+
+
+
+
+
+ +
+
+ + +
+
+
Second Level
+
+ +
+
+
+
Spell name
+
Range
+
Duration
+
Cost
+
+
+ + +
+
+
+
+ + Description +
+
+
Description
+
Notes
+
+
+
+
+
+
+
+
+ +
+
+ + +
+
+
Third Level
+
+ +
+
+
+
Spell name
+
Range
+
Duration
+
Cost
+
+
+ + +
+
+
+
+ + Description +
+
+
Description
+
Notes
+
+
+
+
+
+
+
+
+ +
+
+ + +
+
+
Fourth Level
+
+ +
+
+
+
Spell name
+
Range
+
Duration
+
Cost
+
+
+ + +
+
+
+
+ + Description +
+
+
Description
+
Notes
+
+
+
+
+
+
+
+
+ +
+
+ + +
+
+
Fifth Level
+
+ +
+
+
+
Spell name
+
Range
+
Duration
+
Cost
+
+
+ + +
+
+
+
+ + Description +
+
+
Description
+
Notes
+
+
+
+
+
+
+
+
+ +
+
+ + +
+
+
Sixth Level
+
+ +
+
+
+
Spell name
+
Range
+
Duration
+
Cost
+
+
+ + +
+
+
+
+ + Description +
+
+
Description
+
Notes
+
+
+
+
+
+
+
+
+ +
+
+ +
+
+ +
+

UPDATE MODE

-
-

Update Level and HP

+
+

Update Level and HP

-
Class
-
Race
+
Class
+
Race
@@ -785,25 +984,27 @@
-
+
+
-
+
+
@@ -821,11 +1022,11 @@
-

Modify Base Stats

+

Modify Base Stats

-
Stat
-
Base
-
Bonus
+
Stat
+
Base
+
Bonus
Strength
@@ -847,14 +1048,13 @@
-
- -
-

Modify Base Skills

+
+
+

Modify Base Skills

-
 
-
Skill
-
Base
+
 
+
Skill
+
Base
 
@@ -888,34 +1088,32 @@
-
 
-
Race Starting
+
Race Starting
-
Class Starting
+
Class Starting
-
Class Progression
+
Class Progression
-
+

Rules available at: https://beacond20.blogspot.com/p/get-beacon.html

-

Sheet last updated Aug 2020

+

Sheet last updated Mar 2021

- +//calc Container Encumbrance +on("sheet:opened remove:repeating_containers change:repeating_containers:containerEquip change:repeating_containers:containerWeight", function() { + getAttrs(["repeating_containers_containerWeight", "repeating_containers_containerEquip", "containerLoadTotal"], function(v) { + setAttrs({ + containerLoadTotal: parseInt(0) + }); + }); + + TAS.repeating("containers") + .attrs("containerLoadTotal") + .fields("containerEquip", "containerWeight") + .map(function(row, attrSet, id, rowSet) { + + var checkContainer = (row.containerEquip == 'on') ? true : false; + var contWeight = parseInt(row.containerWeight)||0; + + if ((checkContainer) == true) { + //console.log("1"); + attrSet.containerLoadTotal += contWeight; + //console.log("Container Weight Total="+ attrSet.containerloadTotal); + } + }) + .execute(); +}); + +//calc fields on ranged weapons +on("sheet:opened remove:repeating_rangedweapon change:repeating_rangedweapon:rangedEquip change:repeating_rangedweapon:rangedAtkMod change:repeating_rangedweapon:rangedDamMod change:repeating_rangedweapon:rangedWeaponsize change:repeating_rangedweapon:rangedDistance change:dexBonus change:repeating_rangedweapon:rangedWeaponType change:repeating_rangedweapon:rangedMagic change:strCurrent change:ATK change:DAM change:Class", function() { + getAttrs(["repeating_rangedweapon_rangedWeaponsize", "repeating_rangedweapon_rangedWeaponType", "repeating_rangedweapon_rangedAtkMod", "repeating_rangedweapon_rangedDamMod", "repeating_rangedweapon_rangedDistance", "strCurrent", "repeating_rangedweapon_rangedMagic", "strBonus", "dexBonus", "ATK", "DAM", "Class"], function(v) { + + var Dam = 3; + var DamBonus = parseInt(0); + var maxrange = parseInt(3); + var DEXBonus = parseInt(v.dexBonus)||0; + var AttackMod = parseInt(v.repeating_rangedweapon_rangedAtkMod)||0; + var DamageMod = parseInt(v.repeating_rangedweapon_rangedDamMod)||0; + var magicBonus = parseInt(v.repeating_rangedweapon_rangedMagic)||0; + var range = parseInt(v.repeating_rangedweapon_rangedDistance)||0; + var Attack = parseInt(v.ATK)||0; + var Damage = parseInt(v.DAM)||0; + + if (v.repeating_rangedweapon_rangedWeaponType == "missile") {maxrange=5*range;} + else {maxrange=3*range;} + + if (v.repeating_rangedweapon_rangedWeaponsize == "heavy") {Dam = 4;} + else {Dam = 3;} + + var calcHitbonus = Attack + DEXBonus + AttackMod + magicBonus; + var calcDambonus = Damage + DamBonus + DamageMod + magicBonus; + + setAttrs({ repeating_rangedweapon_rangedDam : Dam, + repeating_rangedweapon_rangedMax : maxrange, + repeating_rangedweapon_rangedToHit : calcHitbonus, + repeating_rangedweapon_rangedDamBonus : calcDambonus, + + }); + }); + getAttrs(["rangedLoadTotal"], function(v) { + setAttrs({ + rangedLoadTotal: parseInt(0) + }); + }); + TAS.repeating("rangedweapon") + .attrs("rangedLoadTotal") + .fields("rangedEquip", "rangedAmmo", "rangedWeaponsize", "rangedWeaponType") + .map(function(row, attrSet, id, rowSet) { + + var checkEquip = (row.rangedEquip == 'on') ? true : false; + var Ammo = parseInt(row.rangedAmmo)||0; + var Enc = 0; + var Num = 1; + + if (row.rangedWeaponType == "thrown") {Num = Ammo} + + if (row.rangedWeaponsize == "heavy") {Enc = 1*Num;} + else {Enc = 0.5*Num;} + + if ((checkEquip) == true) { + //console.log("1"); + attrSet.rangedLoadTotal += Enc; + //console.log("ranged Weight Total="+ attrSet.rangedLoadTotal); + } + }) + .execute(); + }); + +//calc fields on melee weapons +on("sheet:opened remove:repeating_meleeweapon change:repeating_meleeweapon:meleeEquip change:repeating_meleeweapon:meleeAtkMod change:repeating_meleeweapon:meleeCount change:repeating_meleeweapon:meleeDamMod change:repeating_meleeweapon:meleeWeaponsize change:repeating_meleeweapon:meleeMagic change:dexPenalty change:dexBonus change:strCurrent change:ATK change:DAM change:Class", function() { + getAttrs(["repeating_meleeweapon_meleeWeaponsize","repeating_meleeweapon_meleeMagic","repeating_meleeweapon_meleeAtkMod","repeating_meleeweapon_meleeDamMod","strCurrent","strBonus","dexBonus","ATK","DAM","Class"], function(v) { + + var Dam = 3; + //var DamBonus = parseInt(0); + var STRBonus = parseInt(v.strBonus)||0; + var DEXBonus = parseInt(v.dexBonus)||0; + var AttackMod = parseInt(v.repeating_meleeweapon_meleeAtkMod)||0; + var DamageMod = parseInt(v.repeating_meleeweapon_meleeDamMod)||0; + var magicBonus= parseInt(v.repeating_meleeweapon_meleeMagic)||0; + var Attack = parseInt(v.ATK)||0; + var Damage = parseInt(v.DAM)||0; + + if (v.repeating_meleeweapon_meleeWeaponsize == "light-rogue") {calcHitbonus = Attack + AttackMod + DEXBonus + magicBonus;} + else {calcHitbonus = Attack + STRBonus + AttackMod + magicBonus;} + + switch (v.repeating_meleeweapon_meleeWeaponsize) { + case "heavy-2hand" : Dam = 5; break; + case "heavy" : Dam = 4; break; + default: Dam = 3; + } + var calcDambonus = Damage + STRBonus + DamageMod + magicBonus; + + setAttrs({ repeating_meleeweapon_meleeDam : Dam, + repeating_meleeweapon_meleeToHit : calcHitbonus, + repeating_meleeweapon_meleeDamBonus : calcDambonus + }); + }); + getAttrs(["meleeLoadTotal"], function(v) { + setAttrs({ + meleeLoadTotal: parseInt(0) + }); + }); + TAS.repeating("meleeweapon") + .attrs("meleeLoadTotal") + .fields("meleeEquip", "meleeCount", "meleeWeaponsize") + .map(function(row, attrSet, id, rowSet) { + + var checkEquip = (row.meleeEquip == 'on') ? true : false; + var Num = parseInt(row.meleeCount)||1; + var Enc = 0; + + if (row.meleeWeaponsize == "heavy") {Enc = 1*Num;} + else {Enc = 0.5*Num;} +// } + + if ((checkEquip) == true) { + //console.log("1"); + attrSet.meleeLoadTotal += Enc; + //console.log("melee Weight Total="+ attrSet.meleeLoadTotal); + } + }) + .execute(); + }); + + \ No newline at end of file