diff --git a/test/actors/fvtt-Actor-Breaker.json b/test/actors/fvtt-Actor-Breaker.json new file mode 100644 index 0000000..27c33e7 --- /dev/null +++ b/test/actors/fvtt-Actor-Breaker.json @@ -0,0 +1,568 @@ +{ + "_id": "nHQPQBYP4qmIA8LZ", + "name": "Breaker", + "type": "character", + "data": { + "abilities": { + "str": { + "value": 10, + "proficient": 0 + }, + "dex": { + "value": 10, + "proficient": 0 + }, + "con": { + "value": 10, + "proficient": 0 + }, + "int": { + "value": 10, + "proficient": 0 + }, + "wis": { + "value": 10, + "proficient": 0 + }, + "cha": { + "value": 10, + "proficient": 0 + } + }, + "attributes": { + "ac": { + "value": 10 + }, + "hp": { + "value": 10, + "min": 0, + "max": 10, + "temp": null, + "tempmax": null + }, + "init": { + "value": 0, + "bonus": 0 + }, + "movement": { + "burrow": 0, + "climb": 0, + "fly": 0, + "swim": 0, + "walk": 30, + "units": "ft", + "hover": false + }, + "senses": { + "darkvision": 0, + "blindsight": 0, + "tremorsense": 0, + "truesight": 0, + "units": "ft", + "special": "" + }, + "spellcasting": "int", + "death": { + "success": 0, + "failure": 0 + }, + "encumbrance": { + "value": null, + "max": null + }, + "exhaustion": 0, + "inspiration": false + }, + "details": { + "biography": { + "value": "", + "public": "" + }, + "alignment": "", + "race": "", + "background": "", + "xp": { + "value": 0, + "min": 0, + "max": 300 + }, + "appearance": "", + "trait": "", + "ideal": "", + "bond": "", + "flaw": "" + }, + "traits": { + "size": "med", + "di": { + "value": [], + "custom": "" + }, + "dr": { + "value": [], + "custom": "" + }, + "dv": { + "value": [], + "custom": "" + }, + "ci": { + "value": [], + "custom": "" + }, + "languages": { + "value": [], + "custom": "" + }, + "weaponProf": { + "value": [], + "custom": "" + }, + "armorProf": { + "value": [], + "custom": "" + }, + "toolProf": { + "value": [], + "custom": "" + } + }, + "currency": { + "pp": 0, + "gp": 0, + "ep": 0, + "sp": 0, + "cp": 0 + }, + "skills": { + "acr": { + "value": 0, + "ability": "dex" + }, + "ani": { + "value": 0, + "ability": "wis" + }, + "arc": { + "value": 0, + "ability": "int" + }, + "ath": { + "value": 0, + "ability": "str" + }, + "dec": { + "value": 0, + "ability": "cha" + }, + "his": { + "value": 0, + "ability": "int" + }, + "ins": { + "value": 0, + "ability": "wis" + }, + "itm": { + "value": 0, + "ability": "cha" + }, + "inv": { + "value": 0, + "ability": "int" + }, + "med": { + "value": 0, + "ability": "wis" + }, + "nat": { + "value": 0, + "ability": "int" + }, + "prc": { + "value": 0, + "ability": "wis" + }, + "prf": { + "value": 0, + "ability": "cha" + }, + "per": { + "value": 0, + "ability": "cha" + }, + "rel": { + "value": 0, + "ability": "int" + }, + "slt": { + "value": 0, + "ability": "dex" + }, + "ste": { + "value": 0, + "ability": "dex" + }, + "sur": { + "value": 0, + "ability": "wis" + } + }, + "spells": { + "spell1": { + "value": 0, + "override": null + }, + "spell2": { + "value": 0, + "override": null + }, + "spell3": { + "value": 0, + "override": null + }, + "spell4": { + "value": 0, + "override": null + }, + "spell5": { + "value": 0, + "override": null + }, + "spell6": { + "value": 0, + "override": null + }, + "spell7": { + "value": 0, + "override": null + }, + "spell8": { + "value": 0, + "override": null + }, + "spell9": { + "value": 0, + "override": null + }, + "pact": { + "value": 0, + "override": null + } + }, + "bonuses": { + "mwak": { + "attack": "", + "damage": "" + }, + "rwak": { + "attack": "", + "damage": "" + }, + "msak": { + "attack": "", + "damage": "" + }, + "rsak": { + "attack": "", + "damage": "" + }, + "abilities": { + "check": "", + "save": "", + "skill": "" + }, + "spell": { + "dc": "" + } + }, + "resources": { + "primary": { + "value": null, + "max": null, + "sr": false, + "lr": false, + "label": "" + }, + "secondary": { + "value": null, + "max": null, + "sr": false, + "lr": false, + "label": "" + }, + "tertiary": { + "value": null, + "max": null, + "sr": false, + "lr": false, + "label": "" + } + } + }, + "sort": 200000, + "flags": { + "exportSource": { + "world": "torch-test-5e", + "system": "dnd5e", + "coreVersion": "0.7.10", + "systemVersion": "1.2.4" + } + }, + "token": { + "flags": {}, + "name": "Breaker", + "displayName": 50, + "img": "icons/svg/mystery-man.svg", + "tint": "", + "width": 1, + "height": 1, + "scale": 1, + "mirrorX": false, + "mirrorY": false, + "lockRotation": false, + "rotation": 0, + "vision": true, + "dimSight": 30, + "brightSight": 0, + "dimLight": 0, + "brightLight": 0, + "sightAngle": 360, + "lightAngle": 360, + "lightColor": "", + "lightAlpha": 1, + "lightAnimation": { + "type": "", + "speed": 5, + "intensity": 5 + }, + "actorId": "nHQPQBYP4qmIA8LZ", + "actorLink": true, + "disposition": 1, + "displayBars": 0, + "bar1": { + "attribute": "" + }, + "bar2": { + "attribute": "" + }, + "randomImg": false + }, + "items": [ + { + "_id": "nteBnwxx0I6nFJ7p", + "name": "Cleric", + "type": "class", + "data": { + "description": { + "value": "
As a cleric, you gain the following class features.
\nHit Dice: 1d8 per cleric level
Hit Points at 1st Level: 8 + your Constitution modifier
Hit Points at Higher Levels: 1d8 (or 5) + your Constitution modifier per cleric level after 1st
Armor: Light armor, medium armor, shields
Weapons: Simple weapons
Tools: None
Saving Throws: Wisdom, Charisma
Skills: Choose two from History, Insight, Medicine, Persuasion, and Religion
You start with the following equipment, in addition to the equipment granted by your background:
\nLevel | \nProficiency Bonus | \nFeatures | \n
1st | \n+2 | \n@Compendium[dnd5e.classfeatures.v4gKwLhAq9vuqza7]{Spellcasting} , @Compendium[dnd5e.classfeatures.x637K2Icp2ZFM1TB]{Divine Domain} | \n
2nd | \n+2 | \n@Compendium[dnd5e.classfeatures.YpiLQEKGalROn7iJ]{Channel Divinity (1/rest)}, Divine Domain feature | \n
3rd | \n+2 | \n2nd Level Spell Slot | \n
4th | \n+2 | \n@Compendium[dnd5e.classfeatures.s0Cc2zcX0JzIgam5]{Ability Score Improvement} | \n
5th | \n+3 | \n3rd Level Spell Slot, @Compendium[dnd5e.classfeatures.NMy4piwXIpLjYbRE]{Destroy Undead (CR 1/2)} | \n
6th | \n+3 | \n@Compendium[dnd5e.classfeatures.YpiLQEKGalROn7iJ]{Channel Divinity (2/rest)}, Divine Domain feature | \n
7th | \n+3 | \n4th Level Spell Slot | \n
8th | \n+3 | \n@Compendium[dnd5e.classfeatures.s0Cc2zcX0JzIgam5]{ASI}, @Compendium[dnd5e.classfeatures.NMy4piwXIpLjYbRE]{Destroy Undead (CR 1)}, Divine Domain feature | \n
9th | \n+4 | \n5th Level Spell Slot | \n
10th | \n+4 | \n@Compendium[dnd5e.classfeatures.eVXqHn0ojWrEuYGU]{Divine Intervention} | \n
11th | \n+4 | \n6th Level Spell Slot, @Compendium[dnd5e.classfeatures.NMy4piwXIpLjYbRE]{Destroy Undead (CR 2)} | \n
12th | \n+4 | \n@Compendium[dnd5e.classfeatures.s0Cc2zcX0JzIgam5]{Ability Score Improvement} | \n
13th | \n+5 | \n7th Level Spell Slot | \n
14th | \n+5 | \n@Compendium[dnd5e.classfeatures.NMy4piwXIpLjYbRE]{Destroy Undead (CR 3)} | \n
15th | \n+5 | \n8th Level Spell Slot | \n
16th | \n+5 | \n@Compendium[dnd5e.classfeatures.s0Cc2zcX0JzIgam5]{Ability Score Improvement} | \n
17th | \n+6 | \n9th Level Spell Slot, @Compendium[dnd5e.classfeatures.NMy4piwXIpLjYbRE]{Destroy Undead (CR 4)}, Divine Domain feature | \n
18th | \n+6 | \n@Compendium[dnd5e.classfeatures.YpiLQEKGalROn7iJ]{Channel Divinity (3/rest)} | \n
19th | \n+6 | \n@Compendium[dnd5e.classfeatures.s0Cc2zcX0JzIgam5]{Ability Score Improvement} | \n
20th | \n+6 | \n@Compendium[dnd5e.classfeatures.eVXqHn0ojWrEuYGU]{Divine Intervention (Automatic Success)} | \n
The Life domain focuses on the vibrant positive energy—one of the fundamental forces of the universe—that sustains all life. The gods of life promote vitality and health through healing the sick and wounded, caring for those in need, and driving away the forces of death and undeath. Almost any non-evil deity can claim influence over this domain, particularly agricultural deities (such as Chauntea, Arawai, and Demeter), sun gods (such as Lathander, Pelor, and Re-Horakhty), gods of healing or endurance (such as Ilmater, Mishakal, Apollo, and Diancecht), and gods of home and community (such as Hestia, Hathor, and Boldrei).
\nCleric Level | \nSpells | \n
1st | \n@Compendium[dnd5e.spells.8dzaICjGy6mTUaUr]{Bless}, @Compendium[dnd5e.spells.uUWb1wZgtMou0TVP]{Cure Wounds} | \n
3rd | \n@Compendium[dnd5e.spells.F0GsG0SJzsIOacwV]{Lesser Restoration}, @Compendium[dnd5e.spells.JbxsYXxSOTZbf9I0]{Spiritual Weapon} | \n
5th | \n@Compendium[dnd5e.spells.ZU9d6woBdUP8pIPt]{Beacon of Hope}, @Compendium[dnd5e.spells.LmRHHMtplpxr9fX6]{Revivify} | \n
7th | \n@Compendium[dnd5e.spells.VtCXMdyM6mAdIJZb]{Death Ward}, @Compendium[dnd5e.spells.TgHsuhNasPbhu8MO]{Guardian of Faith} | \n
9th | \n@Compendium[dnd5e.spells.Pyzmm8R7rVsNAPsd]{Mass Cure Wounds}, @Compendium[dnd5e.spells.AGFMPAmuzwWO6Dfz]{Raise Dead} | \n
1st Level: @Compendium[dnd5e.classfeatures.68bYIOvx6rIqnlOW]{Bonus Proficiency} @Compendium[dnd5e.classfeatures.jF8AFfEMICIJnAkR]{Disciple of Life}
\n2nd Level: @Compendium[dnd5e.classfeatures.hEymt45rICi4f9eL]{Channel Divinity: Preserve Life}
\n6th Level: @Compendium[dnd5e.classfeatures.yv49QN6Bzqs0ecCs]{Blessed Healer}
\n8th Level: @Compendium[dnd5e.classfeatures.T6u5z8ZTX6UftXqE]{Divine Strike}
\n17th Level: @Compendium[dnd5e.classfeatures.4UOgxzr83vFuUash]{Supreme Healing}
", + "chat": "", + "unidentified": "" + }, + "source": "", + "levels": 1, + "subclass": "", + "hitDice": "d8", + "hitDiceUsed": 0, + "skills": { + "number": 2, + "choices": [ + "his", + "ins", + "med", + "per", + "rel" + ], + "value": [] + }, + "spellcasting": "full", + "damage": { + "parts": [] + } + }, + "sort": 100000, + "flags": { + "core": { + "sourceId": "Compendium.dnd5e.classes.tlwBnN8GmqJcTgub" + } + }, + "img": "systems/dnd5e/icons/skills/light_04.jpg", + "effects": [] + }, + { + "_id": "SIzmYrzwOqKcOe8x", + "name": "Torch", + "type": "consumable", + "data": { + "description": { + "value": "A torch burns for 1 hour, providing bright light in a 20-foot radius and dim light for an additional 20 feet. If you make a melee attack with a burning torch and hit, it deals 1 fire damage.
", + "chat": "", + "unidentified": "" + }, + "source": "PHB pg. 153", + "quantity": 1, + "weight": 1, + "price": 0.01, + "attuned": false, + "attunement": 0, + "equipped": false, + "rarity": "Common", + "identified": true, + "activation": { + "type": "action", + "cost": 1, + "condition": "" + }, + "duration": { + "value": 1, + "units": "hour" + }, + "target": { + "value": 40, + "width": null, + "units": "ft", + "type": "radius" + }, + "range": { + "value": null, + "long": null, + "units": "" + }, + "uses": { + "value": 1, + "max": 1, + "per": "charges", + "autoDestroy": false, + "autoUse": true + }, + "consume": { + "type": "", + "target": null, + "amount": null + }, + "ability": "str", + "actionType": "mwak", + "attackBonus": 0, + "chatFlavor": "", + "critical": null, + "damage": { + "parts": [ + [ + "1", + "fire" + ] + ], + "versatile": "" + }, + "formula": "", + "save": { + "ability": "", + "dc": null, + "scaling": "spell" + }, + "consumableType": "trinket" + }, + "sort": 4700000, + "flags": { + "core": { + "sourceId": "Compendium.dnd5e.items.BnOCLuNWhVvzHLjl" + } + }, + "img": "systems/dnd5e/icons/items/inventory/torch.jpg", + "effects": [] + }, + { + "_id": "SkjWVg48ETMRkY2X", + "name": "Dancing Lights", + "type": "spell", + "data": { + "description": { + "value": "You create up to four torch-sized lights within range, making them appear as torches, lanterns, or glowing orbs that hover in the air for the duration. You can also combine the four lights into one glowing vaguely humanoid form of Medium size. Whichever form you choose, each light sheds dim light in a 10-foot radius.
As a bonus action on your turn, you can move the lights up to 60 feet to a new spot within range. A light must be within 20 feet of another light created by this spell, and a light winks out if it exceeds the spell's range.
", + "chat": "", + "unidentified": "" + }, + "source": "PHB pg. 230", + "activation": { + "type": "action", + "cost": 1, + "condition": "" + }, + "duration": { + "value": 1, + "units": "minute" + }, + "target": { + "value": null, + "width": null, + "units": "any", + "type": "space" + }, + "range": { + "value": 120, + "long": 0, + "units": "ft" + }, + "uses": { + "value": 0, + "max": 0, + "per": "" + }, + "consume": { + "type": "", + "target": null, + "amount": null + }, + "ability": "", + "actionType": "util", + "attackBonus": 0, + "chatFlavor": "", + "critical": null, + "damage": { + "parts": [], + "versatile": "", + "value": "" + }, + "formula": "", + "save": { + "ability": "", + "dc": null, + "scaling": "spell", + "value": "" + }, + "level": 0, + "school": "evo", + "components": { + "value": "", + "vocal": true, + "somatic": true, + "material": true, + "ritual": false, + "concentration": true + }, + "materials": { + "value": "A bit of phosphorus or wychwood, or a glowworm", + "consumed": false, + "cost": 0, + "supply": 0 + }, + "preparation": { + "mode": "prepared", + "prepared": false + }, + "scaling": { + "mode": "none", + "formula": "" + } + }, + "sort": 100001, + "flags": { + "core": { + "sourceId": "Compendium.dnd5e.spells.CAxSzHWizrafT033" + } + }, + "img": "systems/dnd5e/icons/spells/fire-arrows-sky-2.jpg", + "effects": [] + } + ], + "effects": [] +} \ No newline at end of file diff --git a/test/actors/fvtt-Actor-Versatile.json b/test/actors/fvtt-Actor-Versatile.json index f01baac..8c031ac 100644 --- a/test/actors/fvtt-Actor-Versatile.json +++ b/test/actors/fvtt-Actor-Versatile.json @@ -300,7 +300,7 @@ } } }, - "sort": 100001, + "sort": 900000, "flags": { "exportSource": { "world": "torch-test-5e", @@ -655,6 +655,98 @@ }, "img": "systems/dnd5e/icons/spells/beam-royal-2.jpg", "effects": [] + }, + { + "_id": "c0eKpH3FsD7Adm0q", + "name": "Dancing Lights", + "type": "spell", + "data": { + "description": { + "value": "You create up to four torch-sized lights within range, making them appear as torches, lanterns, or glowing orbs that hover in the air for the duration. You can also combine the four lights into one glowing vaguely humanoid form of Medium size. Whichever form you choose, each light sheds dim light in a 10-foot radius.
As a bonus action on your turn, you can move the lights up to 60 feet to a new spot within range. A light must be within 20 feet of another light created by this spell, and a light winks out if it exceeds the spell's range.
", + "chat": "", + "unidentified": "" + }, + "source": "PHB pg. 230", + "activation": { + "type": "action", + "cost": 1, + "condition": "" + }, + "duration": { + "value": 1, + "units": "minute" + }, + "target": { + "value": null, + "width": null, + "units": "any", + "type": "space" + }, + "range": { + "value": 120, + "long": 0, + "units": "ft" + }, + "uses": { + "value": 0, + "max": 0, + "per": "" + }, + "consume": { + "type": "", + "target": null, + "amount": null + }, + "ability": "", + "actionType": "util", + "attackBonus": 0, + "chatFlavor": "", + "critical": null, + "damage": { + "parts": [], + "versatile": "", + "value": "" + }, + "formula": "", + "save": { + "ability": "", + "dc": null, + "scaling": "spell", + "value": "" + }, + "level": 0, + "school": "evo", + "components": { + "value": "", + "vocal": true, + "somatic": true, + "material": true, + "ritual": false, + "concentration": true + }, + "materials": { + "value": "A bit of phosphorus or wychwood, or a glowworm", + "consumed": false, + "cost": 0, + "supply": 0 + }, + "preparation": { + "mode": "prepared", + "prepared": false + }, + "scaling": { + "mode": "none", + "formula": "" + } + }, + "sort": 100001, + "flags": { + "core": { + "sourceId": "Compendium.dnd5e.spells.CAxSzHWizrafT033" + } + }, + "img": "systems/dnd5e/icons/spells/fire-arrows-sky-2.jpg", + "effects": [] } ], "effects": [] diff --git a/test/torch-test-5e/torch-test-5e.zip b/test/torch-test-5e/torch-test-5e.zip index 23f32dc..c9499ec 100644 Binary files a/test/torch-test-5e/torch-test-5e.zip and b/test/torch-test-5e/torch-test-5e.zip differ diff --git a/torch.js b/torch.js index 97050ac..9c918a5 100644 --- a/torch.js +++ b/torch.js @@ -152,7 +152,7 @@ class Torch { return item.name.toLowerCase() === itemName.toLowerCase(); }); let quantity = torchItem.data.data - ? torchItem.data.data.quantity : item.data.quantity; + ? torchItem.data.data.quantity : torchItem.data.quantity; return quantity > 0 ? itemName : '0'; } // GM can always deliver light by fiat without an item